diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 7ab0aeac..af5f467e 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -319,11 +319,9 @@ void GameState::ReadKeyInput() //send delta mouse movement { - this->privData->camera.YawRight( this->privData->input->GetYaw() * 0.017f ); - this->privData->camera.PitchDown( this->privData->input->GetPitch() * 0.017f ); - this->privData->camera.UpdateOrientation(); - - privData->nwClient->Send( Protocol_PlayerLook(this->privData->camera.GetLook(), this->privData->camera.GetRight()) ); + static const float mouseSensitivity = Radian( 1.0f ); + this->privData->camera.PitchDown( this->privData->input->GetPitch() * mouseSensitivity ); + this->privData->nwClient->Send( Protocol_PlayerLeftTurn(this->privData->input->GetYaw() * mouseSensitivity) ); } // shoot diff --git a/Code/Game/GameClient/GameClientState/GamingUI.cpp b/Code/Game/GameClient/GameClientState/GamingUI.cpp index a2edc28f..8ff43d88 100644 --- a/Code/Game/GameClient/GameClientState/GamingUI.cpp +++ b/Code/Game/GameClient/GameClientState/GamingUI.cpp @@ -1,9 +1,11 @@ #include "GamingUI.h" #include +#include "Utilities.h" using namespace ::DanBias::Client; using namespace ::Oyster::Network; using namespace ::GameLogic; +using namespace ::Utility::Value; GamingUI::GamingUI() : GameStateUI() @@ -92,11 +94,9 @@ void GamingUI::ReadKeyInput() //send delta mouse movement { - this->camera->YawRight( this->input->GetYaw() * 0.017f ); - this->camera->PitchDown( this->input->GetPitch() * 0.017f ); - this->camera->UpdateOrientation(); - - this->netClient->Send( Protocol_PlayerLook(this->camera->GetLook(), this->camera->GetRight()) ); + static const float mouseSensitivity = Radian( 1.0f ); + this->camera->PitchDown( this->input->GetPitch() * mouseSensitivity ); + this->netClient->Send( Protocol_PlayerLeftTurn(this->input->GetYaw() * mouseSensitivity) ); } // shoot diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 00d098fa..b067d036 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -33,6 +33,8 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision) this->moveDir = Oyster::Math::Float3(0,0,0); this->moveSpeed = 100; this->previousMoveSpeed = Oyster::Math::Float3(0,0,0); + + this->rotationUp = 0; } Player::Player(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID, int teamID) @@ -53,6 +55,8 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustom this->moveDir = Oyster::Math::Float3(0,0,0); this->moveSpeed = 20; this->previousMoveSpeed = Oyster::Math::Float3(0,0,0); + + this->rotationUp = 0; } Player::~Player(void) @@ -229,8 +233,8 @@ void Player::Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D: } void Player::TurnLeft(Oyster::Math3D::Float deltaRadians) { - //TODO: Conver delta radians to something that phyhsics use... - //this->rigidBody->; + this->rotationUp += deltaRadians; + this->rigidBody->SetRotationAsAngularAxis(Oyster::Math3D::Float4(this->rigidBody->GetState().centerPos.GetNormalized(), this->rotationUp)); } void Player::Jump() diff --git a/Code/Game/GameLogic/Player.h b/Code/Game/GameLogic/Player.h index 73737d60..13c6e300 100644 --- a/Code/Game/GameLogic/Player.h +++ b/Code/Game/GameLogic/Player.h @@ -96,6 +96,8 @@ namespace GameLogic Oyster::Math::Float moveSpeed; Oyster::Math::Float3 previousMoveSpeed; + Oyster::Math::Float rotationUp; + bool hasTakenDamage; float invincibleCooldown; diff --git a/Code/Game/LevelLoader/ParseFunctions.cpp b/Code/Game/LevelLoader/ParseFunctions.cpp index b6b57d83..09adb298 100644 --- a/Code/Game/LevelLoader/ParseFunctions.cpp +++ b/Code/Game/LevelLoader/ParseFunctions.cpp @@ -152,10 +152,9 @@ namespace GameLogic start = 0; LevelLoaderInternal::FormatVersion version; memcpy(&version, &buf[0], sizeof(version)); - start += 4; + start += 8; memcpy(&volume.geoType, &buf[start], sizeof(volume.geoType)); - start += sizeof(volume.geoType); switch(volume.geoType) {