summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2013-02-08 22:54:01 +0200
committerdarkrose <lisa@ltmnet.com>2013-02-14 06:21:30 +1000
commitdf3c925b3ccae3bdba125e6dc3ecc740739baeab (patch)
tree869c7e587022e2873ab3d125a6fca0b60ffaafb6 /src/player.h
parent86b906d015ccde4e8f576a4e61d7c4ae8842b45d (diff)
downloadminetest-df3c925b3ccae3bdba125e6dc3ecc740739baeab.tar.gz
minetest-df3c925b3ccae3bdba125e6dc3ecc740739baeab.tar.bz2
minetest-df3c925b3ccae3bdba125e6dc3ecc740739baeab.zip
Improved Player Physics
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/player.h b/src/player.h
index 67b02c344..770afdb37 100644
--- a/src/player.h
+++ b/src/player.h
@@ -108,8 +108,8 @@ public:
m_speed = speed;
}
- // Y direction is ignored
- void accelerate(v3f target_speed, f32 max_increase);
+ void accelerateHorizontal(v3f target_speed, f32 max_increase);
+ void accelerateVertical(v3f target_speed, f32 max_increase);
v3f getPosition()
{
@@ -196,17 +196,32 @@ public:
bool touching_ground;
// This oscillates so that the player jumps a bit above the surface
- bool in_water;
+ bool in_liquid;
// This is more stable and defines the maximum speed of the player
- bool in_water_stable;
+ bool in_liquid_stable;
+ // Gets the viscosity of water to calculate friction
+ u8 liquid_viscosity;
bool is_climbing;
- bool swimming_up;
+ bool swimming_vertical;
bool camera_barely_in_ceiling;
u8 light;
Inventory inventory;
+ f32 movement_acceleration_default;
+ f32 movement_acceleration_air;
+ f32 movement_acceleration_fast;
+ f32 movement_speed_walk;
+ f32 movement_speed_crouch;
+ f32 movement_speed_fast;
+ f32 movement_speed_climb;
+ f32 movement_speed_jump;
+ f32 movement_liquid_fluidity;
+ f32 movement_liquid_fluidity_smooth;
+ f32 movement_liquid_sink;
+ f32 movement_gravity;
+
u16 hp;
float hurt_tilt_timer;