From e9ca43521f99c6b9baf6d9278f85323086fcade2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Jul 2009 22:57:29 +0000 Subject: 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 --- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/gameengine/Rasterizer/RAS_MeshObject.cpp') diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 1dfcb0c512d..0ae6ad9d7ea 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -382,6 +382,13 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, return NULL; } +const float* RAS_MeshObject::GetVertexLocation(unsigned int orig_index) +{ + vector& sharedmap = m_sharedvertex_map[orig_index]; + vector::iterator it= sharedmap.begin(); + return it->m_darray->m_vertex[it->m_offset].getXYZ(); +} + void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* deformer) { list::iterator it; -- cgit v1.2.3