Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2008-09-26 01:04:41 +0400
committerErwin Coumans <blender@erwincoumans.com>2008-09-26 01:04:41 +0400
commit6732718ef1b7f212e2368cf237c08d72f13d06ab (patch)
tree69963a9ebe5f54795774f366a4cd99ca4519ac13 /source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
parent9a7c53782b63ea084782f9843150f74bcaa2cca3 (diff)
don't apply vertex transformation for deformable game soft bodies.
set a fake world transform for game soft bodies, based on center of the AABB, so visiblity and some game logic works. note: this world transform is not smooth.
Diffstat (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index f90df047ca0..7e684e5d5b7 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -672,11 +672,11 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj,
{
btSoftBody* m_softBody;
class RAS_MeshObject* m_pMeshObject;
- class BL_DeformableGameObject* m_gameobj;
+ class KX_GameObject* m_gameobj;
public:
- KX_SoftBodyDeformer(btSoftBody* softBody,RAS_MeshObject* pMeshObject,BL_DeformableGameObject* gameobj)
+ KX_SoftBodyDeformer(btSoftBody* softBody,RAS_MeshObject* pMeshObject,KX_GameObject* gameobj)
: m_softBody(softBody),
m_pMeshObject(pMeshObject),
m_gameobj(gameobj)
@@ -703,6 +703,8 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj,
// update the vertex in m_transverts
Update();
+
+
// The vertex cache can only be updated for this deformer:
// Duplicated objects with more than one ploymaterial (=multiple mesh slot per object)
// share the same mesh (=the same cache). As the rendering is done per polymaterial
@@ -748,6 +750,12 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj,
//printf("getReplica\n");
return 0;
}
+
+ virtual bool SkipVertexTransform()
+ {
+ return true;
+ }
+
protected:
//class RAS_MeshObject *m_pMesh;
};
@@ -1089,7 +1097,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
if (softBody && gameobj->GetMesh(0))//only the first mesh, if any
{
//should be a mesh then, so add a soft body deformer
- KX_SoftBodyDeformer* softbodyDeformer = new KX_SoftBodyDeformer(softBody, gameobj->GetMesh(0),(BL_DeformableGameObject*)gameobj);
+ KX_SoftBodyDeformer* softbodyDeformer = new KX_SoftBodyDeformer(softBody, gameobj->GetMesh(0),gameobj);
gameobj->SetDeformer(softbodyDeformer);
}