VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
makVrv::DtSceneObjectUpdater Class Reference

Abstract scene object updater interface. More...

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

Public Member Functions

 DtSceneObjectUpdater (DtDe &de, DtUniqueID id, bool suppressTick=false)
 CTOR.
virtual ~DtSceneObjectUpdater ()
 Virtual DTOR.
virtual bool needsUpdate (DtTime tNow)
 The check function called by DtTickableManager to verify if an update is required.
virtual void update (DtTime tNow)=0
 The update function called by DtTickableManager during update-ticks.
virtual DtTime lastUpdateTime () const
 Get the time-stamp of the last update.
virtual void setSceneObject (DtSceneObject *sceneObject)
 Set the scene object to be updated.
DtSceneObjectfindSceneObject ()
 Get the current scene object for this updater.
DtUniqueID uniqueId () const
 Returns the distributed object id of this updater.
virtual void setUpdaterPosition (int vtx, const DtVector &pos)
 Set the position of a scene object vertex.
virtual const DtVectorupdaterPosition (int vtx) const
 Get the position of a scene object vertex.
virtual void setUpdaterOrientation (int vtx, const DtTaitBryan &ori)
 Set the orientation of a scene object vertex.
virtual const DtTaitBryan & updaterOrientation (int vtx) const
 Get the orientation of a scene object vertex.
void updateSceneObject (DtTime tNow)
 Update the scene object position and orientation at each vertex and set the last updated time-stamp.
virtual void terrainScaleTransformsIfNeeded ()
 Scales the transforms if the terrain scaling flag is set.

Protected Attributes

DtDemyDe
 The display engine.
DtUniqueID myUniqueId
 This distributed object's unique identifier.
DtSceneObjectmySceneObject
 A pointer to the current scene object being updated.
DtTime myLastUpdateTime
 The last time stamp when the updateSceneObject() was called.
DtSceneObject::TransformList myTransforms
 Local copy of the vertex positions and orientations.
const DtDeSharedStatemyDeSharedState
 This is kept to make terrain scale updating cheaper ( by one virtual function call ).
bool myInManager
 If tick was suppressed, then this updater is not on the tickableManager.

Private Member Functions

DtSceneObject::ObjectTransformgetOrCreateTransform (int vtx)
 Helper function to get the transform at a given vertex.
const
DtSceneObject::ObjectTransform
getTransform (int vtx) const
 Helper function to get the transform at a given vertex.

Signals

boost::signal< void(const
DtUniqueID &) > 
signal_updaterToBeDeleted
 Signal that this updater is being destroyed.
virtual void slot_sceneObjectToBeDeleted (const DtUniqueID &id)
 Signal that this updater is being destroyed.

Additional Inherited Members

- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager=NULL)
 CTOR.
virtual ~DtTickable ()
 Virtual DTOR.

Detailed Description

Abstract scene object updater interface.

DtSceneObjectUpdaters are distributed objects, managed by DtTickableManager. They update the position and orientation of scene objects during the manager 'tick' update.

Constructor & Destructor Documentation

makVrv::DtSceneObjectUpdater::DtSceneObjectUpdater ( DtDe de,
DtUniqueID  id,
bool  suppressTick = false 
)

CTOR.

Parameters
[in]deis the display engine.
[in]idis a unique identifier for this distributed object.
[in]suppressTickis a flag instructing to not register with a DtTickableManager when set true, default is false.
Note
If suppressTick is set, this object will not receive automatic ticks, requiring a user object to force updates as needed.
virtual makVrv::DtSceneObjectUpdater::~DtSceneObjectUpdater ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual bool makVrv::DtSceneObjectUpdater::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.

Implements makVrv::DtTickable.

virtual void makVrv::DtSceneObjectUpdater::update ( DtTime  tNow)
pure virtual
virtual DtTime makVrv::DtSceneObjectUpdater::lastUpdateTime ( ) const
virtual

Get the time-stamp of the last update.

Returns
The last update time.
virtual void makVrv::DtSceneObjectUpdater::setSceneObject ( DtSceneObject sceneObject)
virtual
DtSceneObject* makVrv::DtSceneObjectUpdater::findSceneObject ( )
inline

Get the current scene object for this updater.

Returns
A pointer to the scene object or NULL if not set.
DtUniqueID makVrv::DtSceneObjectUpdater::uniqueId ( ) const
inline

Returns the distributed object id of this updater.

virtual void makVrv::DtSceneObjectUpdater::setUpdaterPosition ( int  vtx,
const DtVector pos 
)
virtual

Set the position of a scene object vertex.

Parameters
[in]vtxis the vertex of the scene object.
[in]posis the position to set.
virtual const DtVector& makVrv::DtSceneObjectUpdater::updaterPosition ( int  vtx) const
virtual

Get the position of a scene object vertex.

Parameters
[in]vtxis the vertex of the scene object.
Returns
The position at the given vertex.
virtual void makVrv::DtSceneObjectUpdater::setUpdaterOrientation ( int  vtx,
const DtTaitBryan &  ori 
)
virtual

Set the orientation of a scene object vertex.

Parameters
[in]vtxis the vertex of the scene object.
[in]oriis the orientation to set.
virtual const DtTaitBryan& makVrv::DtSceneObjectUpdater::updaterOrientation ( int  vtx) const
virtual

Get the orientation of a scene object vertex.

Parameters
[in]vtxis the vertex of the scene object.
Returns
The orientation at the given vertex.
void makVrv::DtSceneObjectUpdater::updateSceneObject ( DtTime  tNow)

Update the scene object position and orientation at each vertex and set the last updated time-stamp.

Parameters
[in]tNowis the current time-stamp.
Note
Derived classes should call this function in their implementation of the update function.
See Also
update( DtTime ).

Reimplemented in makVrv::DtLineModelUpdater, makVrv::DtSegmentedLineModelUpdater, makVrv::DtAttachableEntityFanUpdater, makVrv::DtAttachableIntervisibilityUpdater, and makVrv::DtAttachableFanUpdater.

virtual void makVrv::DtSceneObjectUpdater::terrainScaleTransformsIfNeeded ( )
virtual

Scales the transforms if the terrain scaling flag is set.

Note
This function modifies the stored transforms in this updater.
virtual void makVrv::DtSceneObjectUpdater::slot_sceneObjectToBeDeleted ( const DtUniqueID id)
protectedvirtual

Signal that this updater is being destroyed.

DtSceneObject::ObjectTransform& makVrv::DtSceneObjectUpdater::getOrCreateTransform ( int  vtx)
private

Helper function to get the transform at a given vertex.

If the vertex is above range, new transforms are created.

Parameters
[in]vtxis the vertex of the transform to get.
Returns
The transform at the given vertex.
Exceptions
DtCorruptedStateif vtx is less than zero.
const DtSceneObject::ObjectTransform& makVrv::DtSceneObjectUpdater::getTransform ( int  vtx) const
private

Helper function to get the transform at a given vertex.

If the vertex is out of range, a 'zero' transform is returned.

Parameters
[in]vtxis the vertex of the transform to get.
Returns
The transform at the given vertex.

Member Data Documentation

boost::signal< void ( const DtUniqueID& ) > makVrv::DtSceneObjectUpdater::signal_updaterToBeDeleted

Signal that this updater is being destroyed.

DtDe& makVrv::DtSceneObjectUpdater::myDe
protected

The display engine.

DtUniqueID makVrv::DtSceneObjectUpdater::myUniqueId
protected

This distributed object's unique identifier.

DtSceneObject* makVrv::DtSceneObjectUpdater::mySceneObject
protected

A pointer to the current scene object being updated.

DtTime makVrv::DtSceneObjectUpdater::myLastUpdateTime
protected

The last time stamp when the updateSceneObject() was called.

DtSceneObject::TransformList makVrv::DtSceneObjectUpdater::myTransforms
protected

Local copy of the vertex positions and orientations.

These are typically pre-calculated, and then pushed to the scene object at a later time, making the concatenation of updaters simpler.

const DtDeSharedState& makVrv::DtSceneObjectUpdater::myDeSharedState
protected

This is kept to make terrain scale updating cheaper ( by one virtual function call ).

bool makVrv::DtSceneObjectUpdater::myInManager
protected

If tick was suppressed, then this updater is not on the tickableManager.

In this case, the scene object is not given a pointer to this updater


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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)