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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user