Ignore:
Timestamp:
09/06/16 17:49:32 (5 years ago)
Author:
Sanahuja Guillaume
Message:

simu cameras

File:
1 edited

Legend:

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

    r69 r70  
    3434namespace simulator {
    3535
    36 FollowMeCamera::FollowMeCamera(const ISceneNode *parent, float rotateSpeed,
    37                              float zoomSpeed):VisualizationCamera(rotateSpeed,zoomSpeed)  {
     36FollowMeCamera::FollowMeCamera(const ISceneNode *parent, std::string name,float inRotateSpeed,
     37                             float inZoomSpeed):VisualizationCamera(name)  {
    3838  this->parent = parent;
     39  rotateSpeed=inRotateSpeed;
     40  zoomSpeed=inZoomSpeed;
    3941  RotY = 20;
    4042  RotZ = 0;
     
    4446FollowMeCamera::~FollowMeCamera() {}
    4547
    46 void FollowMeCamera::setPositionOffset(vector3df newpos) { pos_offset = newpos; }
     48void FollowMeCamera::setPositionOffset(vector3df newpos) {
     49  pos_offset = ToIrrlichtCoordinates(newpos);
     50}
    4751
    4852void FollowMeCamera::setTargetOffset(vector3df newpos) {
    49   target_offset = newpos;
     53  target_offset = ToIrrlichtCoordinates(newpos);
    5054}
    5155
     
    5963
    6064void FollowMeCamera::animateNode(ISceneNode *node, u32 timeMs) {
    61   vector3df pos;
    6265
    6366  float nRotY = RotY;
     
    8487  }
    8588
    86   pos.X = -currentZoom;
     89  float newCurrentZoom= 100+currentZoom * zoomSpeed;
     90  if (newCurrentZoom <= 0) {
     91    newCurrentZoom =zoomSpeed;
     92    currentZoom =1-100/zoomSpeed;
     93  }
     94
     95  vector3df pos;
     96  pos.X = -newCurrentZoom;
    8797  pos.Y = 0;
    8898  pos.Z = 0;
Note: See TracChangeset for help on using the changeset viewer.