some rayTest improvements in btDbvt::rayTestInternal, it avoids/reduces memory allocations during stack allocation (by sharing a persistent m_stack)

and rayTestInternal re-uses precomputed invRayDirection/signs.
also did some performance comparison with different ray-AABB test, from 
http://jgt.akpeters.com/papers/EisemannEtAl07/

In short: it is faster, but it is not clear how to cull ray segments using ray slopes: when rays starts inside the AABB, we get a negative t value, but negatives also get false t-values...
This commit is contained in:
erwin.coumans
2008-10-16 20:00:47 +00:00
parent 60ce828419
commit 675c45f42d
4 changed files with 203 additions and 27 deletions

View File

@@ -21,10 +21,23 @@ subject to the following restrictions:
struct btDispatcherInfo;
class btDispatcher;
#include "btBroadphaseProxy.h"
#include "LinearMath/btAabbUtil2.h"//for fast ray-slope algorithm
class btOverlappingPairCache;
struct btBroadphaseRayCallback
{
///added some cached data to accelerate ray-AABB tests
///m_ray is used to accerate ray-AABB tests, see btDbvt.h, when TEST_RAY_SLOPES is enabled in LinearMath/btAabbUtil2.h
btRaySlope m_ray;
///otherwise this data is used to accelerate ray-AABB tests
btVector3 m_rayDirectionInverse;
unsigned int m_signs[3];
btScalar m_lambda_max;
virtual ~btBroadphaseRayCallback() {}
virtual bool process(const btBroadphaseProxy* proxy) = 0;
};