13 #ifndef _H_HBhvInterpolator_H
14 #define _H_HBhvInterpolator_H
26 class HUtilityXMLGenerator;
30 template class MVO_API VArray< HKeyframe *>;
31 template class MVO_API VArray< void *>;
38 enum TrailInterpolatorType
46 #define REPLACE_VARRAY(c, pos) { if (m_pArray.Count() > pos) \
48 HKeyframe *temp = m_pArray[pos];\
51 m_pArray.ReplaceAt(c, pos); }
53 #define REMOVE_VARRAY(pos) { HKeyframe *temp = m_pArray[pos];\
55 m_pArray.RemoveAt(pos); }
57 #define CURVE_ARRAY(pos) ((HKeyframeChannelCurve *)GetAt(pos))
79 virtual const char *
GetType() = 0;
120 void Remove(
int pos) { REMOVE_VARRAY(pos); }
146 void Duplicate(
int pos,
bool replace,
bool next);
154 void Copy(
int pos,
int adpos,
bool replace);
159 virtual void Serialize(HUtilityXMLGenerator *xmlgen) { }
167 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale) { };
181 void GetTranslationFromMatrix(
HPoint &translation);
186 void GetRotationFromMatrix(
HQuat &rotation);
204 void AddPositionToMatrix(
HPoint &trans);
210 void AddRotationToMatrix(
float rot[16]);
216 void AddScaleToMatrix(
HPoint &scale);
262 linear->
m_cp = pos; m_pArray.InsertAt(linear, l); }
270 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
278 linear->
m_cp = pos; m_pArray.InsertAt(linear, l); }
286 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
295 d->
m_cp = pos; m_pArray.InsertAt(d, l); }
300 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
304 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
311 virtual void Interpolate(
int keyframe,
float fraction);
313 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
318 virtual void Reset();
326 virtual void CalculatePos(
int keyframe,
float fraction,
HPoint &res);
333 virtual void InterpolateCamera(
HPoint &pos,
bool simulate =
false);
339 virtual void InterpolateCamera2(
HPoint &pos,
bool simulate =
false);
345 virtual void CalculateAllTangents();
378 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
382 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
389 virtual void Interpolate(
int keyframe,
float fraction);
393 virtual void Reset();
399 void SetTrailType(TrailInterpolatorType tt) { m_TrailType = tt; }
400 void SetTrailColor(
const char *color) { strcpy(m_Color, color); }
401 void SetTrailWeight(
int weight) { m_Weight = weight; }
402 void SetTrailStyle(
const char *style) { strcpy(m_Style, style); }
407 char m_Color[MVO_SMALL_BUFFER_SIZE];
409 char m_Style[MVO_SMALL_BUFFER_SIZE];
433 void SetAxis(
float x,
float y,
float z) {m_axis.x = x; m_axis.y = y; m_axis.z = z; }
458 linear->
m_angle = angle; m_pArray.InsertAt(linear, l); }
466 c->
m_angle = angle; REPLACE_VARRAY(c, l); }
471 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
476 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
484 virtual void Interpolate(
int keyframe,
float fraction);
485 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
524 color->
m_cp = pos; m_pArray.InsertAt(color, l); }
533 c->
m_cp = pos; REPLACE_VARRAY(c, l); }
538 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
543 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
548 void SetGeomType (
const char *geomtype);
557 void SetColorComponent (
const char *ColorComponent);
567 virtual void Interpolate(
int keyframe,
float fraction);
570 char m_ColorComponent[MVO_BUFFER_SIZE];
571 char m_GeomType[MVO_BUFFER_SIZE];
621 virtual void CalculatePos(
int keyframe,
float fraction,
HPoint &res);
628 virtual void CalculateAllTangents();
633 virtual void Reset();
660 scale->
m_cp = pos; m_pArray.InsertAt(scale, l); }
668 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
673 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
678 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
685 virtual void Interpolate(
int keyframe,
float fraction);
686 void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
694 virtual void InterpolateCamera(
HPoint &Scale,
bool simulate =
false);
699 virtual void InterpolateCamera2(
HPoint &Scale,
bool simulate =
false);
735 rot->
m_quat = q; m_pArray.InsertAt(rot, l); }
753 c->
m_quat = q; REPLACE_VARRAY(c, l); }
766 void AdjustQuaternions();
771 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
776 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
783 virtual void Interpolate(
int keyframe,
float fraction);
784 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
792 virtual void CalculateQuat(
int keyframe,
float fraction,
HQuat &res);
801 virtual void InterpolateCamera(
HQuat &quat,
bool simulate =
false);
807 virtual void InterpolateCamera2(
HQuat &quat,
bool simulate =
false);
846 AttSwitch->
SetTarget(t); m_pArray.InsertAt(AttSwitch, l); }
855 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
860 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
865 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
872 virtual void Interpolate(
int keyframe,
float fraction);
916 VertexMorph->
SetTarget(mident); m_pArray.InsertAt(VertexMorph, l); }
918 VertexMorph->
SetTarget(mident); VertexMorph->m_bDiscrete =
true; m_pArray.InsertAt(VertexMorph, l); }
935 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
940 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
947 virtual void Interpolate(
int keyframe,
float fraction);
958 virtual void AddMorphData(
HPoint *md,
int pnum,
HBaseModel *model,
int pos = -1);
967 void *GetUserInfo(
char *target);
968 void * GetMorphData(
int i);
970 VArray < void *> m_pMorphData;
972 int m_MorphDataLength;
1011 ColorMorph->
SetTarget(mident); m_pArray.InsertAt(ColorMorph, l); }
1013 ColorMorph->
SetTarget(mident); ColorMorph->m_bDiscrete =
true; m_pArray.InsertAt(ColorMorph, l); }
1029 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1034 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1041 virtual void Interpolate(
int keyframe,
float fraction);
1059 virtual void AddMorphData(
HPoint *md,
int pnum,
HBaseModel *model,
int pos = -1);
1066 virtual void SetUseFIndex(
bool tf);
1070 void *GetUserInfo(
char *target);
1071 void * GetMorphData(
int i);
1072 VArray < void *> m_pMorphData;
1074 int m_MorphDataLength;
1112 SegSwitch->
SetTarget(t); m_pArray.InsertAt(SegSwitch, l); }
1121 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
1126 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1131 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1138 virtual void Interpolate(
int keyframe,
float fraction);
1143 virtual void Reset();
1181 InstanceCreate->
SetTarget(t,t2,t3); m_pArray.InsertAt(InstanceCreate, l); }
1190 c->
SetTarget(t,t2,t3); REPLACE_VARRAY(c, l) }
1195 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1200 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1207 virtual void Interpolate(
int keyframe,
float fraction);
1212 virtual void Reset();
1252 SegMove->
SetTarget(t); m_pArray.InsertAt(SegMove, l); }
1261 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
1266 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1271 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1278 virtual void Interpolate(
int keyframe,
float fraction);
1283 virtual void Reset();
1320 for (
int i=0;i<16;i++) rot->
m_matrix[i] = mat[i]; m_pArray.InsertAt(rot, l); }
1331 for (
int i=0;i<16;i++) c->
m_matrix[i] = q[i]; REPLACE_VARRAY(c, l); }
1337 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1342 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1349 virtual void Interpolate(
int keyframe,
float fraction);
void Append(HKeyframe *piece)
Definition: HBhvInterpolator.h:114
void Replace(const char *spath, int l)
Definition: HBhvInterpolator.h:854
VArray< void * > GetMorphData()
Definition: HBhvInterpolator.h:961
void ReplaceLinear(HQuat q, int l)
Definition: HBhvInterpolator.h:760
void Insert(char *mident, int l=0)
Definition: HBhvInterpolator.h:1010
int m_Weight
Definition: HBhvInterpolator.h:408
The HKeyframe class is the base class for all keyframe types.
Definition: HBhvUtility.h:260
The HKeyframeAxisRotation class is used for rotations around an arbitrary axis.
Definition: HBhvUtility.h:642
The HKeyframeQuatSquad class is used for non-linear quaternion based rotation.
Definition: HBhvUtility.h:716
char m_Name[BHV_MAX_NAME_LENGTH]
Definition: HBhvAnimation.h:280
The HBhvInterpolatorColor class controls color attribute changes.
Definition: HBhvInterpolator.h:495
void ReplaceCurve(HPoint pos, int l)
Definition: HBhvInterpolator.h:285
virtual void Serialize(HUtilityXMLGenerator *xmlgen)
Definition: HBhvInterpolator.h:159
The HQuat class defines the data type of a Quaternion.
Definition: HBhvUtility.h:86
void Insert(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:659
virtual const char * GetType()
Definition: HBhvAnimation.h:61
void Insert(char *t, int l=0)
Definition: HBhvInterpolator.h:1251
HBhvAnimation * m_pAnimation
Definition: HBhvInterpolator.h:221
HC_KEY m_trailKey
Definition: HBhvInterpolator.h:410
HQuat m_quat
Definition: HBhvUtility.h:750
void Replace(float angle, int l)
Definition: HBhvInterpolator.h:465
void Insert(char *mident, int l=0)
Definition: HBhvInterpolator.h:915
void Duplicate(int newkeyframe, int oldkeyframe)
void Insert(char *t, int l=0)
Definition: HBhvInterpolator.h:1111
HBhvAnimation * GetAnimation()
Definition: HBhvInterpolator.h:170
void Insert(char *t, char *t2, char *t3, int l=0)
Definition: HBhvInterpolator.h:1180
void Insert(HKeyframe *piece, int pos=0)
Definition: HBhvInterpolator.h:108
void InsertLinear(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:261
void Replace(char *t, char *t2, char *t3, int l)
Definition: HBhvInterpolator.h:1189
float m_angle
Definition: HBhvUtility.h:677
void Replace(HQuat q, int l)
Definition: HBhvInterpolator.h:752
The HBhvInterpolatorVertexMorph class performs interpolation by interpolating the individual vertex p...
Definition: HBhvInterpolator.h:883
int GetMorphDataLength()
Definition: HBhvInterpolator.h:964
virtual int GetArrayLength()
Definition: HBhvInterpolator.h:137
#define BHV_MAX_NAME_LENGTH
Maximum Length of "Names" in animations.
Definition: HBhvUtility.h:44
virtual HKeyframe * GetAt(int pos)
Definition: HBhvInterpolator.h:130
void GetAxis(HPoint &axis)
Definition: HBhvInterpolator.h:438
The HBhvInterpolatorScale class controls scaling. This class can be used for camera interpolation as ...
Definition: HBhvInterpolator.h:611
void SetAnimation(HBhvAnimation *animation)
Definition: HBhvInterpolator.h:175
The HBhvInterpolatorQuatSquad class controls quaternion based rotation. This class can be used for ca...
Definition: HBhvInterpolator.h:706
HBhvInterpolator * m_pInterpolatorInstance
Definition: HBhvInterpolator.h:222
void Replace(HPoint pos, int l)
Definition: HBhvInterpolator.h:667
HPoint m_cp
Definition: HBhvUtility.h:351
The HBhvInterpolatorPosition class controls positional interpolation.
Definition: HBhvInterpolator.h:233
The HBhvInterpolatorInstanceCreate creates a new instance of the target object at the location in the...
Definition: HBhvInterpolator.h:1151
void InsertCurve(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:277
void Replace(char *t, int l)
Definition: HBhvInterpolator.h:1023
The HBhvInterpolatorSegSwitch performs animation by switching on and off the visibility of segments...
Definition: HBhvInterpolator.h:1082
The HKeyframeChannelDiscrete class is used for discrete interpolation of positional values...
Definition: HBhvUtility.h:406
The HBhvInterpolatorColorMorph class performs an interpolation on the face colors of your target obje...
Definition: HBhvInterpolator.h:978
void Insert(float angle, int l=0)
Definition: HBhvInterpolator.h:457
The HBhvInterpolatorTrail class draws a line trail from one keyframe position to the next...
Definition: HBhvInterpolator.h:352
The HBhvInterpolator class is the abstract base class for all interpolator types. ...
Definition: HBhvInterpolator.h:67
void Replace(char *spath, int l)
Definition: HBhvInterpolator.h:1260
const char * GetName()
Definition: HBhvInterpolator.h:123
The HKeyframeString class is used for any string related keyframes.
Definition: HBhvUtility.h:858
float m_matrix[16]
Definition: HBhvUtility.h:795
The HKeyframeChannelCurve class is used for spline based interpolation of positional values...
Definition: HBhvUtility.h:457
void Insert(const char *t, int l=0)
Definition: HBhvInterpolator.h:845
The HBaseModel class is used to store and manage model information.
Definition: HBaseModel.h:52
void InsertLinear(HQuat q, int l=0)
Definition: HBhvInterpolator.h:743
void Insert(float *mat, int l=0)
Definition: HBhvInterpolator.h:1319
void SetTarget(const char *t1, const char *t2, const char *t3)
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
HKeyframe ** GetArray()
Definition: HBhvInterpolator.h:134
virtual void Reset()
Definition: HBhvInterpolator.h:191
The HKeyframeChannelLinear class is used for linear interpolation of positional values.
Definition: HBhvUtility.h:359
HBhvAnimation * CreateInstance()
void SetTarget(const char *target)
virtual void Serialize(HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt)
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:47
VArray< void * > GetMorphData()
Definition: HBhvInterpolator.h:1044
bool m_bLinear
Definition: HBhvUtility.h:635
void Insert(HQuat q, int l=0)
Definition: HBhvInterpolator.h:734
void Replace(float *q, int l)
Definition: HBhvInterpolator.h:1330
void Insert(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:523
VArray< HKeyframe * > m_pArray
Definition: HBhvInterpolator.h:220
int GetMorphDataLength()
Definition: HBhvInterpolator.h:1047
static void * XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData)
char * GetGeomType()
Definition: HBhvInterpolator.h:551
The HKeyframeString class is used for any string related keyframes.
Definition: HBhvUtility.h:809
void Replace(HPoint pos, int l)
Definition: HBhvInterpolator.h:532
void SetAxis(float x, float y, float z)
Definition: HBhvInterpolator.h:433
void Replace(char *spath, int l)
Definition: HBhvInterpolator.h:1120
The HBhvInterpolatorAttSwitch class switches attributes on segments.
Definition: HBhvInterpolator.h:818
virtual void Interpolate(int keyframe, float fraction)
Definition: HBhvInterpolator.h:166
void SetTarget(HBhvTargetObject *target)
The HKeyframeQuatSquad class is used for non-linear quaternion based rotation.
Definition: HBhvUtility.h:757
void ReplaceLinear(HPoint pos, int l)
Definition: HBhvInterpolator.h:269
void Replace(HKeyframe *c, int pos)
Definition: HBhvInterpolator.h:101
The HBhvInterpolatorMatrix class controls quaternion based rotation. This class can be used for camer...
Definition: HBhvInterpolator.h:1291
void Remove(int pos)
Definition: HBhvInterpolator.h:120
char * GetColorComponent()
Definition: HBhvInterpolator.h:560
void Replace(char *t, int l)
Definition: HBhvInterpolator.h:929
void InsertDiscrete(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:294
The HBhvInterpolatorSegMove performs animation by switching on and off the visibility of segments...
Definition: HBhvInterpolator.h:1222
TrailInterpolatorType m_TrailType
Definition: HBhvInterpolator.h:406
The HBhvInterpolatorAxisRotate class controls rotation around an arbitrary axis.
Definition: HBhvInterpolator.h:420
HPoint m_axis
Definition: HBhvInterpolator.h:488
HC_KEY m_pTarget
Definition: HBhvInterpolator.h:223