Dispatch error when using contactPairTest

Bumblebee
Posts: 3
Joined: Sat Aug 14, 2010 3:05 am

Dispatch error when using contactPairTest

Post by Bumblebee »

Hi all, I am new to the bullet physics engine and have trouble understanding it. Essentially, my question in this post is: how do I properly use the contactPairTest() function?

Here is the problem:

When I use the following function call in my game loop:

Code: Select all

world->contactPairTest(collObj1, collObj1, *collisionCall);
my program crashes and XCode highlights return m_dispatcher1; line inside btCollisionWorld.h. This happens because of a bad pointer, I know.

Now, here are the declarations I make. These are global variables:

Code: Select all

btCollisionWorld* world;
btCollisionWorld::ContactResultCallback* collisionCall;
I know that my world pointer is pointing to nothing, and I am guessing that thats why the contactPairTest() has a problem when calling getDispatcher(). And, I also guess that bullet creates an internal btCollisionWorld where it calculates the physics on the objects in that "world". So the question is, how do I make my "world" variable point to that internal collision world?