HBhvInterpolator

Functions

HBhvInterpolator

~HBhvInterpolator

char const *

GetType

void

SetInstancedInterpolator

HBhvInterpolator *

CreateInstance

void

Replace

void

Insert

void

Append

void

Remove

char const *

GetName

HKeyframe *

GetAt

HKeyframe **

GetArray

int

GetArrayLength

void

Duplicate

void

Copy

void

Serialize

void

Interpolate

void

Evaluate

HBhvAnimation *

GetAnimation

void

SetAnimation

void

GetTranslationFromMatrix

void

GetRotationFromMatrix

void

Reset

Detailed Description

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.

Subclassed by HBhvInterpolatorAttSwitch, HBhvInterpolatorAxisRotate, HBhvInterpolatorColor, HBhvInterpolatorColorMorph, HBhvInterpolatorInstanceCreate, HBhvInterpolatorMatrix, HBhvInterpolatorPosition, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorSegMove, HBhvInterpolatorSegSwitch, HBhvInterpolatorVertexMorph

Public Functions

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()
virtual char const *GetType() = 0
Returns

Type of this interpolator.

void 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 *CreateInstance(HBhvAnimation *animationinst) = 0

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.

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

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

inline void Append(HKeyframe *piece)

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

Parameters

piece – The keyframe you want to append.

inline void Remove(int pos)

This method removes a keyframe at the given position.

Parameters

pos – The array position indicating where to remove the keyframe.

inline char const *GetName()
Returns

The name of the interpolator.

inline virtual HKeyframe *GetAt(int pos)

Returns the keyframe that exists at the given position.

Parameters

pos – The array position to retrieve.

Returns

The keyframe at the given position.

inline HKeyframe **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.

inline virtual int GetArrayLength()
Returns

The number of entries in the keyframe array.

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

inline virtual void Serialize(HUtilityXMLGenerator *xmlgen)

Writes XML data to a buffer.

inline virtual void Interpolate(int keyframe, float fraction)

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.

inline virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale)
inline HBhvAnimation *GetAnimation()
Returns

A pointer to the animation associated with this interpolator.

inline void SetAnimation(HBhvAnimation *animation)

Associates an animation with this interpolater.

void GetTranslationFromMatrix(HPoint &translation)

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

Parameters

translation – Returns the x/y/z translation.

void GetRotationFromMatrix(HQuat &rotation)

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

Parameters

rotation – Returns the x/y/z rotation.

inline virtual void Reset()

Resets the interpolator instance.