GameLogic - Added functions for relative rotation
This commit is contained in:
parent
61350572c7
commit
f0c581ca04
|
@ -31,17 +31,18 @@ namespace GameLogic
|
||||||
PlayerData(int playerID,int teamID);
|
PlayerData(int playerID,int teamID);
|
||||||
~PlayerData();
|
~PlayerData();
|
||||||
|
|
||||||
void Move(const PLAYER_MOVEMENT &movement) override;
|
void Move(const PLAYER_MOVEMENT &movement) override;
|
||||||
void UseWeapon(const WEAPON_FIRE &usage) override;
|
void UseWeapon(const WEAPON_FIRE &usage) override;
|
||||||
int GetTeamID() const override;
|
int GetTeamID() const override;
|
||||||
PLAYER_STATE GetState() const override;
|
PLAYER_STATE GetState() const override;
|
||||||
Oyster::Math::Float3 GetPosition() override;
|
Oyster::Math::Float3 GetPosition() override;
|
||||||
Oyster::Math::Quaternion GetRotation() override;
|
Oyster::Math::Quaternion GetRotation() override;
|
||||||
Oyster::Math::Float3 GetScale() override;
|
Oyster::Math::Float3 GetScale() override;
|
||||||
Oyster::Math::Float4x4 GetOrientation() override;
|
Oyster::Math::Float4x4 GetOrientation() override;
|
||||||
int GetID() const override;
|
int GetID() const override;
|
||||||
void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right) override;
|
void Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D::Float3& right) override;
|
||||||
ObjectSpecialType GetObjectType() const override;
|
void TurnLeft(Oyster::Math3D::Float deltaLeftRadians ) override;
|
||||||
|
ObjectSpecialType GetObjectType() const override;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,12 @@ namespace GameLogic
|
||||||
* @param x: The relative x axis
|
* @param x: The relative x axis
|
||||||
* @param y: The relative y axis
|
* @param y: The relative y axis
|
||||||
**/
|
**/
|
||||||
virtual void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right) = 0;
|
virtual void Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D::Float3& right) = 0;
|
||||||
|
|
||||||
|
/** Relative rotation around given axis
|
||||||
|
* @param leftRadians: The relative amount of radians to turn
|
||||||
|
**/
|
||||||
|
virtual void TurnLeft(Oyster::Math3D::Float deltaLeftRadians ) = 0;
|
||||||
|
|
||||||
/********************************************************
|
/********************************************************
|
||||||
* Uses the chosen players weapon based on input
|
* Uses the chosen players weapon based on input
|
||||||
|
|
|
@ -85,7 +85,11 @@ ObjectSpecialType Game::PlayerData::GetObjectType() const
|
||||||
{
|
{
|
||||||
return this->player->GetObjectType();
|
return this->player->GetObjectType();
|
||||||
}
|
}
|
||||||
void Game::PlayerData::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right)
|
void Game::PlayerData::Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D::Float3& right)
|
||||||
{
|
{
|
||||||
this->player->Rotate(lookDir, right);
|
this->player->Rotate(lookDir, right);
|
||||||
}
|
}
|
||||||
|
void Game::PlayerData::TurnLeft(Oyster::Math3D::Float deltaLeftRadians )
|
||||||
|
{
|
||||||
|
this->player->TurnLeft(deltaLeftRadians);
|
||||||
|
}
|
|
@ -220,7 +220,7 @@ void Player::Respawn(Oyster::Math::Float3 spawnPoint)
|
||||||
this->rigidBody->SetPosition(spawnPoint);
|
this->rigidBody->SetPosition(spawnPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right)
|
void Player::Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D::Float3& right)
|
||||||
{
|
{
|
||||||
// this is the camera right vector
|
// this is the camera right vector
|
||||||
this->lookDir = lookDir;
|
this->lookDir = lookDir;
|
||||||
|
@ -228,6 +228,11 @@ void Player::Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::
|
||||||
//Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1];
|
//Oyster::Math::Float3 up = this->rigidBody->GetState().GetOrientation().v[1];
|
||||||
//this->rigidBody->SetUpAndRight(up, right);
|
//this->rigidBody->SetUpAndRight(up, right);
|
||||||
}
|
}
|
||||||
|
void Player::TurnLeft(Oyster::Math3D::Float deltaRadians)
|
||||||
|
{
|
||||||
|
//TODO: Conver delta radians to something that phyhsics use...
|
||||||
|
//this->rigidBody->;
|
||||||
|
}
|
||||||
|
|
||||||
void Player::Jump()
|
void Player::Jump()
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,9 @@ namespace GameLogic
|
||||||
void Respawn(Oyster::Math::Float3 spawnPoint);
|
void Respawn(Oyster::Math::Float3 spawnPoint);
|
||||||
|
|
||||||
|
|
||||||
void Rotate(const Oyster::Math3D::Float3 lookDir, const Oyster::Math3D::Float3 right);
|
void Rotate(const Oyster::Math3D::Float3& lookDir, const Oyster::Math3D::Float3& right);
|
||||||
|
|
||||||
|
void TurnLeft(Oyster::Math3D::Float deltaRadians);
|
||||||
|
|
||||||
/********************************************************
|
/********************************************************
|
||||||
* Collision function for player, this is to be sent to physics through the subscribe function with the rigidbody
|
* Collision function for player, this is to be sent to physics through the subscribe function with the rigidbody
|
||||||
|
|
Loading…
Reference in New Issue