I have been looking into box2d (in java with libgdx) lately and have been trying to create my own custom bounce effect (I increase the Restitution
after the first bounce)
To do this as a test I simply checked the location of the object and waited for the first bounce.
But now I wanted to actually implement this and came across a problem: How to detect the collision of 2 specific object in box2d?
I found this tutorial:
box2d collision detection - but I am very reluctant to use that code. There must be a simpler and cleaner way to detect a collision between 2 objects (without having to set user data and checking all collisions with giant if()
conditions...)
Can anyone help me out? (assuming I am not just hopeful and there actually is a better way)