projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reinitialize SDL's joystick subsystem when scanning for sticks, so
[supertux.git]
/
src
/
physic.hpp
diff --git
a/src/physic.hpp
b/src/physic.hpp
index
f7ec065
..
5275779
100644
(file)
--- a/
src/physic.hpp
+++ b/
src/physic.hpp
@@
-43,7
+43,7
@@
public:
void set_velocity_x(float vx);
void set_velocity_y(float vy);
void set_velocity_x(float vx);
void set_velocity_y(float vy);
- /// Velocities inver
t
ion.
+ /// Velocities inver
s
ion.
void inverse_velocity_x();
void inverse_velocity_y();
void inverse_velocity_x();
void inverse_velocity_y();
@@
-68,6
+68,12
@@
public:
void enable_gravity(bool gravity_enabled);
bool gravity_enabled() const;
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:
Vector get_movement(float elapsed_time);
private:
@@
-75,8
+81,17
@@
private:
float ax, ay;
/// horizontal and vertical velocity
float vx, vy;
float ax, ay;
/// horizontal and vertical velocity
float vx, vy;
- /// should we respect gravity in ou
t
calculations?
+ /// should we respect gravity in ou
r
calculations?
bool gravity_enabled_flag;
bool gravity_enabled_flag;
+ /// current gravity (multiplied by 100) to apply to object, if enabled
+ float gravity;
+};
+
+class UsesPhysic
+{
+public:
+ Physic physic;
+ friend class Sector;
};
#endif
};
#endif