Copyright VirtualSim 2004-2020 - All rights reserved
Qt + OSG
In vsTASKER, add an OSG Viewer and enable it. If the Qt viewer is also enabled, it will connect with a dashed line. This means OSG viewer object will be setup. Do not forget to setup the 3D terrain and to assign to each entity their 3D models.
Once this is done, you will be able to compile and link, but nothing will appear because you will need to call three functions (defined in vt_qt_osg.cpp)
In your Qt main window class constructor, where you create vt_rtc and just after autorun() function, add the following call:
qtOsgInit(vt_rtc);
You will need to add the necessary include on top of the file:
#include "../runtime/qt/vt_qt_osg.h"
Then, in the loop timer, add after the vt_rtc->tic() the following call:
qtOsgTic(vt_rtc);
and finally, in the exit/destructor part, where you delete vt_rtc, clean the OSG thread properly:
qtOsgExit(vt_rtc); // put that before delete vt_rtc !
That's it. You now have the OSG window displayed and ready to use.