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=60aba159b1f94d46bc2f3bebc0818c5bc5be956b;p=supertux.git Some documentation for physic and what it does git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6417 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- 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);