Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HBhvInterpolator.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 #ifndef _H_HBhvInterpolator_H
00011 #define _H_HBhvInterpolator_H
00012 
00013 #ifdef H_PACK_8
00014 #pragma pack(push)
00015 #pragma pack(8)
00016 #endif
00017 
00018 #include "HTools.h"
00019 #include "HBhvUtility.h"
00020 #include "varray.h"
00021 
00022 
00023 class HUtilityXMLGenerator;
00024 class HBhvAnimation;
00025   
00026 #ifdef WINDOWS_SYSTEM
00027 template class MVO_API VArray< HKeyframe *>;
00028 template class MVO_API VArray< void *>;
00029 #endif
00030 
00031 
00035 enum TrailInterpolatorType
00036 {
00037     Forward,          
00038     Backward,           
00039     Full                
00040 };
00041 
00042 
00043 #define REPLACE_VARRAY(c, pos) {    if ((int)m_pArray.Count() > pos)     \
00044                                     {                               \
00045                                     HKeyframe *temp = m_pArray[pos];\
00046                                     delete temp;\
00047                                     }                               \
00048                                     m_pArray.ReplaceAt(c, pos);    }                                
00049 
00050 #define REMOVE_VARRAY(pos)          {  HKeyframe *temp = m_pArray[pos];\
00051                                         delete temp;\
00052                                         m_pArray.RemoveAt(pos);    }                                
00053 
00054 #define CURVE_ARRAY(pos)        ((HKeyframeChannelCurve *)GetAt(pos))
00055                             
00056 
00057 
00059 
00064 class MVO_API HBhvInterpolator
00065 {
00066 public:
00072     HBhvInterpolator(HBhvAnimation *animation = 0, const char *name = 0);
00073     virtual ~HBhvInterpolator();
00074 
00076     virtual const char * GetType() = 0;
00077 
00083     void SetInstancedInterpolator(HBhvInterpolator *interpolator);
00084 
00091     virtual HBhvInterpolator *CreateInstance(HBhvAnimation *animationinst) = 0;
00092 
00098     void  Replace(HKeyframe * c, int pos) { REPLACE_VARRAY(c, pos); }
00099 
00105     void  Insert(HKeyframe * piece, int pos = 0) { m_pArray.InsertAt(piece, pos); }
00106 
00111     void  Append(HKeyframe * piece) { m_pArray.InsertAt(piece, m_pArray.Count()); }
00112 
00117     void  Remove(int pos) { REMOVE_VARRAY(pos); }
00118 
00120     const char * GetName() { return m_Name; }
00121 
00127     virtual HKeyframe *GetAt(int pos) { return m_pArray[pos]; }
00128 
00131     HKeyframe **GetArray() { return &m_pArray[0]; }
00132 
00134     virtual int   GetArrayLength() { return (int)m_pArray.Count(); }
00135    
00143     void Duplicate(int pos, bool replace, bool next);
00144     
00151     void Copy(int pos, int adpos, bool replace);
00152  
00156     virtual void Serialize(HUtilityXMLGenerator *xmlgen) {
00157         UNREFERENCED(xmlgen);
00158     }
00159 
00165     virtual void Interpolate(int keyframe, float fraction) {
00166         UNREFERENCED(keyframe);
00167         UNREFERENCED(fraction);
00168     }
00169 
00170     virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale) {
00171         UNREFERENCED(keyframe);
00172         UNREFERENCED(fraction);
00173         UNREFERENCED(hasPos);
00174         UNREFERENCED(pos);
00175         UNREFERENCED(hasQuat);
00176         UNREFERENCED(quat);
00177         UNREFERENCED(hasScale);
00178         UNREFERENCED(scale);
00179     }
00180  
00182     HBhvAnimation * GetAnimation() { return m_pAnimation; }
00183 
00187     void  SetAnimation(HBhvAnimation *animation) { m_pAnimation = animation; }
00188 
00193     void GetTranslationFromMatrix(HPoint &translation);
00198     void GetRotationFromMatrix(HQuat &rotation);
00199 
00203     virtual void Reset() { };
00204 
00205 protected:  
00206 
00210     void SetTarget();
00211 
00216     void AddPositionToMatrix(HPoint &trans);
00217 
00222     void AddRotationToMatrix(float rot[16]);
00223 
00228     void AddScaleToMatrix(HPoint &scale);
00229     
00230     
00231     char                        m_Name[BHV_MAX_NAME_LENGTH];        
00232     VArray< HKeyframe *>        m_pArray;                           
00233     HBhvAnimation*              m_pAnimation;                       
00234     HBhvInterpolator*           m_pInterpolatorInstance;            
00235     HC_KEY                      m_pTarget;                          
00237 };
00238 
00239 
00241 
00245 class MVO_API HBhvInterpolatorPosition : public HBhvInterpolator
00246 {
00247 public:
00253     HBhvInterpolatorPosition(HBhvAnimation *animation = 0, const char *name = 0);
00254 
00255 
00257     const char * GetType();
00258 
00265     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00266 
00273     void  InsertLinear(HPoint pos, int l = 0) { HKeyframeChannelLinear * linear = new HKeyframeChannelLinear; 
00274                 linear->m_cp = pos; m_pArray.InsertAt(linear, l); }
00281     void  ReplaceLinear(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 
00282                 c->m_cp = pos; REPLACE_VARRAY(c, l) }
00289     void  InsertCurve(HPoint pos, int l = 0) { HKeyframeChannelCurve * linear = new HKeyframeChannelCurve; 
00290                 linear->m_cp = pos; m_pArray.InsertAt(linear, l); }
00297     void  ReplaceCurve(HPoint pos, int l) { HKeyframeChannelCurve * c = new HKeyframeChannelCurve; 
00298                 c->m_cp = pos; REPLACE_VARRAY(c, l) }
00299 
00306     void  InsertDiscrete(HPoint pos, int l = 0) { HKeyframeChannelDiscrete * d = new HKeyframeChannelDiscrete; 
00307                 d->m_cp = pos; m_pArray.InsertAt(d, l); }
00308 
00312     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00316     static  void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00317 
00323     virtual void Interpolate(int keyframe, float fraction);
00324 
00325     virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale);
00326 
00330     virtual void Reset();
00331     
00338     virtual void CalculatePos(int keyframe, float fraction, HPoint &res);
00339 
00340 protected:
00345     virtual void InterpolateCamera(HPoint &pos, bool simulate = false);
00346 
00351     virtual void InterpolateCamera2(HPoint &pos, bool simulate = false);
00352 
00357     virtual void CalculateAllTangents(); 
00358 };
00359 
00361 
00364 class MVO_API HBhvInterpolatorTrail : public HBhvInterpolatorPosition
00365 {
00366 public:
00372     HBhvInterpolatorTrail(HBhvAnimation *animation = 0, const char *name = 0);
00373     ~HBhvInterpolatorTrail();
00374 
00375 
00377     const char * GetType();
00378 
00385     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00386  
00390     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00394     static  void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00395 
00401     virtual void Interpolate(int keyframe, float fraction);
00405     virtual void Reset();
00406 
00410     void Init();
00411     void SetTrailType(TrailInterpolatorType tt) { m_TrailType = tt; }
00412     void SetTrailColor(const char *color) { strcpy(m_Color, color); }
00413     void SetTrailWeight(int weight) { m_Weight = weight; }
00414     void SetTrailStyle(const char *style) { strcpy(m_Style, style); }
00415     
00416     
00417 protected:
00418     TrailInterpolatorType m_TrailType; 
00419     char                m_Color[MVO_SMALL_BUFFER_SIZE]; 
00420     int                 m_Weight; 
00421     char                m_Style[MVO_SMALL_BUFFER_SIZE]; 
00422     HC_KEY              m_TrailSegment, m_trailKey;         
00423     int                 m_lastkeyframe;
00424     bool                m_initialized;
00425  
00426 };
00427 
00429 
00432 class MVO_API HBhvInterpolatorAxisRotate : public HBhvInterpolator
00433 {
00434 public:
00440     HBhvInterpolatorAxisRotate(HBhvAnimation *animation = 0, const char *name = 0);
00441 
00445     void SetAxis(float x, float y, float z) {m_axis.x = x; m_axis.y = y; m_axis.z = z; }
00446 
00450     void GetAxis (HPoint &axis) { axis = m_axis; }
00451 
00453     const char * GetType();
00454 
00461     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00462   
00469     void  Insert(float angle, int l = 0) { HKeyframeAxisRotation* linear = new HKeyframeAxisRotation; 
00470                 linear->m_angle = angle; m_pArray.InsertAt(linear, l); }
00477     void  Replace(float angle, int l) { HKeyframeAxisRotation * c = new HKeyframeAxisRotation; 
00478                 c->m_angle = angle; REPLACE_VARRAY(c, l); }
00479 
00483     static  void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00484 
00488     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00489 
00490 
00496     virtual void Interpolate(int keyframe, float fraction);
00497     virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale);
00498 
00499 protected:
00500     HPoint          m_axis;             
00502 };
00503 
00504 
00506     
00507 class MVO_API HBhvInterpolatorColor : public HBhvInterpolator
00508 {
00509 public:
00516     HBhvInterpolatorColor(HBhvAnimation *animation = 0, const char *name = 0);
00518     const char * GetType();
00519 
00526     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00527 
00535     void  Insert(HPoint pos, int l = 0) { HKeyframeChannelLinear* color = new HKeyframeChannelLinear; 
00536                 color->m_cp = pos; m_pArray.InsertAt(color, l); }
00544     void  Replace(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 
00545                 c->m_cp = pos; REPLACE_VARRAY(c, l); }
00546 
00550     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00551 
00555     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00556     
00560     void SetGeomType (const char *geomtype);
00561 
00563     char * GetGeomType () { return m_GeomType; }
00564 
00569     void SetColorComponent (const char *ColorComponent);
00570 
00572     char * GetColorComponent () { return m_ColorComponent; }
00573 
00579     virtual void Interpolate(int keyframe, float fraction);
00580 
00581 protected:
00582     char                m_ColorComponent[MVO_BUFFER_SIZE];  
00583     char                m_GeomType[MVO_BUFFER_SIZE];        
00585 };
00586 
00587 
00588 /*
00589 class MVO_API HBhvInterpolatorQuat : public HBhvInterpolator
00590 {
00591 public:
00592     HBhvInterpolatorQuat(const char *name = 0);
00593     const char * GetType();
00594 
00595     virtual HBhvInterpolatorInstance * CreateInstance(HBhvanimation *ainst);
00596     void  Insert(HQuat pos, int l) { HKeyframeQuatSlerp * rot = new HKeyframeQuatSlerp; 
00597                 rot->m_quat = pos; m_pArray.InsertAt(rot, l); }
00598     void  Replace(HQuat pos, int l) { HKeyframeQuatSlerp * c = new HKeyframeQuatSlerp; 
00599                 c->m_quat = pos; REPLACE_VARRAY(c, l); }
00600 
00601 };
00602 
00603 
00604 
00605 class MVO_API HBhvInterpolatorInstanceQuat : public HBhvInterpolatorInstance
00606 {
00607 public:
00608     HBhvInterpolatorInstanceQuat(HBhvInterpolatorQuat *ip, HBhvanimation *ainst) : HBhvInterpolatorInstance((HBhvInterpolator *)ip, ainst) {}
00609     virtual void Interpolate(int keyframe, float fraction);
00610  
00611 protected:
00612 
00613     virtual void InterpolateCamera(float *quat);
00614 
00615 };
00616 
00617 */
00618 
00619 
00620 
00622 
00623 class MVO_API HBhvInterpolatorScale : public HBhvInterpolator
00624 {
00625 public:
00626 
00633     virtual void CalculatePos(int keyframe, float fraction,  HPoint &res);
00634 
00635 
00640     virtual void CalculateAllTangents(); 
00641 
00645     virtual void Reset();
00646 
00652     HBhvInterpolatorScale(HBhvAnimation *animation = 0, const char *name = 0);
00653 
00655     const char * GetType();
00656 
00663     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00664 
00671     void  Insert(HPoint pos, int l = 0) { HKeyframeChannelLinear * scale = new HKeyframeChannelLinear; 
00672                 scale->m_cp = pos; m_pArray.InsertAt(scale, l); }
00679     void  Replace(HPoint pos, int l) { HKeyframeChannelLinear * c = new HKeyframeChannelLinear; 
00680                 c->m_cp = pos; REPLACE_VARRAY(c, l) }
00681 
00685     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00686 
00690     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00691 
00697     virtual void Interpolate(int keyframe, float fraction);
00698     void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale);
00699 
00700  
00701 protected:
00706     virtual void InterpolateCamera(HPoint &Scale, bool simulate = false);
00711     virtual void InterpolateCamera2(HPoint &Scale, bool simulate = false);
00712 
00713 };
00714 
00715  
00716 
00718 class MVO_API HBhvInterpolatorQuatSquad : public HBhvInterpolator
00719 {
00720 public:
00721 
00727     HBhvInterpolatorQuatSquad(HBhvAnimation *animation = 0, const char *name = 0);
00728 
00730     const char * GetType();
00731 
00738     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00739 
00746     void  Insert(HQuat q, int l = 0) { HKeyframeQuatSquad * rot = new HKeyframeQuatSquad; 
00747                 rot->m_quat = q; m_pArray.InsertAt(rot, l); }
00748     
00755     void  InsertLinear(HQuat q, int l = 0) { HKeyframeQuatSquad * rot = new HKeyframeQuatSquad; 
00756                 rot->m_quat = q; rot->m_bLinear = true; m_pArray.InsertAt(rot, l); }
00757 
00764     void  Replace(HQuat q, int l) { HKeyframeQuatSquad * c = new HKeyframeQuatSquad; 
00765                 c->m_quat = q; REPLACE_VARRAY(c, l); }
00772     void  ReplaceLinear(HQuat q, int l) { HKeyframeQuatSquad * c = new HKeyframeQuatSquad; 
00773                 c->m_quat = q; c->m_bLinear = true; REPLACE_VARRAY(c, l); }
00774 
00778     void AdjustQuaternions();
00779 
00783     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00784 
00788     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00789 
00795     virtual void Interpolate(int keyframe, float fraction);
00796     virtual void Evaluate(int keyframe, float fraction, bool &hasPos, HPoint &pos, bool &hasQuat, HQuat &quat, bool &hasScale, HPoint &scale);
00797 
00804     virtual void CalculateQuat(int keyframe, float fraction,  HQuat &res);
00805 
00806 
00807 
00808 protected:
00813     virtual void InterpolateCamera(HQuat &quat, bool simulate = false);
00814 
00819     virtual void InterpolateCamera2(HQuat &quat, bool simulate = false);
00820 
00821 };
00822 
00823  
00824 
00825 
00827 
00830 class MVO_API HBhvInterpolatorAttSwitch : public HBhvInterpolator
00831 {
00832 public:
00838     HBhvInterpolatorAttSwitch(HBhvAnimation *animation = 0, const char *name = 0);
00839 
00841     const char * GetType();
00842 
00849     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00850 
00857     void  Insert(const char * t, int l = 0) { HKeyframeString* AttSwitch = new HKeyframeString; 
00858                 AttSwitch->SetTarget(t); m_pArray.InsertAt(AttSwitch, l); }
00859 
00866     void  Replace(const char *spath, int l) { HKeyframeString * c = new HKeyframeString; 
00867                 c->SetTarget(spath); REPLACE_VARRAY(c, l) }
00868 
00872     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00873 
00877     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00878 
00884     virtual void Interpolate(int keyframe, float fraction);
00885  
00886 };
00887 
00888 
00889  
00890 
00891 
00892 
00893 
00895 class MVO_API HBhvInterpolatorVertexMorph : public HBhvInterpolator
00896 {
00897 public:
00898 
00904     HBhvInterpolatorVertexMorph(HBhvAnimation *animation = 0, const char *name = 0);
00905     ~HBhvInterpolatorVertexMorph();
00906 
00908     const char * GetType();
00909 
00916     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
00917 
00927     void  Insert(char * mident, int l = 0) { HKeyframeString* VertexMorph = new HKeyframeString; 
00928                 VertexMorph->SetTarget(mident); m_pArray.InsertAt(VertexMorph, l); }
00929     void  InsertDiscrete(char * mident, int l = 0) { HKeyframeString* VertexMorph = new HKeyframeString; 
00930                 VertexMorph->SetTarget(mident); VertexMorph->m_bDiscrete = true; m_pArray.InsertAt(VertexMorph, l); }
00931 
00941     void  Replace(char *t, int l) { HKeyframeString * c = new HKeyframeString; 
00942                 c->SetTarget(t); REPLACE_VARRAY(c, l) }
00943 
00947     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
00948 
00952     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
00953     
00959     virtual void Interpolate(int keyframe, float fraction);
00960 
00970     virtual void AddMorphData(HPoint *md, int pnum, HBaseModel *model, int pos = -1);
00971  
00973     VArray < void *> GetMorphData() { return m_pMorphData; }
00974 
00976     int GetMorphDataLength() { return m_MorphDataLength; }
00977 private:    
00978  
00979     void *GetUserInfo(char *target); 
00980     void * GetMorphData(int i); 
00982     VArray < void *>        m_pMorphData;       
00983     HC_KEY                  m_shelltarget;      
00984     int                     m_MorphDataLength; 
00985 };
00986 
00987 
00988 
00990 class MVO_API HBhvInterpolatorColorMorph : public HBhvInterpolator
00991 {
00992 public:
00993 
00999     HBhvInterpolatorColorMorph(HBhvAnimation *animation = 0, const char *name = 0);
01000     ~HBhvInterpolatorColorMorph();
01001 
01003     const char * GetType();
01004 
01011     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
01012 
01022     void  Insert(char * mident, int l = 0) { HKeyframeString* ColorMorph = new HKeyframeString; 
01023                 ColorMorph->SetTarget(mident); m_pArray.InsertAt(ColorMorph, l); }
01024     void  InsertDiscrete(char * mident, int l = 0) { HKeyframeString* ColorMorph = new HKeyframeString; 
01025                 ColorMorph->SetTarget(mident); ColorMorph->m_bDiscrete = true; m_pArray.InsertAt(ColorMorph, l); }
01035     void  Replace(char *t, int l) { HKeyframeString * c = new HKeyframeString; 
01036                 c->SetTarget(t); REPLACE_VARRAY(c, l) }
01037 
01041     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
01042 
01046     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
01047     
01053     virtual void Interpolate(int keyframe, float fraction);
01054  
01056     VArray < void *> GetMorphData() { return m_pMorphData; }
01057 
01059     int GetMorphDataLength() { return m_MorphDataLength; }
01071     virtual void AddMorphData(HPoint *md, int pnum, HBaseModel *model, int pos = -1);
01072 
01078     virtual void SetUseFIndex(bool tf);
01079 
01080 private:    
01081  
01082     void *GetUserInfo(char *target);
01083     void * GetMorphData(int i);
01084     VArray < void *>        m_pMorphData;       
01085      HC_KEY                 m_shelltarget;      
01086     int                     m_MorphDataLength;
01087     bool                    m_bUseFIndex;
01088 };
01089 
01090  
01091 
01092 
01094 class MVO_API HBhvInterpolatorSegSwitch : public HBhvInterpolator
01095 {
01096 public:
01097 
01103     HBhvInterpolatorSegSwitch(HBhvAnimation *animation = 0, const char *name = 0);
01104     ~HBhvInterpolatorSegSwitch();
01105 
01107     const char * GetType();
01108 
01115     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
01116 
01123     void  Insert(char * t, int l = 0) { HKeyframeString* SegSwitch = new HKeyframeString; 
01124                 SegSwitch->SetTarget(t); m_pArray.InsertAt(SegSwitch, l); }
01125 
01132     void  Replace(char *spath, int l) { HKeyframeString * c = new HKeyframeString; 
01133                 c->SetTarget(spath); REPLACE_VARRAY(c, l) }
01134 
01138     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
01139 
01143     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
01144 
01150     virtual void Interpolate(int keyframe, float fraction);
01151 
01155     virtual void Reset();
01156         
01157 };
01158 
01159 
01160 
01161 
01163 class MVO_API HBhvInterpolatorInstanceCreate : public HBhvInterpolator
01164 {
01165 public:
01166 
01172     HBhvInterpolatorInstanceCreate(HBhvAnimation *animation = 0, const char *name = 0);
01173     ~HBhvInterpolatorInstanceCreate();
01174 
01176     const char * GetType();
01177 
01184     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
01185 
01192     void  Insert(char * t, char *t2, char *t3, int l = 0) { HKeyframe3String* InstanceCreate = new HKeyframe3String; 
01193                 InstanceCreate->SetTarget(t,t2,t3); m_pArray.InsertAt(InstanceCreate, l); }
01194 
01201     void  Replace(char *t, char *t2, char *t3, int l) { HKeyframe3String * c = new HKeyframe3String; 
01202                 c->SetTarget(t,t2,t3); REPLACE_VARRAY(c, l) }
01203 
01207     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
01208 
01212     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
01213 
01219     virtual void Interpolate(int keyframe, float fraction);
01220 
01224     virtual void Reset();
01225 
01226     static void DeciperString(HBhvInterpolatorInstanceCreate *itp, char *text, HBaseModel *model, int &counter);
01227 
01228         
01229 };
01230 
01231 
01232 
01234 class MVO_API HBhvInterpolatorSegMove : public HBhvInterpolator
01235 {
01236 public:
01237 
01243     HBhvInterpolatorSegMove(HBhvAnimation *animation = 0, const char *name = 0);
01244     ~HBhvInterpolatorSegMove();
01245 
01247     const char * GetType();
01248 
01255     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
01256 
01263     void  Insert(char * t, int l = 0) { HKeyframeString* SegMove = new HKeyframeString; 
01264                 SegMove->SetTarget(t); m_pArray.InsertAt(SegMove, l); }
01265 
01272     void  Replace(char *spath, int l) { HKeyframeString * c = new HKeyframeString; 
01273                 c->SetTarget(spath); REPLACE_VARRAY(c, l) }
01274 
01278     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
01279 
01283     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
01284 
01290     virtual void Interpolate(int keyframe, float fraction);
01291 
01295     virtual void Reset();
01296         
01297 };
01298 
01299 
01300 
01301 
01303 class MVO_API HBhvInterpolatorMatrix : public HBhvInterpolator
01304 {
01305 public:
01306 
01312     HBhvInterpolatorMatrix(HBhvAnimation *animation = 0, const char *name = 0);
01313 
01315     const char * GetType();
01316 
01323     virtual HBhvInterpolator * CreateInstance(HBhvAnimation *ainst);
01324 
01331     void  Insert(float *mat, int l = 0) { HKeyframeMatrix * rot = new HKeyframeMatrix; 
01332                 for (int i=0;i<16;i++) rot->m_matrix[i] = mat[i]; m_pArray.InsertAt(rot, l); }
01333     
01334  
01335  
01342     void  Replace(float * q, int l) { HKeyframeMatrix * c = new HKeyframeMatrix; 
01343                     for (int i=0;i<16;i++) c->m_matrix[i] = q[i]; REPLACE_VARRAY(c, l); }
01344 
01345 
01349     virtual void Serialize(HUtilityXMLGenerator *xmlgen);
01350 
01354     static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
01355 
01361     virtual void Interpolate(int keyframe, float fraction);
01362 
01363  
01364 protected:
01365 
01366 };
01367 
01368  
01369 
01370 #ifdef H_PACK_8
01371 #pragma pack(pop)
01372 #endif
01373 
01374 #endif
01375 
01376 
01377