Added inverse functions for speed. Might be usefull for someone that wants to make...
authorRicardo Cruz <rick2@aeiou.pt>
Sat, 17 Apr 2004 15:21:50 +0000 (15:21 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Sat, 17 Apr 2004 15:21:50 +0000 (15:21 +0000)
SVN-Revision: 545

src/physic.cpp
src/physic.h

index 232475d..243e8cf 100644 (file)
@@ -41,6 +41,16 @@ Physic::set_velocity(float nvx, float nvy)
     vy = -nvy;
 }
 
+void Physic::inverse_velocity_x()
+{
+vx = -vx;
+}
+
+void Physic::inverse_velocity_y()
+{
+vy = -vy;
+}
+
 float
 Physic::get_velocity_x()
 {
index 37b6302..81e4451 100644 (file)
@@ -28,6 +28,10 @@ public:
     /** sets velocity to a fixed value */
     void set_velocity(float vx, float vy);
 
+    /** velocities invertion */
+    void inverse_velocity_x();
+    void inverse_velocity_y();
+
     float get_velocity_x();
     float get_velocity_y();