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

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

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

Public Member Functions

 DtShipFlagDirTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel *osgArticulatedModel)
 
virtual ~DtShipFlagDirTickable ()
 
virtual void update (DtTime tNow)
 
float calcRotAngleForShipFlag (DtSceneObject *sceneObj, DtDeadReckonUpdater *updater, DtTime tNow, const DtVector &windDirVec, float windSpeedMperS)
 
DtVector computeWindVec (DtSceneObject *sceneObj, float windDirRad)
 
virtual bool needsUpdate (DtTime tNow)
 
virtual void configure (osg::Node *n, const rapidjson::Value &windJsonData)
 
virtual void modelToBeDestroyed (DtModel *model)
 
- Public Member Functions inherited from makVrv::DtDynamicFeatureTickable
virtual ~DtDynamicFeatureTickable ()
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool updateIfNeeded (DtTime tNow)
 
virtual ~DtTickable ()
 
virtual void setTickableEnabled (bool enabled)
 
virtual void setIsThreadSafe (bool safe)
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 
virtual unsigned int updatePeriod () const
 
virtual bool adaptiveTickLodEnabled () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Attributes

static const chartheShipFlagDirFeatureName
 
static const chartheTagRotOffsetDeg
 
static const chartheTagRotDir
 
static const chartheRotDirCW
 

Protected Member Functions

virtual void disconnectFromModel ()
 
virtual void slot_coordinateSystemChanged ()
 
- Protected Member Functions inherited from makVrv::DtDynamicFeatureTickable
 DtDynamicFeatureTickable (DtDe &de, DtElementID elementId, DtUniqueID sceneObjectId, DtUniqueID uniqueId, unsigned int nodeTypeIndex)
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 
 DtTickable ()=delete
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtSceneObjectmySceneObject
 
float myLastFlagDir
 
DtVector myLastPos
 
DtTime myLastTime
 
osgSim::DOFTransform * myWindDirNode
 
float myRotOffset
 
float myRotDir
 
DtOsgArticulatedModelmyOsgArticulatedModel
 
DtSignalConnectionManager myConnections
 
DtCoordinateSystemmyCoordinateSystem = nullptr
 
boost::signalslib::connection myModelToBeDestroyedConnection
 
- Protected Attributes inherited from makVrv::DtDynamicFeatureTickable
DtDemyDe
 
DtElementID myElementId
 
DtUniqueID mySceneObjectId
 
unsigned int myNodeTypeIndex
 
DtUniqueID myUniqueId
 
std::string myFeatureName
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
unsigned int myTickableIndex
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Additional Inherited Members

- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 

Constructor & Destructor Documentation

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

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,
const DtVector windDirVec,
float  windSpeedMperS 
)

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.

virtual void makVrv::DtShipFlagDirTickable::modelToBeDestroyed ( DtModel model)
virtual

listen to the model to be destroyed signal

virtual void makVrv::DtShipFlagDirTickable::disconnectFromModel ( )
protectedvirtual

internal function to disconnect from the model

virtual void makVrv::DtShipFlagDirTickable::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

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.

DtOsgArticulatedModel* makVrv::DtShipFlagDirTickable::myOsgArticulatedModel
protected
DtSignalConnectionManager makVrv::DtShipFlagDirTickable::myConnections
protected
DtCoordinateSystem* makVrv::DtShipFlagDirTickable::myCoordinateSystem = nullptr
protected

local clone of the system wide coordinate system. for thread safety.

boost::signalslib::connection makVrv::DtShipFlagDirTickable::myModelToBeDestroyedConnection
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)