From aa1b45c3de611167656ff96abad35ea6f8d60d1f Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sun, 23 Oct 2022 15:03:24 +0800 Subject: [PATCH] Fixed editor camera --- SHADE_Engine/src/Camera/SHCameraSystem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 3c5cae23..07995fc5 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -69,6 +69,7 @@ namespace SHADE if (SHInputManager::GetKey(SHInputManager::SH_KEYCODE::A)) { + std::cout << "Camera movement: "<UpdateCameraComponent(system->editorCamera); } @@ -134,14 +136,14 @@ namespace SHADE void SHCameraSystem::UpdateCameraComponent(SHCameraComponent& camera) noexcept { - if (SHComponentManager::HasComponent(camera.GetEID()) == true) + if (SHComponentManager::HasComponent(camera.GetEID()) == true && &camera != &editorCamera) { auto transform = SHComponentManager::GetComponent(camera.GetEID()); SHVec3 rotation = transform->GetWorldRotation(); camera.pitch = rotation.x; camera.yaw = rotation.y; camera.roll = rotation.z; - camera.position = transform->GetWorldPosition(); + camera.position = transform->GetWorldPosition(); } @@ -151,7 +153,7 @@ namespace SHADE SHVec3 view, right, UP; - ClampCameraRotation(camera); + //ClampCameraRotation(camera); GetCameraAxis(camera, view, right, UP);