19 static unsigned char counter = 0;
23 BaseAction::initializers.push_back(
this);
27 cerr <<
"\aCreate just one instance of JointAction::Initializer!" << endl;
51 lastPositionIndex = 0;
56 AddToActiveInstancesList();
62 list<BaseAction*>::iterator iter = activeInstances.begin();
63 bool positionNotFound =
true;
64 while (positionNotFound && (iter != activeInstances.end()))
73 positionNotFound =
false;
76 positionNotFound =
false;
80 activeInstances.push_back(
this);
82 activeInstances.insert(iter,
this);
92 list<VART::JointMover*>::iterator iter = jointMoverList.begin();
93 for (; iter != jointMoverList.end(); ++iter)
94 (*iter)->DeactivateDofMovers();
100 list<VART::JointMover*>::iterator iter = jointMoverList.begin();
101 for (; iter != jointMoverList.end(); ++iter)
102 (*iter)->GetFinalTimes(resultPtr);
108 list<VART::JointMover*>::iterator iter = jointMoverList.begin();
109 for (; iter != jointMoverList.end(); ++iter)
110 listPtr->push_back(const_cast<Joint*>((*iter)->GetAttachedJoint()));
118 jointMoverList.push_back(jointMoverPtr);
119 if (newDuration > duration)
120 duration = newDuration;
121 return jointMoverPtr;
128 ComputePositionIndex(&cycled);
130 DeactivateDofMovers();
144 list<VART::JointMover*>::iterator iter = jointMoverList.begin();
145 for (; iter != jointMoverList.end(); ++iter)
152 list<JointMover*>::iterator jointIter = jointMoverList.begin();
153 for(; jointIter != jointMoverList.end(); ++jointIter)
154 (*jointIter)->ModifyDofMovers(modifier);
159 list<VART::JointMover*>::iterator iter = jointMoverList.begin();
160 for (; iter != jointMoverList.end(); ++iter)
162 if (jointPtr == ((*iter)->GetAttachedJoint()))
163 return (*iter)->GetDofMover(dof);
170 list<JointMover*>::const_iterator iter = action.
jointMoverList.begin();
172 output <<
"<?xml version=\"1.0\"?>\n"
173 <<
"<!DOCTYPE action SYSTEM \"vartAnimation.dtd\">\n"
174 <<
"<action action_name=\"" << action.
description <<
"\" speed=\""
182 output <<
"</action>\n";
Header file for V-ART class "JointAction".
Header file for V-ART class "Dof".
Representation of joints.
static bool cycle
Indicates whether the current action is cyclic.
void ModifyDofMovers(DMModifier &mod)
Modifies dof movers.
JointMover * AddJointMover(Joint *jointPtr, float newDuration, const Interpolator &interpolator)
Adds a joint mover to the action.
static void ClearPriorities()
Resets priorities of all DOF instances.
std::ostream & operator<<(std::ostream &output, const Joint::DofID &dofId)
void GetJoints(std::list< Joint * > *listPtr)
Returns a list of all target joints.
std::list< JointMover * > jointMoverList
float speedModifier
Speed modifier.
Header file for V-ART class "JointMover".
An object that modifies noisy dof movers.
void AddToActiveInstancesList()
Adds itself to list of active instances, in priority order.
void DeactivateDofMovers()
A coordinated movement of joints in an articulated body.
Controller for DOF movement.
Interpolator representation.
Controllers for joint movement.
void GetFinalTimes(std::list< float > *resultPtr)
Returns a ordered list with all different final times for every dof mover.
virtual void Initialize()
Header file for V-ART class "DofMover".
DofMover * SearchDofMover(Joint *jointPtr, Joint::DofID dof)
Returns a dof mover.
virtual void Activate()
Activates a JointAction.
static unsigned int priority
Priority of active action.
bool cyclic
Whether the action restarts upon termination.
virtual void Move()
Make the action update its targets.