![]() |
VR-Forces 4.2 Class Documentation
|
Provide a basic sim engine to use in an example showing how to embed a sim engine into a driver that runs in a single thread. More...
Public Member Functions | |
| DtExampleSimEngine (makVrv::DtDe &de) | |
| CTOR. | |
| virtual | ~DtExampleSimEngine () |
| DTOR. | |
| bool | init () |
| Initialize the simulation engine. | |
| bool | uninit () |
| Destroy what was created in init() | |
| bool | tick (double simTime) |
| Perform updates param[in] simTime is he current simulation time. | |
| DtExampleSimEngine (DtExampleSimulationConnection &connection) | |
| CTOR. | |
| virtual | ~DtExampleSimEngine () |
| DTOR. | |
| bool | init () |
| Initialize the simulation engine. | |
| bool | uninit () |
| Destroy what was created in init() | |
| bool | tick (double simTime) |
| Perform updates param[in] simTime is he current simulation time. | |
Protected Member Functions | |
| virtual void | setHoverSignalsActive (bool active) |
| Sets whether the sim engine is listening for mouseover events or not in its entity indicator. | |
| virtual void | setEntityInfoWidgetActive (bool active) |
| Sets whether the entity info widget is displayed or not. | |
| virtual makVrv::DtUnicode | generateInfoString () const |
| Generates the information string displayed in the entity info widget. | |
| virtual void | updatePosition (double simTime) |
| Updates the current position / orientation of the entity. | |
| virtual void | repositionAircraft (DtVector position, DtTaitBryan ori) |
| Positions the aircraft at the given position with the given orientation. | |
| virtual void | setHoverSignalsActive (bool active) |
| Sets whether the sim engine is listening for mouseover events or not. | |
| virtual void | setEntityInfoWidgetActive (bool active) |
| Sets whether the entity info widget is displayed or not. | |
| virtual makVrv::DtUnicode | generateInfoString () const |
| Generates the information string displayed in the info widget. | |
| virtual void | updatePosition (double simTime) |
| Updates the current position / orientation of the entity. | |
| virtual void | repositionAircraft (DtVector position, DtTaitBryan ori) |
| Positions the aircraft at the given position with the given orientation. | |
| void | slot_toggleLabelPinnedState (const makVrv::DtSelectionManager::IdSet &selList) |
| Boost slots. | |
| void | slot_toggleLabelPinnedState (const makVrv::DtSelectionManager::IdSet &sel) |
| Boost slots. | |
Protected Attributes | |
| makVrv::DtDe & | myDe |
| makVrv::DtEntity3dFacade * | myEntityFacade |
| makVrv::DtEntityIndicatorWidget * | myEntityIndicator |
| makVrv::DtEntityInfoWidget * | myEntityInfoWidget |
| makVrv::DtEntityHATLineFacade * | myEntityHATLineFacade |
| std::string | myEntityDisplayName |
| bool | myEntityInfoWidgetPinnedFlag |
| DtTaitBryan | myOrientation |
| DtVector | myPosition |
| DtVector | myOrbitCenter |
| double | myAngularVelocity |
| double | myLastCommLineTime |
| double | myLastUpdateTime |
| double | myClockAngle |
| double | myHeading |
| double | myRadius |
| double | myRoll |
| makVrv::DtSignalConnectionManager | mySignalConnections |
| DtExampleSimulationConnection & | mySimulationConnection |
Provide a basic sim engine to use in an example showing how to embed a sim engine into a driver that runs in a single thread.
Provide an example sim engine to use in an example showing how to embed a sim engine into a driver that runs in a separate thread.
The vast majority of this code is identical to the DtExampleSimEngine code in the exampleThreadedDriver example. Comparing the two is worthwhile. It creates an aircraft, with a HAT line and entity indicator, and updates it to fly in a circle and display the entity info widget when the mouse is over the entity indicator. The only significant difference between this code and the code in exampleThreadedDriver is that instead of using a connection, its using the display engine (DtDe) interface provided by the driver; and getting sim time from the DtDe instead of from the connection.
The vast majority of this code was extracted directly from DtExampleDriver. It creates an aircraft, with a HAT line and entity indicator, and updates it to fly in a circle and display the entity info widget when the mouse is over the entity indicator. The only significant difference between this code and the code extracted from exampleDriver is that instead of using the agent manager provided to the driver, its using the agent manager interface (sceneInterface()) provided by the connection; and getting sim time from the connection instead of from the DtDe. Note that we could have just grabbed clock time, but this demonstrates a way of moving this piece of data (sim time) from the driver to the connection.
| DtExampleSimEngine::DtExampleSimEngine | ( | makVrv::DtDe & | de | ) |
CTOR.
| [in] | de | is a a reference to the Display Engine |
|
virtual |
DTOR.
| DtExampleSimEngine::DtExampleSimEngine | ( | DtExampleSimulationConnection & | connection | ) |
CTOR.
| [in] | connection | is an simple example connection object. |
|
virtual |
DTOR.
| bool DtExampleSimEngine::init | ( | ) |
Initialize the simulation engine.
In this case, the entity facade, indicators, and hat line are created.
| bool DtExampleSimEngine::uninit | ( | ) |
Destroy what was created in init()
| bool DtExampleSimEngine::tick | ( | double | simTime | ) |
Perform updates param[in] simTime is he current simulation time.
|
protected |
Boost slots.
Slot called by signal to indicate that the label state was changed for the elements listed in the IdSet. If our element ID is among them, we will call setEntityInfoWidgetActive param[in] selList is the list of the currently selected elements
|
protectedvirtual |
Sets whether the sim engine is listening for mouseover events or not in its entity indicator.
|
protectedvirtual |
Sets whether the entity info widget is displayed or not.
|
protectedvirtual |
Generates the information string displayed in the entity info widget.
|
protectedvirtual |
Updates the current position / orientation of the entity.
|
protectedvirtual |
Positions the aircraft at the given position with the given orientation.
| bool DtExampleSimEngine::init | ( | ) |
Initialize the simulation engine.
In this case, the entity facade, indicators, and hat line are created.
| bool DtExampleSimEngine::uninit | ( | ) |
Destroy what was created in init()
| bool DtExampleSimEngine::tick | ( | double | simTime | ) |
Perform updates param[in] simTime is he current simulation time.
|
protected |
Boost slots.
Slot called by signal to indicate that the label state was changed for the elements listed in the IdSet. If our element ID is among them, we will call setEntityInfoWidgetActive
|
protectedvirtual |
Sets whether the sim engine is listening for mouseover events or not.
|
protectedvirtual |
Sets whether the entity info widget is displayed or not.
|
protectedvirtual |
Generates the information string displayed in the info widget.
|
protectedvirtual |
Updates the current position / orientation of the entity.
|
protectedvirtual |
Positions the aircraft at the given position with the given orientation.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |