summaryrefslogtreecommitdiffstats
path: root/source/Entity.cpp
diff options
context:
space:
mode:
authorkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-28 20:54:43 +0200
committerkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-28 20:54:43 +0200
commit55b8495bf31875949fda825e2bbfe4004d815231 (patch)
tree42cea5fd62a5c6c4cf8eabaeba027c2436d0b723 /source/Entity.cpp
parentAdded dtAdmin damage type for use in plugins (diff)
downloadcuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar.gz
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar.bz2
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar.lz
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar.xz
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.tar.zst
cuberite-55b8495bf31875949fda825e2bbfe4004d815231.zip
Diffstat (limited to 'source/Entity.cpp')
-rw-r--r--source/Entity.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/Entity.cpp b/source/Entity.cpp
index 5f14a5e53..c614c8e9c 100644
--- a/source/Entity.cpp
+++ b/source/Entity.cpp
@@ -33,6 +33,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z)
, m_HeadYaw( 0.0 )
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
+ , m_Mass (0.001) //Default 1g
, m_bDirtyHead(true)
, m_bDirtyOrientation(true)
, m_bDirtyPosition(true)
@@ -506,6 +507,25 @@ void cEntity::SetHeadYaw(double a_HeadYaw)
+void cEntity::SetMass(double a_Mass)
+{
+ if (a_Mass > 0)
+ {
+ m_Mass = a_Mass;
+ }
+ else
+ {
+ //Make sure that mass is not zero. 1g is the default because we
+ //have to choose a number. It's perfectly legal to have a mass
+ //less than 1g as long as is NOT equal or less than zero.
+ m_Mass = 0.001;
+ }
+}
+
+
+
+
+
void cEntity::SetRotation(double a_Rotation)
{
m_Rot.x = a_Rotation;