From f8e68b95b2011f7e3b43f5275a2a29f93743493f Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Fri, 14 Feb 2014 12:07:49 +0100 Subject: [PATCH] Temporary jump --- Code/Game/GameLogic/Game_PlayerData.cpp | 2 +- Code/Game/GameLogic/Player.cpp | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Code/Game/GameLogic/Game_PlayerData.cpp b/Code/Game/GameLogic/Game_PlayerData.cpp index 72251c5a..275866b9 100644 --- a/Code/Game/GameLogic/Game_PlayerData.cpp +++ b/Code/Game/GameLogic/Game_PlayerData.cpp @@ -17,7 +17,7 @@ Game::PlayerData::PlayerData() //sbDesc.quaternion = Oyster::Math::Float3(0, Oyster::Math::pi, 0); //create rigid body - Oyster::Physics::ICustomBody* rigidBody = Oyster::Physics::API::Instance().AddCharacter(1.5f, 0.5f, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f ); + Oyster::Physics::ICustomBody* rigidBody = Oyster::Physics::API::Instance().AddCharacter(2.0f, 0.5f, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f ); rigidBody->SetAngularFactor(0.0f); //create player with this rigid body this->player = new Player(rigidBody, Player::PlayerCollision, ObjectSpecialType_Player,0,0); diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 66ae7288..508857b9 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -28,6 +28,11 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision) key_backward = 0; key_strafeRight = 0; key_strafeLeft = 0; + + this->previousPosition = Oyster::Math::Float3(0,0,0); + this->moveDir = Oyster::Math::Float3(0,0,0); + this->moveSpeed = 100; + this->previousMoveSpeed = Oyster::Math::Float3(0,0,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) @@ -103,11 +108,6 @@ void Player::BeginFrame() } } - if(this->rigidBody->GetLamda() == 1.0f) - { - this->playerState = PLAYER_STATE_WALKING; - } - this->moveDir = Oyster::Math::Float3::null; if (key_forward > 0.001) @@ -226,18 +226,12 @@ void Player::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D:: void Player::Jump() { -<<<<<<< HEAD if(this->rigidBody->GetLamda() < 1.0f) { Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1].GetNormalized(); this->rigidBody->ApplyImpulse(up *1500); this->playerState = PLAYER_STATE::PLAYER_STATE_JUMPING; } -======= - Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1].GetNormalized(); - this->rigidBody->ApplyImpulse(up *1500); - this->playerState = PLAYER_STATE::PLAYER_STATE_JUMPING; ->>>>>>> origin/GameLogic } bool Player::IsWalking()