matthias-research / pages

My web page containing all the demos from my youtube channel "Ten Minute Physics" www.youtube.com/c/TenMinutePhysics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling of ground contact in 10-softBodies

wdiestel opened this issue · comments

commented

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)