V-ART
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
VART::JointMover Class Reference

Controllers for joint movement. More...

#include <jointmover.h>

Public Member Functions

 JointMover ()
 
 JointMover (Joint *newJointPtr, float newDuration, const Interpolator &interpolator)
 
 ~JointMover ()
 
void Move ()
 Moves the associated joint. More...
 
void AttachToJoint (Joint *newJointPtr)
 Sets the associated joint. More...
 
const VART::JointGetAttachedJoint () const
 Returns the associated joint. More...
 
void AddDofMover (Joint::DofID dof, float iniTime, float finTime, float finPos)
 Creates a DofMover. More...
 
NoisyDofMoverAddNoisyDofMover (Joint::DofID dof, float iniTime, float finTime, float finPos)
 Creates a noisy DofMover. More...
 
DofMoverGetDofMover (Joint::DofID dof)
 Return the DofMover working on given Dof. More...
 
void SetDuration (float newDuration)
 Sets the total movement duration (in seconds). More...
 
float GetDuration ()
 Return the total movement duration (in seconds). More...
 
void SetInterpolator (const Interpolator &interp)
 Changes the associated interpolator. More...
 
const InterpolatorGetInterpolator ()
 Returns a pointer to the associated interpolator. NULL is returned if there are no interpolator associated. More...
 
void DeactivateDofMovers ()
 Deactivates all DOF movers. More...
 
void MultiplyTimes (float value)
 Changes starting/ending times of all dof movers. More...
 
void GetFinalTimes (std::list< float > *resultPtr)
 Returns a list with all different final times for every dof mover. More...
 
void CopyFrom (VART::JointMover &jointMover, VART::Joint *targetJoint)
 Copy jointMover data to this jointMover, setting its jointPtr atribute to the targetJoint. More...
 
void ModifyDofMovers (DMModifier &modifier)
 Modifies noisy dof movers. More...
 

Static Public Attributes

static float goalTime
 

Protected Attributes

JointjointPtr
 Associated joint. More...
 
float duration
 
float minimumDuration
 
const InterpolatorinterpolatorPtr
 
std::list< DofMover * > dofMoverList
 

Friends

std::ostream & operator<< (std::ostream &output, const JointMover &mover)
 

Detailed Description

Controllers for joint movement.

Joint movers contain a set of DOF movers (see DofMover). They control how a joint moves in a particular action (see Action).

Definition at line 22 of file jointmover.h.

Constructor & Destructor Documentation

VART::JointMover::JointMover ( )

Definition at line 20 of file jointmover.cpp.

VART::JointMover::JointMover ( VART::Joint newJointPtr,
float  newDuration,
const Interpolator interpolator 
)

Definition at line 26 of file jointmover.cpp.

VART::JointMover::~JointMover ( )

Definition at line 35 of file jointmover.cpp.

Member Function Documentation

void VART::JointMover::AddDofMover ( Joint::DofID  dof,
float  iniTime,
float  finTime,
float  finPos 
)

Creates a DofMover.

Parameters
dof[in] DOF ID on which the new DOF mover will act
iniTime[in] Initial movement time (in range [0..1])
finTime[in] Final movement time (in range [0..1])
finPos[in] Final movement position (in range [0..1])

Definition at line 59 of file jointmover.cpp.

References VART::DofMover::Initialize(), VART::DofMover::SetDof(), and VART::DofMover::targetDofPtr.

Referenced by VART::XmlJointAction::ParseDofMovement(), and VART::XmlAction::ParseDofMovement().

VART::NoisyDofMover * VART::JointMover::AddNoisyDofMover ( Joint::DofID  dof,
float  iniTime,
float  finTime,
float  finPos 
)

Creates a noisy DofMover.

Parameters
dof[in] DOF ID on which the new DOF mover will act
iniTime[in] Initial movement time (in range [0..1])
finTime[in] Final movement time (in range [0..1])
finPos[in] Final movement position (in range [0..1])

Definition at line 72 of file jointmover.cpp.

References VART::NoisyDofMover::Initialize(), VART::DofMover::SetDof(), and VART::DofMover::targetDofPtr.

Referenced by VART::XmlJointAction::ParseDofMovement(), and VART::XmlAction::ParseDofMovement().

