Reverted bigger parts of tuxdev patch:
[supertux.git] / src / physic.hpp
index da44f9b..abfdba5 100644 (file)
@@ -1,7 +1,8 @@
 //  $Id$
-// 
+//
 //  SuperTux
 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -12,7 +13,7 @@
 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 //  GNU General Public License for more details.
-// 
+//
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -67,6 +68,12 @@ public:
   void enable_gravity(bool gravity_enabled);
   bool gravity_enabled() const;
 
+  /// Set gravity to apply to object when enabled
+  void set_gravity(float gravity);
+
+  /// Get gravity to apply to object when enabled
+  float get_gravity() const;
+
   Vector get_movement(float elapsed_time);
 
 private:
@@ -76,6 +83,8 @@ private:
   float vx, vy;
   /// should we respect gravity in out calculations?
   bool gravity_enabled_flag;
+  /// current gravity to apply to object, if enabled
+  float gravity;
 };
 
 #endif