diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-03-23 09:00:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-03-23 09:00:21 +0300 |
commit | 4a078765623b72641164a25291e925bb4e64bcba (patch) | |
tree | 201f0c96b61d968eaead5032719bc43d58ffac83 /source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | |
parent | bd13f302240ec3347df73cab9ff06e4845223923 (diff) |
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.
Diffstat (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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 |