Changeset 286 in flair-src for trunk/lib/FlairSimulator/src/Blade.cpp


Ignore:
Timestamp:
Jan 8, 2019, 10:13:03 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

draw vrpn axis in simulator

File:
1 edited

Legend:

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

    r15 r286  
    6464}
    6565
     66Blade::Blade(ISceneNode *parent, const vector3df &position, bool inverted, s32 id)
     67    : ISceneNode(parent, getGui()->getSceneManager(), id,
     68                 position) {
     69  ISceneManager *mgr = getGui()->getSceneManager();
     70
     71  const IGeometryCreator *geo;
     72  geo = mgr->getGeometryCreator();
     73  pale = geo->createCubeMesh(vector3df(63.5, 0.5, 5));
     74
     75  float angle;
     76  if (inverted == false) {
     77    angle = 20;
     78  } else {
     79    angle = -20;
     80  }
     81
     82  ITexture *texture = getGui()->getTexture("carbone.jpg");
     83  pale_1 = new MeshSceneNode(parent, pale, vector3df(-30, 0, 0),
     84                             vector3df(-angle + 90, 0, 0), texture);
     85  pale_1->setParent(this);
     86  pale_2 = new MeshSceneNode(parent, pale, vector3df(30, 0, 0),
     87                             vector3df(angle + 90, 0, 0), texture);
     88  pale_2->setParent(this);
     89
     90  anim = mgr->createRotationAnimator(vector3df(0.f, 0.f, 0.f));
     91  addAnimator(anim);
     92}
     93
    6694void Blade::OnRegisterSceneNode() {
    6795  if (IsVisible)
Note: See TracChangeset for help on using the changeset viewer.