summaryrefslogtreecommitdiffstats
path: root/source/Entities/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-30 20:49:33 +0200
committermadmaxoft <github@xoft.cz>2013-08-30 20:49:33 +0200
commit105251a986d741e34561df588582de3ef882d183 (patch)
tree8f414b24316af0fcfd3174e6c2e825ac53465362 /source/Entities/Player.cpp
parentProtoProxy: Log individual chunks in MapChunkBulk packet. (diff)
parentAnvilStats: Implemented a cImageComposingCallback class. (diff)
downloadcuberite-105251a986d741e34561df588582de3ef882d183.tar
cuberite-105251a986d741e34561df588582de3ef882d183.tar.gz
cuberite-105251a986d741e34561df588582de3ef882d183.tar.bz2
cuberite-105251a986d741e34561df588582de3ef882d183.tar.lz
cuberite-105251a986d741e34561df588582de3ef882d183.tar.xz
cuberite-105251a986d741e34561df588582de3ef882d183.tar.zst
cuberite-105251a986d741e34561df588582de3ef882d183.zip
Diffstat (limited to 'source/Entities/Player.cpp')
-rw-r--r--source/Entities/Player.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/Entities/Player.cpp b/source/Entities/Player.cpp
index 0cb047933..0943f61ff 100644
--- a/source/Entities/Player.cpp
+++ b/source/Entities/Player.cpp
@@ -857,6 +857,36 @@ void cPlayer::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ)
+Vector3d cPlayer::GetThrowStartPos(void) const
+{
+ Vector3d res = GetEyePosition();
+
+ // Adjust the position to be just outside the player's bounding box:
+ res.x += 0.16 * cos(GetPitch());
+ res.y += -0.1;
+ res.z += 0.16 * sin(GetPitch());
+
+ return res;
+}
+
+
+
+
+
+Vector3d cPlayer::GetThrowSpeed(double a_SpeedCoeff) const
+{
+ Vector3d res = GetLookVector();
+ res.Normalize();
+
+ // TODO: Add a slight random change (+-0.0075 in each direction)
+
+ return res * a_SpeedCoeff;
+}
+
+
+
+
+
void cPlayer::MoveTo( const Vector3d & a_NewPos )
{
if ((a_NewPos.y < -990) && (GetPosY() > -100))