From 4a078765623b72641164a25291e925bb4e64bcba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Mar 2009 06:00:21 +0000 Subject: Speedup for bullet physics mesh conversion Was adding each face with a remove doubles option that made conversion increasingly slower for larger meshes, this would often hang blender when starting with the BGE with larger meshes. Replace btTriangleMesh()->addTriangle() with btTriangleIndexVertexArray() YoFrankie level_1_home.blend starts a third faster, level_nut about twice as fast. - previous commit was also incorrect using the original meshes vert locations rather then the vert locations that came from the derived mesh. - Softbody is relying on removing doubles at 0.01 to give stable results, this no longer works but seems a bit dodgy anyway. Maybe some post-processing filter could fix up a mesh for bullet softbody. --- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp') diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 602486e0017..9b2d7403974 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -881,6 +881,9 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, { shapeInfo->SetMesh(meshobj, false,false); } + + // Note! since 2.48a bullet mesh conversion has been sped up not to remove doubles + // if softbody needs this there should be some post processing filter for softbody meshes. if (objprop->m_softbody) shapeInfo->setVertexWeldingThreshold(0.01f); //todo: expose this to the UI -- cgit v1.2.3