Jump to content

P2 physics - Bouncing (restitution) on same material and mass


Threedy
 Share

Recommended Posts

Hi there.

I want to collide a ball A with another ball B in a zero gravity world. Both balls have the same mass and (max) restitution and stiffness.

When A collides with B, I see that B's reaction is ''exaggerated'' and flies away, which is good for my purposes. However, I see that A is barely affected. I would prefer if A's reaction is also exaggerated and bounces back a lot rather than staying on basically the same area of the collision. 

Does anybody know what type of settings I have to change?

 contactMaterial.friction = 0.3;     // Friction to use in the contact of these two materials.
    contactMaterial.restitution = 1.0;  // Restitution (i.e. how bouncy it is!) to use in the contact of these two materials.
    contactMaterial.stiffness = 1e7;    // Stiffness of the resulting ContactEquation that this ContactMaterial generate.
    contactMaterial.relaxation = 3;     // Relaxation of the resulting ContactEquation that this ContactMaterial generate.
    contactMaterial.frictionStiffness = 1e7;    // Stiffness of the resulting FrictionEquation that this ContactMaterial generate.
    contactMaterial.frictionRelaxation = 3;     // Relaxation of the resulting FrictionEquation that this ContactMaterial generate.
    contactMaterial.surfaceVelocity = 0;        // Will add surface velocity to this material. If bodyA rests on top if bodyB, and the surface velocity is positive, bodyA will slide to the right.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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