Collision callbacks vs iterating [SOLVED]

Post Reply
fredericvo
Posts: 1
Joined: Sat Aug 09, 2014 4:57 pm

Collision callbacks vs iterating [SOLVED]

Post by fredericvo »

Hello,

I completed this tutorial: https://www.youtube.com/watch?v=YweNArzAHs4
and I got the logic but since he is using globals and old-style opengl I wanted to integrate bullet within an OOP framework and DX11.
My question is simple but maybe silly, of the classes that can be overridden which one is identical (called under the exact same circumstances and being fed the same parameters) to gContactAddedCallback?
there seems to be none and it is problematic as I don't want to use globals to give myself access to my other subsystems during collision processing. Example: play a loud bang when a sphere collides with a wall. I would need access to my soundmanager.

Is iterating after stepping the world a fast way? The manual does start with this line: "he best way to determine if collisions happened between existing objects in the world, is to iterate over all contact manifolds." but it contradicts itself in the next section with "A more efficient way is to use ghost objects"
I didn't get how to use those though.

EDIT
OK I figured it out from this post: http://www.bulletphysics.org/Bullet/php ... f=9&t=3997
Iterating over all manifolds after stepping seems to be the answer as suggested by Erwin Coumans himself.
Post Reply