From 8f047b07046314f1ff22bfc775240aaeb300ef1b Mon Sep 17 00:00:00 2001 From: "keyboard.osh@gmail.com" Date: Tue, 2 Apr 2013 06:48:31 +0000 Subject: Added support for head yaw tracking and packet sending and fixed bug in BroadcastMovementUpdate git-svn-id: http://mc-server.googlecode.com/svn/trunk@1350 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Entity.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/Entity.h') diff --git a/source/Entity.h b/source/Entity.h index e40827cf4..80c399a92 100644 --- a/source/Entity.h +++ b/source/Entity.h @@ -105,6 +105,7 @@ public: cWorld * GetWorld(void) const { return m_World; } + double GetHeadYaw (void) const {return m_HeadYaw; } const Vector3d & GetPosition (void) const {return m_Pos; } double GetPosX (void) const {return m_Pos.x; } double GetPosY (void) const {return m_Pos.y; } @@ -123,6 +124,7 @@ public: int GetChunkY(void) const {return m_ChunkY; } int GetChunkZ(void) const {return m_ChunkZ; } + void SetHeadYaw (double a_HeadYaw); void SetPosX (double a_PosX); void SetPosY (double a_PosY); void SetPosZ (double a_PosZ); @@ -175,6 +177,9 @@ public: /// Detaches from the currently attached entity, if any void Detach(void); + //Makes sure head yaw is not over the specified range. + void WrapHeadYaw(); + //Makes sure rotation is not over the specified range. void WrapRotation(); @@ -213,6 +218,7 @@ protected: int m_ChunkX, m_ChunkY, m_ChunkZ; //Flags that signal that we haven't updated the clients with the latest. + bool m_bDirtyHead; bool m_bDirtyOrientation; bool m_bDirtyPosition; bool m_bDirtySpeed; @@ -243,6 +249,7 @@ protected: void ReferencedBy( cEntity*& a_EntityPtr ); void Dereference( cEntity*& a_EntityPtr ); private: + double m_HeadYaw; Vector3d m_Speed; Vector3d m_Rot; Vector3d m_Pos; -- cgit v1.2.3