matthias-research / pages

My web page containing all the demos from my youtube channel "Ten Minute Physics" www.youtube.com/c/TenMinutePhysics
655 stars 136 forks source link

Handling of ground contact in 10-softBodies #20

Open wdiestel opened 1 year ago

wdiestel commented 1 year ago

The handling of ground contact in 10-softBodies:preSolve looks a bit hacky to me!? Is there a physical motivation to do it that way, or was it just to keep calculations simple?

Normally for a bouncing particle I would expect a reflection at the ground, so that y-coordinates between pos and prevPos are exchanged whereas the x,z-coordinates are that projected below ground into vel-direction, so not touched after adding the velocity vector to previous pos (and finally, according to elasticity the vector between the contact point and new pos would be multiplied with a value between 0..1)