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 HBhvInterpolator * | CreateInstance (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) |
HBhvAnimation * | GetAnimation () |
HKeyframe ** | GetArray () |
virtual int | GetArrayLength () |
virtual HKeyframe * | GetAt (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] |
HBhvAnimation * | m_pAnimation |
VArray< HKeyframe * > | m_pArray |
HBhvInterpolator * | m_pInterpolatorInstance |
HC_KEY | m_pTarget |
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.
HBhvInterpolator::HBhvInterpolator | ( | HBhvAnimation * | animation = 0 , |
const char * | name = 0 |
||
) |
Constructs an HBhvInterpolator object.
animation | The animation that this interpolator belongs to. |
name | The name of this interpolator. |
|
protected |
Adds a translational component to the modelling matrix.
trans | The translational component. |
|
protected |
Adds a rotational component to the modelling matrix.
rot | The rotation matrix. |
|
protected |
Adds a scaling component to modelling matrix.
scale | The scale component. |
|
inline |
This method appends the given keyframe to the end of array.
piece | The keyframe you want to append. |
void HBhvInterpolator::Copy | ( | int | pos, |
int | adpos, | ||
bool | replace | ||
) |
This method copies a given keyframe and inserts the copy at a new location.
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. |
|
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.
animationinst | The animation instance that this interpolator is associated with. |
Implemented in HBhvInterpolatorMatrix, HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorColorMorph, HBhvInterpolatorVertexMorph, HBhvInterpolatorAttSwitch, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorColor, HBhvInterpolatorAxisRotate, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.
void HBhvInterpolator::Duplicate | ( | int | pos, |
bool | replace, | ||
bool | next | ||
) |
Duplicates a keyframe and inserts it at the position indicated the replace and next 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. |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Returns the keyframe that exists at the given position.
pos | The array position to retrieve. |
|
inline |
References HBhvAnimation::m_Name.
void HBhvInterpolator::GetRotationFromMatrix | ( | HQuat & | rotation | ) |
Calculates the rotation components from modelling matrix of the target segment.
rotation | Returns the x/y/z rotation. |
void HBhvInterpolator::GetTranslationFromMatrix | ( | HPoint & | translation | ) |
Calculates the translation components from modelling matrix of the target segment.
translation | Returns the x/y/z translation. |
|
pure virtual |
Implemented in HBhvInterpolatorMatrix, HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorColorMorph, HBhvInterpolatorVertexMorph, HBhvInterpolatorAttSwitch, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorColor, HBhvInterpolatorAxisRotate, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.
|
inline |
Inserts a keyframe at the given position.
piece | The keyframe to insert |
pos | The array position to insert item after. |
|
inlinevirtual |
Performs interpolation on the animation target given a keyframe and a fraction.
keyframe | Reference keyframe for this interpolation. |
fraction | Fraction 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.
|
inline |
This method removes a keyframe at the given position.
pos | The array position indicating where to remove the keyframe. |
|
inline |
This method replaces an array item at a given position.
c | The replacement keyframe. |
pos | The array position for the replacement keyframe. |
|
inlinevirtual |
Resets the interpolator instance.
Reimplemented in HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorScale, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.
|
inlinevirtual |
Writes XML data to a buffer.
Reimplemented in HBhvInterpolatorMatrix, HBhvInterpolatorSegMove, HBhvInterpolatorInstanceCreate, HBhvInterpolatorSegSwitch, HBhvInterpolatorColorMorph, HBhvInterpolatorVertexMorph, HBhvInterpolatorAttSwitch, HBhvInterpolatorQuatSquad, HBhvInterpolatorScale, HBhvInterpolatorColor, HBhvInterpolatorAxisRotate, HBhvInterpolatorTrail, and HBhvInterpolatorPosition.
|
inline |
Associates an animation with this interpolater.
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.
interpolator | Interpolator to reference. |
|
protected |
Sets the target as the one associated with this interpolator's animation instance.
|
protected |
The name of the interpolator object.
|
protected |
A pointer to the animation that this interpolator belongs to.
|
protected |
The keyframe array.
|
protected |
A pointer to instanced interpolator.
|
protected |
The key of interpolator target.