X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fphysic.h;h=002b42f805cc8ab6b0d0c6ef965169b4093cb280;hb=828b5e1ef1cb89d830735f24dd79bbd9b09d5b32;hp=0e15cfa75bf05a164ef984a186eb3767774f36ef;hpb=84160722392a024dda42bd86ca9bd85b68c49457;p=supertux.git diff --git a/src/physic.h b/src/physic.h index 0e15cfa75..002b42f80 100644 --- a/src/physic.h +++ b/src/physic.h @@ -36,6 +36,9 @@ public: /** sets velocity to a fixed value */ void set_velocity(float vx, float vy); + void set_velocity_x(float vx); + void set_velocity_y(float vy); + /** velocities invertion */ void inverse_velocity_x(); void inverse_velocity_y(); @@ -48,6 +51,9 @@ public: */ void set_acceleration(float ax, float ay); + void set_acceleration_x(float ax); + void set_acceleration_y(float ay); + float get_acceleration_x(); float get_acceleration_y(); @@ -57,6 +63,9 @@ public: /** applies the physical simulation to given x and y coordinates */ void apply(float frame_ratio, float &x, float &y); + /** applies the physical simulation to given x and y coordinates */ + void apply(Vector& vector, float frame_ratio); + private: /// horizontal and vertical acceleration float ax, ay;