Closed sparshg closed 1 year ago
Tested 86cfb08 and the objects never stopped bouncing. 8c1ee5c fixes the issue, please test.
Tested https://github.com/sugarlabs/physics/commit/86cfb08b5c29e461bd166664033d9990a001d967 and the objects never stopped bouncing
That is the intended behaviour, that is what was meant by restitution=1 (no relative speed change) for basketball, meaning that it should bounce till the same height and keep bouncing forever. My change will set it to 0.95, it will not bounce forever as a side-effect but it will bounce for long enough and also prevent unexpacted energy gain.
I don't think 8c1ee5c would be correct
@quozl Can you take a look at this? Thanks
What specifically do you need? I raised the issue because I didn't plan to fix it myself; otherwise I would have fixed it immediately when the code was in my head.
Various resources give the bounce height of a basketball in competition at standard inflation, temperature, and air pressure, of between 60% and 80%. 16% doesn't seem right, nor does 93%. 100% is not realistic simulation.
I did set it to 95% just because it was close to the original value of 100% so there won't be much noticeable change, but yes it won't be realistic. I think 70% would be a good choice then and solve all the issues too.
Tested 53d9541, 70% is a good choice.
Refer: https://github.com/sugarlabs/physics/issues/28#issuecomment-1644697676 @chimosky I have set the restitution to 0.95 instead of 1 to atleast prevent the system from gaining energy and becoming unstable.