Merge branch 'GameClient' of https://github.com/dean11/Danbias into GameServer
This commit is contained in:
commit
d79e65657c
|
@ -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
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#include "GamingUI.h"
|
||||
#include <Protocols.h>
|
||||
#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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -96,6 +96,8 @@ namespace GameLogic
|
|||
Oyster::Math::Float moveSpeed;
|
||||
Oyster::Math::Float3 previousMoveSpeed;
|
||||
|
||||
Oyster::Math::Float rotationUp;
|
||||
|
||||
|
||||
bool hasTakenDamage;
|
||||
float invincibleCooldown;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue