From: Mathnerd314 Date: Sat, 27 Feb 2010 13:00:42 +0000 (+0000) Subject: Some documentation for physic and what it does X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=21918f9dd888ca5a0b78d4d181e05bf927c7502f;p=supertux.git Some documentation for physic and what it does SVN-Revision: 6417 --- diff --git a/src/supertux/physic.cpp b/src/supertux/physic.cpp index 02132350e..729e0be13 100644 --- a/src/supertux/physic.cpp +++ b/src/supertux/physic.cpp @@ -152,6 +152,9 @@ Physic::get_movement(float elapsed_time) { float grav = gravity_enabled_flag ? (Sector::current()->get_gravity() * gravity_modifier * 100.0f) : 0; + // Semi-implicit Euler integration + // with constant acceleration, this will result in a position delta of + // v t + .5 a t (t+elapsed_time) at total time t vx += ax * elapsed_time; vy += (ay + grav) * elapsed_time; Vector result(vx * elapsed_time, vy * elapsed_time);