projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3aae75
)
Some documentation for physic and what it does
author
Mathnerd314
<man.is.allan@gmail.com>
Sat, 27 Feb 2010 13:00:42 +0000
(13:00 +0000)
committer
Mathnerd314
<man.is.allan@gmail.com>
Sat, 27 Feb 2010 13:00:42 +0000
(13:00 +0000)
SVN-Revision: 6417
src/supertux/physic.cpp
patch
|
blob
|
history
diff --git
a/src/supertux/physic.cpp
b/src/supertux/physic.cpp
index
0213235
..
729e0be
100644
(file)
--- 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);