Merge branch 'GameClient' of https://github.com/dean11/Danbias into GameServer

This commit is contained in:
dean11 2014-02-19 14:04:53 +01:00
commit d79e65657c
5 changed files with 17 additions and 14 deletions

View File

@ -319,11 +319,9 @@ void GameState::ReadKeyInput()
//send delta mouse movement //send delta mouse movement
{ {
this->privData->camera.YawRight( this->privData->input->GetYaw() * 0.017f ); static const float mouseSensitivity = Radian( 1.0f );
this->privData->camera.PitchDown( this->privData->input->GetPitch() * 0.017f ); this->privData->camera.PitchDown( this->privData->input->GetPitch() * mouseSensitivity );
this->privData->camera.UpdateOrientation(); this->privData->nwClient->Send( Protocol_PlayerLeftTurn(this->privData->input->GetYaw() * mouseSensitivity) );
privData->nwClient->Send( Protocol_PlayerLook(this->privData->camera.GetLook(), this->privData->camera.GetRight()) );
} }
// shoot // shoot

View File

@ -1,9 +1,11 @@
#include "GamingUI.h" #include "GamingUI.h"
#include <Protocols.h> #include <Protocols.h>
#include "Utilities.h"
using namespace ::DanBias::Client; using namespace ::DanBias::Client;
using namespace ::Oyster::Network; using namespace ::Oyster::Network;
using namespace ::GameLogic; using namespace ::GameLogic;
using namespace ::Utility::Value;
GamingUI::GamingUI() : GamingUI::GamingUI() :
GameStateUI() GameStateUI()
@ -92,11 +94,9 @@ void GamingUI::ReadKeyInput()
//send delta mouse movement //send delta mouse movement
{ {
this->camera->YawRight( this->input->GetYaw() * 0.017f ); static const float mouseSensitivity = Radian( 1.0f );
this->camera->PitchDown( this->input->GetPitch() * 0.017f ); this->camera->PitchDown( this->input->GetPitch() * mouseSensitivity );
this->camera->UpdateOrientation(); this->netClient->Send( Protocol_PlayerLeftTurn(this->input->GetYaw() * mouseSensitivity) );
this->netClient->Send( Protocol_PlayerLook(this->camera->GetLook(), this->camera->GetRight()) );
} }
// shoot // shoot

View File

@ -33,6 +33,8 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision)
this->moveDir = Oyster::Math::Float3(0,0,0); this->moveDir = Oyster::Math::Float3(0,0,0);
this->moveSpeed = 100; this->moveSpeed = 100;
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0); 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) 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->moveDir = Oyster::Math::Float3(0,0,0);
this->moveSpeed = 20; this->moveSpeed = 20;
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0); this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
this->rotationUp = 0;
} }
Player::~Player(void) 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) void Player::TurnLeft(Oyster::Math3D::Float deltaRadians)
{ {
//TODO: Conver delta radians to something that phyhsics use... this->rotationUp += deltaRadians;
//this->rigidBody->; this->rigidBody->SetRotationAsAngularAxis(Oyster::Math3D::Float4(this->rigidBody->GetState().centerPos.GetNormalized(), this->rotationUp));
} }
void Player::Jump() void Player::Jump()

View File

@ -96,6 +96,8 @@ namespace GameLogic
Oyster::Math::Float moveSpeed; Oyster::Math::Float moveSpeed;
Oyster::Math::Float3 previousMoveSpeed; Oyster::Math::Float3 previousMoveSpeed;
Oyster::Math::Float rotationUp;
bool hasTakenDamage; bool hasTakenDamage;
float invincibleCooldown; float invincibleCooldown;

View File

@ -152,10 +152,9 @@ namespace GameLogic
start = 0; start = 0;
LevelLoaderInternal::FormatVersion version; LevelLoaderInternal::FormatVersion version;
memcpy(&version, &buf[0], sizeof(version)); memcpy(&version, &buf[0], sizeof(version));
start += 4; start += 8;
memcpy(&volume.geoType, &buf[start], sizeof(volume.geoType)); memcpy(&volume.geoType, &buf[start], sizeof(volume.geoType));
start += sizeof(volume.geoType);
switch(volume.geoType) switch(volume.geoType)
{ {