Add SetActive function
This commit is contained in:
@@ -51,6 +51,16 @@ namespace OpenVulkano
|
|||||||
CURRENT_FRAME.needsRedraw = true;
|
CURRENT_FRAME.needsRedraw = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FreeCamCameraController::SetActive()
|
||||||
|
{
|
||||||
|
if (!GetCamera()) return;
|
||||||
|
Math::Vector3f viewDir = Math::Utils::normalize(GetCamera()->GetViewDirection());
|
||||||
|
|
||||||
|
m_position = GetCamera()->GetPosition();
|
||||||
|
m_pitch = Math::Utils::asin(viewDir.y);
|
||||||
|
m_yaw = Math::Utils::atan(-viewDir.x, -viewDir.z);
|
||||||
|
}
|
||||||
|
|
||||||
void FreeCamCameraController::SetDefaultKeybindings()
|
void FreeCamCameraController::SetDefaultKeybindings()
|
||||||
{
|
{
|
||||||
m_actionForward->BindKey(Input::InputKey::Controller::AXIS_LEFT_Y);
|
m_actionForward->BindKey(Input::InputKey::Controller::AXIS_LEFT_Y);
|
||||||
|
|||||||
@@ -46,5 +46,7 @@ namespace OpenVulkano
|
|||||||
void Tick() override;
|
void Tick() override;
|
||||||
|
|
||||||
void SetDefaultKeybindings();
|
void SetDefaultKeybindings();
|
||||||
|
|
||||||
|
void SetActive() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user