Jump to content

Physics P2 Collision equation


Andy R
 Share

Recommended Posts

Hi,

i've 2 characters physics p2 enabled, they both can collide with each other, they are also static=False.Which mean that when one run toward another, the second get back and get some velocity.

Which properties i've to set to get more control on this effect ? I tried editing masse/inertia but got had not good results. Any tips ?

 

I'm also looking for an equation that show how the effect works depending on theses parameters.

 

Thx

Link to comment
Share on other sites

Static objects should not collide as they are  ... static.  Static are two houses on street - it does not move.
For moving objects in game physics (not only P2) you have two choices:
 - kinematic body,
 - dynamic body.

Kinematic body is good for things like moving platforms - it moves, but when player jumps on it it does not react and still makes its work. Dynamic bodies are what you need when you want action-reaction behaviour. Now, you can set its mass and other properties to tune your game.

 Regarding equation, this is good source: http://chrishecker.com/Rigid_body_dynamics and equation you are looking for is in part 3: http://chrishecker.com/images/e/e7/Gdmphys3.pdf

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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