Hello,
I'm working on a top-down shooter.
Where:
-Bullets are Kinematic bodies.
-Players are Dynamic bodies.
-Walls are Static bodies.
I'm able to detect collisions between the bullet and other players just fine. The collisions are detected by setting a ContactListener on the world that gets the Fixture user data and makes a callback to the Players so they can play a .wav file that says "Ouch! Ye Hit me". However, I was scratching my head for a long time when I couldn't get it to work with walls. I re-read the manual and found that collisions between static and dynamic bodies won't work. Bummer.
In summary, how would you handle or work around this situation:
I have a wall backed by a Static body.
I have a bullet backed by a Kinematic body.
I only need to know the moment of impact and the fixtures (or bodies) involved.
I don't need (nor want) Box2D to handle anything in terms of collision resolution between the two objects.
Also, I'd really like to be able to keep the body types as they are if possible, since it makes sense as it is. If only I could be notified of their collisions some how.
Thanke.
I'm working on a top-down shooter.
Where:
-Bullets are Kinematic bodies.
-Players are Dynamic bodies.
-Walls are Static bodies.
I'm able to detect collisions between the bullet and other players just fine. The collisions are detected by setting a ContactListener on the world that gets the Fixture user data and makes a callback to the Players so they can play a .wav file that says "Ouch! Ye Hit me". However, I was scratching my head for a long time when I couldn't get it to work with walls. I re-read the manual and found that collisions between static and dynamic bodies won't work. Bummer.
In summary, how would you handle or work around this situation:
I have a wall backed by a Static body.
I have a bullet backed by a Kinematic body.
I only need to know the moment of impact and the fixtures (or bodies) involved.
I don't need (nor want) Box2D to handle anything in terms of collision resolution between the two objects.
Also, I'd really like to be able to keep the body types as they are if possible, since it makes sense as it is. If only I could be notified of their collisions some how.
Thanke.