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

Scene Object Updater. More...

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

Classes

struct  UpdateLODParams
 

Public Member Functions

 DtSceneObjectUpdater (DtDe &de, DtUniqueID id)
 CTOR. More...
 
virtual ~DtSceneObjectUpdater ()
 Virtual DTOR. More...
 
virtual void setNextUpdater (DtSceneObjectUpdater *nextUpdater)
 Set the next updater in the updater chain. More...
 
virtual void setPrevUpdater (DtSceneObjectUpdater *prevUpdater)
 Set the previous updater in the updater chain. More...
 
virtual bool needsUpdate (DtTime tNow)
 The check function called by DtTickableManager to verify if an update is required. More...
 
virtual void update (DtTime tNow)
 The update function called by DtTickableManager during update-ticks. More...
 
virtual void updateAdaptiveTickrate (const DtVector &lastPos, const DtTime &deltaTime)
 This is called by the update function after all the original chaining updates happen. More...
 
virtual void setVertexToUpdate (unsigned int vertex)
 Specify which vertex in the scene object this updater updates. More...
 
virtual void setInputPosition (const DtVector &position)
 Set the position input to this updater. More...
 
virtual void setInputOrientation (const DtTaitBryan &orientation)
 Set the orientation input to this updater. More...
 
virtual void setOutputPosition (const DtVector &position)
 Output the resultant position. More...
 
virtual void setOutputOrientation (const DtTaitBryan &orientation)
 Output the resultant orientation. More...
 
virtual void setOutputPositionAndOrientation (const DtVector &position, const DtTaitBryan &orientation)
 Set both the position and orientation at the same time. More...
 
virtual DtTime lastUpdateTime () const
 Get the time-stamp of the last update. More...
 
virtual void setSceneObject (DtSceneObject *sceneObject, bool addToTickableMgrIfHead)
 Set the scene object to be updated. More...
 
virtual void setSceneObject (DtSceneObject *sceneObject)
 Set the scene object to be updated. More...
 
virtual void setLodSystemEnabled (bool enabled)
 brief set if the lod update system is on for this model More...
 
virtual bool lodSystemEnabled () const
 brief gets if the lod update system is on for this model More...
 
virtual void setLodScaleSpeedFactor (float factor)
 brief sets the value that linearly adjusts the range of the lod radii by the velocity More...
 
virtual float lodScaleSpeedFactor () const
 brief gets the value that linearly adjusts the range of the lod radii by the velocity More...
 
virtual void setLodRadiusStart (float ratius)
 brief sets the near radius where the update rate starts to fall off More...
 
virtual float lodRadiusStart () const
 brief gets the near radius where the update rate starts to fall off More...
 
virtual void setLodRadiusEnd (float ratius)
 brief sets the far radius where the update rate stops falling off More...
 
virtual float lodRadiusEnd () const
 brief gets the far radius where the update rate stops falling off More...
 
virtual void setNearLodUpdateRate (int nearRate)
 sets the update rate at the near radius, defaults to every six ticks More...
 
virtual int nearLodUpdateRate () const
 brief gets the update rate at the near radius, defaults to every six ticks More...
 
virtual void setFarLodUpdateRate (int maxRate)
 brief the update rate at the far radius, defaults to every 30 ticks More...
 
virtual int farLodUpdateRate () const
 brief gets the update rate at the far radius defaults to every 30 ticks More...
 
DtUniqueID uniqueId () const
 Returns the distributed object id of this updater. More...
 
DtSceneObjectUpdaterfindNextUpdater () const
 Return the next updater in the updater chain. More...
 
DtSceneObjectUpdaterfindPrevUpdater () const
 Return the previous updater in the updater chain. More...
 
virtual bool isChainThreadSafe (DtSceneObjectUpdater *firstUpdater)
 Check all the updaters in the current chain and determine if the chain is thread safe. More...
 
virtual DtSceneObjectUpdaterchainHead ()
 Find the first updater in the chain. More...
 
virtual void setIsThreadSafe (bool safe)
 Override the DtTickable base class' method so retest the entire chain this updater belongs to. More...
 
DtSceneObjectfindSceneObject ()
 Get the current scene object for this updater. More...
 
DtSceneObject *const findSceneObject () const
 const correct version 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 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
 

Public Attributes

Signals

Signal that this updater is being destroyed

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

Protected Member Functions

virtual void removeThreadSafeChainFromManager (DtSceneObjectUpdater *head)
 Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's thread-safe tickable list. More...
 
virtual void removeUnThreadSafeChainFromManager (DtSceneObjectUpdater *head)
 Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's un-thread-safe tickable list. More...
 
virtual void addThreadSafeChainToManager (DtSceneObjectUpdater *head)
 Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's thread-safe tickable list. More...
 
