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

#include <HBhvInterpolator.h>

Public Member Functions

void Append (HKeyframe *piece)
 
void Copy (int pos, int adpos, bool replace)
 
virtual HBhvInterpolatorCreateInstance (HBhvAnimation *animationinst)=0
 
void Duplicate (int pos, bool replace, bool next)
 
virtual void Evaluate (int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale)
 
HBhvAnimationGetAnimation ()
 
HKeyframe ** GetArray ()
 
virtual int GetArrayLength ()
 
virtual HKeyframeGetAt (int pos)
 
const char * GetName ()
 
void GetRotationFromMatrix (HQuat &rotation)
 
void GetTranslationFromMatrix (HPoint &translation)
 
virtual const char * GetType ()=0
 
 HBhvInterpolator (HBhvAnimation *animation=0, const char *name=0)
 
void Insert (HKeyframe *piece, int pos=0)
 
virtual void Interpolate (int keyframe, float fraction)
 
void Remove (int pos)
 
void Replace (HKeyframe *c, int pos)
 
virtual void Reset ()
 
virtual void Serialize (HUtilityXMLGenerator *xmlgen)
 
void SetAnimation (HBhvAnimation *animation)
 
void SetInstancedInterpolator (HBhvInterpolator *interpolator)
 

Protected Member Functions

void AddPositionToMatrix (HPoint &trans)
 
void AddRotationToMatrix (float rot[16])
 
void AddScaleToMatrix (HPoint &scale)
 
void SetTarget ()
 

Protected Attributes

char m_Name [BHV_MAX_NAME_LENGTH]
 
HBhvAnimationm_pAnimation
 
VArray< HKeyframe * > m_pArray
 
HBhvInterpolatorm_pInterpolatorInstance
 
HC_KEY m_pTarget
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ HBhvInterpolator()

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

Constructs an HBhvInterpolator object.

Parameters
animationThe animation that this interpolator belongs to.
nameThe name of this interpolator.

Member Function Documentation

◆ AddPositionToMatrix()

void HBhvInterpolator::AddPositionToMatrix ( HPoint trans)
protected

Adds a translational component to the modelling matrix.

Parameters
transThe translational component.

◆ AddRotationToMatrix()

void HBhvInterpolator::AddRotationToMatrix ( float  rot[16])
protected

Adds a rotational component to the modelling matrix.

Parameters
rotThe rotation matrix.

◆ AddScaleToMatrix()

void HBhvInterpolator::AddScaleToMatrix ( HPoint scale)
protected

Adds a scaling component to modelling matrix.

Parameters
scaleThe scale component.

◆ Append()

void HBhvInterpolator::Append ( HKeyframe piece)
inline

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

Parameters
pieceThe keyframe you want to append.

◆ Copy()

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

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

Parameters
posThe position of the item to copy.
adposThe target position.
replacePass true to replace item at the target position and false to insert after the target position.

◆ CreateInstance()

virtual HBhvInterpolator* HBhvInterpolator::CreateInstance ( HBhvAnimation animationinst)
pure 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
animationinstThe animation instance that this interpolator is associated with.
Returns
The newly created interpolator that references this interpolator.

Implemented in HBhvInterpolatorMatrix, HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorColorMorph, HBhvInterpolatorVertexMorph, HBhvInterpolatorAttSwitch, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorColor, HBhvInterpolatorAxisRotate, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.

◆ Duplicate()

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
posThe position of the keyframe to duplicate.
replacePass true if you want to replace the item at pos with the duplicate and false to insert the duplicate item after the pos item.
nextPass true duplicate the item at given pos and false to duplicate the item before the given pos.

◆ GetAnimation()

HBhvAnimation* HBhvInterpolator::GetAnimation ( )
inline
Returns
A pointer to the animation associated with this interpolator.

◆ GetArray()

HKeyframe** HBhvInterpolator::GetArray ( )
inline
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.

◆ GetArrayLength()

virtual int HBhvInterpolator::GetArrayLength ( )
inlinevirtual
Returns
The number of entries in the keyframe array.

◆ GetAt()

virtual HKeyframe* HBhvInterpolator::GetAt ( int  pos)
inlinevirtual

Returns the keyframe that exists at the given position.

Parameters
posThe array position to retrieve.
Returns
The keyframe at the given position.

◆ GetName()

const char* HBhvInterpolator::GetName ( )
inline
Returns
The name of the interpolator.

References HBhvAnimation::m_Name.

◆ GetRotationFromMatrix()

void HBhvInterpolator::GetRotationFromMatrix ( HQuat rotation)

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

Parameters
rotationReturns the x/y/z rotation.

◆ GetTranslationFromMatrix()

void HBhvInterpolator::GetTranslationFromMatrix ( HPoint translation)

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

Parameters
translationReturns the x/y/z translation.

◆ GetType()

◆ Insert()

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

Inserts a keyframe at the given position.

Parameters
pieceThe keyframe to insert
posThe array position to insert item after.

◆ Interpolate()

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

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

Parameters
keyframeReference keyframe for this interpolation.
fractionFraction value from the specified keyframe to the next keyframe. This value is from 0 to 1.

Reimplemented in HBhvInterpolatorMatrix, HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorColorMorph, HBhvInterpolatorVertexMorph, HBhvInterpolatorAttSwitch, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorColor, HBhvInterpolatorAxisRotate, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.

◆ Remove()

void HBhvInterpolator::Remove ( int  pos)
inline

This method removes a keyframe at the given position.

Parameters
posThe array position indicating where to remove the keyframe.

◆ Replace()

void HBhvInterpolator::Replace ( HKeyframe c,
int  pos 
)
inline

This method replaces an array item at a given position.

Parameters
cThe replacement keyframe.
posThe array position for the replacement keyframe.

◆ Reset()

virtual void HBhvInterpolator::Reset ( )
inlinevirtual

◆ Serialize()

◆ SetAnimation()

void HBhvInterpolator::SetAnimation ( HBhvAnimation animation)
inline

Associates an animation with this interpolater.

◆ SetInstancedInterpolator()

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
interpolatorInterpolator to reference.

◆ SetTarget()

void HBhvInterpolator::SetTarget ( )
protected

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

Member Data Documentation

◆ m_Name

char HBhvInterpolator::m_Name[BHV_MAX_NAME_LENGTH]
protected

The name of the interpolator object.

◆ m_pAnimation

HBhvAnimation* HBhvInterpolator::m_pAnimation
protected

A pointer to the animation that this interpolator belongs to.

◆ m_pArray

VArray< HKeyframe *> HBhvInterpolator::m_pArray
protected

The keyframe array.

◆ m_pInterpolatorInstance

HBhvInterpolator* HBhvInterpolator::m_pInterpolatorInstance
protected

A pointer to instanced interpolator.

◆ m_pTarget

HC_KEY HBhvInterpolator::m_pTarget
protected

The key of interpolator target.


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