GL - added error checking

This commit is contained in:
lindaandersson 2014-02-04 16:39:01 +01:00
parent 6e0dd63d64
commit ec4d34b131
2 changed files with 16 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;