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


Ignore:
Timestamp:
Jan 8, 2019, 11:46:02 AM (6 years ago)
Author:
Sanahuja Guillaume
Message:

handle vrpn yaw rotation for drawing vrpn axis

Location:
trunk/lib/FlairSimulator/src
Files:
2 edited

Legend:

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

    r286 r287  
    2222#include "Gui.h"
    2323#include "Gui_impl.h"
     24#include <Euler.h>
    2425#include <ICursorControl.h>
    2526#include <ICameraSceneNode.h>
     
    5253  // camera to draw axis, in a new dedicated scene manager
    5354  axis_scenemanager=getGui()->getSceneManager()->createNewSceneManager();
    54   axis_camera = axis_scenemanager->addCameraSceneNode();
     55  axis_camera= axis_scenemanager->addCameraSceneNode();
    5556  axis_camera->setAspectRatio(1);  // same as texture ratio, TODO: get it from texture in renderAxisToTexture
    5657  axis_camera->setUpVector(vector3df(0, 0, 1));
    5758  axis_camera->setFOV(PI / 2.5f);
    5859  axis_scenemanager->setActiveCamera(axis_camera);
    59   prendre en compte le yaw monde/optitrack (rotation de axis_scenemanager?)
     60 
     61  //draw ned axis
    6062  IAnimatedMesh* arrowMeshRed = axis_scenemanager->addArrowMesh( "x_axisArrow",video::SColor(255, 255, 0, 0),video::SColor(255, 255, 0, 0));
    6163  nodeX = axis_scenemanager->addMeshSceneNode(arrowMeshRed);
    6264  nodeX->setMaterialFlag(video::EMF_LIGHTING, false);
    63   nodeX->setRotation(vector3df(0,0,-90));
     65  nodeX->setRotation(vector3df(0,0,-90+core::Euler::ToDegree(getSimulator()->Yaw())));//use vrpn yaw rotation from earth
    6466  nodeX->setScale(vector3df(1,3,1));
    6567 
     
    6769  nodeY = axis_scenemanager->addMeshSceneNode(arrowMeshGreen);
    6870  nodeY->setMaterialFlag(video::EMF_LIGHTING, false);
     71  nodeY->setRotation(vector3df(0,0,core::Euler::ToDegree(getSimulator()->Yaw())));//use vrpn yaw rotation from earth
    6972  nodeY->setScale(vector3df(1,3,1));
    7073 
  • trunk/lib/FlairSimulator/src/VisualizationCamera.h

    r286 r287  
    5151  irr::scene::ISceneNode *nodeX,*nodeY,*nodeZ;
    5252  irr::scene::ISceneManager *axis_scenemanager;
    53  
     53
    5454protected:
    5555  bool LMouseKey;
Note: See TracChangeset for help on using the changeset viewer.