VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
makVrv::DtShipFlagDirTickable Class Reference

The DtShipFlagDirTickable updates a transform node to rotate into the direction of the wind and ship. More...

Inheritance diagram for makVrv::DtShipFlagDirTickable:
Inheritance graph
[legend]

Public Member Functions

 DtShipFlagDirTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex)
 CTOR.
virtual ~DtShipFlagDirTickable ()
 DTOR.
virtual void update (DtTime tNow)
 Update the wind direction.
float calcRotAngleForShipFlag (DtSceneObject *sceneObj, DtDeadReckonUpdater *updater, DtTime tNow, DtVector windDirVec, float windSpeedKPH)
 Calculate the rotation about Z for the flag given the ship velocity and wind velocity.
DtVector computeWindVec (DtSceneObject *sceneObj, float windDirRad)
 Convert the wind angle to a directional vector.
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 node based on json data.
- Public Member Functions inherited from makVrv::DtDynamicFeatureTickable
 DtDynamicFeatureTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex)
 CTOR.
virtual ~DtDynamicFeatureTickable ()
 DTOR.
- Public Member Functions inherited from makVrv::DtTickable
virtual ~DtTickable ()
 Virtual DTOR.
virtual void setUpdatePeriod (unsigned int period)
 Specify how often (in # of frames) this tickable should call update.
virtual unsigned int updatePeriod () const
 Specify how often (in # of frames) this tickable should call update.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Attributes

static const chartheShipFlagDirFeatureName
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.
static const chartheTagRotOffsetDeg
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.
static const chartheTagRotDir
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.
static const chartheRotDirCW
 Strings to get the different parts of the meta file Use these instead of hardcoded strings.

Protected Attributes

DtSceneObjectmySceneObject
 The scene object we are querying.
float myLastFlagDir
 Last update wind direction.
DtVector myLastPos
 Last position.
DtTime myLastTime
 Last update time.
osgSim::DOFTransform * myWindDirNode
 Transform for the wind to act upon.
float myRotOffset
 The rotation offset to bring the model's rotation in line with the wind's direction.
float myRotDir
 Clockwise or counterclockwise rotation.
- Protected Attributes inherited from makVrv::DtDynamicFeatureTickable
DtDemyDe
 The display engine.
DtElementID myElementId
 Object element id.
DtUniqueID mySceneObjectId
 To retrieve the scene object if needed.
DtInstanceManagermyInstanceManager
 The instance manager in case we have instancing on.
bool myUseInstancing
 Is instancing enabled?
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)
DtUniqueID myUniqueId
 For retrieving the instance state from the instance manager.
std::string myFeatureName
 The name of the feature in the .meta file.
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 Pointer to manager for removal during destruction.
DtSignalConnectionManager myConnections
unsigned int myFrameCounter
unsigned int myFrameToUpdate
unsigned int myUpdatePeriod

Additional Inherited Members

- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 CTOR.
 DtTickable ()
 Unimplemented default CTOR.
virtual void slot_managerAboutToBeDeleted ()

Detailed Description

The DtShipFlagDirTickable updates a transform node to rotate into the direction of the wind and ship.

Constructor & Destructor Documentation

makVrv::DtShipFlagDirTickable::DtShipFlagDirTickable ( DtDe de,
DtElementID  elementId,
DtUniqueID  sceneObjectId,
DtUniqueID  uniqueId,
bool  useInstancing,
unsigned int  nodeTypeIndex 
)

CTOR.

virtual makVrv::DtShipFlagDirTickable::~DtShipFlagDirTickable ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtShipFlagDirTickable::update ( DtTime  tNow)
virtual

Update the wind direction.

Implements makVrv::DtTickable.

float makVrv::DtShipFlagDirTickable::calcRotAngleForShipFlag ( DtSceneObject sceneObj,
DtDeadReckonUpdater updater,
DtTime  tNow,
DtVector  windDirVec,
float  windSpeedKPH 
)

Calculate the rotation about Z for the flag given the ship velocity and wind velocity.

DtVector makVrv::DtShipFlagDirTickable::computeWindVec ( DtSceneObject sceneObj,
float  windDirRad 
)

Convert the wind angle to a directional vector.

virtual bool makVrv::DtShipFlagDirTickable::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]tNowis the current time-stamp.
Return values
trueif this object needs to be ticked.
falseotherwise.

Reimplemented from makVrv::DtTickable.

virtual void makVrv::DtShipFlagDirTickable::configure ( osg::Node *  n,
const rapidjson::Value &  windJsonData 
)
virtual

Configure node based on json data.

Member Data Documentation

const char* makVrv::DtShipFlagDirTickable::theShipFlagDirFeatureName
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtShipFlagDirTickable::theTagRotOffsetDeg
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtShipFlagDirTickable::theTagRotDir
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtShipFlagDirTickable::theRotDirCW
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

DtSceneObject* makVrv::DtShipFlagDirTickable::mySceneObject
protected

The scene object we are querying.

float makVrv::DtShipFlagDirTickable::myLastFlagDir
protected

Last update wind direction.

DtVector makVrv::DtShipFlagDirTickable::myLastPos
protected

Last position.

DtTime makVrv::DtShipFlagDirTickable::myLastTime
protected

Last update time.

osgSim::DOFTransform* makVrv::DtShipFlagDirTickable::myWindDirNode
protected

Transform for the wind to act upon.

float makVrv::DtShipFlagDirTickable::myRotOffset
protected

The rotation offset to bring the model's rotation in line with the wind's direction.

float makVrv::DtShipFlagDirTickable::myRotDir
protected

Clockwise or counterclockwise rotation.


The documentation for this class was generated from the following file:

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)