Ignore:
Timestamp:
09/02/16 17:48:40 (5 years ago)
Author:
Sanahuja Guillaume
Message:

refonte camera simu

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/FollowMeCamera.cpp

    r51 r69  
    44// %flair:license}
    55//  created:    2012/08/21
    6 //  filename:   AnimPoursuite.cpp
     6//  filename:   FollowMeCamera.cpp
    77//
    88//  author:     Guillaume Sanahuja
     
    1616#ifdef GL
    1717
    18 #include "AnimPoursuite.h"
     18#include "FollowMeCamera.h"
    1919#include "Simulator.h"
    2020#include "Model.h"
    2121#include "Model_impl.h"
     22#include "Gui.h"
    2223#include <ICursorControl.h>
    2324#include <ICameraSceneNode.h>
     25#include <IrrlichtDevice.h>
     26#include <ISceneManager.h>
    2427
    2528using namespace irr;
     
    3134namespace simulator {
    3235
    33 AnimPoursuite::AnimPoursuite(const ISceneNode *parent, float rotateSpeed,
    34                              float zoomSpeed) {
     36FollowMeCamera::FollowMeCamera(const ISceneNode *parent, float rotateSpeed,
     37                             float zoomSpeed):VisualizationCamera(rotateSpeed,zoomSpeed) {
    3538  this->parent = parent;
    36   this->zoomSpeed = zoomSpeed;
    37   this->rotateSpeed = rotateSpeed;
    38   currentZoom = 100;
    3939  RotY = 20;
    4040  RotZ = 0;
    4141  Rotating = false;
    42   LMouseKey = false;
    4342}
    4443
    45 AnimPoursuite::~AnimPoursuite() {}
     44FollowMeCamera::~FollowMeCamera() {}
    4645
    47 void AnimPoursuite::setPositionOffset(vector3df newpos) { pos_offset = newpos; }
     46void FollowMeCamera::setPositionOffset(vector3df newpos) { pos_offset = newpos; }
    4847
    49 void AnimPoursuite::setTargetOffset(vector3df newpos) {
     48void FollowMeCamera::setTargetOffset(vector3df newpos) {
    5049  target_offset = newpos;
    5150}
    5251
    53 float AnimPoursuite::sat(float value) {
     52float FollowMeCamera::sat(float value) {
    5453  if (value > 89)
    5554    value = 89;
     
    5958}
    6059
    61 void AnimPoursuite::animateNode(ISceneNode *node, u32 timeMs) {
    62   ICameraSceneNode *camera = static_cast<ICameraSceneNode *>(node);
     60void FollowMeCamera::animateNode(ISceneNode *node, u32 timeMs) {
    6361  vector3df pos;
    6462
     
    9795}
    9896
    99 ISceneNodeAnimator *AnimPoursuite::createClone(ISceneNode *node,
    100                                                ISceneManager *newManager) {
    101   return NULL;
    102 }
    103 
    104 bool AnimPoursuite::MouseMoved(const SEvent &event,
    105                                irr::core::position2df MousePos) {
    106   if (event.EventType != EET_MOUSE_INPUT_EVENT)
    107     return false;
    108 
    109   switch (event.MouseInput.Event) {
    110 
    111   case EMIE_MOUSE_WHEEL:
    112     currentZoom -= event.MouseInput.Wheel * zoomSpeed;
    113     if (currentZoom <= 0)
    114       currentZoom = zoomSpeed;
    115     break;
    116   case EMIE_LMOUSE_PRESSED_DOWN:
    117     LMouseKey = true;
    118     break;
    119   case EMIE_LMOUSE_LEFT_UP:
    120     LMouseKey = false;
    121     break;
    122   case EMIE_MOUSE_MOVED:
    123     this->MousePos = MousePos;
    124     break;
    125   default:
    126     return false;
    127     break;
    128   }
    129 
    130   return true;
    131 }
    13297
    13398} // end namespace simulator
Note: See TracChangeset for help on using the changeset viewer.