Camera arm target offset rotation fix #395

Merged
maverickdgg merged 1 commits from SP3-141-Camera-System into main 2023-03-05 11:46:02 +08:00
1 changed files with 7 additions and 0 deletions

View File

@ -272,6 +272,13 @@ namespace SHADE
if (arm->isActive == true) if (arm->isActive == true)
{ {
camera.offset = arm->GetOffset(); camera.offset = arm->GetOffset();
SHVec3 tOffset = arm->GetTargetOffset();
tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw()));
if (arm->lookAtCameraOrigin) if (arm->lookAtCameraOrigin)
CameraLookAt(camera, camera.position + arm->GetTargetOffset()); CameraLookAt(camera, camera.position + arm->GetTargetOffset());