void VART::JointMover::AttachToJoint ( Joint newJointPtr)
inline

Sets the associated joint.

Definition at line 34 of file jointmover.h.

References jointPtr.

void VART::JointMover::CopyFrom ( VART::JointMover jointMover,
VART::Joint targetJoint 
)

Copy jointMover data to this jointMover, setting its jointPtr atribute to the targetJoint.

Definition at line 130 of file jointmover.cpp.

References dofMoverList, duration, VART::DofMover::finalTime, VART::Joint::GetDofID(), VART::DofMover::initialTime, interpolatorPtr, jointPtr, minimumDuration, and VART::DofMover::targetPosition.

Referenced by VART::Action::AddJointMover().

void VART::JointMover::DeactivateDofMovers ( )

Deactivates all DOF movers.

Definition at line 87 of file jointmover.cpp.

const VART::Joint* VART::JointMover::GetAttachedJoint ( ) const
inline

Returns the associated joint.

Definition at line 37 of file jointmover.h.

References jointPtr.

VART::DofMover * VART::JointMover::GetDofMover ( Joint::DofID  dof)

Return the DofMover working on given Dof.

Returns
NULL if no such DofMover.

Definition at line 107 of file jointmover.cpp.

float VART::JointMover::GetDuration ( )
inline

Return the total movement duration (in seconds).

Definition at line 61 of file jointmover.h.

References duration.

Referenced by VART::Action::AddJointMover().

void VART::JointMover::GetFinalTimes ( std::list< float > *  resultPtr)

Returns a list with all different final times for every dof mover.

Definition at line 122 of file jointmover.cpp.

const Interpolator* VART::JointMover::GetInterpolator ( )
inline

Returns a pointer to the associated interpolator. NULL is returned if there are no interpolator associated.

Definition at line 68 of file jointmover.h.

References interpolatorPtr.

Referenced by VART::Action::AddJointMover().

void VART::JointMover::ModifyDofMovers ( DMModifier modifier)

Modifies noisy dof movers.

Definition at line 155 of file jointmover.cpp.

References VART::DMModifier::Modify().

void VART::JointMover::Move ( )

Moves the associated joint.

Definition at line 43 of file jointmover.cpp.

References VART::DofMover::goalTime, VART::DofMover::interpolatorPtr, and VART::DofMover::minimumDuration.

void VART::JointMover::MultiplyTimes ( float  value)

Changes starting/ending times of all dof movers.

Parameters
value[in] multiplying factor.

Multiplies "value" for starting and ending time, of every dof mover. This could be usefull for sequencing dof movers inside an action.

Definition at line 94 of file jointmover.cpp.

void VART::JointMover::SetDuration ( float  newDuration)
inline

Sets the total movement duration (in seconds).

Definition at line 58 of file jointmover.h.

References duration.

void VART::JointMover::SetInterpolator ( const Interpolator interp)
inline

Changes the associated interpolator.

Definition at line 64 of file jointmover.h.

References interpolatorPtr.

Referenced by VART::XmlJointAction::CreateJointMover(), and VART::XmlAction::LoadAnimation().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const JointMover mover 
)
friend

Member Data Documentation

std::list<DofMover*> VART::JointMover::dofMoverList
protected

Definition at line 101 of file jointmover.h.

Referenced by CopyFrom().

float VART::JointMover::duration
protected

Definition at line 98 of file jointmover.h.

Referenced by CopyFrom(), GetDuration(), and SetDuration().

float VART::JointMover::goalTime
static

Definition at line 92 of file jointmover.h.

Referenced by VART::JointAction::Move(), and VART::Action::Move().

const Interpolator* VART::JointMover::interpolatorPtr
protected

Definition at line 100 of file jointmover.h.

Referenced by CopyFrom(), GetInterpolator(), and SetInterpolator().

Joint* VART::JointMover::jointPtr
protected

Associated joint.

Definition at line 97 of file jointmover.h.

Referenced by AttachToJoint(), CopyFrom(), and GetAttachedJoint().

float VART::JointMover::minimumDuration
protected

Definition at line 99 of file jointmover.h.

Referenced by CopyFrom().


The documentation for this class was generated from the following files: