HBhvInterpolator

class HBhvInterpolator

The HBhvInterpolator class is the abstract base class for all interpolator types.

HBhvInterpolator keeps an array of keyframes as well as methods to access members of that array. The various interpolator types then implement the required functions that actually perform the interpolation.

Methods

HBhvInterpolator::HBhvInterpolator(HBhvAnimation *animation = 0, char const *name = 0)

Constructs an HBhvInterpolator object.

Parameters

animation: The animation that this interpolator belongs to.

name: The name of this interpolator.

virtual HBhvInterpolator::~HBhvInterpolator()

virtual

virtual char const *HBhvInterpolator::GetType() = 0

virtual

Returns

Type of this interpolator.
void HBhvInterpolator::SetInstancedInterpolator(HBhvInterpolator *interpolator)

In special cases, if you want to reference another interpolator without changing it, use this method to indicate the interpolator that you want this interpolator to refer to.

Parameters

interpolator: Interpolator to reference.
virtual HBhvInterpolator *HBhvInterpolator::CreateInstance(HBhvAnimation *animationinst) = 0

virtual

In special cases, you may want an interpolator that references this interpolator without changing it. Use this method to create the new interpolator passing a pointer to the animation that you want it to be associated with.

Parameters

animationinst: The animation instance that this interpolator is associated with.

Returns

The newly created interpolator that references this interpolator.
void HBhvInterpolator::Replace(HKeyframe *c, int pos)

This method replaces an array item at a given position.

Parameters

c: The replacement keyframe.

pos: The array position for the replacement keyframe.

void HBhvInterpolator::Insert(HKeyframe *piece, int pos = 0)

Inserts a keyframe at the given position.

Parameters

piece: The keyframe to insert

pos: The array position to insert item after.

void HBhvInterpolator::Append(HKeyframe *piece)

This method appends the given keyframe to the end of array.

Parameters

piece: The keyframe you want to append.
void HBhvInterpolator::Remove(int pos)

This method removes a keyframe at the given position.

Parameters

pos: The array position indicating where to remove the keyframe.
char const *HBhvInterpolator::GetName()

Returns

The name of the interpolator.
virtual HKeyframe *HBhvInterpolator::GetAt(int pos)

virtual

Returns the keyframe that exists at the given position.

Parameters

pos: The array position to retrieve.

Returns

The keyframe at the given position.
HKeyframe **HBhvInterpolator::GetArray()

Returns

The keyframe array. Note this is for read-only purposes. If you want to modify the keyframe array, use the methods provided in this class to do so.
virtual int HBhvInterpolator::GetArrayLength()

virtual

Returns

The number of entries in the keyframe array.
void HBhvInterpolator::Duplicate(int pos, bool replace, bool next)

Duplicates a keyframe and inserts it at the position indicated the replace and next parameters.

Parameters

pos: The position of the keyframe to duplicate.

replace: Pass true if you want to replace the item at pos with the duplicate and false to insert the duplicate item after the pos item.

next: Pass true duplicate the item at given pos and false to duplicate the item before the given pos.

void HBhvInterpolator::Copy(int pos, int adpos, bool replace)

This method copies a given keyframe and inserts the copy at a new location.

Parameters

pos: The position of the item to copy.

adpos: The target position.

replace: Pass true to replace item at the target position and false to insert after the target position.

virtual void HBhvInterpolator::Serialize(HUtilityXMLGenerator *xmlgen)

virtual

Writes XML data to a buffer.

virtual void HBhvInterpolator::Interpolate(int keyframe, float fraction)

virtual

Performs interpolation on the animation target given a keyframe and a fraction.

Parameters

keyframe: Reference keyframe for this interpolation.

fraction: Fraction value from the specified keyframe to the next keyframe. This value is from 0 to 1.

virtual void HBhvInterpolator::Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale)

virtual

HBhvAnimation *HBhvInterpolator::GetAnimation()

Returns

A pointer to the animation associated with this interpolator.
void HBhvInterpolator::SetAnimation(HBhvAnimation *animation)

Associates an animation with this interpolater.

void HBhvInterpolator::GetTranslationFromMatrix(HPoint &translation)

Calculates the translation components from modelling matrix of the target segment.

Parameters

translation: Returns the x/y/z translation.
void HBhvInterpolator::GetRotationFromMatrix(HQuat &rotation)

Calculates the rotation components from modelling matrix of the target segment.

Parameters

rotation: Returns the x/y/z rotation.
virtual void HBhvInterpolator::Reset()

virtual

Resets the interpolator instance.

void HBhvInterpolator::SetTarget()

protected

Sets the target as the one associated with this interpolator’s animation instance.

void HBhvInterpolator::AddPositionToMatrix(HPoint &trans)

protected

Adds a translational component to the modelling matrix.

Parameters

trans: The translational component.
void HBhvInterpolator::AddRotationToMatrix(float rot[16])

protected

Adds a rotational component to the modelling matrix.

Parameters

rot: The rotation matrix.
void HBhvInterpolator::AddScaleToMatrix(HPoint &scale)

protected

Adds a scaling component to modelling matrix.

Parameters

scale: The scale component.

Variables

char HBhvInterpolator::m_Name[BHV_MAX_NAME_LENGTH]

protected

char

The name of the interpolator object.

VArray<HKeyframe*> HBhvInterpolator::m_pArray

protected

VArray<*

The keyframe array.

HBhvAnimation *HBhvInterpolator::m_pAnimation

protected

A pointer to the animation that this interpolator belongs to.

HBhvInterpolator *HBhvInterpolator::m_pInterpolatorInstance

protected

A pointer to instanced interpolator.

HC_KEY HBhvInterpolator::m_pTarget

protected

HC_KEY

The key of interpolator target.