MovieChat Forums > General Discussion > This is a simple Physics simulation I wr...

This is a simple Physics simulation I wrote in Javascript.


https://johnenverga.github.io/physics.html

It's still a work in progress. I'm working on the collisions, implementation of other objects, and other things.

reply

Cool! Nice work.

reply

Thanks!

reply

cool!
why does radius 10 bounce forever and radius 11 more normal?

reply

Thanks!

It has to do with the "compression" value. The compression controls the degree of the bounce - basically:

bounce factor = compression / (2 * radius)

...so...assuming that you didn't change the compression...the bounce of radius 10 would be 1 - hence it would bounce forever. But the bounce of radius 11 would be 20/22 or a little less than 1, providing a more "realistic" bounce.

reply