virtual void addUnThreadSafeChainToManager (DtSceneObjectUpdater *head)
 Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's un-thread-safe tickable list. More...
 
virtual void placeChainOnCorrectTickableList (DtSceneObjectUpdater *head)
 Examines the chain for the given head updater, removes the head from the approriate ticable list if necessary, and then adds the head to the correct (threaded or unthreaded) tickable list. More...
 
Slots

Slot called when the a scene object is to be deleted.

If its the scene object that this updater is updating, then the local scene object copy is set to false

virtual void slot_sceneObjectToBeDeleted (const DtUniqueID &id)
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 CTOR. More...
 
 DtTickable ()
 Unimplemented default CTOR. More...
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtDemyDe
 The display engine. More...
 
DtUniqueID myUniqueId
 This distributed object's unique identifier. More...
 
DtSceneObjectmySceneObject
 A pointer to the current scene object being updated. More...
 
int myModelSet
 This updater is registered as a modelset-specific tickable; this is the modelset it's registered with. More...
 
boost::signalslib::connection mySceneObjectConnection
 
DtSceneObjectUpdatermyNextUpdater
 The next updater in the chain (or NULL) More...
 
DtSceneObjectUpdatermyPrevUpdater
 The previous updater in the chain (or NULL) More...
 
unsigned int myVertexToUpdate
 The default scene object vertex to update. More...
 
DtVector myInputPosition
 Input position. More...
 
DtTaitBryan myInputOrientation
 Input Orientation. More...
 
bool myPositionDataOutputted
 Flag to indicate if setOutputPosition has been called this tick. More...
 
bool myOrientationDataOutputted
 Flag to indicate if setOutputOrientation has been called this tick. More...
 
UpdateLODParams myLodUpdateParams
 automatic lod system params More...
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 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...
 

Detailed Description

Scene Object Updater.

DtSceneObjectUpdater is a distributed object managed by DtTickableManager. It provides an API and infrastructure used by deriving objects to update the position and orientation of scene objects in render space. DtSceneObjectUpdaters may be chained together in a list to perform multiple position and/or orientation transformations. For example, one updater might dead reckon position and orientation based on kinematic info, the next in the chain could ground clamp the object. A third might adjust the ground clamped position to support terrain scaling.

02/23/2020 - Added support for determine whether an updater chain should be placed on the threaded or unthreaded DtTickableManager tickable list

Constructor & Destructor Documentation

makVrv::DtSceneObjectUpdater::DtSceneObjectUpdater ( DtDe de,
DtUniqueID  id 
)

CTOR.

Parameters
[in]deis the display engine.
[in]idis a unique identifier for this distributed object.
virtual makVrv::DtSceneObjectUpdater::~DtSceneObjectUpdater ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtSceneObjectUpdater::setNextUpdater ( DtSceneObjectUpdater nextUpdater)
virtual

Set the next updater in the updater chain.

Parameters
[in]nextUpdateris the next updater in this updater chain When the next updater is null, it indicates that the updater is at the end of the chain. Its output will be used to set the appropriate vertex (set using setVertexToUpdate) in the scene object. Updaters with a non-null next updater will provide its outputs to the inputs of the next updater.

Reimplemented in makVrv::DtSurfaceClampingUpdater.

virtual void makVrv::DtSceneObjectUpdater::setPrevUpdater ( DtSceneObjectUpdater prevUpdater)
virtual

Set the previous updater in the updater chain.

Parameters
[in]prevUpdateris the prev updater in this updater chain When the previous updater is null, it indicates that this is the start of the updater chain; intial position and information is provided using setInputPosition and setInputOrientation.
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. This base class method uses both the time and the presence of valid input transforms to determine if the updater should be ticked. Will always be true if the object is being observed

Reimplemented from makVrv::DtTickable.

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

The update function called by DtTickableManager during update-ticks.

Parameters
[in]tNowis the current time-stamp.
Note
All classes deriving from DtSceneObjectUpdater must call DtSceneObjectUpdater::update() AFTER their own update completes for chaining (and pass-thru) to work correctly.

Implements makVrv::DtTickable.

Reimplemented in makVrv::DtEmbarkationUpdater, makVrv::DtMultiPointEmbarkationUpdater, makVrv::DtSurfaceClampingUpdater, makVrv::DtVertexUpdater, makVrv::DtGroundClampingUpdater, makVrv::DtMultiPointSceneObjectUpdater, makVrv::DtWaterClampingUpdater, makVrv::DtDeadReckonUpdater, and makVrv::DtTerrainScalingUpdater.

virtual void makVrv::DtSceneObjectUpdater::updateAdaptiveTickrate ( const DtVector lastPos,
const DtTime deltaTime 
)
virtual

This is called by the update function after all the original chaining updates happen.

