V-ART
|
A coordinated movement of joints in an articulated body. More...
#include <action.h>
Public Member Functions | |
Action () | |
Creates an unitialized action. More... | |
~Action () | |
VART::Action & | operator= (const VART::Action &action) |
Copy action data, except the active atribute (that remains unmodified). Used in Action::Copy() method. More... | |
JointMover * | AddJointMover (Joint *jointPtr, float newDuration, const Interpolator &interpolator) |
Adds a joint mover to the action. More... | |
JointMover * | AddJointMover (Joint *jointPtr, JointMover *jointMover) |
Used to add a copy of jointMover, aplied to jointPtr. More... | |
void | SetPriority (unsigned int newPriority) |
Sets the priority of an action. More... | |
void | SetSpeed (float newSpeed) |
Sets the speed of an action. More... | |
void | SetCyclic (bool value) |
Sets whether an action is cyclic. More... | |
bool | IsCyclic () |
Checks whether the action is cyclic. More... | |
void | Set (float newSpeed, unsigned int newPriority, bool cyclic) |
Sets speed, priority and cycle attibutes. More... | |
void | Activate () |
Activate action. More... | |
void | Deactivate () |
Deactivate action. More... | |
void | Deactivate (float seconds) |
Deactivate action after some time. More... | |
bool | IsActive () const |
Returns true if the action is currently active. More... | |
void | GetFinalTimes (std::list< float > *resultPtr) |
Returns a ordered list with all different final times for every dof mover. More... | |
VART::Action * | Copy (VART::SceneNode &targetNode) |
Returns a copy of an action, aplied to an targetNode sceneNode. More... | |
void | ModifyDofMovers (DMModifier &mod) |
Modifies dof movers. More... | |
Static Public Member Functions | |
static unsigned int | MoveAllActive () |
Moves all active actions. More... | |
Public Attributes | |
std::string | description |
Textual description. More... | |
CallBack * | callbackPtr |
A call-back to be activated once the action is finished/deactivated. More... | |
Static Public Attributes | |
static float | frameFrequency = 0.0f |
Fake animation time. More... | |
Protected Member Functions | |
void | Move () |
Animate joints. More... | |
void | DeactivateDofMovers () |
Deactivates DOF movers in every joint mover. More... | |
Protected Attributes | |
bool | cycle |
bool | active |
float | speed |
float | duration |
float | timeToLive |
unsigned int | priority |
seconds to auto deactivation More... | |
std::list< JointMover * > | jointMoverList |
Time | initialTime |
Static Protected Attributes | |
static std::list< Action * > | activeInstances |
Friends | |
std::ostream & | operator<< (std::ostream &output, const Action &action) |
A coordinated movement of joints in an articulated body.
Actions represent simple tasks such as walking, waving or scratching the head. They may be thought as an integration of key poses, interpolation schemes and time control. When the time period for a non-cyclic action terminates, it is automatically deactivated. They are implementated as a collection of joint movers (see JointMover).
VART::Action::Action | ( | ) |
Creates an unitialized action.
Definition at line 19 of file action.cpp.
VART::Action::~Action | ( | ) |
Definition at line 37 of file action.cpp.
void VART::Action::Activate | ( | ) |
Activate action.
Definition at line 127 of file action.cpp.
VART::JointMover * VART::Action::AddJointMover | ( | VART::Joint * | jointPtr, |
float | newDuration, | ||
const Interpolator & | interpolator | ||
) |
Adds a joint mover to the action.
[in] | jointPtr | A pointer to the joint that will be controlled by the new joint mover. |
[in] | newDuration | Duration (in seconds) of the joint movement. |
[in] | interpolator | An interpolator instance that will control motion. |
Creates a new joint mover which is assigned to the action. The memory allocated by the joint mover will be deallocated by the action's destructor.
Definition at line 52 of file action.cpp.
Referenced by Copy().
VART::JointMover * VART::Action::AddJointMover | ( | Joint * | jointPtr, |
JointMover * | jointMover | ||
) |
Used to add a copy of jointMover, aplied to jointPtr.
Definition at line 62 of file action.cpp.
References VART::JointMover::CopyFrom(), VART::JointMover::GetDuration(), and VART::JointMover::GetInterpolator().
VART::Action * VART::Action::Copy | ( | VART::SceneNode & | targetNode | ) |
Returns a copy of an action, aplied to an targetNode sceneNode.
Use it when copy actions and aply it to a copy of sceneNodes (using SceneNode::RecursiveCopy() method).
Definition at line 224 of file action.cpp.
References AddJointMover(), VART::SceneNode::FindChildByName(), and jointMoverList.
void VART::Action::Deactivate | ( | ) |
Deactivate action.
Definition at line 156 of file action.cpp.
void VART::Action::Deactivate | ( | float | seconds | ) |
Deactivate action after some time.
Definition at line 183 of file action.cpp.
|
protected |
Deactivates DOF movers in every joint mover.
Deactivation of a DOF mover means it will have to recompute its motion at next move. See DofMover::Move().
Definition at line 188 of file action.cpp.
void VART::Action::GetFinalTimes | ( | std::list< float > * | resultPtr | ) |
Returns a ordered list with all different final times for every dof mover.
Definition at line 215 of file action.cpp.
|
inline |
|
inline |
void VART::Action::ModifyDofMovers | ( | DMModifier & | mod | ) |
Modifies dof movers.
Definition at line 246 of file action.cpp.
|
protected |
Animate joints.
Definition at line 70 of file action.cpp.
References VART::DofMover::cycle, VART::JointMover::goalTime, VART::DofMover::priority, and VART::Time::Set().
|
static |
Moves all active actions.
Definition at line 195 of file action.cpp.
References VART::Dof::ClearPriorities().
VART::Action & VART::Action::operator= | ( | const VART::Action & | action | ) |
Copy action data, except the active atribute (that remains unmodified). Used in Action::Copy() method.
Definition at line 24 of file action.cpp.
References cycle, description, duration, initialTime, priority, speed, and timeToLive.
void VART::Action::Set | ( | float | newSpeed, |
unsigned int | newPriority, | ||
bool | cyclic | ||
) |
Sets speed, priority and cycle attibutes.
Definition at line 45 of file action.cpp.
|
inline |
|
inline |
|
inline |
|
friend |
|
protected |
Definition at line 125 of file action.h.
Referenced by IsActive().
|
staticprotected |
CallBack* VART::Action::callbackPtr |
|
protected |
Definition at line 124 of file action.h.
Referenced by IsCyclic(), operator=(), and SetCyclic().
std::string VART::Action::description |
|
protected |
Definition at line 129 of file action.h.
Referenced by operator=().
|
static |
|
protected |
Definition at line 133 of file action.h.
Referenced by operator=().
|
protected |
|
protected |
seconds to auto deactivation
Definition at line 131 of file action.h.
Referenced by operator=(), and SetPriority().
|
protected |
Definition at line 128 of file action.h.
Referenced by operator=(), and SetSpeed().
|
protected |
Definition at line 130 of file action.h.
Referenced by operator=().