From c5112e68e5a3f088199a06b57c7664b27d18a110 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 28 Oct 2008 05:51:32 +0000 Subject: [PATCH] make sure the btDbvtBroadphase doesn't add/remove any pairs, use the btNullPairCache --- src/BulletCollision/BroadphaseCollision/btAxisSweep3.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h index 88972355d..c7a23ff05 100644 --- a/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h +++ b/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h @@ -96,6 +96,7 @@ protected: ///additional dynamic aabb structure, used to accelerate ray cast queries. ///can be disabled using a optional argument in the constructor btDbvtBroadphase* m_raycastAccelerator; + btOverlappingPairCache* m_nullPairCache; // allocation/deallocation @@ -338,7 +339,8 @@ m_raycastAccelerator(0) if (!disableRaycastAccelerator) { - m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase();//m_pairCache); + m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache(); + m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache); m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs } @@ -404,6 +406,8 @@ btAxisSweep3Internal::~btAxisSweep3Internal() { if (m_raycastAccelerator) { + m_nullPairCache->~btOverlappingPairCache(); + btAlignedFree(m_nullPairCache); m_raycastAccelerator->~btDbvtBroadphase(); btAlignedFree (m_raycastAccelerator); }