jaipack17 / Nature2D

A 2D physics engine for Roblox. Create versatile physics simulations and mechanics with GUIs!
https://jaipack17.github.io/Nature2D/
MIT License
147 stars 8 forks source link

Fix and Improve Frictional Forces #4

Closed jaipack17 closed 2 years ago

jaipack17 commented 2 years ago

Currently friction is nothing but a simple damping value. It works fine for most of the time, countering this - Friction isn't supposed to be active even when two Bodies aren't in contact with each other. As of now, Friction forces act even if two RigidBodies or other objects aren't in contact with each other.

This is something I wish to fix. I also wish to improve the way you pass in parameters when updating the global or local frictional damping value. The parameters take in an alpha value. But it acts as an inverse! If friction is 0, aren't the Bodies supposed to move infinitely and never stop? Well that's expected, but isn't the actual result! Setting friction to 0 makes it impossible for a Body to move. The closer the friction to 0, the higher it is.

I aim to change this. The closer the friction to 0, the lower it is supposed to be.

This PR will remain a draft until all updates are made and revised.