johnBuffer / VerletSFML-Multithread

Multithreaded deterministic minimalist Verlet solver
MIT License
438 stars 59 forks source link

what is this 40.0 magic number? #4

Closed mreinstein closed 11 months ago

mreinstein commented 1 year ago

Looking at this line in physics_object.hpp:

const Vec2 new_position = position + last_update_move + (acceleration - last_update_move * 40.0f) * (dt * dt);

https://github.com/johnBuffer/VerletSFML-Multithread/blob/4c380909f5fe02b0acb4904581737e5d66d96c0d/src/physics/physic_object.hpp#L32C9-L32C119

johnBuffer commented 11 months ago

It's an arbitray value used to damp velocity (it's a rough approximation of air friction).