[ Patch #1793 ] Turn physic into POD
[supertux.git] / src / physic.hpp
1 //  $Id$
2 //
3 //  SuperTux
4 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
5 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 //  02111-1307, USA.
21 #ifndef SUPERTUX_PHYSIC_H
22 #define SUPERTUX_PHYSIC_H
23
24 #include "math/vector.hpp"
25
26 /// Physics engine.
27 /** This is a very simplistic physics engine handling accelerated and constant
28   * movement along with gravity.
29   */
30 class Physic
31 {
32 public:
33   Physic();
34
35   Vector get_movement(float elapsed_time);
36
37   /// horizontal and vertical acceleration
38   float ax, ay;
39   /// horizontal and vertical velocity
40   float vx, vy;
41   /// should we respect gravity in our calculations?
42   bool gravity_enabled;
43   /// current gravity to apply to object, if enabled
44   float gravity;
45 };
46
47 #endif