fixes in btCollisionWorld and Raytracer, to allow 'all hits' (work in progress)

This commit is contained in:
ejcoumans
2007-12-11 03:00:53 +00:00
parent c1c01ff1a0
commit a537fb68b6
5 changed files with 286 additions and 135 deletions

View File

@@ -17,9 +17,20 @@ subject to the following restrictions:
#include "DemoApplication.h"
class btDefaultCollisionConfiguration;
class btCollisionDispatcher;
class btAxisSweep3;
class btCollisionWorld;
///Raytracer shows the inner working of the ray casting, using ray tracing rendering into a texture.
class Raytracer : public DemoApplication
{
btDefaultCollisionConfiguration* m_collisionConfiguration;
btCollisionDispatcher* m_dispatcher;
btAxisSweep3* m_overlappingPairCache;
btCollisionWorld* m_collisionWorld;
public:
void initPhysics();
@@ -30,6 +41,15 @@ class Raytracer : public DemoApplication
virtual void displayCallback();
///worldRaytest performs a ray versus all objects in a collision world, returning true is a hit is found (filling in worldNormal and worldHitPoint)
bool worldRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint);
///singleObjectRaytest performs a ray versus one collision shape, returning true is a hit is found (filling in worldNormal and worldHitPoint)
bool singleObjectRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint);
///lowlevelRaytest performs a ray versus convex shape, returning true is a hit is found (filling in worldNormal and worldHitPoint)
bool lowlevelRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint);
static DemoApplication* Create()
{
Raytracer* demo = new Raytracer();