From ec4d34b131bb5f699417d38215be9deb01d72967 Mon Sep 17 00:00:00 2001 From: lindaandersson Date: Tue, 4 Feb 2014 16:39:01 +0100 Subject: [PATCH] GL - added error checking --- Code/Game/GameLogic/Object.cpp | 16 +++++++++++++++- Code/Game/GameLogic/Player.cpp | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp index c7813e61..8cb57aae 100644 --- a/Code/Game/GameLogic/Object.cpp +++ b/Code/Game/GameLogic/Object.cpp @@ -140,8 +140,17 @@ void Object::BeginFrame() // update physic void Object::EndFrame() { + if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum()) + { + //error + int i =0 ; + } this->currPhysicsState = this->rigidBody->GetState(); - + if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum()) + { + //error + int i =0 ; + } if(currPhysicsState.GetGravityNormal() !=currPhysicsState.GetGravityNormal()) { //error @@ -163,6 +172,11 @@ void Object::EndFrame() } + if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum()) + { + //error + int i =0 ; + } this->newPhysicsState = this->currPhysicsState; } diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index aa649461..f01e4d46 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -6,7 +6,7 @@ using namespace GameLogic; using namespace Oyster::Physics; -const int MOVE_FORCE = 50000; +const int MOVE_FORCE = 5000; Player::Player() :DynamicObject() { @@ -73,7 +73,6 @@ void Player::EndFrame() Oyster::Math::Float3 up = currPhysicsState.GetOrientation().v[1]; Oyster::Math::Float3 deltaAxis = up * (-dx * 0.02) ; - Oyster::Math::Float3 oldOrt = currPhysicsState.GetRotation(); currPhysicsState.AddRotation(deltaAxis); dx = 0;