X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fphysic.hpp;h=f7ec06514041d31ba246dfceb164a2d67ea6cec0;hb=f53572ad2b744ddddd7cc4b6479489543d44f98d;hp=828b1e1058c6c795bf9b7561c0b57e9b9fe42b2f;hpb=fb0352196d3ade68ccae3e2aa25a8be3e8a9ade0;p=supertux.git diff --git a/src/physic.hpp b/src/physic.hpp index 828b1e105..f7ec06514 100644 --- a/src/physic.hpp +++ b/src/physic.hpp @@ -1,7 +1,8 @@ // $Id$ -// +// // SuperTux // Copyright (C) 2004 Tobias Glaesser +// Copyright (C) 2006 Matthias Braun // // 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 @@ -37,6 +38,7 @@ public: /// Sets velocity to a fixed value. void set_velocity(float vx, float vy); + void set_velocity(const Vector& vector); void set_velocity_x(float vx); void set_velocity_y(float vy); @@ -45,8 +47,9 @@ public: void inverse_velocity_x(); void inverse_velocity_y(); - float get_velocity_x(); - float get_velocity_y(); + Vector get_velocity() const; + float get_velocity_x() const; + float get_velocity_y() const; /// Set acceleration. /** Sets acceleration applied to the object. (Note that gravity is @@ -57,8 +60,9 @@ public: void set_acceleration_x(float ax); void set_acceleration_y(float ay); - float get_acceleration_x(); - float get_acceleration_y(); + Vector get_acceleration() const; + float get_acceleration_x() const; + float get_acceleration_y() const; /// Enables or disables handling of gravity. void enable_gravity(bool gravity_enabled);