From debdba183e2efc8bab5c20581dcc27417b5ac073 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Mon, 20 Feb 2023 14:39:10 +0800 Subject: [PATCH 1/2] removed some debug code --- SHADE_Engine/src/Camera/SHCameraSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 6ebbd078..dfcfd463 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -204,8 +204,8 @@ namespace SHADE //SHLOG_INFO("CAMERA COLLISION HIT, {} armlength: {}, true armlength: {}", hitResult.distance, hitResult.distance, (cameraPos - camera->position).Length()); //SHLOG_INFO("Racoon Position {}, {}, {}, Camera Position: {}, {}, {}, Distance {}", cameraTarget.x, cameraTarget.y, cameraTarget.z, cameraPos.x, cameraPos.y, cameraPos.z, SHVec3::Distance(cameraTarget, cameraPos)); //SHLOG_INFO("Camera Position: {}, {}, {}", cameraPos.x, cameraPos.y, cameraPos.z); - auto otherTransform = SHComponentManager::GetComponent_s(hitResult.entityHit); - SHVec3 otherPos = hitResult.position; + //auto otherTransform = SHComponentManager::GetComponent_s(hitResult.entityHit); + //SHVec3 otherPos = hitResult.position; -- 2.40.1 From c9e9a30c3fc43964aa99441346e37629ca14bd35 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Mon, 20 Feb 2023 14:52:01 +0800 Subject: [PATCH 2/2] Exposed FOV to editor. Adjust AR for game camera --- SHADE_Engine/src/Camera/SHCameraComponent.cpp | 3 ++- SHADE_Engine/src/Camera/SHCameraSystem.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SHADE_Engine/src/Camera/SHCameraComponent.cpp b/SHADE_Engine/src/Camera/SHCameraComponent.cpp index 8b2f50d9..17378d79 100644 --- a/SHADE_Engine/src/Camera/SHCameraComponent.cpp +++ b/SHADE_Engine/src/Camera/SHCameraComponent.cpp @@ -254,7 +254,8 @@ RTTR_REGISTRATION .property("Height", &SHCameraComponent::GetHeight, &SHCameraComponent::SetHeight) .property("Near", &SHCameraComponent::GetNear, &SHCameraComponent::SetNear) .property("Far", &SHCameraComponent::GetFar, &SHCameraComponent::SetFar) - .property("Perspective", &SHCameraComponent::GetIsPerspective, &SHCameraComponent::SetIsPerspective); + .property("Perspective", &SHCameraComponent::GetIsPerspective, &SHCameraComponent::SetIsPerspective) + .property("FOV",&SHCameraComponent::GetFOV, &SHCameraComponent::SetFOV); } diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 9b5c1a47..6154c104 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -145,6 +145,19 @@ namespace SHADE //std::cout << EVENT_DATA->resizeWidth << std::endl; //std::cout << EVENT_DATA->resizeHeight << std::endl; + + for (auto director : directorHandleList) + { + auto camera = SHComponentManager::GetComponent_s(director->mainCameraEID); + if (camera) + { + camera->SetWidth(EVENT_DATA->resizeWidth); + camera->SetHeight(EVENT_DATA->resizeHeight); + } + + } + + return eventPtr->handle; } -- 2.40.1