Parameters
[in]lastPosis the position right before update was run .
[in]deltaTimeis useful for calculating velocity of the objects
virtual void makVrv::DtSceneObjectUpdater::setVertexToUpdate ( unsigned int  vertex)
virtual

Specify which vertex in the scene object this updater updates.

Parameters
[in]vertexis the vertex in the scene object to update.

Reimplemented in makVrv::DtSurfaceClampingUpdater.

virtual void makVrv::DtSceneObjectUpdater::setInputPosition ( const DtVector position)
virtual

Set the position input to this updater.

Parameters
[in]positionis the position to use.

Reimplemented in makVrv::DtDeadReckonUpdater, and makVrv::DtSurfaceClampingUpdater.

virtual void makVrv::DtSceneObjectUpdater::setInputOrientation ( const DtTaitBryan &  orientation)
virtual

Set the orientation input to this updater.

Parameters
[in]orientationis the orientation to use.

Reimplemented in makVrv::DtDeadReckonUpdater, and makVrv::DtSurfaceClampingUpdater.

virtual void makVrv::DtSceneObjectUpdater::setOutputPosition ( const DtVector position)
virtual

Output the resultant position.

If there is a next updater, this will call that updater's setInputPosition with the result. Otherwise the result will be provided to the specified scene object

Parameters
[in]positionis the position to set.

Reimplemented in makVrv::DtBoxUpdater.

virtual void makVrv::DtSceneObjectUpdater::setOutputOrientation ( const DtTaitBryan &  orientation)
virtual

Output the resultant orientation.

If there is a next updater, this will call that updater's setInputOrientaiton with the result. Otherwise the result will be provided to the specified scene object

Parameters
[in]orientationis the orientation to set.
virtual void makVrv::DtSceneObjectUpdater::setOutputPositionAndOrientation ( const DtVector position,
const DtTaitBryan &  orientation 
)
virtual

Set both the position and orientation at the same time.

This allows the scene obejct and DtModels to set both at the same time which can avoid additional calculations when the two depend on each other. Currently only the DtDiGuyCharacterModel takes advantage of the performance improvement

Reimplemented in makVrv::DtBoxUpdater.

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,
bool  addToTickableMgrIfHead 
)
virtual

Set the scene object to be updated.

Parameters
[in]sceneObjectis the scene object to receive updates.
[in]addToTickableMgrIfHeadwill allow (or disallow) the updater to be added to the tickable manager if it is currently has no 'previous' updater. This is a workaround used for cases where updaters aren't part of a simple chain, like the buoyancy and ground clamping updaters which are owned by a surface updater
virtual void makVrv::DtSceneObjectUpdater::setSceneObject ( DtSceneObject sceneObject)
virtual

Set the scene object to be updated.

Parameters
[in]sceneObjectis the scene object to receive updates. Calls setSceneObject(DtSceneObject* sceneObject, bool addToTickableMgrIfHead) with addToTickableMgrIfHead=true for back compatibility

Reimplemented in makVrv::DtSurfaceClampingUpdater, and makVrv::DtDeadReckonUpdater.

virtual void makVrv::DtSceneObjectUpdater::setLodSystemEnabled ( bool  enabled)
virtual

brief set if the lod update system is on for this model

virtual bool makVrv::DtSceneObjectUpdater::lodSystemEnabled ( ) const
virtual

brief gets if the lod update system is on for this model

Reimplemented from makVrv::DtTickable.

virtual void makVrv::DtSceneObjectUpdater::setLodScaleSpeedFactor ( float  factor)
virtual

brief sets the value that linearly adjusts the range of the lod radii by the velocity

virtual float makVrv::DtSceneObjectUpdater::lodScaleSpeedFactor ( ) const
virtual

brief gets the value that linearly adjusts the range of the lod radii by the velocity

virtual void makVrv::DtSceneObjectUpdater::setLodRadiusStart ( float  ratius)
virtual

brief sets the near radius where the update rate starts to fall off

virtual float makVrv::DtSceneObjectUpdater::lodRadiusStart ( ) const
virtual

brief gets the near radius where the update rate starts to fall off

virtual void makVrv::DtSceneObjectUpdater::setLodRadiusEnd ( float  ratius)
virtual

brief sets the far radius where the update rate stops falling off

virtual float makVrv::DtSceneObjectUpdater::lodRadiusEnd ( ) const
virtual

brief gets the far radius where the update rate stops falling off

virtual void makVrv::DtSceneObjectUpdater::setNearLodUpdateRate ( int  nearRate)
virtual

sets the update rate at the near radius, defaults to every six ticks

virtual int makVrv::DtSceneObjectUpdater::nearLodUpdateRate ( ) const
virtual

brief gets the update rate at the near radius, defaults to every six ticks

virtual void makVrv::DtSceneObjectUpdater::setFarLodUpdateRate ( int  maxRate)
virtual

