Collision without the Physics

Hello,

How much work would it be to enable collision detection for Kinematic vs Kinematic?

Basically, I'd like to be able to use the Box2D's collision library, without being forced to use the physics library. Or, at least, have the option of doing that for the majority of the objects in my game.

Yes, I realise it's a physics engine, but it's also something of a de-facto standard in generic 2D game engines. It would be really, really nice if I could just add Colliders to things and get callbacks when they touch, but I'm guessing it would be easier to require that they be kinematic.

A bit of background: I just finished writing an Android port of Robotron and had to spend a lot of time fighting with the physics because I needed to add dynamic Rigid Bodies to (almost) everything in order to implement the collision rules correctly. This was doubly frustrating because it's now wasting a lot of CPU cycles running a simulation that I don't want.

Thanks,

Andrew.
In the function b2Body::ShouldCollide there is a check to make sure that at least one body is dynamic - you could try commenting that out.
That would most likely give you problems when a contact occurs where one body is not dynamic. You could go around commenting out everywhere that gives you trouble, or you could also try altering the main solve function so that no collision response is even done at all. I have not tried myself, but the first thing I would do is go into b2Island::Solve and b2Island::SolveTOI and comment out everything except for the section prefixed with "Integrate velocities and apply damping...", the section prefixed "Copy state buffers back to the bodies", and the call to Report.

Original thread: https://box2d.org/forum/viewtopic.php?t=9733