Object rebound properties

Hi ,

I would like to know how odejava calculates the velocity of an object after a contact with an other surface because in my app, I have a tennis ball that bounces on a surface and it’ s boucing like it was a solid object with low bouncing properties…

Do I have to adjust the velocity by hand to simulate a tennis ball bouncing on a tennis court?



When you say low bouncing properties do you mean low elasticity? I don’t think you can simulate the different levels of elasticity at the moment but I could be wrong. At least I haven’t seen where you would set it.

Hopfully when Per or DP read your posts they will have more concrete answers for you.

ContactAction does all that…

Just play around with the values till you get something you want. Below is the source for the default:

contactAction = new ContactAction(this) {
         public void onContact(PhysicsObject other, Contact contact) {
            contact.setMode(Ode.dContactBounce | Ode.dContactApprox1);

See, you set the bounce methods, the bounciness of the object, its bounce velocity, and Mu is a friction thing...


Hey … that’s really cool. Time to add some squishy objects into my game heh.