From df3c925b3ccae3bdba125e6dc3ecc740739baeab Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 8 Feb 2013 22:54:01 +0200 Subject: Improved Player Physics --- src/player.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/player.h') 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; -- cgit v1.2.3 From 497ff1ecd64c8908f988e15ca879824f2781e3fd Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 24 Feb 2013 18:40:43 +0100 Subject: Change Minetest-c55 to Minetest --- src/player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/player.h') diff --git a/src/player.h b/src/player.h index 770afdb37..8c9e7e725 100644 --- a/src/player.h +++ b/src/player.h @@ -1,5 +1,5 @@ /* -Minetest-c55 +Minetest Copyright (C) 2010-2011 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify -- cgit v1.2.3 From 6d0ea26c2d62c3774ff384cf1bfc2a3372b49a3b Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sun, 24 Feb 2013 19:38:45 +0100 Subject: Update Copyright Years --- src/player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/player.h') diff --git a/src/player.h b/src/player.h index 8c9e7e725..496c99532 100644 --- a/src/player.h +++ b/src/player.h @@ -1,6 +1,6 @@ /* Minetest -Copyright (C) 2010-2011 celeron55, Perttu Ahola +Copyright (C) 2010-2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by -- cgit v1.2.3