Atoms Crowd  7.0.0
Atoms::AnimationClip Class Reference

Animation clip. More...

#include <AnimationClip.h>

Public Types

enum  DirectionType {
  kPelvis = 0 , kStatic , kJoints , kClip ,
  kLocal
}
 
enum  AdditiveMode { kDisabled = 0 , kBindPose , kReferenceClip }
 
enum  MirrorPlane { kX = 0 , kY , kZ }
 
enum  MirrorSideJointsSearch { kAuto = 0 , kByName }
 
enum  MirrorStringReplacementType { kAny = 0 , kPrefix , kPostfix }
 

Public Member Functions

 AnimationClip ()
 Constructor.
 
 AnimationClip (const unsigned int numberOfJoints, const unsigned int numberOfFrames, const double fps)
 
 ~AnimationClip ()
 Destructor.
 
int numJoints () const
 Gets the number of joints.
 
int numFrames () const
 Gets the number of frames.
 
void setNumFrames (const unsigned int numberOfFrames)
 Sets the number of frames.
 
void setNumJoints (const unsigned int numberOfJoints)
 Sets the number of frames.
 
double fps () const
 Gets the frame per second.
 
void setFps (double value)
 Sets the frame per second.
 
unsigned int mapTimeToFrame (const double time, double &reminder) const
 Maps time to frame.
 
void setJointName (const unsigned int index, const std::string &jointName)
 Sets the joint name.
 
int jointId (const std::string &jointName) const
 Get joint index from joint name.
 
JointClipDataoperator[] (unsigned short index)
 Gets joint clip data.
 
const JointClipDataoperator[] (unsigned short index) const
 Gets joint clip data.
 
JointClipDataat (unsigned short index)
 Gets joint clip data.
 
const JointClipDataat (unsigned short index) const
 Gets joint clip data.
 
AtomsCore::MapMetadatametadata ()
 Gets metadata map.
 
const AtomsCore::MapMetadatametadata () const
 Gets metadata map.
 
void setDirection (const AtomsCore::Vector3 &direction)
 Sets the clip direction.
 
AtomsCore::Vector3 direction () const
 Gets the clip direction.
 
void setDirectionType (unsigned int directionType)
 Sets the clip direction type.
 
unsigned int directionType () const
 Gets the clip direction type.
 
void setDirectionFromJoints (unsigned int fromJoint, unsigned int toJoint)
 Sets the two joint ids used for evaluating the direction when the direction type is set to kJoints.
 
const std::pair< unsigned int, unsigned int > & directionFromJoints () const
 Gets the two joint ids used for evaluating the direction when the direction type is set to kJoints.
 
void disableFootLock (bool value)
 Sets the clip foot lock state.
 
bool isFootLockDisabled () const
 Returns false if the the foot lock is disabled.
 
const std::vector< int > & transitionFrames () const
 Gets the transition frames.
 
void setTransitionFrames (const std::vector< int > &frames)
 Get the transition frames.
 
void setCompatibleAgentType (const std::string &agentType)
 Set compatible agent type name.
 
const std::string & getCompatibleAgentType () const
 Get compatible agent type name.
 
void setGlobalIKData (const std::string &jointName, const AtomsCore::Vector2ArrayMetadata &data)
 Set global ik data for a specific joint.
 
void setPerchingData (const AtomsCore::Vector2ArrayMetadata &data)
 Set perching data on the joint root.
 
void setSittingData (const AtomsCore::Vector2ArrayMetadata &data)
 Set sitting data.
 
void refreshSittingData ()
 refresh the sitting data
 
void setFootDownData (const std::string &jointName, const AtomsCore::Vector2ArrayMetadata &data)
 Set foot data for a specific joint.
 
void addJointMetadata (const std::string &metadataName, const std::string &jointName, const int metadataType, const AtomsCore::Vector2ArrayMetadata &data)
 Add a joint metadata.
 
void setAdditiveMode (const unsigned int additiveMode)
 Set the additive mode.
 
void setAdditiveReferenceClip (const std::string &clipName)
 Set additive reference clip.
 
unsigned int additiveMode () const
 Gets the clip additive mode.
 
const std::string & additiveReferenceClip () const
 Gets the clip additive mode.
 
void cacheFrameRootRotation (const std::string &agentType)
 Cache frame root rotation.
 
void computeClipDirections (const std::string &agentType, std::vector< AtomsCore::Vector3 > &directions) const
 Compute and returns the clip directions.
 
AtomsCore::Vector3 computeClipDirection (Atoms::AgentTypeCPtr atPtr, const int frame) const
 Compute and returns the clip direction for a frame.
 
void computePelvisAndFeetHeight (double height)
 Compute the the pelvis and feet height.
 
void reverse ()
 Reverse clip.
 
void computeMirror (const unsigned int animMirrorPlane, const unsigned int bindMirrorPlane, const unsigned int searchMode, const std::string &left, const std::string &right, const bool rawMirror=false, const unsigned int stringReplacementType=0, const std::vector< std::string > skipJoints={}, const bool affectSkipJointsHierarchy=false)
 Compute the mirror of the clip in the given mirror plane.
 
void computeAnimatedJoints ()
 Compute the animated joints.
 
void sanitizeJointNames ()
 Sanitize joint names.
 
void sanitizeJointScales ()
 Sanitize joint scales.
 
double computeAverageVelocity () const
 Get the mean velocity of this clip.
 
double computeAverageAngularVelocity () const
 Get the mean angular velocity of this clip.
 
AtomsCore::Matrix clipJointWorldMatrix (const AtomsCore::Skeleton &skeleton, int clampedFrame, double weight, AtomsCore::JointCPtr pelvisJoint) const
 Get a world matrix form the clip.
 
void conformFootDownDataForLocomotion ()
 Conforms the foot down data for locomotion.
 
void transferMotionToVirtualRoot ()
 Transfers the motion from the skeleton root to the virtual root.
 
void setTransferMotionToVirtualRoot (const bool x, const bool y, const bool z, const bool overrideVirtualRootPos, const AtomsCore::Vector3 &virtualRootPos)
 
bool transferMotionToVirtualRootX () const
 Get transfer X motion from root to virtual root flag.
 
bool transferMotionToVirtualRootY () const
 Get transfer Y motion from root to virtual root flag.
 
bool transferMotionToVirtualRootZ () const
 Get transfer Z motion from root to virtual root flag.
 
bool overrideVirtualRootPosition () const
 Get override virtual root position flag.
 
AtomsCore::Vector3 virtualRootPositionOverride () const
 Get override virtual root position flag.
 
void refreshVirtualRoot ()
 marks the this clip so that the virtual roo data is rebuilt
 

Detailed Description

Animation clip.

Member Function Documentation

◆ setTransferMotionToVirtualRoot()

void Atoms::AnimationClip::setTransferMotionToVirtualRoot ( const bool  x,
const bool  y,
const bool  z,
const bool  overrideVirtualRootPos,
const AtomsCore::Vector3 virtualRootPos 
)

Set the axis for transfering motion from root to virtual root flag

Parameters
xtranfers the X motion to the virtual root
ytranfers the Y motion to the virtual root
ztranfers the Z motion to the virtual root
overrideVirtualRootPosif true, the virtualPos vector is going to be used as a position for the virtual root instead of the the one stored in the agent type
virtualRootPosvirtual root position override

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