brief the update rate at the far radius, defaults to every 30 ticks

virtual int makVrv::DtSceneObjectUpdater::farLodUpdateRate ( ) const
virtual

brief gets the update rate at the far radius defaults to every 30 ticks

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.
DtSceneObject* const makVrv::DtSceneObjectUpdater::findSceneObject ( ) const
inline

const correct version

DtUniqueID makVrv::DtSceneObjectUpdater::uniqueId ( ) const
inline

Returns the distributed object id of this updater.

DtSceneObjectUpdater* makVrv::DtSceneObjectUpdater::findNextUpdater ( ) const
inline

Return the next updater in the updater chain.

DtSceneObjectUpdater* makVrv::DtSceneObjectUpdater::findPrevUpdater ( ) const
inline

Return the previous updater in the updater chain.

virtual bool makVrv::DtSceneObjectUpdater::isChainThreadSafe ( DtSceneObjectUpdater firstUpdater)
virtual

Check all the updaters in the current chain and determine if the chain is thread safe.

Called to determine which tickable list the first updater should be placed on.

virtual DtSceneObjectUpdater* makVrv::DtSceneObjectUpdater::chainHead ( )
virtual

Find the first updater in the chain.

virtual void makVrv::DtSceneObjectUpdater::setIsThreadSafe ( bool  safe)
virtual

Override the DtTickable base class' method so retest the entire chain this updater belongs to.

Reimplemented from makVrv::DtTickable.

virtual void makVrv::DtSceneObjectUpdater::slot_sceneObjectToBeDeleted ( const DtUniqueID id)
protectedvirtual
virtual void makVrv::DtSceneObjectUpdater::removeThreadSafeChainFromManager ( DtSceneObjectUpdater head)
protectedvirtual

Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's thread-safe tickable list.

Catches the exception that DtTickableManager may throw and outputs an appropriate message to the debug log

virtual void makVrv::DtSceneObjectUpdater::removeUnThreadSafeChainFromManager ( DtSceneObjectUpdater head)
protectedvirtual

Helper method to remove an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) from the DtTickableManager's un-thread-safe tickable list.

Catches the exception that DtTickableManager may throw and outputs an appropriate message to the debug log

virtual void makVrv::DtSceneObjectUpdater::addThreadSafeChainToManager ( DtSceneObjectUpdater head)
protectedvirtual

Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's thread-safe tickable list.

Catches the exception that DtTickableManager may throw and outputs an appropriate message to the debug log

virtual void makVrv::DtSceneObjectUpdater::addUnThreadSafeChainToManager ( DtSceneObjectUpdater head)
protectedvirtual

Helper method to add an updater (not necessarily this one, but rather the one at the head of the chain that this updater belongs to) to the DtTickableManager's un-thread-safe tickable list.

Catches the exception that DtTickableManager may throw and outputs an appropriate message to the debug log

virtual void makVrv::DtSceneObjectUpdater::placeChainOnCorrectTickableList ( DtSceneObjectUpdater head)
protectedvirtual

Examines the chain for the given head updater, removes the head from the approriate ticable list if necessary, and then adds the head to the correct (threaded or unthreaded) tickable list.

Member Data Documentation

boost::signal< void ( const DtUniqueID& ) > makVrv::DtSceneObjectUpdater::signal_updaterToBeDeleted
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.

int makVrv::DtSceneObjectUpdater::myModelSet
protected

This updater is registered as a modelset-specific tickable; this is the modelset it's registered with.

boost::signalslib::connection makVrv::DtSceneObjectUpdater::mySceneObjectConnection
protected
DtSceneObjectUpdater* makVrv::DtSceneObjectUpdater::myNextUpdater
protected

The next updater in the chain (or NULL)

DtSceneObjectUpdater* makVrv::DtSceneObjectUpdater::myPrevUpdater
protected

The previous updater in the chain (or NULL)

unsigned int makVrv::DtSceneObjectUpdater::myVertexToUpdate
protected

The default scene object vertex to update.

DtVector makVrv::DtSceneObjectUpdater::myInputPosition
protected

Input position.

DtTaitBryan makVrv::DtSceneObjectUpdater::myInputOrientation
protected

Input Orientation.

bool makVrv::DtSceneObjectUpdater::myPositionDataOutputted
protected

Flag to indicate if setOutputPosition has been called this tick.

If a deriving updater hasn't called setOutputPosition, this base class will copy the input position to the output.

bool makVrv::DtSceneObjectUpdater::myOrientationDataOutputted
protected

Flag to indicate if setOutputOrientation has been called this tick.

If a deriving updater hasn't called setOutputPosition, this base class will copy the input orientation to the output.

UpdateLODParams makVrv::DtSceneObjectUpdater::myLodUpdateParams
protected

automatic lod system params


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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)