Temporary jump

This commit is contained in:
Robin Engman 2014-02-14 12:07:49 +01:00
parent 61c49cf352
commit f8e68b95b2
2 changed files with 6 additions and 12 deletions

View File

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

View File

@ -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()