From 81c3fc9726c64f58ee2976b732fb2701c768f6de Mon Sep 17 00:00:00 2001 From: Sergej Reich Date: Thu, 3 Jul 2014 21:40:04 +0200 Subject: cloth: Speed up collision detection Noticed this while looking into something else. The change is trivial, but gives a rather nice preformance improvement, so why not. Theres's actually a lot one can do to improve collision performance if one wanted to, the triangle-triangle check alone has a lot of room for improvement. --- extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp b/extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp index 893453bddaf..21f0aa93220 100644 --- a/extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp +++ b/extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp @@ -32,6 +32,7 @@ subject to the following restrictions: #include "LinearMath/btTransform.h" #include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h" #include "BulletCollision/CollisionShapes/btTriangleShape.h" +#include "BulletCollision/Gimpact/btTriangleShapeEx.h" #include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h" #include "BulletCollision/NarrowPhaseCollision/btPointCollector.h" @@ -341,12 +342,12 @@ void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation) double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3]) { btVector3 vp(p1[0], p1[1], p1[2]); - btTriangleShape trishapeA(vp, + btTriangleShapeEx trishapeA(vp, btVector3(p2[0], p2[1], p2[2]), btVector3(p3[0], p3[1], p3[2])); trishapeA.setMargin(0.000001f); btVector3 vq(q1[0], q1[1], q1[2]); - btTriangleShape trishapeB(vq, + btTriangleShapeEx trishapeB(vq, btVector3(q2[0], q2[1], q2[2]), btVector3(q3[0], q3[1], q3[2])); trishapeB.setMargin(0.000001f); -- cgit v1.2.3