Hi, I'm writing a pinball game, and I have this editor mode, where the physics are supposed to be on pause, but you can still add objects (static bodies), and most importantly, move them around. I want the user to be able to create an object and then move it around (probably using the mouse joint, or I'll directly set the coordinates if that doesn't work); the static body will become red if it overlaps another static body, or is outside pre-defined boundaries. When it's not red, the user can click to place the body permanently.
I'm gonna slightly modify b2ContactManager.cpp so that the b2ContactFilter::shouldCollide() method gets called even when two static bodies overlap. This way with a custom shouldCollide() method I can react at the right time and do my "red" effect.
However, since I don't want any dynamic bodies I have around to be moving in edit mode, I was wondering if it was possible to do collision detection without stepping the world. Is it possible to call only the part of the code which updates the collisions? I don't mind if there are some slight modifications to do to Box2D to achieve that, I'd just like to be pointed to the right part of the code, and to be notified about what is very dependent or linked to that code.
Thanks! And special thanks to Erin for this wonderful physics engine.
I'm gonna slightly modify b2ContactManager.cpp so that the b2ContactFilter::shouldCollide() method gets called even when two static bodies overlap. This way with a custom shouldCollide() method I can react at the right time and do my "red" effect.
However, since I don't want any dynamic bodies I have around to be moving in edit mode, I was wondering if it was possible to do collision detection without stepping the world. Is it possible to call only the part of the code which updates the collisions? I don't mind if there are some slight modifications to do to Box2D to achieve that, I'd just like to be pointed to the right part of the code, and to be notified about what is very dependent or linked to that code.
Thanks! And special thanks to Erin for this wonderful physics engine.