Implemented TurnLeft function
This commit is contained in:
parent
0a9b522e15
commit
3520062577
|
@ -33,6 +33,8 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, void (*EventOnCollision)
|
||||||
this->moveDir = Oyster::Math::Float3(0,0,0);
|
this->moveDir = Oyster::Math::Float3(0,0,0);
|
||||||
this->moveSpeed = 100;
|
this->moveSpeed = 100;
|
||||||
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
||||||
|
|
||||||
|
this->rotationUp = 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)
|
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)
|
||||||
|
@ -53,6 +55,8 @@ Player::Player(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustom
|
||||||
this->moveDir = Oyster::Math::Float3(0,0,0);
|
this->moveDir = Oyster::Math::Float3(0,0,0);
|
||||||
this->moveSpeed = 20;
|
this->moveSpeed = 20;
|
||||||
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
this->previousMoveSpeed = Oyster::Math::Float3(0,0,0);
|
||||||
|
|
||||||
|
this->rotationUp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::~Player(void)
|
Player::~Player(void)
|
||||||
|
@ -229,8 +233,8 @@ void Player::Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D:
|
||||||
}
|
}
|
||||||
void Player::TurnLeft(Oyster::Math3D::Float deltaRadians)
|
void Player::TurnLeft(Oyster::Math3D::Float deltaRadians)
|
||||||
{
|
{
|
||||||
//TODO: Conver delta radians to something that phyhsics use...
|
this->rotationUp += deltaRadians;
|
||||||
//this->rigidBody->;
|
this->rigidBody->SetRotationAsAngularAxis(Oyster::Math3D::Float4(this->rigidBody->GetState().centerPos.GetNormalized(), this->rotationUp));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Jump()
|
void Player::Jump()
|
||||||
|
|
|
@ -96,6 +96,8 @@ namespace GameLogic
|
||||||
Oyster::Math::Float moveSpeed;
|
Oyster::Math::Float moveSpeed;
|
||||||
Oyster::Math::Float3 previousMoveSpeed;
|
Oyster::Math::Float3 previousMoveSpeed;
|
||||||
|
|
||||||
|
Oyster::Math::Float rotationUp;
|
||||||
|
|
||||||
|
|
||||||
bool hasTakenDamage;
|
bool hasTakenDamage;
|
||||||
float invincibleCooldown;
|
float invincibleCooldown;
|
||||||
|
|
Loading…
Reference in New Issue