![]() |
VR-Forces 5.0.1 Developer's Guide
|
A base class for managers of DtTickable objects.

Public Types | |
| typedef std::vector< DtTickable * > | TickableList |
| typedef std::vector< TickableList > | TickablesArray |
Public Member Functions | |
| DtTickableManager (DtDe &de) | |
| virtual | ~DtTickableManager () |
| virtual bool | addTickableObject (DtTickable *ticObj) |
| virtual bool | addTickableObjectToMainList (DtTickable *ticObj) |
| virtual bool | addTickableObjectToThreadSafeList (DtTickable *ticObj) |
| virtual void | removeTickableObject (DtTickable *ticObj) |
| virtual void | removeTickableObjectFromMainList (DtTickable *ticObj) |
| virtual void | removeTickableObjectFromThreadSafeList (DtTickable *ticObj) |
| virtual void | tick (DtTime tNow=0.0) |
| virtual bool | inTick () |
| virtual int | numTickables () |
| virtual int | numMultithreadedTickables () |
| virtual int | numTickedLastFrame () |
| virtual double | timeSpentThisFrame () |
| virtual void | setUseAdaptiveTickRate (bool value) |
| virtual bool | useAdaptiveTickRate () |
| virtual void | resetAdaptiveTickrate () |
| virtual void | setUseMultithreadUpdate (bool useIt) |
| virtual bool | useMultithreadUpdate () const |
Public Member Functions inherited from makVrv::DtTickableManagerInterface | |
| virtual | ~DtTickableManagerInterface () |
Protected Member Functions | |
| bool | addTickableObject (TickableList &array, DtTickable *ticObj) |
Additional Inherited Members | |
Public Attributes inherited from makVrv::DtTickableManagerInterface | |
| boost::signalslib::signal< void()> | signal_aboutToBeDeleted |
| typedef std::vector<DtTickable*> makVrv::DtTickableManager::TickableList |
| typedef std::vector<TickableList> makVrv::DtTickableManager::TickablesArray |
| makVrv::DtTickableManager::DtTickableManager | ( | DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
Add a DtTickable object to this manager.
| [in] | ticObj | is a pointer to a tick-able object to add. |
| true | if the pointer was successfully added. |
| false | otherwise. |
| DtCorruptedState | if called during tick-update. This call checks DtTickable::isThreadSafe() and places the tickable on the appropriate tickable list |
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Add a tickable to the main (not threaded) tickable list Even if a tickable is 'thread safe' we may choose to not place it on the threaded list (mainly because it may be a scene object updater at the head of a not thread safe updater chain). This call checks DtTickable::isThreadSafe() and places the tickable on the appropriate tickable list. This method sets the tickable's tickableListState to DtTickable::TickableOnMainList.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Add a tickable to the threaded tickable list. This method checks the tickable's isThreadSafe() method and will not add the tickable to the list if not thread-safe.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Remove a DtTickable object from this manager.
| [in] | ticObj | is a pointer to a tick-able object to remove. |
| DtCorruptedState | if called during tick-update. Note: This form is kept for back compatibility. It is inefficient because it needs to check both tickable lists for the tickable to remove. The preferred method is to check the tickable for which list it's on (DtTickable::tickableListState()) and then explicitly remove it from the correct list |
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Remove a tickable from this manager's main (unthreaded) tickable list. This method sets the tickable's tickableListState to DtTickable::TickableNotOnList.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Remove a tickable from this manager's thread-safe tickable list. This method sets the tickable's tickableListState to DtTickable::TickableNotOnList.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Function to update each tick-able object. Each tick-able object on the main (not threaded) list receives a call to its update() function if its needsUpdate() function returns true. If the myUseMultithreadUpdate is false, tickables on the the thread-safe list are treated the same way. But if the flag is true, a parallel_for is used to call the tickable's updateIfNeeded() method (which currently just combines the call to needsUpdate() and update().
| [in] | tNow | is a time-stamp to pass to each object. |
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief returns if the tick manager is currently updating
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief how many tickables there are total
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief how many tickables there are, having been filtered by the modelset vector
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief how many tickables were ticked last frame
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief how long the last update took in seconds
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief should objects attempt to call setUpdatePeriod on themselves with reasonable values.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief are objects calling setUpdatePeriod on themselves when they are updated.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
brief resets the tickables back to an update period of 1 frame
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Set the flag that determines whether tickables on the threadsafe list are updated in a parallel_for.
Implements makVrv::DtTickableManagerInterface.
|
virtual |
Get the flag that determines whether tickables on the threadsafe list are updated in a parallel_for.
Implements makVrv::DtTickableManagerInterface.
|
protected |
adds tickable to the array if it is not already in the list
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |