GL - testing

This commit is contained in:
lindaandersson 2014-02-05 09:06:33 +01:00
parent ac278555ea
commit 6818dda2b9
4 changed files with 19 additions and 3 deletions

View File

@ -84,7 +84,7 @@ using namespace GameLogic;
if(kineticEnergyLoss > forceThreashHold) //should only take damage if the force is high enough if(kineticEnergyLoss > forceThreashHold) //should only take damage if the force is high enough
{ {
damageDone = kineticEnergyLoss * 0.10f; damageDone = kineticEnergyLoss * 0.10f;
player.DamageLife(damageDone); //player.DamageLife(damageDone);
} }
} }

View File

@ -11,6 +11,8 @@ Game::PlayerData::PlayerData()
sbDesc.size = Oyster::Math::Float3(4,7,4); sbDesc.size = Oyster::Math::Float3(4,7,4);
sbDesc.mass = 70; sbDesc.mass = 70;
sbDesc.restitutionCoeff = 0.5; sbDesc.restitutionCoeff = 0.5;
sbDesc.frictionCoeff_Static = 0.4;
sbDesc.frictionCoeff_Dynamic = 0.3;
sbDesc.rotation = Oyster::Math::Float3(0, Oyster::Math::pi, 0); sbDesc.rotation = Oyster::Math::Float3(0, Oyster::Math::pi, 0);
//create rigid body //create rigid body

View File

@ -156,6 +156,8 @@ void Object::EndFrame()
//error //error
int i =0 ; int i =0 ;
} }
if(currPhysicsState.GetGravityNormal()!= Float3::null) if(currPhysicsState.GetGravityNormal()!= Float3::null)
{ {
Oyster::Math::Float4 axis; Oyster::Math::Float4 axis;
@ -170,6 +172,18 @@ void Object::EndFrame()
Oyster::Math::Float3 debug = ::LinearAlgebra3D::WorldAxisOf(::LinearAlgebra3D::Rotation(axis.xyz), Oyster::Math::Float3::standard_unit_y); Oyster::Math::Float3 debug = ::LinearAlgebra3D::WorldAxisOf(::LinearAlgebra3D::Rotation(axis.xyz), Oyster::Math::Float3::standard_unit_y);
debug += currPhysicsState.GetGravityNormal(); debug += currPhysicsState.GetGravityNormal();
} }
Oyster::Math::Float3 pos = currPhysicsState.GetCenterPosition();
Oyster::Math::Float3 up = -currPhysicsState.GetGravityNormal();
//300, 0,0,
//1,0,0
if( pos.GetLength() < 303.5f)
{
Oyster::Math::Float moveUp = 303.5 - pos.GetLength();
up *= moveUp;
//currPhysicsState.SetCenterPosition(pos + up);
}
if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum()) if(currPhysicsState.GetLinearMomentum() !=currPhysicsState.GetLinearMomentum())

View File

@ -6,7 +6,7 @@
using namespace GameLogic; using namespace GameLogic;
using namespace Oyster::Physics; using namespace Oyster::Physics;
const int MOVE_FORCE = 5000; const int MOVE_FORCE = 500;
Player::Player() Player::Player()
:DynamicObject() :DynamicObject()
{ {
@ -73,7 +73,7 @@ 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) ;
currPhysicsState.AddRotation(deltaAxis); //currPhysicsState.AddRotation(deltaAxis);
dx = 0; dx = 0;
this->newPhysicsState = this->currPhysicsState; this->newPhysicsState = this->currPhysicsState;
} }