- added object support (untested)
[supertux.git] / src / physic.h
1 //
2 // C++ Interface: physic
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_PHYSIC_H
14 #define SUPERTUX_PHYSIC_H
15
16 #include "timer.h"
17
18 enum {
19   PH_VT, /* Vertical throw.*/
20   PH_HA  /* Horizontal acceleration. */
21 };
22
23 /* Physic type: */
24
25 struct physic_type
26   {
27     int state;
28     float start_vy;
29     float start_vx;
30     float acceleration;
31     unsigned int start_time;
32 };
33
34 /* global variables. */
35 extern float gravity;
36
37 void physic_init(physic_type* pphysic);
38 int physic_get_state(physic_type* pphysic);
39 void physic_set_state(physic_type* pphysic, int nstate);
40 void physic_set_start_vy(physic_type* pphysic, float start_vy);
41 void physic_set_start_vx(physic_type* pphysic, float start_vx);
42 void physic_set_acceleration(physic_type* pphysic, float acceleration);
43 int physic_is_set(physic_type* pphysic);
44 float physic_get_velocity(physic_type* pphysic);
45 float physic_get_max_distance(physic_type* pphysic);
46 unsigned int physic_get_max_time(physic_type* pphysic);
47 unsigned int physic_get_time_gone(physic_type* pphysic);
48
49 #endif /*SUPERTUX_PHYSIC_H*/