class RED::AnimationData
Base data for animation. More...
#include <REDAnimationData.h>
Inherits: Object.
Public functions:
AnimationData ( ) | |
void | Add ( const AnimationData & iData1, const AnimationData & iData2, double iWeight ) |
virtual void * | As ( const RED::CID & iCID ) |
template< class T_As > const T_As * | As ( ) const |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > T_As * | As ( ) |
void | Blend ( const AnimationData & iData1, const AnimationData & iData2, double iWeight ) |
void | GetMatrix ( RED::Matrix & oMatrix ) const |
void | SetNeutral ( ) |
void | SetPosition ( const RED::Vector3 & iPosition ) |
void | SetPosition ( double iX, double iY, double iZ ) |
void | SetRotation ( double iX, double iY, double iZ, double iW ) |
void | SetRotation ( const RED::Quaternion & iRotation ) |
void | SetScale ( const RED::Vector3 & iScale ) |
void | SetScale ( double iX, double iY, double iZ ) |
void | Sub ( const AnimationData & iData1, const AnimationData & iData2, double iWeight ) |
Public static functions:
static RED::CID | GetClassID ( ) |
Public variables:
double | _position [3] |
double | _rotation [4] |
double | _scale [3] |
Detailed description:
Base data for animation.
Animation data is composed of:
- Position as a 3 components vector;
- Rotation as a 4 components quaternion;
- Scale as a 3 components vector.
This class provides functions for blending used in the RED animation system:
An animation data can be converted to a RED::Matrix using the RED::AnimationData::GetMatrix function.
Functions documentation
public RED::AnimationData::AnimationData | ( | ) |
Default constructor.
public static RED::CID RED::AnimationData::GetClassID | ( | ) |
Reimplements: RED::Object::GetClassID.
public void RED::AnimationData::Add | ( | const AnimationData & | iData1, |
const AnimationData & | iData2, | ||
double | iWeight | ||
) |
Sets the animation data as an addition of two other data.
The Addition operation performs interpolations between iData1 and iData1 + iData2.
Parameters:
iData1: | the first data. |
iData2: | the second data. |
iWeight: | the blending weight between 0 and 1 (0 = iData1, 1 = iData1 + iData2) |
public virtual void * RED::AnimationData::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
template< class T_As > public const T_As * RED::AnimationData::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
public virtual const void * RED::AnimationData::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
template< class T_As > public T_As * RED::AnimationData::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
public void RED::AnimationData::Blend | ( | const AnimationData & | iData1, |
const AnimationData & | iData2, | ||
double | iWeight | ||
) |
Sets the animation data as a blend between two other data.
The blending operation performs interpolations between iData1 and iData2.
Parameters:
iData1: | the first data. |
iData2: | the second data. |
iWeight: | the blending weight between 0 and 1 (0 = iData1, 1 = iData2) |
public void RED::AnimationData::GetMatrix | ( | RED::Matrix & | oMatrix | ) const |
Gets the transform matrix corresponding to the animation data.
Parameters:
oMatrix: | returned transform matrix. |
public void RED::AnimationData::SetNeutral | ( | ) |
Sets the neutral transform (no position, rotation or scale).
public void RED::AnimationData::SetPosition | ( | const RED::Vector3 & | iPosition | ) |
Sets the position.
Parameters:
iPosition: | Position. |
public void RED::AnimationData::SetPosition | ( | double | iX, |
double | iY, | ||
double | iZ | ||
) |
Sets the position from coordinates.
Parameters:
iX: | Position x coordinate. |
iY: | Position y coordinate. |
iZ: | Position z coordinate. |
public void RED::AnimationData::SetRotation | ( | double | iX, |
double | iY, | ||
double | iZ, | ||
double | iW | ||
) |
Sets the rotation from quaternion values.
Parameters:
iX: | Quaternion x coordinate. |
iY: | Quaternion y coordinate. |
iZ: | Quaternion z coordinate. |
iW: | Quaternion w coordinate. |
public void RED::AnimationData::SetRotation | ( | const RED::Quaternion & | iRotation | ) |
Sets the rotation.
Parameters:
iRotation: | Rotation as a quaternion. |
public void RED::AnimationData::SetScale | ( | const RED::Vector3 & | iScale | ) |
Sets the scale.
Parameters:
iScale: | Scale. |
public void RED::AnimationData::SetScale | ( | double | iX, |
double | iY, | ||
double | iZ | ||
) |
Sets the scale from coordinates.
Parameters:
iX: | Scale x coordinate. |
iY: | Scale y coordinate. |
iZ: | Scale z coordinate. |
public void RED::AnimationData::Sub | ( | const AnimationData & | iData1, |
const AnimationData & | iData2, | ||
double | iWeight | ||
) |
Sets the animation data as a substraction of two other data.
The Substraction operation performs interpolations between iData1 and iData1 - iData2.
Parameters:
iData1: | the first data. |
iData2: | the second data. |
iWeight: | the blending weight between 0 and 1 (0 = iData1, 1 = iData1 - iData2) |
Variables documentation
Position.
Quaternion rotation.
Scale.