18 speedModifier(1.0), timeToLive(604800.0f)
31 list<VART::BaseAction*>::iterator iter = activeInstances.begin();
32 while (iter != activeInstances.end())
36 activeInstances.erase(iter);
37 iter = activeInstances.end();
45 callbackPtr->Activate();
49 timeToLive = 604800.0f;
64 lastPositionIndex = 0;
69 activeInstances.push_back(
this);
77 list<VART::BaseAction::Initializer*>::iterator i = initializers.begin();
78 while (i != initializers.end())
85 list<VART::BaseAction*>::iterator iter = activeInstances.begin();
86 list<VART::BaseAction*>::iterator tempIter;
88 while (iter != activeInstances.end())
96 return activeInstances.size();
105 float diffTime = (currentTime - lastUpdateTime).AsFloat();
107 positionIndex = ((diffTime * speedModifier) / duration) + lastPositionIndex;
108 if (positionIndex > 1.0)
113 positionIndex -= 1.0;
122 timeToLive -= diffTime;
126 lastPositionIndex = positionIndex;
127 lastUpdateTime = currentTime;
static const Time & NOW()
Returns current time.
virtual void Deactivate()
Deactivate now.
Header file for V-ART class "Time".
Header file for V-ART class "CallBack".
static std::list< Initializer * > initializers
List of action initializers.
BaseAction()
Creates an action with sane defaults.
Header file for V-ART class "BaseAction".
static unsigned int MoveAllActive()
Moves all active actions.
static std::list< BaseAction * > activeInstances
List of active actions.
virtual void Activate()
Activates the action.
virtual void ComputePositionIndex(bool *cycled)
Computes current position index.
Elapsed time representation.