33 jointMoverList = jointMoverList;
39 list<VART::JointMover*>::iterator iter;
41 for (iter = jointMoverList.begin(); iter != jointMoverList.end(); ++iter)
48 priority = newPriority;
56 jointMoverList.push_back(jointMoverPtr);
57 if (newDuration > duration)
58 duration = newDuration;
66 jointMoverPtr->
CopyFrom(*jointMover, jointPtr);
76 list<VART::JointMover*>::iterator iter;
80 if (frameFrequency < 0.001)
82 timeDiff = (currentTime - initialTime).AsFloat() * speed;
85 timeDiff += (frameFrequency * speed);
88 if (timeDiff > timeToLive)
91 timeToLive = 604800.0f;
96 if (timeDiff > duration)
100 timeDiff -= duration;
101 initialTime += duration;
102 DeactivateDofMovers();
103 timeToLive -= duration;
121 for (iter = jointMoverList.begin(); iter != jointMoverList.end(); ++iter)
134 list<Action*>::iterator iter = activeInstances.begin();
135 bool notFinished =
true;
136 while (notFinished && (iter != activeInstances.end()))
141 if ((*iter)->priority < priority)
143 activeInstances.insert(iter,
this);
149 activeInstances.push_back(
this);
160 list<VART::Action*>::iterator iter = activeInstances.begin();
165 while (iter != activeInstances.end())
170 DeactivateDofMovers();
172 activeInstances.erase(iter);
173 iter = activeInstances.end();
179 callbackPtr->Activate();
185 timeToLive = seconds;
190 list<VART::JointMover*>::iterator iter;
191 for (iter = jointMoverList.begin(); iter != jointMoverList.end(); ++iter)
192 (*iter)->DeactivateDofMovers();
198 list<VART::Action*>::iterator iter = activeInstances.begin();
199 list<VART::Action*>::iterator tempIter;
204 while (iter != activeInstances.end())
212 return activeInstances.size();
217 list<VART::JointMover*>::iterator iter;
220 for (iter = jointMoverList.begin(); iter != jointMoverList.end(); ++iter)
221 (*iter)->GetFinalTimes(resultPtr);
229 std::list<JointMover*>::iterator jointMoverIter;
232 thisCopy->Action::operator=(*this);
235 for( jointMoverIter = jointMoverList.begin(); jointMoverIter != jointMoverList.end(); jointMoverIter ++ )
240 jointMover = thisCopy->
AddJointMover( joint, *jointMoverIter );
249 list<JointMover*>::iterator jointIter = jointMoverList.begin();
250 for(; jointIter != jointMoverList.end(); ++jointIter)
251 (*jointIter)->ModifyDofMovers(modifier);
256 list<JointMover*>::const_iterator iter = action.
jointMoverList.begin();
258 output <<
"Action '" << action.
description <<
"'. Speed: " << action.
speed <<
". ";
260 output <<
"Cyclic.\n";
262 output <<
"Not cyclic.\n";
VART::Action & operator=(const VART::Action &action)
Copy action data, except the active atribute (that remains unmodified). Used in Action::Copy() method...
Base class for objects that compose a scene graph.
void ModifyDofMovers(DMModifier &mod)
Modifies dof movers.
Header file for V-ART class "Dof".
Action()
Creates an unitialized action.
Representation of joints.
void Set(float newSpeed, unsigned int newPriority, bool cyclic)
Sets speed, priority and cycle attibutes.
static bool cycle
Indicates whether the current action is cyclic.
Header file for V-ART class "Time".
A coordinated movement of joints in an articulated body.
static float frameFrequency
Fake animation time.
static void ClearPriorities()
Resets priorities of all DOF instances.
void GetFinalTimes(std::list< float > *resultPtr)
Returns a ordered list with all different final times for every dof mover.
std::ostream & operator<<(std::ostream &output, const Joint::DofID &dofId)
Header file for V-ART class "CallBack".
void Set()
Set to current time.
std::string description
Textual description.
unsigned int priority
seconds to auto deactivation
Header file for V-ART class "JointMover".
void CopyFrom(VART::JointMover &jointMover, VART::Joint *targetJoint)
Copy jointMover data to this jointMover, setting its jointPtr atribute to the targetJoint.
void DeactivateDofMovers()
Deactivates DOF movers in every joint mover.
float GetDuration()
Return the total movement duration (in seconds).
Header file for V-ART class "Action".
An object that modifies noisy dof movers.
static std::list< Action * > activeInstances
Interpolator representation.
Controllers for joint movement.
void Move()
Animate joints.
static unsigned int MoveAllActive()
Moves all active actions.
Header file for V-ART class "DofMover".
void Activate()
Activate action.
void Deactivate()
Deactivate action.
std::list< JointMover * > jointMoverList
VART::Action * Copy(VART::SceneNode &targetNode)
Returns a copy of an action, aplied to an targetNode sceneNode.
SceneNode * FindChildByName(const std::string &name) const
Recusively searches its children for a given name.
JointMover * AddJointMover(Joint *jointPtr, float newDuration, const Interpolator &interpolator)
Adds a joint mover to the action.
static unsigned int priority
Priority of active action.
const Interpolator * GetInterpolator()
Returns a pointer to the associated interpolator. NULL is returned if there are no interpolator assoc...
Elapsed time representation.