10 #ifndef _H_HBhvInterpolator_H 11 #define _H_HBhvInterpolator_H 23 class HUtilityXMLGenerator;
27 template class MVO_API VArray< HKeyframe *>;
28 template class MVO_API VArray< void *>;
35 enum TrailInterpolatorType
43 #define REPLACE_VARRAY(c, pos) { if ((int)m_pArray.Count() > pos) \ 45 HKeyframe *temp = m_pArray[pos];\ 48 m_pArray.ReplaceAt(c, pos); } 50 #define REMOVE_VARRAY(pos) { HKeyframe *temp = m_pArray[pos];\ 52 m_pArray.RemoveAt(pos); } 54 #define CURVE_ARRAY(pos) ((HKeyframeChannelCurve *)GetAt(pos)) 80 virtual const char *
GetType() = 0;
121 void Remove(
int pos) { REMOVE_VARRAY(pos); }
147 void Duplicate(
int pos,
bool replace,
bool next);
155 void Copy(
int pos,
int adpos,
bool replace);
161 UNREFERENCED(xmlgen);
170 UNREFERENCED(keyframe);
171 UNREFERENCED(fraction);
174 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale) {
175 UNREFERENCED(keyframe);
176 UNREFERENCED(fraction);
177 UNREFERENCED(hasPos);
179 UNREFERENCED(hasQuat);
181 UNREFERENCED(hasScale);
197 void GetTranslationFromMatrix(
HPoint &translation);
202 void GetRotationFromMatrix(
HQuat &rotation);
220 void AddPositionToMatrix(
HPoint &trans);
226 void AddRotationToMatrix(
float rot[16]);
232 void AddScaleToMatrix(
HPoint &scale);
278 linear->
m_cp = pos; m_pArray.InsertAt(linear, l); }
286 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
294 linear->
m_cp = pos; m_pArray.InsertAt(linear, l); }
302 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
311 d->
m_cp = pos; m_pArray.InsertAt(d, l); }
316 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
320 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
327 virtual void Interpolate(
int keyframe,
float fraction);
329 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
334 virtual void Reset();
342 virtual void CalculatePos(
int keyframe,
float fraction,
HPoint &res);
349 virtual void InterpolateCamera(
HPoint &pos,
bool simulate =
false);
355 virtual void InterpolateCamera2(
HPoint &pos,
bool simulate =
false);
361 virtual void CalculateAllTangents();
394 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
398 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
405 virtual void Interpolate(
int keyframe,
float fraction);
409 virtual void Reset();
415 void SetTrailType(TrailInterpolatorType tt) { m_TrailType = tt; }
416 void SetTrailColor(
const char *color) { strncpy(m_Color, color,
sizeof(m_Color)); }
417 void SetTrailWeight(
int weight) { m_Weight = weight; }
418 void SetTrailStyle(
const char *style) { strncpy(m_Style, style,
sizeof(m_Style)); }
423 char m_Color[MVO_SMALL_BUFFER_SIZE];
425 char m_Style[MVO_SMALL_BUFFER_SIZE];
449 void SetAxis(
float x,
float y,
float z) {m_axis.x = x; m_axis.y = y; m_axis.z = z; }
474 linear->
m_angle = angle; m_pArray.InsertAt(linear, l); }
482 c->
m_angle = angle; REPLACE_VARRAY(c, l); }
487 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
492 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
500 virtual void Interpolate(
int keyframe,
float fraction);
501 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
540 color->
m_cp = pos; m_pArray.InsertAt(color, l); }
549 c->
m_cp = pos; REPLACE_VARRAY(c, l); }
554 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
559 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
564 void SetGeomType (
const char *geomtype);
573 void SetColorComponent (
const char *ColorComponent);
583 virtual void Interpolate(
int keyframe,
float fraction);
586 char m_ColorComponent[MVO_BUFFER_SIZE];
587 char m_GeomType[MVO_BUFFER_SIZE];
637 virtual void CalculatePos(
int keyframe,
float fraction,
HPoint &res);
644 virtual void CalculateAllTangents();
649 virtual void Reset();
676 scale->
m_cp = pos; m_pArray.InsertAt(scale, l); }
684 c->
m_cp = pos; REPLACE_VARRAY(c, l) }
689 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
694 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
701 virtual void Interpolate(
int keyframe,
float fraction);
702 void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
710 virtual void InterpolateCamera(
HPoint &Scale,
bool simulate =
false);
715 virtual void InterpolateCamera2(
HPoint &Scale,
bool simulate =
false);
751 rot->
m_quat = q; m_pArray.InsertAt(rot, l); }
769 c->
m_quat = q; REPLACE_VARRAY(c, l); }
782 void AdjustQuaternions();
787 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
792 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
799 virtual void Interpolate(
int keyframe,
float fraction);
800 virtual void Evaluate(
int keyframe,
float fraction,
bool &hasPos,
HPoint &pos,
bool &hasQuat,
HQuat &quat,
bool &hasScale,
HPoint &scale);
808 virtual void CalculateQuat(
int keyframe,
float fraction,
HQuat &res);
817 virtual void InterpolateCamera(
HQuat &quat,
bool simulate =
false);
823 virtual void InterpolateCamera2(
HQuat &quat,
bool simulate =
false);
862 AttSwitch->
SetTarget(t); m_pArray.InsertAt(AttSwitch, l); }
871 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
876 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
881 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
888 virtual void Interpolate(
int keyframe,
float fraction);
932 VertexMorph->
SetTarget(mident); m_pArray.InsertAt(VertexMorph, l); }
934 VertexMorph->
SetTarget(mident); VertexMorph->m_bDiscrete =
true; m_pArray.InsertAt(VertexMorph, l); }
951 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
956 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
963 virtual void Interpolate(
int keyframe,
float fraction);
974 virtual void AddMorphData(
HPoint *md,
int pnum,
HBaseModel *model,
int pos = -1);
983 void *GetUserInfo(
char *target);
984 void * GetMorphData(
int i);
986 VArray < void *> m_pMorphData;
987 HC_KEY m_shelltarget;
988 int m_MorphDataLength;
1027 ColorMorph->
SetTarget(mident); m_pArray.InsertAt(ColorMorph, l); }
1029 ColorMorph->
SetTarget(mident); ColorMorph->m_bDiscrete =
true; m_pArray.InsertAt(ColorMorph, l); }
1045 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1050 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1057 virtual void Interpolate(
int keyframe,
float fraction);
1075 virtual void AddMorphData(
HPoint *md,
int pnum,
HBaseModel *model,
int pos = -1);
1082 virtual void SetUseFIndex(
bool tf);
1086 void *GetUserInfo(
char *target);
1087 void * GetMorphData(
int i);
1088 VArray < void *> m_pMorphData;
1089 HC_KEY m_shelltarget;
1090 int m_MorphDataLength;
1128 SegSwitch->
SetTarget(t); m_pArray.InsertAt(SegSwitch, l); }
1137 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
1142 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1147 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1154 virtual void Interpolate(
int keyframe,
float fraction);
1159 virtual void Reset();
1197 InstanceCreate->
SetTarget(t,t2,t3); m_pArray.InsertAt(InstanceCreate, l); }
1206 c->
SetTarget(t,t2,t3); REPLACE_VARRAY(c, l) }
1211 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1216 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1223 virtual void Interpolate(
int keyframe,
float fraction);
1228 virtual void Reset();
1268 SegMove->
SetTarget(t); m_pArray.InsertAt(SegMove, l); }
1277 c->
SetTarget(spath); REPLACE_VARRAY(c, l) }
1282 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1287 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1294 virtual void Interpolate(
int keyframe,
float fraction);
1299 virtual void Reset();
1336 for (
int i=0;i<16;i++) { rot->
m_matrix[i] = mat[i]; m_pArray.InsertAt(rot, l);} }
1347 for (
int i=0;i<16;i++) c->
m_matrix[i] = q[i]; REPLACE_VARRAY(c, l); }
1353 virtual void Serialize(HUtilityXMLGenerator *xmlgen);
1358 static void *
XMLCallback(HUtilityXMLTag *xt,
bool open,
void *m_pExtraData);
1365 virtual void Interpolate(
int keyframe,
float fraction);
void Append(HKeyframe *piece)
Definition: HBhvInterpolator.h:115
void Replace(const char *spath, int l)
Definition: HBhvInterpolator.h:870
VArray< void * > GetMorphData()
Definition: HBhvInterpolator.h:977
void ReplaceLinear(HQuat q, int l)
Definition: HBhvInterpolator.h:776
void Insert(char *mident, int l=0)
Definition: HBhvInterpolator.h:1026
int m_Weight
Definition: HBhvInterpolator.h:424
The HKeyframe class is the base class for all keyframe types.
Definition: HBhvUtility.h:257
The HKeyframeAxisRotation class is used for rotations around an arbitrary axis.
Definition: HBhvUtility.h:647
The HKeyframeQuatSquad class is used for non-linear quaternion based rotation.
Definition: HBhvUtility.h:721
char m_Name[BHV_MAX_NAME_LENGTH]
Definition: HBhvAnimation.h:280
The HBhvInterpolatorColor class controls color attribute changes.
Definition: HBhvInterpolator.h:511
void ReplaceCurve(HPoint pos, int l)
Definition: HBhvInterpolator.h:301
virtual void Serialize(HUtilityXMLGenerator *xmlgen)
Definition: HBhvInterpolator.h:160
The HQuat class defines the data type of a Quaternion.
Definition: HBhvUtility.h:83
void Insert(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:675
virtual const char * GetType()
Definition: HBhvAnimation.h:57
void Insert(char *t, int l=0)
Definition: HBhvInterpolator.h:1267
HBhvAnimation * m_pAnimation
Definition: HBhvInterpolator.h:237
HC_KEY m_trailKey
Definition: HBhvInterpolator.h:426
HQuat m_quat
Definition: HBhvUtility.h:755
void Replace(float angle, int l)
Definition: HBhvInterpolator.h:481
void Insert(char *mident, int l=0)
Definition: HBhvInterpolator.h:931
void Duplicate(int newkeyframe, int oldkeyframe)
void Insert(char *t, int l=0)
Definition: HBhvInterpolator.h:1127
HBhvAnimation * GetAnimation()
Definition: HBhvInterpolator.h:186
void Insert(char *t, char *t2, char *t3, int l=0)
Definition: HBhvInterpolator.h:1196
void Insert(HKeyframe *piece, int pos=0)
Definition: HBhvInterpolator.h:109
void InsertLinear(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:277
void Replace(char *t, char *t2, char *t3, int l)
Definition: HBhvInterpolator.h:1205
float m_angle
Definition: HBhvUtility.h:682
void Replace(HQuat q, int l)
Definition: HBhvInterpolator.h:768
The HBhvInterpolatorVertexMorph class performs interpolation by interpolating the individual vertex p...
Definition: HBhvInterpolator.h:899
int GetMorphDataLength()
Definition: HBhvInterpolator.h:980
virtual int GetArrayLength()
Definition: HBhvInterpolator.h:138
#define BHV_MAX_NAME_LENGTH
Maximum Length of "Names" in animations.
Definition: HBhvUtility.h:41
virtual HKeyframe * GetAt(int pos)
Definition: HBhvInterpolator.h:131
void GetAxis(HPoint &axis)
Definition: HBhvInterpolator.h:454
The HBhvInterpolatorScale class controls scaling. This class can be used for camera interpolation as ...
Definition: HBhvInterpolator.h:627
void SetAnimation(HBhvAnimation *animation)
Definition: HBhvInterpolator.h:191
The HBhvInterpolatorQuatSquad class controls quaternion based rotation. This class can be used for ca...
Definition: HBhvInterpolator.h:722
HBhvInterpolator * m_pInterpolatorInstance
Definition: HBhvInterpolator.h:238
void Replace(HPoint pos, int l)
Definition: HBhvInterpolator.h:683
HPoint m_cp
Definition: HBhvUtility.h:356
The HBhvInterpolatorPosition class controls positional interpolation.
Definition: HBhvInterpolator.h:249
The HBhvInterpolatorInstanceCreate creates a new instance of the target object at the location in the...
Definition: HBhvInterpolator.h:1167
void InsertCurve(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:293
void Replace(char *t, int l)
Definition: HBhvInterpolator.h:1039
The HBhvInterpolatorSegSwitch performs animation by switching on and off the visibility of segments...
Definition: HBhvInterpolator.h:1098
The HKeyframeChannelDiscrete class is used for discrete interpolation of positional values...
Definition: HBhvUtility.h:411
The HBhvInterpolatorColorMorph class performs an interpolation on the face colors of your target obje...
Definition: HBhvInterpolator.h:994
void Insert(float angle, int l=0)
Definition: HBhvInterpolator.h:473
The HBhvInterpolatorTrail class draws a line trail from one keyframe position to the next...
Definition: HBhvInterpolator.h:368
The HBhvInterpolator class is the abstract base class for all interpolator types. ...
Definition: HBhvInterpolator.h:64
void Replace(char *spath, int l)
Definition: HBhvInterpolator.h:1276
const char * GetName()
Definition: HBhvInterpolator.h:124
The HKeyframeString class is used for any string related keyframes.
Definition: HBhvUtility.h:863
float m_matrix[16]
Definition: HBhvUtility.h:800
The HKeyframeChannelCurve class is used for spline based interpolation of positional values...
Definition: HBhvUtility.h:462
void Insert(const char *t, int l=0)
Definition: HBhvInterpolator.h:861
The HBaseModel class is used to store and manage model information.
Definition: HBaseModel.h:47
void InsertLinear(HQuat q, int l=0)
Definition: HBhvInterpolator.h:759
void Insert(float *mat, int l=0)
Definition: HBhvInterpolator.h:1335
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:121
HKeyframe ** GetArray()
Definition: HBhvInterpolator.h:135
virtual void Reset()
Definition: HBhvInterpolator.h:207
The HKeyframeChannelLinear class is used for linear interpolation of positional values.
Definition: HBhvUtility.h:364
HBhvAnimation * CreateInstance()
void SetTarget(const char *target)
virtual void Serialize(HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt)
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:43
VArray< void * > GetMorphData()
Definition: HBhvInterpolator.h:1060
bool m_bLinear
Definition: HBhvUtility.h:640
void Insert(HQuat q, int l=0)
Definition: HBhvInterpolator.h:750
void Replace(float *q, int l)
Definition: HBhvInterpolator.h:1346
void Insert(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:539
VArray< HKeyframe * > m_pArray
Definition: HBhvInterpolator.h:236
int GetMorphDataLength()
Definition: HBhvInterpolator.h:1063
static void * XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData)
char * GetGeomType()
Definition: HBhvInterpolator.h:567
The HKeyframeString class is used for any string related keyframes.
Definition: HBhvUtility.h:814
void Replace(HPoint pos, int l)
Definition: HBhvInterpolator.h:548
void SetAxis(float x, float y, float z)
Definition: HBhvInterpolator.h:449
void Replace(char *spath, int l)
Definition: HBhvInterpolator.h:1136
The HBhvInterpolatorAttSwitch class switches attributes on segments.
Definition: HBhvInterpolator.h:834
virtual void Interpolate(int keyframe, float fraction)
Definition: HBhvInterpolator.h:169
void SetTarget(HBhvTargetObject *target)
The HKeyframeQuatSquad class is used for non-linear quaternion based rotation.
Definition: HBhvUtility.h:762
void ReplaceLinear(HPoint pos, int l)
Definition: HBhvInterpolator.h:285
void Replace(HKeyframe *c, int pos)
Definition: HBhvInterpolator.h:102
The HBhvInterpolatorMatrix class controls quaternion based rotation. This class can be used for camer...
Definition: HBhvInterpolator.h:1307
void Remove(int pos)
Definition: HBhvInterpolator.h:121
char * GetColorComponent()
Definition: HBhvInterpolator.h:576
void Replace(char *t, int l)
Definition: HBhvInterpolator.h:945
void InsertDiscrete(HPoint pos, int l=0)
Definition: HBhvInterpolator.h:310
The HBhvInterpolatorSegMove performs animation by switching on and off the visibility of segments...
Definition: HBhvInterpolator.h:1238
TrailInterpolatorType m_TrailType
Definition: HBhvInterpolator.h:422
The HBhvInterpolatorAxisRotate class controls rotation around an arbitrary axis.
Definition: HBhvInterpolator.h:436
HPoint m_axis
Definition: HBhvInterpolator.h:504
HC_KEY m_pTarget
Definition: HBhvInterpolator.h:239