Add btBroadphaseInterface::aabbTest. btDbvtBroadphase and btAxisSweep3 should perform well, as long as the raycast accelerator is enabled.

This should fix the btCollisionWorld::contactTest(btCollisionObject* colObj, ContactResultCallback& resultCallback);

Thanks to Ola for the report!
This commit is contained in:
erwin.coumans
2010-02-11 18:25:50 +00:00
parent 7a175fb65e
commit bb8d1b11df
8 changed files with 115 additions and 7 deletions

View File

@@ -20,6 +20,8 @@ subject to the following restrictions:
#include "LinearMath/btVector3.h"
#include "LinearMath/btTransform.h"
#include "LinearMath/btMatrix3x3.h"
#include "LinearMath/btAabbUtil2.h"
#include <new>
extern int gOverlappingPairs;
@@ -166,6 +168,23 @@ void btSimpleBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo
}
void btSimpleBroadphase::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
{
for (int i=0; i <= m_LastHandleIndex; i++)
{
btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
if(!proxy->m_clientObject)
{
continue;
}
if (TestAabbAgainstAabb2(aabbMin,aabbMax,proxy->m_aabbMin,proxy->m_aabbMax))
{
callback.process(proxy);
}
}
}