Atoms Crowd  7.0.0
Atoms::AnimationState Class Reference

Animation State. More...

#include <AnimationState.h>

Public Member Functions

 AnimationState ()
 Constructor.
 
 AnimationState (const std::string &name, int id)
 Constructor. More...
 
 AnimationState (const std::string &name, int id, const AtomsCore::Vector3 maxTurn, unsigned int blendIn, unsigned int blendOut)
 Constructor. More...
 
 AnimationState (const std::string &name, int id, const AtomsCore::Vector3 maxTurn, unsigned int blendIn, unsigned int blendOut, bool randomLoop)
 Constructor. More...
 
 AnimationState (const std::string &name, int id, const AtomsCore::Vector3 maxTurn, unsigned int blendIn, unsigned int blendOut, bool randomLoop, double velocity)
 Constructor. More...
 
 AnimationState (const AnimationState &other)
 Copy constructor.
 
AnimationStateoperator= (const AnimationState &other)
 Assign Operator.
 
 ~AnimationState ()
 Destructor.
 
void setName (const std::string &name)
 Sets the state name. More...
 
const std::string & name () const
 Gets the state name. More...
 
void addClip (const AnimationStateClip &clip)
 Adds a animation state clip. More...
 
void removeClip (unsigned int &clipId)
 Removes a clip. More...
 
const AnimationStateClipclip (unsigned int clipId) const
 Gets an animation state clip. More...
 
AnimationStateClipclip (unsigned int clipId)
 Gets an animation state clip. More...
 
unsigned int numClips () const
 Gets the number of animation state clips. More...
 
void clearClips ()
 Removes all animation state clips.
 
void setId (int id)
 Sets the state id. More...
 
int id () const
 Gets the state id. More...
 
bool isEmpty () const
 Checks if the state has no clip. More...
 
void setMaxTurnAngle (const AtomsCore::Vector3 &angle)
 Sets max turn angle. More...
 
const AtomsCore::Vector3maxTurnAngle () const
 Gets max turn angle. More...
 
void setMaxAcceleration (const AtomsCore::Vector2 &acceleration)
 Sets max linear and angular acceleration. More...
 
const AtomsCore::Vector2maxAcceleration () const
 Gets max acceleration. More...
 
void setAverageNumFrames (const AtomsCore::Vector2i &averageNumFrames)
 Sets linear and angular average num frames. More...
 
const AtomsCore::Vector2iaverageNumFrames () const
 Gets max acceleration. More...
 
void setBlendInFrames (unsigned int frames)
 Sets blend in frames. More...
 
unsigned int blendInFrames () const
 Gets blend in frames. More...
 
void setBlendOutFrames (unsigned int frames)
 Sets blend out frames. More...
 
unsigned int blendOutFrames () const
 Gets blend out frames. More...
 
void setRandomLoop (bool value)
 Set random loop flag. More...
 
bool randomLoop () const
 Gets random loop flag. More...
 
const std::vector< unsigned int > & validClips () const
 Gets valid clips. More...
 
const std::vector< unsigned int > & validMotionTypeClips (unsigned int motionType) const
 Gets valid clips of a motion type. More...
 
void updateValidClips ()
 Updated the valid clips list of this state.
 
void setVelocity (double velocity)
 Sets the state velocity. More...
 
double velocity () const
 Gets the state velocity. More...
 
void setIsLocomotion (const bool value)
 Sets the locomotion state. More...
 
bool isLocomotion () const
 Gets the locomotion state. More...
 
void setLocomotionName (const std::string &value)
 Sets the locomotion name. More...
 
const std::string & locomotionName () const
 Gets the locomotion name. More...
 

Detailed Description

Animation State.

This class defines a state used by the state machine

Constructor & Destructor Documentation

◆ AnimationState() [1/4]

Atoms::AnimationState::AnimationState ( const std::string &  name,
int  id 
)

Constructor.

Parameters
nameState name
idState id

◆ AnimationState() [2/4]

Atoms::AnimationState::AnimationState ( const std::string &  name,
int  id,
const AtomsCore::Vector3  maxTurn,
unsigned int  blendIn,
unsigned int  blendOut 
)

Constructor.

Parameters
nameState name
idState id
idState horizontal and vertical max turn angle
blendInState blend in frames
blendOutState blend out frames

◆ AnimationState() [3/4]

Atoms::AnimationState::AnimationState ( const std::string &  name,
int  id,
const AtomsCore::Vector3  maxTurn,
unsigned int  blendIn,
unsigned int  blendOut,
bool  randomLoop 
)

Constructor.

Parameters
nameState name
idState id
idState horizontal and vertical max turn angle
blendInState blend in frames
blendOutState blend out frames
randomLoopState random loop

◆ AnimationState() [4/4]

Atoms::AnimationState::AnimationState ( const std::string &  name,
int  id,
const AtomsCore::Vector3  maxTurn,
unsigned int  blendIn,
unsigned int  blendOut,
bool  randomLoop,
double  velocity 
)

Constructor.

Parameters
nameState name
idState id
idState horizontal and vertical max turn angle
blendInState blend in frames
blendOutState blend out frames
randomLoopState random loop
velocityState velocity

Member Function Documentation

◆ addClip()

void Atoms::AnimationState::addClip ( const AnimationStateClip clip)
inline

Adds a animation state clip.

Parameters
clipAnimation state clip

◆ averageNumFrames()

