Merged 15170:15635 from trunk (no conflicts or even merges)
[blender.git] / source / gameengine / Converter / BL_DeformableGameObject.h
index d943cc7388a57c3784fc5eb460e38b1bde34cb41..57a404ad72b64ac6906173c325f8087c3c4f36af 100644 (file)
 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
 #endif //WIN32
 
+#include "DNA_mesh_types.h"
 #include "KX_GameObject.h"
-#include "RAS_Deformer.h"
+#include "BL_MeshDeformer.h"
+#include <vector>
+
+class BL_ShapeActionActuator;
+struct Key;
 
 class BL_DeformableGameObject : public KX_GameObject  
 {
 public:
 
-       RAS_Deformer            *m_pDeformer;   
        CValue*         GetReplica();
+
+       double GetLastFrame ()
+       {
+               return m_lastframe;
+       }
+       Object* GetBlendObject()
+       {
+               return m_blendobj;
+       }
        virtual void Relink(GEN_Map<GEN_HashedPtr, void*>*map)
        {
                if (m_pDeformer)
@@ -50,13 +63,32 @@ public:
        };
        void ProcessReplica(KX_GameObject* replica);
 
-       BL_DeformableGameObject(void* sgReplicationInfo, SG_Callbacks callbacks) :
+       BL_DeformableGameObject(Object* blendobj, void* sgReplicationInfo, SG_Callbacks callbacks) :
                KX_GameObject(sgReplicationInfo,callbacks),
-               m_pDeformer(NULL)
+               m_pDeformer(NULL),
+               m_activeAct(NULL),
+               m_lastframe(0.),
+               m_blendobj(blendobj),
+               m_activePriority(9999)
        {
                m_isDeformable = true;
        };
        virtual ~BL_DeformableGameObject();
+       bool SetActiveAction(class BL_ShapeActionActuator *act, short priority, double curtime);
+
+       bool GetShape(vector<float> &shape);
+       Key* GetKey()
+       {
+               return (m_pDeformer) ? ((BL_MeshDeformer*)m_pDeformer)->GetMesh()->key : NULL;
+       }
+       
+public:
+       RAS_Deformer            *m_pDeformer;   
+protected:     
+       class BL_ShapeActionActuator *m_activeAct;
+       double          m_lastframe;
+       Object*         m_blendobj;
+       short           m_activePriority;
 
 };