Changeset 288 in flair-src for trunk/lib/FlairSimulator/src/Gui_impl.cpp


Ignore:
Timestamp:
Jan 8, 2019, 2:45:15 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

added earth frame axis

File:
1 edited

Legend:

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

    r286 r288  
    180180  ITexture* texture=0;
    181181  IGUIFont* font =0;
     182  VisualizationCamera::AxisType axisType=VisualizationCamera::AxisType::vrpn;
    182183 
    183184  if (!driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) {
     
    216217
    217218  setWindowCaption(0, 0);
     219 
     220  Printf("\nUsefull keys:\n");
     221  Printf(" page up/down: circle between cameras\n");
     222  Printf(" a: change axis display (VRPN, earth or none)\n");
    218223
    219224  while (device->run()) {
     
    260265    //render to texture for axis if possible
    261266    if (texture) {
    262       cameras.at(cam_id)->renderAxisToTexture(texture);
     267      cameras.at(cam_id)->renderAxisToTexture(texture,font,axisType);
    263268    }
    264269   
     
    278283   
    279284    driver->setViewPort(core::rect<s32>(0, 0, smgr->getVideoDriver()->getScreenSize().Width, smgr->getVideoDriver()->getScreenSize().Height));
    280     if(font) {
    281       font->draw(L"VRPN:",rect<s32>(10,scene_height-30,100,50),SColor(128,255,255,255));
    282       font->draw(L"X",rect<s32>(60,scene_height-30,100,50),SColor(255,255,0,0));
    283       font->draw(L"Y",rect<s32>(70,scene_height-30,100,50),SColor(255,0,255,0));
    284       font->draw(L"Z",rect<s32>(80,scene_height-30,100,50),SColor(255,0,0,255));
    285      
    286     }
    287285    device->getGUIEnvironment()->drawAll();
    288286    driver->endScene();
     
    306304      receiver->SetModel(getModelFromVisualizationCamera(models,cameras.at(cam_id)));
    307305      setWindowCaption(cam_id, fps);
     306    }
     307    if (receiver->IsKeyDown(KEY_KEY_A)) {
     308      switch(axisType) {
     309        case VisualizationCamera::AxisType::vrpn:
     310          axisType=VisualizationCamera::AxisType::earth;
     311          break;
     312        case VisualizationCamera::AxisType::earth:
     313          axisType=VisualizationCamera::AxisType::none;
     314          break;
     315        case VisualizationCamera::AxisType::none:
     316          axisType=VisualizationCamera::AxisType::vrpn;
     317          break;
     318      }
    308319    }
    309320
Note: See TracChangeset for help on using the changeset viewer.