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:
@@ -229,14 +229,22 @@ void btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo,
|
||||
|
||||
BroadphaseRayTester callback(rayCallback);
|
||||
|
||||
m_sets[0].rayTest( m_sets[0].m_root,
|
||||
m_sets[0].rayTestInternal( m_sets[0].m_root,
|
||||
rayFrom,
|
||||
rayTo,
|
||||
rayCallback.m_rayDirectionInverse,
|
||||
rayCallback.m_signs,
|
||||
rayCallback.m_lambda_max,
|
||||
rayCallback.m_ray,
|
||||
callback);
|
||||
|
||||
m_sets[1].rayTest( m_sets[1].m_root,
|
||||
m_sets[1].rayTestInternal( m_sets[1].m_root,
|
||||
rayFrom,
|
||||
rayTo,
|
||||
rayCallback.m_rayDirectionInverse,
|
||||
rayCallback.m_signs,
|
||||
rayCallback.m_lambda_max,
|
||||
rayCallback.m_ray,
|
||||
callback);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user