![]() |
VR-Forces Developer's Guide
|
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

Classes | |
| struct | AdaptiveTickRateLODParams |
Public Member Functions | |
| DtSceneObjectUpdater (DtDe &de, DtUniqueID id) | |
| virtual | ~DtSceneObjectUpdater () |
| virtual void | setNextUpdater (DtSceneObjectUpdater *nextUpdater) |
| virtual void | setPrevUpdater (DtSceneObjectUpdater *prevUpdater) |
| virtual bool | needsUpdate (DtTime tNow) |
| virtual void | update (DtTime tNow) |
| virtual void | updateAdaptiveTickrate (const DtVector &lastPos, const DtTime &deltaTime) |
| virtual void | setVertexToUpdate (unsigned int vertex) |
| virtual void | setInputPosition (const DtVector &position) |
| virtual void | setInputOrientation (const DtTaitBryan &orientation) |
| virtual void | setOutputPosition (const DtVector &position) |
| virtual DtVector | outputPosition () const |
| virtual void | setOutputOrientation (const DtTaitBryan &orientation) |
| virtual DtTaitBryan | outputOrientation () const |
| virtual void | setOutputPositionAndOrientation (const DtVector &position, const DtTaitBryan &orientation) |
| virtual DtTime | lastUpdateTime () const |
| virtual void | setSceneObject (DtSceneObject *sceneObject, bool addToTickableMgrIfHead) |
| virtual void | setSceneObject (DtSceneObject *sceneObject) |
| DtUniqueID | uniqueId () const |
| DtSceneObjectUpdater * | findNextUpdater () const |
| DtSceneObjectUpdater * | findPrevUpdater () const |
| virtual bool | isChainThreadSafe (DtSceneObjectUpdater *firstUpdater) |
| virtual DtSceneObjectUpdater * | chainHead () |
| virtual void | setIsThreadSafe (bool safe) |
| virtual void | setTickableEnabled (bool enabled) override |
| virtual void | setAdaptiveTickLodEnabled (bool enabled) |
| virtual bool | adaptiveTickLodEnabled () const override |
| virtual void | setLodScaleSpeedFactor (float factor) |
| virtual float | lodScaleSpeedFactor () const |
| virtual void | setLodRadiusStart (float ratius) |
| virtual float | lodRadiusStart () const |
| virtual void | setLodRadiusEnd (float ratius) |
| virtual float | lodRadiusEnd () const |
| virtual void | setNearLodUpdateRate (int nearRate) |
| virtual int | nearLodUpdateRate () const |
| virtual void | setFarLodUpdateRate (int maxRate) |
| virtual int | farLodUpdateRate () const |
| DtSceneObject * | findActiveSceneObject () |
| DtSceneObject *const | findActiveSceneObject () const |
| DtSceneObject * | findSceneObjectForModelSet (DtModelSetId modelSet) |
| DtSceneObject *const | findSceneObjectForModelSet (DtModelSetId modelSet) const |
| virtual void | addSceneObjectToUpdate (DtModelSetId modelSet, DtSceneObject *sceneObject, bool addToTickableMgrIfHead=true) |
| virtual void | removeSceneObjectToUpdate (DtModelSetId modelSet, DtSceneObject *sceneObject) |
| virtual void | addSceneObjectToUpdateAtChainEnd (DtModelSetId modelSet, DtSceneObject *sceneObject, bool addToTickableMgrIfHead=true) |
| virtual void | removeSceneObjectToUpdateAtChainEnd (DtModelSetId modelSet, DtSceneObject *sceneObject) |
Public Member Functions inherited from makVrv::DtTickable | |
| virtual bool | updateIfNeeded (DtTime tNow) |
| virtual | ~DtTickable () |
| virtual bool | isThreadSafe () const |
| virtual void | setTickableListState (TickableListState safeList) |
| virtual TickableListState | tickableListState () const |
| virtual void | setUpdatePeriod (unsigned int period) |
| virtual unsigned int | updatePeriod () const |
Public Attributes | |
Signals | |
Signal that this updater is being destroyed | |
| boost::signalslib::signal < void(const DtUniqueID &) > | signal_updaterToBeDeleted |
Protected Types | |
| using | ModelSetToSceneObjectMap = std::map< DtModelSetId, DtSceneObject * > |
| using | SceneObjectConnectionsMap = std::unordered_map< DtUniqueID, boost::signalslib::connection > |
Protected Member Functions | |
| virtual void | removeThreadSafeChainFromManager (DtSceneObjectUpdater *head) |
| virtual void | removeUnThreadSafeChainFromManager (DtSceneObjectUpdater *head) |
| virtual void | addThreadSafeChainToManager (DtSceneObjectUpdater *head) |
| virtual void | addUnThreadSafeChainToManager (DtSceneObjectUpdater *head) |
| virtual void | placeChainOnCorrectTickableList (DtSceneObjectUpdater *head) |
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) | |
| DtTickable ()=delete | |
| virtual void | slot_managerAboutToBeDeleted () |
Additional Inherited Members | |
Public Types inherited from makVrv::DtTickable | |
| enum | TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList } |
|
protected |
|
protected |
| makVrv::DtSceneObjectUpdater::DtSceneObjectUpdater | ( | DtDe & | de, |
| DtUniqueID | id | ||
| ) |
CTOR.
| [in] | de | is the display engine. |
| [in] | id | is a unique identifier for this distributed object. |
|
virtual |
Virtual DTOR.
|
virtual |
Set the next updater in the updater chain.
| [in] | nextUpdater | is 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 |
Set the previous updater in the updater chain.
| [in] | prevUpdater | is 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. |
The check function called by DtTickableManager to verify if an update is required. If this function returns true, the DtTickableManager will then call update().
| [in] | tNow | is the current time-stamp. |
| true | if this object needs to be ticked. |
| false | otherwise. 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 |
The update function called by DtTickableManager during update-ticks.
| [in] | tNow | is the current time-stamp. |
Implements makVrv::DtTickable.
Reimplemented in makVrv::DtMultiPointEmbarkationUpdater, makVrv::DtEmbarkationUpdater, makVrv::DtGroundClampingUpdater, makVrv::DtSurfaceClampingUpdater, makVrv::DtVertexUpdater, makVrv::DtMultiPointSceneObjectUpdater, makVrv::DtWaterClampingUpdater, makVrv::DtDeadReckonUpdater, and makVrv::DtTerrainScalingUpdater.
|
virtual |
This is called by the update function after all the original chaining updates happen.
| [in] | lastPos | is the position right before update was run . |
| [in] | deltaTime | is useful for calculating velocity of the objects |
Specify which vertex in the scene object this updater updates.
| [in] | vertex | is the vertex in the scene object to update. |
Reimplemented in makVrv::DtSurfaceClampingUpdater.
|
virtual |
Set the position input to this updater.
| [in] | position | is the position to use. |
Reimplemented in makVrv::DtSurfaceClampingUpdater, and makVrv::DtDeadReckonUpdater.
|
virtual |
Set the orientation input to this updater.
| [in] | orientation | is the orientation to use. |
Reimplemented in makVrv::DtDeadReckonUpdater, and makVrv::DtSurfaceClampingUpdater.
|
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.
| [in] | position | is the position to set. |
|
virtual |
Get the last output position.
|
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.
| [in] | orientation | is the orientation to set. |
|
virtual |
Get the last output 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.
|
virtual |
Get the time-stamp of the last update.
|
virtual |
Set the scene object to be updated.
| [in] | sceneObject | is the scene object to receive updates. |
| [in] | addToTickableMgrIfHead | will 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 Calls addSceneObjectToUpdate with the model set of the scene object Left for backwards compatibility, please use addSceneObjectToUpdate. |
|
virtual |
Set the scene object to be updated.
| [in] | sceneObject | is the scene object to receive updates. Calls setSceneObject(DtSceneObject* sceneObject, bool addToTickableMgrIfHead) with addToTickableMgrIfHead=true for back compatibility |
|
virtual |
Following methods are all used for adaptive tick rate LOD Adaptive tick rate will increase or decrease how often this updater updates based on these LOD parameters.
Set/Get if the adaptive tick lod update system is on for this updater
|
overridevirtual |
Following methods are all used for adaptive tick rate LOD Adaptive tick rate will increase or decrease how often this updater updates based on these LOD parameters.
Set/Get if the adaptive tick lod update system is on for this updater
Reimplemented from makVrv::DtTickable.
|
virtual |
sets the value that linearly adjusts the range of the lod radii by the velocity
|
virtual |
gets the value that linearly adjusts the range of the lod radii by the velocity
|
virtual |
sets the near radius where the update rate starts to fall off
|
virtual |
gets the near radius where the update rate starts to fall off
|
virtual |
sets the far radius where the update rate stops falling off
|
virtual |
gets the far radius where the update rate stops falling off
|
virtual |
sets the update rate at the near radius, defaults to every six ticks
|
virtual |
gets the update rate at the near radius, defaults to every six ticks
|
virtual |
the update rate at the far radius, defaults to every 30 ticks
|
virtual |
gets the update rate at the far radius defaults to every 30 ticks
|
inline |
Find an active scene object.
|
inline |
const correct version
|
inline |
Find an active scene object.
|
inline |
Find an active scene object.
|
inline |
Returns the distributed object id of this updater.
|
inline |
Return the next updater in the updater chain.
|
inline |
Return the previous updater in the updater chain.
|
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 |
Find the first updater in the chain.
|
virtual |
Override the DtTickable base class' method so retest the entire chain this updater belongs to.
Reimplemented from makVrv::DtTickable.
|
virtual |
Add / Remove a scene to apply updates to Adds the updater to the tickable update list if it is not there already.
Reimplemented in makVrv::DtDeadReckonUpdater, and makVrv::DtSurfaceClampingUpdater.
|
virtual |
Add / Remove a scene to apply updates to Adds the updater to the tickable update list if it is not there already.
Reimplemented in makVrv::DtDeadReckonUpdater, and makVrv::DtSurfaceClampingUpdater.
|
virtual |
Chain end methods will iterate the chain using findNextUpdater and then call addSceneObjectToUpdate / removeSceneObjectToUpdate on the last updater.
|
virtual |
Add / Remove a scene to apply updates to Adds the updater to the tickable update list if it is not there already.
|
overridevirtual |
Set whether this updater should get ticked or not.
Reimplemented from makVrv::DtTickable.
|
protectedvirtual |
|
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.
|
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.
|
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.
|
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.
|
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.
| boost::signalslib::signal< void ( const DtUniqueID& ) > makVrv::DtSceneObjectUpdater::signal_updaterToBeDeleted |
|
protected |
The display engine.
|
protected |
This distributed object's unique identifier.
|
protected |
A pointer to the current scene object being updated.
This updater is registered as a modelset-specific tickable; this is the modelset it's registered with
|
protected |
|
protected |
The next updater in the chain (or NULL)
|
protected |
The previous updater in the chain (or NULL)
The default scene object vertex to update.
|
protected |
Used to calculate the velocity for adaptive tick rate.
|
protected |
Input position.
|
protected |
Input Orientation.
|
protected |
Last Output position.
|
protected |
Last Output Orientation.
|
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.
|
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.
|
protected |
|
protected |
|
protected |