diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-26 02:57:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-26 02:57:29 +0400 |
commit | e9ca43521f99c6b9baf6d9278f85323086fcade2 (patch) | |
tree | 58ab9f5afe70d77fa04f920fa2c55adb34cd2990 /source/gameengine/Converter | |
parent | 1c00eacca2b084d7189de33cb75e8612cb542030 (diff) |
BGE Physics
Add support back for reinstancePhysics mesh, a frequently requested feature in the BGE forums.
from what I can tell Sumo supported this but bullet never did.
Currently only accessible via python at the moment.
- rigid body, dynamic, static types work.
- instanced physics meshes are modified too.
- compound shapes are not supported.
Physics mesh can be re-instanced from...
* shape keys & armature deformations
* subsurf (any other modifiers too)
* RAS_TexVert's (can be modified from python)
Moved the reinstancePhysicsMesh functions from RAS_MeshObject into KX_GameObject since the physics data is stored here.
video and blend file demo.
http://www.graphicall.org/ftp/ideasman42/reinstance.ogv
http://www.graphicall.org/ftp/ideasman42/reinstance_demo.blend
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 5 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_MeshDeformer.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 385301b1105..caa76263b25 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1040,7 +1040,10 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* layer.face++; } } - meshobj->m_sharedvertex_map.clear(); + // keep meshobj->m_sharedvertex_map for reinstance phys mesh. + // 2.49a and before it did: meshobj->m_sharedvertex_map.clear(); + // but this didnt save much ram. - Campbell + meshobj->EndConversion(); // pre calculate texture generation for(list<RAS_MeshMaterial>::iterator mit = meshobj->GetFirstMaterial(); diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 99ae5f9dea0..289826e45e7 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -68,6 +68,8 @@ public: virtual RAS_Deformer* GetReplica(){return NULL;}; virtual void ProcessReplica(); struct Mesh* GetMesh() { return m_bmesh; }; + virtual class RAS_MeshObject* GetRasMesh() { return (RAS_MeshObject*)m_pMeshObject; }; + virtual float (* GetTransVerts(int *tot))[3] { *tot= m_tvtot; return m_transverts; } // virtual void InitDeform(double time){}; protected: |