I'm prototyping a game idea and seek to achieve the functionality I need by these two different means - either from inside of box2d by using one sided contacts or by handling player body with my own collision reaction. These are two solutions I am exploring.
Quote:
For the first one you can write some code to flag the contact as one-sided, then in the contact solver you would set the inverse mass and inertia to zero for the immovable body.
I found this solution in the forum. It would mean modifying the source, or does box2d provide some functionality for doing that from the outside?
I would make a flag on a contact alongside sensor/continuous/touching flags in b2contact?
Then in b2ContactSolver, every time invmass appears, check for this flag and make zero if this flag appears?
The same with inertia?
How would I make sure that all the contacts generated with player body would have this specyfic flag?
Quote:
For the second one, you would not use anything in the dynamics folder and just use the structures and algorithms in the collision folder. By design, nothing in the collision folder depends on anything in the dynamics folder.
The point is box2d collision reaction fits fine for most of bodies in my game, but I would like to process the player body differently. Get the contacts from the "dummy" player body, but do not execute them inside the box2d step and process them myself instead.
Hope that's clear enough

.