Refactor CameraController logic

This commit is contained in:
2021-08-25 19:11:19 +02:00
parent 16f76fa04b
commit 2364c05055
5 changed files with 56 additions and 32 deletions

View File

@@ -12,7 +12,7 @@
namespace openVulkanoCpp
{
FreeCamCameraController::FreeCamCameraController(Scene::Camera* camera) : m_camera(camera)
FreeCamCameraController::FreeCamCameraController(Scene::Camera* camera) : CameraController(camera)
{
auto input = Input::InputManager::GetInstance();
m_actionForward = input->GetAction("forward");
@@ -48,7 +48,7 @@ namespace openVulkanoCpp
m_position += rot * vec;
Math::Matrix4f camTransformation = Math::Utils::toMat4(rot);
camTransformation[3] = Math::Vector4f(m_position, 1);
m_camera->SetMatrix(camTransformation);
GetCamera()->SetMatrix(camTransformation);
}
void FreeCamCameraController::SetDefaultKeybindings()