Make raycast benchmark default, to show improved raycasting performance.
Add rayTest to btBroadphaseInterface, and implement efficient version for btDbvtBroadphase to accelerate raycasting. btAxisSweep3, btSimpleBroadphase and btMultiSapBroadphase implement brute-force method (as before). For now, it is recommended to use btDbvtBroadphase for fastest world raycast.
This commit is contained in:
@@ -23,6 +23,11 @@ class btDispatcher;
|
||||
#include "btBroadphaseProxy.h"
|
||||
class btOverlappingPairCache;
|
||||
|
||||
struct btBroadphaseRayCallback
|
||||
{
|
||||
virtual bool process(const btBroadphaseProxy* proxy) = 0;
|
||||
};
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
|
||||
@@ -38,6 +43,8 @@ public:
|
||||
virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;
|
||||
virtual void getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;
|
||||
|
||||
virtual void rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback) = 0;
|
||||
|
||||
///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
|
||||
virtual void calculateOverlappingPairs(btDispatcher* dispatcher)=0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user