From ef0ff801e499d80f6c594940dea66ac0eceaafe1 Mon Sep 17 00:00:00 2001 From: maverickdgg Date: Sun, 5 Mar 2023 10:55:39 +0800 Subject: [PATCH] Camera arm target offset rotation fix --- SHADE_Engine/src/Camera/SHCameraSystem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 85f3b1b1..20d44201 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -272,6 +272,13 @@ namespace SHADE if (arm->isActive == true) { camera.offset = arm->GetOffset(); + + SHVec3 tOffset = arm->GetTargetOffset(); + + + tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw())); + + if (arm->lookAtCameraOrigin) CameraLookAt(camera, camera.position + arm->GetTargetOffset()); -- 2.40.1