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.
This commit is contained in:
Sergej Reich 2014-07-03 21:40:04 +02:00
parent 6cc78927a3
commit 81c3fc9726

@ -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);