Camera fixes follow-up (#5703)
* allow unconstrained camera when tracking transform and fix some camera interpolation issues Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * tests for interpolation fixes Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add test for camera constraints change Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * updates following review feeedback Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9f9aa8f2a6
commit
593f03efb4
@@ -145,6 +145,15 @@ namespace SandboxEditor
|
||||
}
|
||||
};
|
||||
|
||||
const auto trackingTransform = [viewportId = m_viewportId]
|
||||
{
|
||||
bool tracking = false;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
tracking, viewportId, &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::IsTrackingTransform);
|
||||
|
||||
return tracking;
|
||||
};
|
||||
|
||||
m_firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(SandboxEditor::CameraFreeLookChannelId());
|
||||
|
||||
m_firstPersonRotateCamera->m_rotateSpeedFn = []
|
||||
@@ -152,6 +161,11 @@ namespace SandboxEditor
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
|
||||
m_firstPersonRotateCamera->m_constrainPitch = [trackingTransform]
|
||||
{
|
||||
return !trackingTransform();
|
||||
};
|
||||
|
||||
// default behavior is to hide the cursor but this can be disabled (useful for remote desktop)
|
||||
// note: See CaptureCursorLook in the Settings Registry
|
||||
m_firstPersonRotateCamera->SetActivationBeganFn(hideCursor);
|
||||
@@ -255,6 +269,11 @@ namespace SandboxEditor
|
||||
return SandboxEditor::CameraOrbitYawRotationInverted();
|
||||
};
|
||||
|
||||
m_orbitRotateCamera->m_constrainPitch = [trackingTransform]
|
||||
{
|
||||
return !trackingTransform();
|
||||
};
|
||||
|
||||
m_orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(
|
||||
translateCameraInputChannelIds, AzFramework::LookTranslation, AzFramework::TranslateOffsetOrbit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user