Changeset 289 in flair-src for trunk/lib/FlairSimulator


Ignore:
Timestamp:
Jan 8, 2019, 3:18:33 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

use yaw rotation of vrpn

File:
1 edited

Legend:

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

    r286 r289  
    8080  input->ReleaseMutex();
    8181 
     82  //use yaw rotation from earth to vrpn
     83  Quaternion yaw_rot_quat;
     84  Euler yaw_rot_euler(0, 0, getSimulator()->Yaw()); // yaw_rad is vrpn rotation in earth reference
     85  yaw_rot_euler.ToQuaternion(yaw_rot_quat);
     86  vrpnPosition.Rotate(yaw_rot_quat);
     87  vrpnQuaternion= yaw_rot_quat * vrpnQuaternion;
     88 
    8289  vector3df nodePosition;
    8390  Quaternion nodeQuaternion;
    8491  Euler nodeEuler;
    8592
     93  //transform form earth to irrlicht
    8694  nodePosition = ToIrrlichtCoordinates(vrpnPosition);
    8795  setPosition(nodePosition);
Note: See TracChangeset for help on using the changeset viewer.