cmm-21 / a5

0 stars 0 forks source link

[Discussion] Why our impulse-based collision model is errorneous? #8

Open eastskykang opened 3 years ago

eastskykang commented 3 years ago

Watch the following demo video and let's discuss what's problem and why it happens:

https://youtu.be/v1zMGm-7id4

Please leave your idea freely!

update: I found the title is a bit misleading. Let's focus on errorneous behaviors of our collision model. Assuming ideal case, what is expected behaviors of ball after collision? Does our simulation follow such expectation? If not, why is it the case?

Hustwireless commented 3 years ago

I think one of the reasons should be that we suppose the object and the ground are both rigid bodies, however in reality they are both not.

zdchan commented 3 years ago

The other reason may be that, we suppose the collision happens in an instant, but in reality it requires some time.

eastskykang commented 3 years ago

@Hustwireless @zdchan thank you very much for your participation!

Let's start from the identifying the problem. What do you notice from the demo video?

zdchan commented 3 years ago

I think the most obvious ones are:

  1. for the case which eps=0.5, the ball is rebounded forever (although very low), while in reality it should stop moving after a while.
  2. for the case which eps=1, the ball gets higher and higher, which is totally impossible (or we can invent the perpetual motion machine, which can definitely help us get the Nobel Prize 😂)
Hustwireless commented 3 years ago

Current thoughts of this question:

eastskykang commented 3 years ago

@Hustwireless Brilliant! :D

yes, our collision detection algorithm is too crude. Let's assume we just put the ball on the ground with zero velocity (without any penetration). In the next timestep, the ball will go down due to gravity, but our collision detection algorithm will not identify the collision since the position yet is not updated. Thus the ball will go through the ground with certain amount of penetration error. (and next timestep, eventually our collision detector will say the ball and the ground are in collision and activate impulse-based collision logic)

that's why small dt gives a better result. still the penetration error exists, but it will be small enough