AnimationData

Fields

double

_position

double

_rotation

double

_scale

Functions

SET_CID

AnimationData

void

SetPosition

void

SetPosition

void

SetRotation

void

SetRotation

void

SetScale

void

SetScale

void

SetNeutral

void

Blend

void

Add

void

Sub

void

GetMatrix

Detailed Description

class AnimationData : public RED::Object

Base data for animation.

@related class RED::AnimationClip, class RED::Quaternion

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.

Public Functions

SET_CID (CID_class_REDAnimationData) IMPLEMENT_AS()
AnimationData()

Default constructor.

void SetPosition(const RED::Vector3 &iPosition)

Sets the position.

Parameters

iPosition – Position.

void 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.

void SetRotation(const RED::Quaternion &iRotation)

Sets the rotation.

Parameters

iRotation – Rotation as a quaternion.

void SetRotation(double iX, double iY, double iZ, double iW)

Sets the rotation from quaternion values.

Parameters
void SetScale(const RED::Vector3 &iScale)

Sets the scale.

Parameters

iScale – Scale.

void 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.

void SetNeutral()

Sets the neutral transform (no position, rotation or scale).

void 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)

void 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)

void 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)

void GetMatrix(RED::Matrix &oMatrix) const

Gets the transform matrix corresponding to the animation data.

Parameters

oMatrix – returned transform matrix.

Public Members

double _position[3]

Position.

double _rotation[4]

Quaternion rotation.

double _scale[3]

Scale.