const AtomsCore::Vector2i & Atoms::AnimationState::averageNumFrames ( ) const
inline

Gets max acceleration.

Returns
Max acceleration in unit / second (x: linear acceleration, y: angular acceleration)

◆ blendInFrames()

unsigned int Atoms::AnimationState::blendInFrames ( ) const
inline

Gets blend in frames.

Returns
Get blend in frames

◆ blendOutFrames()

unsigned int Atoms::AnimationState::blendOutFrames ( ) const
inline

Gets blend out frames.

Returns
blend out frames

◆ clip() [1/2]

AnimationStateClip & Atoms::AnimationState::clip ( unsigned int  clipId)
inline

Gets an animation state clip.

Parameters
clipIdAnimation state clip id
Returns
Get an animation state clip

◆ clip() [2/2]

const AnimationStateClip & Atoms::AnimationState::clip ( unsigned int  clipId) const
inline

Gets an animation state clip.

Parameters
clipIdAnimation state clip id
Returns
Get an animation state clip

◆ id()

int Atoms::AnimationState::id ( ) const
inline

Gets the state id.

Returns
State id

◆ isEmpty()

bool Atoms::AnimationState::isEmpty ( ) const
inline

Checks if the state has no clip.

Returns
return true if the state has no clip

◆ isLocomotion()

bool Atoms::AnimationState::isLocomotion ( ) const
inline

Gets the locomotion state.

Returns
State Locomotion state

◆ locomotionName()

const std::string & Atoms::AnimationState::locomotionName ( ) const
inline

Gets the locomotion name.

Returns
State Locomotion name

◆ maxAcceleration()

const AtomsCore::Vector2 & Atoms::AnimationState::maxAcceleration ( ) const
inline

Gets max acceleration.

Returns
Max acceleration in unit / second (x: linear acceleration, y: angular acceleration)

◆ maxTurnAngle()

const AtomsCore::Vector3 & Atoms::AnimationState::maxTurnAngle ( ) const
inline

Gets max turn angle.

Returns
max turn angle in degrees (x: horizontal, y: vertical)

◆ name()

const std::string & Atoms::AnimationState::name ( ) const
inline

Gets the state name.

Returns
Get state name

◆ numClips()

unsigned int Atoms::AnimationState::numClips ( ) const
inline

Gets the number of animation state clips.

Returns
Get number of clips

◆ randomLoop()

bool Atoms::AnimationState::randomLoop ( ) const
inline

Gets random loop flag.

Returns
random loop flag

◆ removeClip()

void Atoms::AnimationState::removeClip ( unsigned int &  clipId)
inline

Removes a clip.

Parameters
clipIdAnimation state clip id

◆ setAverageNumFrames()

void Atoms::AnimationState::setAverageNumFrames ( const AtomsCore::Vector2i averageNumFrames)
inline

Sets linear and angular average num frames.

Parameters
averageNumFramesaverage num frames (x: linear average num frames, y: angular average num frames)

◆ setBlendInFrames()

void Atoms::AnimationState::setBlendInFrames ( unsigned int  frames)
inline

Sets blend in frames.

Parameters
framesBlend in frames

◆ setBlendOutFrames()

void Atoms::AnimationState::setBlendOutFrames ( unsigned int  frames)
inline

Sets blend out frames.

Parameters
framesBlend out frames

◆ setId()

void Atoms::AnimationState::setId ( int  id)
inline

Sets the state id.

Parameters
idState id

◆ setIsLocomotion()

void Atoms::AnimationState::setIsLocomotion ( const bool  value)
inline

Sets the locomotion state.

Parameters
valueLocomotion state

◆ setLocomotionName()

void Atoms::AnimationState::setLocomotionName ( const std::string &  value)
inline

Sets the locomotion name.

Parameters
valueLocomotion name

◆ setMaxAcceleration()

void Atoms::AnimationState::setMaxAcceleration ( const AtomsCore::Vector2 acceleration)
inline

Sets max linear and angular acceleration.

Parameters
accelerationAcceleration in unit / second (x: linear acceleration, y: angular acceleration)

◆ setMaxTurnAngle()

void Atoms::AnimationState::setMaxTurnAngle ( const AtomsCore::Vector3 angle)
inline

Sets max turn angle.

Parameters
angleAngle in degrees (x: horizontal, y: vertical)

◆ setName()

void Atoms::AnimationState::setName ( const std::string &  name)
inline

Sets the state name.

Parameters
nameState name

◆ setRandomLoop()

void Atoms::AnimationState::setRandomLoop ( bool  value)
inline

Set random loop flag.

This flag activate the random pick of a new clip when the loop of one clip is finished

◆ setVelocity()

void Atoms::AnimationState::setVelocity ( double  velocity)
inline

Sets the state velocity.

Parameters
velocityState velocity

◆ validClips()

const std::vector< unsigned int > & Atoms::AnimationState::validClips ( ) const
inline

Gets valid clips.

Gets clips that can be played

Returns
Gets clips that can be played

◆ validMotionTypeClips()

const std::vector< unsigned int > & Atoms::AnimationState::validMotionTypeClips ( unsigned int  motionType) const
inline

Gets valid clips of a motion type.

Gets clips of a specific motiontype that can be played

Returns
Gets clips that can be played

◆ velocity()

double Atoms::AnimationState::velocity ( ) const
inline

Gets the state velocity.

Returns
State velocity

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