You don't even need to use all of what is in the demo for requirements like that.
But to answer your question
Code: Select all
btCollisionWorld::ContactResultCallback::addSingleResult(...)
This adds a result to a Contact result structure which you can get information from later.
The manifold point is where the contact happens (I believe). Aside from the bodies, the other parameters are mainly for internal use. You are only supposed to read these as a user, not write them.
Code: Select all
btCollisionWorld::ContactResultCallback::needsCollision(...)
This will tell whether or not it is colliding, so for a dynamics world, it will know that it needs to process that there is a collision taking place which should be handled.
A broadphase proxy is what calculates if further collision detection is required, that is why it is a parameter.
gokoon wrote:
I can understand what a callback is, I just don't really get what are those function's arguments, and the doc doesn't tell much. I guess that in
Code: Select all
virtual btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1)
colobj are the object which collided, index are their position in CollisionWorld::getCollisionObjectArray(), but what about partId ? I'd like to know if I'm right about the index, since it help for how I manage my object in Ogre3D.
I see many #ifdef and I'm a little confused when reading CollisionInterfaceDemo.cpp, I'm having a hard time figuring things out.
Thanks again in advance for reading this and providing help !
basically comments out the code they did, which can be re-enabled easily by just switching the 0 to a 1.
The compiler just skips over those sections.
Code: Select all
#ifndef TEST_NOT_ADDING_OBJECTS_TO_WORLD
can be read as
Code: Select all
if NOT defined TEST_NOT_ADDING_OBJECTS_TO_WORLD then ...
It means that when the compiler doesn't know anything about TEST_NOT_ADDING_OBJECTS_TO_WORLD existing, use the following code.
Its likely just parts left over by the developer as they were writing the program. Ultimately trust what cmake or the make file tells the compiler to use regarding these definitions.