Fix editor orbit camera (#1683)

* Add a way for the EditorViewportWidget to inform the legacy orbit camera of the calculated orbit distance.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
This commit is contained in:
rgba16f
2021-06-30 15:23:47 -05:00
committed by GitHub
parent 827855f01c
commit 1f9917f5b7
3 changed files with 33 additions and 0 deletions
@@ -26,6 +26,12 @@ namespace SandboxEditor
LegacyViewportCameraControllerInstance::LegacyViewportCameraControllerInstance(AzFramework::ViewportId viewportId, LegacyViewportCameraController* controller)
: AzFramework::MultiViewportControllerInstanceInterface<LegacyViewportCameraController>(viewportId, controller)
{
OrbitCameraControlsBus::Handler::BusConnect(viewportId);
}
LegacyViewportCameraControllerInstance::~LegacyViewportCameraControllerInstance()
{
OrbitCameraControlsBus::Handler::BusDisconnect();
}
bool LegacyViewportCameraControllerInstance::JustAltHeld() const
@@ -59,6 +65,12 @@ bool LegacyViewportCameraControllerInstance::InvertPan() const
return JustAltHeld();
}
void LegacyViewportCameraControllerInstance::SetOrbitDistance(float orbitDistance)
{
m_orbitDistance = orbitDistance;
}
AZ::RPI::ViewportContextPtr LegacyViewportCameraControllerInstance::GetViewportContext()
{
// This could be cached, if needed