Godlike / Pegasus

Game physics engine (can fly)
MIT License
5 stars 2 forks source link

Restitution behavior #120

Open MrDmitry opened 6 years ago

MrDmitry commented 6 years ago

Unexpectedly small difference between restitution coefficients of 0.35, 1.0 and -0.35 https://en.wikipedia.org/wiki/Coefficient_of_restitution says the following:

e < 0: A COR less than zero would represent a collision in which the separation velocity of the objects has the same direction (sign) as the closing velocity, implying the objects passed through one another without fully engaging. This may also be thought of as an incomplete transfer of momentum. An example of this might be a small, dense object passing through a large, less dense one – e.g., a bullet passing through a target, or a motorcycle passing through a motor home or a wave tearing through a dam.
0 < e < 1: This is a real-world inelastic collision, in which some kinetic energy is dissipated.
e = 1: This is a perfectly elastic collision, in which no kinetic energy is dissipated, and the objects rebound from one another with the same relative speed with which they approached.

Here are gifs that illustrate the issue (all using static duration of 0.005): 0.35: stack_0 35

1.0: stack_1 0

-0.35: stack_-0 35

Notable things:

Just from fiddling around with the value, it looks like with current demo the sphere jumps back to original position with restitution coefficient of 48.88 or thereabouts but only for the weight of 1. Increasing weight makes the sphere jump higher on each collision.