Jump to content

P2 - restitution


Recommended Posts

In the game's world, I add a few balls. I'm using P2 for the collision detection.
I want the balls to bounce on themselves without losing much energy.
So I apply the following to the world:

game.physics.p2.restitution = 0.8;game.physics.p2.friction = 0;game.physics.p2.applyGravity = false;

And for the ball:

ball.body.collideWorldBounds = true;ball.body.damping = 0.03;ball.body.angularDamping = 0;ball.body.fixedRotation = true;

The problem is when 2 balls are in collision one can almost stop and the other one get great speed.
I would like to balls to not lose or gain any energy after any contact.
How can I do that???



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...