From c743c7fd0cc12bf10d76ecb8cdcb8029ed8429a4 Mon Sep 17 00:00:00 2001 From: DevToaster Date: Mon, 30 Mar 2015 19:42:32 -0400 Subject: Modified physics for more vanilla-like behavior --- src/Entities/Entity.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Entities/Entity.h') diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 9bb1837f1..2c994c550 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -270,6 +270,10 @@ public: float GetGravity(void) const { return m_Gravity; } void SetGravity(float a_Gravity) { m_Gravity = a_Gravity; } + + float GetAirDrag(void) const { return m_AirDrag; } + + void SetAirDrag(float a_AirDrag) { m_AirDrag = a_AirDrag; } /// Sets the rotation to match the speed vector (entity goes "face-forward") void SetYawFromSpeed(void); @@ -504,6 +508,10 @@ protected: For realistic effects, this should be negative. For spaaaaaaace, this can be zero or even positive */ float m_Gravity; + /** Stores the air drag that is applied to the entity every tick, measured in speed ratio per second + Acts as air friction and slows down flight */ + float m_AirDrag; + /** Last position sent to client via the Relative Move or Teleport packets (not Velocity) Only updated if cEntity::BroadcastMovementUpdate() is called! */ Vector3d m_LastPos; -- cgit v1.2.3 From 45c84ea93318a4ab8921a20d7d2c086cfc313999 Mon Sep 17 00:00:00 2001 From: DevToaster Date: Tue, 31 Mar 2015 11:03:35 -0400 Subject: Changed air drag units to 'interpolated ticks' per second --- src/Entities/Entity.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Entities/Entity.h') diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 2c994c550..dd6190ced 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -508,8 +508,10 @@ protected: For realistic effects, this should be negative. For spaaaaaaace, this can be zero or even positive */ float m_Gravity; - /** Stores the air drag that is applied to the entity every tick, measured in speed ratio per second - Acts as air friction and slows down flight */ + /** Stores the air drag that is applied to the entity every tick, measured in speed ratio per tick + Acts as air friction and slows down flight + Will be interpolated if the server tick rate varies + Data: http://minecraft.gamepedia.com/Entity#Motion_of_entities */ float m_AirDrag; /** Last position sent to client via the Relative Move or Teleport packets (not Velocity) -- cgit v1.2.3