diff --git a/src/BulletCollision/BroadphaseCollision/btDbvt.h b/src/BulletCollision/BroadphaseCollision/btDbvt.h index d733fedf2..061b5030f 100644 --- a/src/BulletCollision/BroadphaseCollision/btDbvt.h +++ b/src/BulletCollision/BroadphaseCollision/btDbvt.h @@ -961,8 +961,8 @@ inline void btDbvt::rayTestInternal( const btDbvtNode* root, do { const btDbvtNode* node=stack[--depth]; - bounds[0] = node->volume.Mins()+aabbMin; - bounds[1] = node->volume.Maxs()+aabbMax; + bounds[0] = node->volume.Mins()-aabbMax; + bounds[1] = node->volume.Maxs()-aabbMin; btScalar tmin=1.f,lambda_min=0.f; unsigned int result1=false; result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max); diff --git a/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp b/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp index edd890ebb..9a35242fb 100644 --- a/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp +++ b/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp @@ -493,8 +493,8 @@ void btQuantizedBvh::walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCall bounds[0] = rootNode->m_aabbMinOrg; bounds[1] = rootNode->m_aabbMaxOrg; /* Add box cast extents */ - bounds[0] += aabbMin; - bounds[1] += aabbMax; + bounds[0] -= aabbMax; + bounds[1] -= aabbMin; aabbOverlap = TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg); //perhaps profile if it is worth doing the aabbOverlap test first @@ -617,8 +617,8 @@ void btQuantizedBvh::walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* bounds[0] = unQuantize(rootNode->m_quantizedAabbMin); bounds[1] = unQuantize(rootNode->m_quantizedAabbMax); /* Add box cast extents */ - bounds[0] += aabbMin; - bounds[1] += aabbMax; + bounds[0] -= aabbMax; + bounds[1] -= aabbMin; btVector3 normal; #if 0 bool ra2 = btRayAabb2 (raySource, rayDirection, sign, bounds, param, 0.0, lambda_max);