2 // C++ Interface: physic
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
9 // Copyright: See COPYING file that comes with this distribution
13 #ifndef SUPERTUX_PHYSIC_H
14 #define SUPERTUX_PHYSIC_H
16 /** This is a very simplistic physics engine handling accelerated and constant
17 * movement along with gravity.
25 /** resets all velocities and accelerations to 0 */
28 /** sets velocity to a fixed value */
29 void set_velocity(float vx, float vy);
31 float get_velocity_x();
32 float get_velocity_y();
34 /** sets acceleration applied to the object. (Note that gravity is
35 * eventually added to the vertical acceleration)
37 void set_acceleration(float ax, float ay);
39 float get_acceleration_x();
40 float get_acceleration_y();
42 /** enables or disables handling of gravity */
43 void enable_gravity(bool gravity_enabled);
45 /** applies the physical simulation to given x and y coordinates */
46 void apply(float frame_ratio, float &x, float &y);
49 /// horizontal and vertical acceleration
51 /// horizontal and vertical velocity
53 /// should we respect gravity in out calculations?
57 #endif /*SUPERTUX_PHYSIC_H*/