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 // update physic
void Object::EndFrame() void Object::EndFrame()
{ {
if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum())
{
//error
int i =0 ;
}
this->currPhysicsState = this->rigidBody->GetState(); this->currPhysicsState = this->rigidBody->GetState();
if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum())
{
//error
int i =0 ;
}
if(currPhysicsState.GetGravityNormal() !=currPhysicsState.GetGravityNormal()) if(currPhysicsState.GetGravityNormal() !=currPhysicsState.GetGravityNormal())
{ {
//error //error
@ -163,6 +172,11 @@ void Object::EndFrame()
} }
if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum())
{
//error
int i =0 ;
}
this->newPhysicsState = this->currPhysicsState; this->newPhysicsState = this->currPhysicsState;
} }

View File

@ -6,7 +6,7 @@
using namespace GameLogic; using namespace GameLogic;
using namespace Oyster::Physics; using namespace Oyster::Physics;
const int MOVE_FORCE = 50000; const int MOVE_FORCE = 5000;
Player::Player() Player::Player()
:DynamicObject() :DynamicObject()
{ {
@ -73,7 +73,6 @@ void Player::EndFrame()
Oyster::Math::Float3 up = currPhysicsState.GetOrientation().v[1]; Oyster::Math::Float3 up = currPhysicsState.GetOrientation().v[1];
Oyster::Math::Float3 deltaAxis = up * (-dx * 0.02) ; Oyster::Math::Float3 deltaAxis = up * (-dx * 0.02) ;
Oyster::Math::Float3 oldOrt = currPhysicsState.GetRotation();
currPhysicsState.AddRotation(deltaAxis); currPhysicsState.AddRotation(deltaAxis);
dx = 0; dx = 0;