00001 // 00002 // Copyright (c) 2000 by Tech Soft 3D, LLC. 00003 // The information contained herein is confidential and proprietary to 00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 // civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 // and criminal remedies in the event of unauthorized use or misappropriation 00007 // of its trade secrets. Use of this information by anyone other than 00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 // written non-disclosure agreement, expressly prescribing the scope and 00010 // manner of such use. 00011 // 00012 00013 #ifndef _H_HBhvInterpolator_H 00014 #define _H_HBhvInterpolator_H 00015 00016 #ifdef H_PACK_8 00017 #pragma pack(push) 00018 #pragma pack(8) 00019 #endif 00020 00021 #include "HTools.h" 00022 #include "HBhvUtility.h" 00023 #include "varray.h" 00024 00025 00026 class HUtilityXMLGenerator; 00027 class HBhvAnimation; 00028 00029 #ifdef WINDOWS_SYSTEM 00030 template class MVO_API VArray< HKeyframe *>; 00031 template class MVO_API VArray< void *>; 00032 #endif 00033 00034 00038 enum TrailInterpolatorType 00039 { 00040 Forward, 00041 Backward, 00042 Full 00043 }; 00044 00045 00046 #define REPLACE_VARRAY(c, pos) { if ((int)m_pArray.Count() > pos) \ 00047 { \ 00048 HKeyframe *temp = m_pArray[pos];\ 00049 delete temp;\ 00050 } \ 00051 m_pArray.ReplaceAt(c, pos); } 00052 00053 #define REMOVE_VARRAY(pos) { HKeyframe *temp = m_pArray[pos];\ 00054 delete temp;\ 00055 m_pArray.RemoveAt(pos); } 00056 00057 #define CURVE_ARRAY(pos) ((HKeyframeChannelCurve *)GetAt(pos)) 00058 00059 00060 00062 00067 class MVO_API HBhvInterpolator 00068 { 00069 public: 00075 HBhvInterpolator(HBhvAnimation *animation = 0, const char *name = 0); 00076 virtual ~HBhvInterpolator(); 00077 00079 virtual const char * GetType() = 0; 00080 00086 void SetInstancedInterpolator(HBhvInterpolator *interpolator); 00087 00094 virtual HBhvInterpolator *CreateInstance(HBhvAnimation *animationinst) = 0; 00095 00101 void Replace(HKeyframe * c, int pos) { REPLACE_VARRAY(c, pos); } 00102 00108 void Insert(HKeyframe * piece, int pos = 0) { m_pArray.InsertAt(piece, pos); } 00109 00114 void Append(HKeyframe * piece) { m_pArray.InsertAt(piece, m_pArray.Count()); } 00115 00120 void Remove(int pos) { REMOVE_VARRAY(pos); } 00121 00123 const char * GetName() { return m_Name; } 00124 00130 virtual HKeyframe *GetAt(int pos) { return m_pArray[pos]; } 00131 00134 HKeyframe **GetArray() { return &m_pArray[0]; } 00135 00137 virtual int GetArrayLength() { return (int)m_pArray.Count(); } 00138 00146 void Duplicate(int pos, bool replace, bool next); 00147 00154 void Copy(int pos, int adpos, bool replace); 00155 00159 virtual void Serialize(HUtilityXMLGenerator *xmlgen) { 00160 UNREFERENCED(xmlgen); 00161 } 00162 00168 virtual void Interpolate(int keyframe, float fraction) { 00169 UNREFERENCED(keyframe); 00170 UNREFERENCED(fraction); 00171 } 00172 00173 virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale) { 00174 UNREFERENCED(keyframe); 00175 UNREFERENCED(fraction); 00176 UNREFERENCED(hasPos); 00177 UNREFERENCED(pos); 00178 UNREFERENCED(hasQuat); 00179 UNREFERENCED(quat); 00180 UNREFERENCED(hasScale); 00181 UNREFERENCED(scale); 00182 } 00183 00185 HBhvAnimation * GetAnimation() { return m_pAnimation; } 00186 00190 void SetAnimation(HBhvAnimation *animation) { m_pAnimation = animation; } 00191 00196 void GetTranslationFromMatrix(HPoint &translation); 00201 void GetRotationFromMatrix(HQuat &rotation); 00202 00206 virtual void Reset() { }; 00207 00208 protected: 00209 00213 void SetTarget(); 00214 00219 void AddPositionToMatrix(HPoint &trans); 00220 00225 void AddRotationToMatrix(float rot[16]); 00226 00231 void AddScaleToMatrix(HPoint &scale); 00232 00233 00234 char m_Name[BHV_MAX_NAME_LENGTH]; 00235 VArray< HKeyframe *> m_pArray; 00236 HBhvAnimation* m_pAnimation; 00237 HBhvInterpolator* m_pInterpolatorInstance; 00238 HC_KEY m_pTarget; 00240 }; 00241 00242 00244 00248 class MVO_API HBhvInterpolatorPosition : public HBhvInterpolator 00249 { 00250 public: 00256 HBhvInterpolatorPosition(HBhvAnimation *animation = 0, const char *name = 0); 00257 00258 00260 const char * GetType(); 00261 00268 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00269 00276 void InsertLinear(HPoint pos, int l = 0) { HKeyframeChannelLinear * linear = new HKeyframeChannelLinear; 00277 linear->m_cp = pos; m_pArray.InsertAt(linear, l); } 00284 void ReplaceLinear(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 00285 c->m_cp = pos; REPLACE_VARRAY(c, l) } 00292 void InsertCurve(HPoint pos, int l = 0) { HKeyframeChannelCurve * linear = new HKeyframeChannelCurve; 00293 linear->m_cp = pos; m_pArray.InsertAt(linear, l); } 00300 void ReplaceCurve(HPoint pos, int l) { HKeyframeChannelCurve * c = new HKeyframeChannelCurve; 00301 c->m_cp = pos; REPLACE_VARRAY(c, l) } 00302 00309 void InsertDiscrete(HPoint pos, int l = 0) { HKeyframeChannelDiscrete * d = new HKeyframeChannelDiscrete; 00310 d->m_cp = pos; m_pArray.InsertAt(d, l); } 00311 00315 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00319 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00320 00326 virtual void Interpolate(int keyframe, float fraction); 00327 00328 virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale); 00329 00333 virtual void Reset(); 00334 00341 virtual void CalculatePos(int keyframe, float fraction, HPoint &res); 00342 00343 protected: 00348 virtual void InterpolateCamera(HPoint &pos, bool simulate = false); 00349 00354 virtual void InterpolateCamera2(HPoint &pos, bool simulate = false); 00355 00360 virtual void CalculateAllTangents(); 00361 }; 00362 00364 00367 class MVO_API HBhvInterpolatorTrail : public HBhvInterpolatorPosition 00368 { 00369 public: 00375 HBhvInterpolatorTrail(HBhvAnimation *animation = 0, const char *name = 0); 00376 ~HBhvInterpolatorTrail(); 00377 00378 00380 const char * GetType(); 00381 00388 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00389 00393 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00397 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00398 00404 virtual void Interpolate(int keyframe, float fraction); 00408 virtual void Reset(); 00409 00413 void Init(); 00414 void SetTrailType(TrailInterpolatorType tt) { m_TrailType = tt; } 00415 void SetTrailColor(const char *color) { strcpy(m_Color, color); } 00416 void SetTrailWeight(int weight) { m_Weight = weight; } 00417 void SetTrailStyle(const char *style) { strcpy(m_Style, style); } 00418 00419 00420 protected: 00421 TrailInterpolatorType m_TrailType; 00422 char m_Color[MVO_SMALL_BUFFER_SIZE]; 00423 int m_Weight; 00424 char m_Style[MVO_SMALL_BUFFER_SIZE]; 00425 HC_KEY m_TrailSegment, m_trailKey; 00426 int m_lastkeyframe; 00427 bool m_initialized; 00428 00429 }; 00430 00432 00435 class MVO_API HBhvInterpolatorAxisRotate : public HBhvInterpolator 00436 { 00437 public: 00443 HBhvInterpolatorAxisRotate(HBhvAnimation *animation = 0, const char *name = 0); 00444 00448 void SetAxis(float x, float y, float z) {m_axis.x = x; m_axis.y = y; m_axis.z = z; } 00449 00453 void GetAxis (HPoint &axis) { axis = m_axis; } 00454 00456 const char * GetType(); 00457 00464 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00465 00472 void Insert(float angle, int l = 0) { HKeyframeAxisRotation* linear = new HKeyframeAxisRotation; 00473 linear->m_angle = angle; m_pArray.InsertAt(linear, l); } 00480 void Replace(float angle, int l) { HKeyframeAxisRotation * c = new HKeyframeAxisRotation; 00481 c->m_angle = angle; REPLACE_VARRAY(c, l); } 00482 00486 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00487 00491 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00492 00493 00499 virtual void Interpolate(int keyframe, float fraction); 00500 virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale); 00501 00502 protected: 00503 HPoint m_axis; 00505 }; 00506 00507 00509 00510 class MVO_API HBhvInterpolatorColor : public HBhvInterpolator 00511 { 00512 public: 00519 HBhvInterpolatorColor(HBhvAnimation *animation = 0, const char *name = 0); 00521 const char * GetType(); 00522 00529 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00530 00538 void Insert(HPoint pos, int l = 0) { HKeyframeChannelLinear* color = new HKeyframeChannelLinear; 00539 color->m_cp = pos; m_pArray.InsertAt(color, l); } 00547 void Replace(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 00548 c->m_cp = pos; REPLACE_VARRAY(c, l); } 00549 00553 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00554 00558 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00559 00563 void SetGeomType (const char *geomtype); 00564 00566 char * GetGeomType () { return m_GeomType; } 00567 00572 void SetColorComponent (const char *ColorComponent); 00573 00575 char * GetColorComponent () { return m_ColorComponent; } 00576 00582 virtual void Interpolate(int keyframe, float fraction); 00583 00584 protected: 00585 char m_ColorComponent[MVO_BUFFER_SIZE]; 00586 char m_GeomType[MVO_BUFFER_SIZE]; 00588 }; 00589 00590 00591 /* 00592 class MVO_API HBhvInterpolatorQuat : public HBhvInterpolator 00593 { 00594 public: 00595 HBhvInterpolatorQuat(const char *name = 0); 00596 const char * GetType(); 00597 00598 virtual HBhvInterpolatorInstance * CreateInstance(HBhvanimation *ainst); 00599 void Insert(HQuat pos, int l) { HKeyframeQuatSlerp * rot = new HKeyframeQuatSlerp; 00600 rot->m_quat = pos; m_pArray.InsertAt(rot, l); } 00601 void Replace(HQuat pos, int l) { HKeyframeQuatSlerp * c = new HKeyframeQuatSlerp; 00602 c->m_quat = pos; REPLACE_VARRAY(c, l); } 00603 00604 }; 00605 00606 00607 00608 class MVO_API HBhvInterpolatorInstanceQuat : public HBhvInterpolatorInstance 00609 { 00610 public: 00611 HBhvInterpolatorInstanceQuat(HBhvInterpolatorQuat *ip, HBhvanimation *ainst) : HBhvInterpolatorInstance((HBhvInterpolator *)ip, ainst) {} 00612 virtual void Interpolate(int keyframe, float fraction); 00613 00614 protected: 00615 00616 virtual void InterpolateCamera(float *quat); 00617 00618 }; 00619 00620 */ 00621 00622 00623 00625 00626 class MVO_API HBhvInterpolatorScale : public HBhvInterpolator 00627 { 00628 public: 00629 00636 virtual void CalculatePos(int keyframe, float fraction, HPoint &res); 00637 00638 00643 virtual void CalculateAllTangents(); 00644 00648 virtual void Reset(); 00649 00655 HBhvInterpolatorScale(HBhvAnimation *animation = 0, const char *name = 0); 00656 00658 const char * GetType(); 00659 00666 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00667 00674 void Insert(HPoint pos, int l = 0) { HKeyframeChannelLinear * scale = new HKeyframeChannelLinear; 00675 scale->m_cp = pos; m_pArray.InsertAt(scale, l); } 00682 void Replace(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 00683 c->m_cp = pos; REPLACE_VARRAY(c, l) } 00684 00688 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00689 00693 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00694 00700 virtual void Interpolate(int keyframe, float fraction); 00701 void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale); 00702 00703 00704 protected: 00709 virtual void InterpolateCamera(HPoint &Scale, bool simulate = false); 00714 virtual void InterpolateCamera2(HPoint &Scale, bool simulate = false); 00715 00716 }; 00717 00718 00719 00721 class MVO_API HBhvInterpolatorQuatSquad : public HBhvInterpolator 00722 { 00723 public: 00724 00730 HBhvInterpolatorQuatSquad(HBhvAnimation *animation = 0, const char *name = 0); 00731 00733 const char * GetType(); 00734 00741 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00742 00749 void Insert(HQuat q, int l = 0) { HKeyframeQuatSquad * rot = new HKeyframeQuatSquad; 00750 rot->m_quat = q; m_pArray.InsertAt(rot, l); } 00751 00758 void InsertLinear(HQuat q, int l = 0) { HKeyframeQuatSquad * rot = new HKeyframeQuatSquad; 00759 rot->m_quat = q; rot->m_bLinear = true; m_pArray.InsertAt(rot, l); } 00760 00767 void Replace(HQuat q, int l) { HKeyframeQuatSquad * c = new HKeyframeQuatSquad; 00768 c->m_quat = q; REPLACE_VARRAY(c, l); } 00775 void ReplaceLinear(HQuat q, int l) { HKeyframeQuatSquad * c = new HKeyframeQuatSquad; 00776 c->m_quat = q; c->m_bLinear = true; REPLACE_VARRAY(c, l); } 00777 00781 void AdjustQuaternions(); 00782 00786 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00787 00791 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00792 00798 virtual void Interpolate(int keyframe, float fraction); 00799 virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale); 00800 00807 virtual void CalculateQuat(int keyframe, float fraction, HQuat &res); 00808 00809 00810 00811 protected: 00816 virtual void InterpolateCamera(HQuat &quat, bool simulate = false); 00817 00822 virtual void InterpolateCamera2(HQuat &quat, bool simulate = false); 00823 00824 }; 00825 00826 00827 00828 00830 00833 class MVO_API HBhvInterpolatorAttSwitch : public HBhvInterpolator 00834 { 00835 public: 00841 HBhvInterpolatorAttSwitch(HBhvAnimation *animation = 0, const char *name = 0); 00842 00844 const char * GetType(); 00845 00852 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00853 00860 void Insert(const char * t, int l = 0) { HKeyframeString* AttSwitch = new HKeyframeString; 00861 AttSwitch->SetTarget(t); m_pArray.InsertAt(AttSwitch, l); } 00862 00869 void Replace(const char *spath, int l) { HKeyframeString * c = new HKeyframeString; 00870 c->SetTarget(spath); REPLACE_VARRAY(c, l) } 00871 00875 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00876 00880 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00881 00887 virtual void Interpolate(int keyframe, float fraction); 00888 00889 }; 00890 00891 00892 00893 00894 00895 00896 00898 class MVO_API HBhvInterpolatorVertexMorph : public HBhvInterpolator 00899 { 00900 public: 00901 00907 HBhvInterpolatorVertexMorph(HBhvAnimation *animation = 0, const char *name = 0); 00908 ~HBhvInterpolatorVertexMorph(); 00909 00911 const char * GetType(); 00912 00919 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 00920 00930 void Insert(char * mident, int l = 0) { HKeyframeString* VertexMorph = new HKeyframeString; 00931 VertexMorph->SetTarget(mident); m_pArray.InsertAt(VertexMorph, l); } 00932 void InsertDiscrete(char * mident, int l = 0) { HKeyframeString* VertexMorph = new HKeyframeString; 00933 VertexMorph->SetTarget(mident); VertexMorph->m_bDiscrete = true; m_pArray.InsertAt(VertexMorph, l); } 00934 00944 void Replace(char *t, int l) { HKeyframeString * c = new HKeyframeString; 00945 c->SetTarget(t); REPLACE_VARRAY(c, l) } 00946 00950 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 00951 00955 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 00956 00962 virtual void Interpolate(int keyframe, float fraction); 00963 00973 virtual void AddMorphData(HPoint *md, int pnum, HBaseModel *model, int pos = -1); 00974 00976 VArray < void *> GetMorphData() { return m_pMorphData; } 00977 00979 int GetMorphDataLength() { return m_MorphDataLength; } 00980 private: 00981 00982 void *GetUserInfo(char *target); 00983 void * GetMorphData(int i); 00985 VArray < void *> m_pMorphData; 00986 HC_KEY m_shelltarget; 00987 int m_MorphDataLength; 00988 }; 00989 00990 00991 00993 class MVO_API HBhvInterpolatorColorMorph : public HBhvInterpolator 00994 { 00995 public: 00996 01002 HBhvInterpolatorColorMorph(HBhvAnimation *animation = 0, const char *name = 0); 01003 ~HBhvInterpolatorColorMorph(); 01004 01006 const char * GetType(); 01007 01014 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 01015 01025 void Insert(char * mident, int l = 0) { HKeyframeString* ColorMorph = new HKeyframeString; 01026 ColorMorph->SetTarget(mident); m_pArray.InsertAt(ColorMorph, l); } 01027 void InsertDiscrete(char * mident, int l = 0) { HKeyframeString* ColorMorph = new HKeyframeString; 01028 ColorMorph->SetTarget(mident); ColorMorph->m_bDiscrete = true; m_pArray.InsertAt(ColorMorph, l); } 01038 void Replace(char *t, int l) { HKeyframeString * c = new HKeyframeString; 01039 c->SetTarget(t); REPLACE_VARRAY(c, l) } 01040 01044 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 01045 01049 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 01050 01056 virtual void Interpolate(int keyframe, float fraction); 01057 01059 VArray < void *> GetMorphData() { return m_pMorphData; } 01060 01062 int GetMorphDataLength() { return m_MorphDataLength; } 01074 virtual void AddMorphData(HPoint *md, int pnum, HBaseModel *model, int pos = -1); 01075 01081 virtual void SetUseFIndex(bool tf); 01082 01083 private: 01084 01085 void *GetUserInfo(char *target); 01086 void * GetMorphData(int i); 01087 VArray < void *> m_pMorphData; 01088 HC_KEY m_shelltarget; 01089 int m_MorphDataLength; 01090 bool m_bUseFIndex; 01091 }; 01092 01093 01094 01095 01097 class MVO_API HBhvInterpolatorSegSwitch : public HBhvInterpolator 01098 { 01099 public: 01100 01106 HBhvInterpolatorSegSwitch(HBhvAnimation *animation = 0, const char *name = 0); 01107 ~HBhvInterpolatorSegSwitch(); 01108 01110 const char * GetType(); 01111 01118 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 01119 01126 void Insert(char * t, int l = 0) { HKeyframeString* SegSwitch = new HKeyframeString; 01127 SegSwitch->SetTarget(t); m_pArray.InsertAt(SegSwitch, l); } 01128 01135 void Replace(char *spath, int l) { HKeyframeString * c = new HKeyframeString; 01136 c->SetTarget(spath); REPLACE_VARRAY(c, l) } 01137 01141 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 01142 01146 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 01147 01153 virtual void Interpolate(int keyframe, float fraction); 01154 01158 virtual void Reset(); 01159 01160 }; 01161 01162 01163 01164 01166 class MVO_API HBhvInterpolatorInstanceCreate : public HBhvInterpolator 01167 { 01168 public: 01169 01175 HBhvInterpolatorInstanceCreate(HBhvAnimation *animation = 0, const char *name = 0); 01176 ~HBhvInterpolatorInstanceCreate(); 01177 01179 const char * GetType(); 01180 01187 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 01188 01195 void Insert(char * t, char *t2, char *t3, int l = 0) { HKeyframe3String* InstanceCreate = new HKeyframe3String; 01196 InstanceCreate->SetTarget(t,t2,t3); m_pArray.InsertAt(InstanceCreate, l); } 01197 01204 void Replace(char *t, char *t2, char *t3, int l) { HKeyframe3String * c = new HKeyframe3String; 01205 c->SetTarget(t,t2,t3); REPLACE_VARRAY(c, l) } 01206 01210 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 01211 01215 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 01216 01222 virtual void Interpolate(int keyframe, float fraction); 01223 01227 virtual void Reset(); 01228 01229 static void DeciperString(HBhvInterpolatorInstanceCreate *itp, char *text, HBaseModel *model, int &counter); 01230 01231 01232 }; 01233 01234 01235 01237 class MVO_API HBhvInterpolatorSegMove : public HBhvInterpolator 01238 { 01239 public: 01240 01246 HBhvInterpolatorSegMove(HBhvAnimation *animation = 0, const char *name = 0); 01247 ~HBhvInterpolatorSegMove(); 01248 01250 const char * GetType(); 01251 01258 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 01259 01266 void Insert(char * t, int l = 0) { HKeyframeString* SegMove = new HKeyframeString; 01267 SegMove->SetTarget(t); m_pArray.InsertAt(SegMove, l); } 01268 01275 void Replace(char *spath, int l) { HKeyframeString * c = new HKeyframeString; 01276 c->SetTarget(spath); REPLACE_VARRAY(c, l) } 01277 01281 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 01282 01286 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 01287 01293 virtual void Interpolate(int keyframe, float fraction); 01294 01298 virtual void Reset(); 01299 01300 }; 01301 01302 01303 01304 01306 class MVO_API HBhvInterpolatorMatrix : public HBhvInterpolator 01307 { 01308 public: 01309 01315 HBhvInterpolatorMatrix(HBhvAnimation *animation = 0, const char *name = 0); 01316 01318 const char * GetType(); 01319 01326 virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst); 01327 01334 void Insert(float *mat, int l = 0) { HKeyframeMatrix * rot = new HKeyframeMatrix; 01335 for (int i=0;i<16;i++) rot->m_matrix[i] = mat[i]; m_pArray.InsertAt(rot, l); } 01336 01337 01338 01345 void Replace(float * q, int l) { HKeyframeMatrix * c = new HKeyframeMatrix; 01346 for (int i=0;i<16;i++) c->m_matrix[i] = q[i]; REPLACE_VARRAY(c, l); } 01347 01348 01352 virtual void Serialize(HUtilityXMLGenerator *xmlgen); 01353 01357 static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData); 01358 01364 virtual void Interpolate(int keyframe, float fraction); 01365 01366 01367 protected: 01368 01369 }; 01370 01371 01372 01373 #ifdef H_PACK_8 01374 #pragma pack(pop) 01375 #endif 01376 01377 #endif 01378 01379 01380