Removed ray-AABB slopes code again, we are not using it and it is archived in Subversion repo now.
This commit is contained in:
@@ -21,7 +21,6 @@ subject to the following restrictions:
|
|||||||
struct btDispatcherInfo;
|
struct btDispatcherInfo;
|
||||||
class btDispatcher;
|
class btDispatcher;
|
||||||
#include "btBroadphaseProxy.h"
|
#include "btBroadphaseProxy.h"
|
||||||
#include "LinearMath/btAabbUtil2.h"//for fast ray-slope algorithm
|
|
||||||
|
|
||||||
class btOverlappingPairCache;
|
class btOverlappingPairCache;
|
||||||
|
|
||||||
@@ -30,10 +29,6 @@ class btOverlappingPairCache;
|
|||||||
struct btBroadphaseRayCallback
|
struct btBroadphaseRayCallback
|
||||||
{
|
{
|
||||||
///added some cached data to accelerate ray-AABB tests
|
///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;
|
btVector3 m_rayDirectionInverse;
|
||||||
unsigned int m_signs[3];
|
unsigned int m_signs[3];
|
||||||
btScalar m_lambda_max;
|
btScalar m_lambda_max;
|
||||||
|
|||||||
@@ -333,7 +333,6 @@ struct btDbvt
|
|||||||
const btVector3& rayDirectionInverse,
|
const btVector3& rayDirectionInverse,
|
||||||
unsigned int signs[3],
|
unsigned int signs[3],
|
||||||
btScalar lambda_max,
|
btScalar lambda_max,
|
||||||
const btRaySlope& raySlope,
|
|
||||||
DBVT_IPOLICY) const;
|
DBVT_IPOLICY) const;
|
||||||
|
|
||||||
DBVT_PREFIX
|
DBVT_PREFIX
|
||||||
@@ -872,7 +871,6 @@ inline void btDbvt::rayTestInternal( const btDbvtNode* root,
|
|||||||
const btVector3& rayDirectionInverse,
|
const btVector3& rayDirectionInverse,
|
||||||
unsigned int signs[3],
|
unsigned int signs[3],
|
||||||
btScalar lambda_max,
|
btScalar lambda_max,
|
||||||
const btRaySlope& raySlope,
|
|
||||||
DBVT_IPOLICY) const
|
DBVT_IPOLICY) const
|
||||||
{
|
{
|
||||||
DBVT_CHECKTYPE
|
DBVT_CHECKTYPE
|
||||||
@@ -889,66 +887,11 @@ inline void btDbvt::rayTestInternal( const btDbvtNode* root,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
const btDbvtNode* node=m_stack[--depth];
|
const btDbvtNode* node=m_stack[--depth];
|
||||||
//m_stack.pop_back();
|
|
||||||
|
|
||||||
bounds[0] = node->volume.Mins();
|
bounds[0] = node->volume.Mins();
|
||||||
bounds[1] = node->volume.Maxs();
|
bounds[1] = node->volume.Maxs();
|
||||||
|
|
||||||
btScalar tmin=1.f,lambda_min=0.f;
|
btScalar tmin=1.f,lambda_min=0.f;
|
||||||
unsigned int result1=false;
|
unsigned int result1=false;
|
||||||
|
|
||||||
/// A comparison test for ray-AABB test:
|
|
||||||
/// "Fast Ray/Axis-Aligned Bounding Box Overlap Tests using Ray Slopes"
|
|
||||||
/// http://jgt.akpeters.com/papers/EisemannEtAl07/
|
|
||||||
/// The algorithm seems indeed a bit faster, but the code complexity doesn't make it attractive for future optimizations.
|
|
||||||
///
|
|
||||||
/// Enable/disable #define TEST_RAY_SLOPES in btBroadphaseInterface.h
|
|
||||||
///
|
|
||||||
#ifndef TEST_RAY_SLOPES
|
|
||||||
result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
|
result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
|
||||||
#else
|
|
||||||
btScalar t=1.f;
|
|
||||||
btAaboxSlope aabbSlope;
|
|
||||||
aabbSlope.x0 = node->volume.Mins().getX();
|
|
||||||
aabbSlope.y0 = node->volume.Mins().getY();
|
|
||||||
aabbSlope.z0 = node->volume.Mins().getZ();
|
|
||||||
|
|
||||||
aabbSlope.x1 = node->volume.Maxs().getX();
|
|
||||||
aabbSlope.y1 = node->volume.Maxs().getY();
|
|
||||||
aabbSlope.z1 = node->volume.Maxs().getZ();
|
|
||||||
|
|
||||||
|
|
||||||
//ray starts or ends within AABB
|
|
||||||
|
|
||||||
// if (!result1)
|
|
||||||
// if (TestPointAgainstAabb2(node->volume.Mins(),node->volume.Maxs(),rayTo))
|
|
||||||
// result1=true;
|
|
||||||
// if (!result1)
|
|
||||||
|
|
||||||
result1 = btRaySlopeAabb(&raySlope,&aabbSlope,&t);
|
|
||||||
|
|
||||||
if (result1)
|
|
||||||
{
|
|
||||||
//if fromRay is inside the AABB, t can still be negative, so we need an additional check.
|
|
||||||
if (t>1.0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (t<0.)
|
|
||||||
{
|
|
||||||
if (!TestPointAgainstAabb2(node->volume.Mins(),node->volume.Maxs(),rayFrom))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif //USE_ORIGINAL_RAY_AABB
|
|
||||||
|
|
||||||
#ifdef COMPARE_BTRAY_AABB2//slower version using in/outcodes
|
|
||||||
btScalar param=1.f;
|
|
||||||
bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);
|
|
||||||
btAssert(result1 == result2);
|
|
||||||
#endif //TEST_BTRAY_AABB2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(result1)
|
if(result1)
|
||||||
{
|
{
|
||||||
if(node->isinternal())
|
if(node->isinternal())
|
||||||
@@ -1004,7 +947,6 @@ inline void btDbvt::rayTest( const btDbvtNode* root,
|
|||||||
btVector3 bounds[2];
|
btVector3 bounds[2];
|
||||||
do {
|
do {
|
||||||
const btDbvtNode* node=stack[--depth];
|
const btDbvtNode* node=stack[--depth];
|
||||||
//m_stack.pop_back();
|
|
||||||
|
|
||||||
bounds[0] = node->volume.Mins();
|
bounds[0] = node->volume.Mins();
|
||||||
bounds[1] = node->volume.Maxs();
|
bounds[1] = node->volume.Maxs();
|
||||||
@@ -1012,11 +954,11 @@ inline void btDbvt::rayTest( const btDbvtNode* root,
|
|||||||
btScalar tmin=1.f,lambda_min=0.f;
|
btScalar tmin=1.f,lambda_min=0.f;
|
||||||
unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
|
unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
|
||||||
|
|
||||||
#ifdef COMPARE_BTRAY_AABB2
|
#ifdef COMPARE_BTRAY_AABB2
|
||||||
btScalar param=1.f;
|
btScalar param=1.f;
|
||||||
bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);
|
bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);
|
||||||
btAssert(result1 == result2);
|
btAssert(result1 == result2);
|
||||||
#endif //TEST_BTRAY_AABB2
|
#endif //TEST_BTRAY_AABB2
|
||||||
|
|
||||||
if(result1)
|
if(result1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ void btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo,
|
|||||||
rayCallback.m_rayDirectionInverse,
|
rayCallback.m_rayDirectionInverse,
|
||||||
rayCallback.m_signs,
|
rayCallback.m_signs,
|
||||||
rayCallback.m_lambda_max,
|
rayCallback.m_lambda_max,
|
||||||
rayCallback.m_ray,
|
|
||||||
callback);
|
callback);
|
||||||
|
|
||||||
m_sets[1].rayTestInternal( m_sets[1].m_root,
|
m_sets[1].rayTestInternal( m_sets[1].m_root,
|
||||||
@@ -244,7 +243,6 @@ void btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo,
|
|||||||
rayCallback.m_rayDirectionInverse,
|
rayCallback.m_rayDirectionInverse,
|
||||||
rayCallback.m_signs,
|
rayCallback.m_signs,
|
||||||
rayCallback.m_lambda_max,
|
rayCallback.m_lambda_max,
|
||||||
rayCallback.m_ray,
|
|
||||||
callback);
|
callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user