![]() |
VR-Forces 4.10 Class Documentation
|
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed and ship speed. More...

Public Member Functions | |
| DtShipFlagSwitchTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel *osgArticulatedModel) | |
| CTOR. More... | |
| virtual | ~DtShipFlagSwitchTickable () |
| DTOR. More... | |
| DtVector | computeWindVec (DtSceneObject *sceneObj, float windDirRad) |
| Convert the wind angle to a directional vector. More... | |
| virtual void | update (DtTime tNow) |
| Update the switch node based on the wind speed. More... | |
| void | SetWindNodeSwitch (double windSpeed) |
| virtual bool | needsUpdate (DtTime tNow) |
| The check function called by DtTickableManager to verify if an update is required. More... | |
| virtual void | configure (osg::Node *n, const rapidjson::Value &windJsonData) |
| Configure the meta file tickable object. More... | |
| unsigned int | getSwitchIndexForSpeed (double windSpeed) |
| Get the switch index based on the wind speed (km/h) More... | |
| virtual void | modelToBeDestroyed (DtModel *model) |
| listen to the model to be destroyed signal More... | |
Public Member Functions inherited from makVrv::DtDynamicFeatureTickable | |
| virtual | ~DtDynamicFeatureTickable () |
| DTOR. More... | |
Public Member Functions inherited from makVrv::DtTickable | |
| virtual bool | updateIfNeeded (DtTime tNow) |
| Calls needsUpdate(), and then calls update() if needsUpdate() is true. More... | |
| virtual | ~DtTickable () |
| Virtual DTOR. More... | |
| virtual void | setIsThreadSafe (bool safe) |
| Get/set whether this tickable can be updated in parallel with other tickables. More... | |
| virtual bool | isThreadSafe () const |
| virtual void | setTickableListState (TickableListState safeList) |
| Track which tickable list (if any) this tickable is on Since the tickable constructor puts ALL tickables on the main (unThreadSafe) to start we need a way to check which list a tickable is on (and this way we can request removals from the correct list instead of having to call DtTickableManager::removeTickableObject(), which tries both lists). More... | |
| virtual TickableListState | tickableListState () const |
| virtual void | setUpdatePeriod (unsigned int period) |
| Specify how often (in # of frames) this tickable should call update. More... | |
| virtual unsigned int | updatePeriod () const |
| virtual bool | lodSystemEnabled () const |
| is the update LOD system enabled, overridden by subclasses More... | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. More... | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. More... | |
Static Public Attributes | |
| static const char * | theShipFlagSwitchFeatureName |
| Strings to get the different parts of the meta file Use these instead of hardcoded strings. More... | |
| static const char * | theTagWindSpeeds |
| static const char * | theTagSwitchIndices |
Protected Member Functions | |
| virtual void | disconnectFromModel () |
| internal function to disconnect from the model More... | |
Protected Member Functions inherited from makVrv::DtDynamicFeatureTickable | |
| DtDynamicFeatureTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, unsigned int nodeTypeIndex) | |
| CTOR. More... | |
Protected Member Functions inherited from makVrv::DtTickable | |
| DtTickable (DtTickableManagerInterface *manager) | |
| CTOR. More... | |
| DtTickable () | |
| Unimplemented default CTOR. More... | |
| virtual void | slot_managerAboutToBeDeleted () |
Protected Attributes | |
| DtSceneObject * | mySceneObject |
| The scene object. More... | |
| float | myLastWindSpeed |
| Last update wind speed. More... | |
| DtVector | myLastPos |
| Last position. More... | |
| DtTime | myLastTime |
| Last update time. More... | |
| DtDoubleSmoother | myFlagSpeedSmoother |
| Moving average of last 10 ship speeds. More... | |
| DtDisplayUnitsConverter & | myConverter |
| To convert the wind speed to display units (km/h) More... | |
| osgSim::MultiSwitch * | myWindSwitchNode |
| The actual node that contains switch states. More... | |
| std::vector< double > | myWindSpeeds |
| Windspeeds. More... | |
| std::vector< int > | mySwitchIndices |
| DtOsgArticulatedModel * | myOsgArticulatedModel |
Protected Attributes inherited from makVrv::DtDynamicFeatureTickable | |
| DtDe & | myDe |
| The display engine. More... | |
| DtElementID | myElementId |
| Object element id. More... | |
| DtUniqueID | mySceneObjectId |
| To retrieve the scene object if needed. More... | |
| unsigned int | myNodeTypeIndex |
| For the node type used in the tickable, the index in the instancing array for that node type (so we update the right one) More... | |
| DtUniqueID | myUniqueId |
| For retrieving the instance state from the instance manager. More... | |
| std::string | myFeatureName |
| The name of the feature in the .meta file. More... | |
Protected Attributes inherited from makVrv::DtTickable | |
| DtTickableManagerInterface * | myManager |
| Pointer to manager for removal during destruction. More... | |
| DtSignalConnectionManager | myConnections |
| unsigned int | myFrameCounter |
| unsigned int | myFrameToUpdate |
| unsigned int | myUpdatePeriod |
| DtTime | myLastUpdateTime |
| bool | myIsThreadSafe |
| TickableListState | myTickableListState |
Additional Inherited Members | |
Public Types inherited from makVrv::DtTickable | |
| enum | TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList } |
| Enumeration used to indicate which DtTickableManager's tickable list the tickable is on, if any. More... | |
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed and ship speed.
| makVrv::DtShipFlagSwitchTickable::DtShipFlagSwitchTickable | ( | DtDe & | de, |
| DtElementID | elementId, | ||
| DtUniqueID | sceneObjectId, | ||
| DtUniqueID | uniqueId, | ||
| unsigned int | nodeTypeIndex, | ||
| DtOsgArticulatedModel * | osgArticulatedModel | ||
| ) |
CTOR.
|
virtual |
DTOR.
| DtVector makVrv::DtShipFlagSwitchTickable::computeWindVec | ( | DtSceneObject * | sceneObj, |
| float | windDirRad | ||
| ) |
Convert the wind angle to a directional vector.
|
virtual |
Update the switch node based on the wind speed.
Implements makVrv::DtTickable.
| void makVrv::DtShipFlagSwitchTickable::SetWindNodeSwitch | ( | double | windSpeed | ) |
The check function called by DtTickableManager to verify if an update is required.
If this function returns true, the DtTickableManager will then call update().
| [in] | tNow | is the current time-stamp. |
| true | if this object needs to be ticked. |
| false | otherwise. |
Reimplemented from makVrv::DtTickable.
|
virtual |
Configure the meta file tickable object.
Get the switch index based on the wind speed (km/h)
|
virtual |
listen to the model to be destroyed signal
|
protectedvirtual |
internal function to disconnect from the model
|
static |
Strings to get the different parts of the meta file Use these instead of hardcoded strings.
|
static |
|
static |
|
protected |
The scene object.
|
protected |
Last update wind speed.
|
protected |
Last position.
|
protected |
Last update time.
|
protected |
Moving average of last 10 ship speeds.
|
protected |
To convert the wind speed to display units (km/h)
|
protected |
The actual node that contains switch states.
|
protected |
Windspeeds.
|
protected |
|
protected |