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, bool useInstancing, unsigned int nodeTypeIndex) |
| | CTOR.
|
| virtual | ~DtShipFlagSwitchTickable () |
| | DTOR.
|
| DtVector | computeWindVec (DtSceneObject *sceneObj, float windDirRad) |
| | Convert the wind angle to a directional vector.
|
| virtual void | update (DtTime tNow) |
| | Update the switch node based on the wind speed.
|
| void | SetWindNodeSwitch (double windSpeed) |
| virtual bool | needsUpdate (DtTime tNow) |
| | The check function called by DtTickableManager to verify if an update is required.
|
| virtual void | configure (osg::Node *n, const rapidjson::Value &windJsonData) |
| | Configure the meta file tickable object.
|
| unsigned int | getSwitchIndexForSpeed (double windSpeed) |
| | Get the switch index based on the wind speed (km/h)
|
| | DtDynamicFeatureTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex) |
| | CTOR.
|
| virtual | ~DtDynamicFeatureTickable () |
| | DTOR.
|
| virtual | ~DtTickable () |
| | Virtual DTOR.
|
| | DtVirtualBaseClass () |
| | Do nothing constructor.
|
| virtual | ~DtVirtualBaseClass () |
| | Virtual do nothing destructor.
|
Static Public Attributes |
|
| static const char * | theShipFlagSwitchFeatureName |
| | Strings to get the different parts of the meta file Use these instead of hardcoded strings.
|
| static const char * | theTagWindSpeeds |
| | Strings to get the different parts of the meta file Use these instead of hardcoded strings.
|
| static const char * | theTagSwitchIndices |
| | Strings to get the different parts of the meta file Use these instead of hardcoded strings.
|
Detailed Description
The DtShipFlagSwitchTickable class is responsible for switching nodes based on the current wind speed and ship speed.
Constructor & Destructor Documentation
| virtual makVrv::DtShipFlagSwitchTickable::~DtShipFlagSwitchTickable |
( |
| ) |
|
|
virtual |
Member Function Documentation
Convert the wind angle to a directional vector.
| virtual void makVrv::DtShipFlagSwitchTickable::update |
( |
DtTime |
tNow | ) |
|
|
virtual |
| void makVrv::DtShipFlagSwitchTickable::SetWindNodeSwitch |
( |
double |
windSpeed | ) |
|
| virtual bool makVrv::DtShipFlagSwitchTickable::needsUpdate |
( |
DtTime |
tNow | ) |
|
|
virtual |
The check function called by DtTickableManager to verify if an update is required.
If this function returns true, the DtTickableManager will then call update().
- Parameters
-
| [in] | tNow | is the current time-stamp. |
- Return values
-
| true | if this object needs to be ticked. |
| false | otherwise. |
Implements makVrv::DtTickable.
| virtual void makVrv::DtShipFlagSwitchTickable::configure |
( |
osg::Node * |
n, |
|
|
const rapidjson::Value & |
windJsonData |
|
) |
| |
|
virtual |
Configure the meta file tickable object.
| unsigned int makVrv::DtShipFlagSwitchTickable::getSwitchIndexForSpeed |
( |
double |
windSpeed | ) |
|
Get the switch index based on the wind speed (km/h)
Member Data Documentation
| const char* makVrv::DtShipFlagSwitchTickable::theShipFlagSwitchFeatureName |
|
static |
Strings to get the different parts of the meta file Use these instead of hardcoded strings.
| const char* makVrv::DtShipFlagSwitchTickable::theTagWindSpeeds |
|
static |
Strings to get the different parts of the meta file Use these instead of hardcoded strings.
| const char* makVrv::DtShipFlagSwitchTickable::theTagSwitchIndices |
|
static |
Strings to get the different parts of the meta file Use these instead of hardcoded strings.
| float makVrv::DtShipFlagSwitchTickable::myLastWindSpeed |
|
protected |
| DtVector makVrv::DtShipFlagSwitchTickable::myLastPos |
|
protected |
| DtTime makVrv::DtShipFlagSwitchTickable::myLastTime |
|
protected |
Moving average of last 10 ship speeds.
To convert the wind speed to display units (km/h)
| osgSim::MultiSwitch* makVrv::DtShipFlagSwitchTickable::myWindSwitchNode |
|
protected |
The actual node that contains switch states.
| std::vector<double> makVrv::DtShipFlagSwitchTickable::myWindSpeeds |
|
protected |
| std::vector<int> makVrv::DtShipFlagSwitchTickable::mySwitchIndices |
|
protected |
The documentation for this class was generated from the following file: