Expose sticky select option to the SettingsRegistry and disable by default (#4149)

* expose sticky select option to the SettingsRegistry

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* update missed callsites after API change to Manipulator Test Framework

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* updates following review feedback

Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
hultonha
2021-09-16 09:14:37 +01:00
committed by GitHub
parent a8908a987a
commit 7e85b1512a
19 changed files with 275 additions and 182 deletions
@@ -49,17 +49,17 @@ namespace AzManipulatorTestFramework
m_viewportManipulatorInteraction.GetManipulatorManager().ConsumeMouseInteractionEvent(*m_event);
}
void ImmediateModeActionDispatcher::EnableSnapToGridImpl()
void ImmediateModeActionDispatcher::SetSnapToGridImpl(const bool enabled)
{
m_viewportManipulatorInteraction.GetViewportInteraction().EnableGridSnaping();
m_viewportManipulatorInteraction.GetViewportInteraction().SetGridSnapping(enabled);
}
void ImmediateModeActionDispatcher::DisableSnapToGridImpl()
void ImmediateModeActionDispatcher::SetStickySelectImpl(const bool enabled)
{
m_viewportManipulatorInteraction.GetViewportInteraction().DisableGridSnaping();
m_viewportManipulatorInteraction.GetViewportInteraction().SetStickySelect(enabled);
}
void ImmediateModeActionDispatcher::GridSizeImpl(float size)
void ImmediateModeActionDispatcher::GridSizeImpl(const float size)
{
m_viewportManipulatorInteraction.GetViewportInteraction().SetGridSize(size);
}
@@ -6,16 +6,15 @@
*
*/
#include <AzManipulatorTestFramework/ViewportInteraction.h>
#include <AzFramework/Viewport/ViewportScreen.h>
#include <AzFramework/Viewport/CameraState.h>
#include <AzFramework/Viewport/ViewportScreen.h>
#include <AzManipulatorTestFramework/ViewportInteraction.h>
#include <AzToolsFramework/Manipulators/ManipulatorBus.h>
namespace AzManipulatorTestFramework
{
// Null debug display for dummy draw calls
class NullDebugDisplayRequests
: public AzFramework::DebugDisplayRequests
class NullDebugDisplayRequests : public AzFramework::DebugDisplayRequests
{
public:
virtual ~NullDebugDisplayRequests() = default;
@@ -76,6 +75,11 @@ namespace AzManipulatorTestFramework
return 0.1f;
}
bool ViewportInteraction::StickySelectEnabled() const
{
return m_stickySelect;
}
void ViewportInteraction::FindVisibleEntities(AZStd::vector<AZ::EntityId>& visibleEntitiesOut)
{
visibleEntitiesOut.assign(m_entityVisibilityQuery.Begin(), m_entityVisibilityQuery.End());
@@ -101,24 +105,19 @@ namespace AzManipulatorTestFramework
return *m_nullDebugDisplayRequests;
}
void ViewportInteraction::EnableGridSnaping()
void ViewportInteraction::SetGridSnapping(const bool enabled)
{
m_gridSnapping = true;
m_gridSnapping = enabled;
}
void ViewportInteraction::DisableGridSnaping()
void ViewportInteraction::SetAngularSnapping(const bool enabled)
{
m_gridSnapping = false;
m_angularSnapping = enabled;
}
void ViewportInteraction::EnableAngularSnaping()
void ViewportInteraction::SetStickySelect(const bool enabled)
{
m_angularSnapping = true;
}
void ViewportInteraction::DisableAngularSnaping()
{
m_angularSnapping = false;
m_stickySelect = enabled;
}
void ViewportInteraction::SetGridSize(float size)
@@ -152,4 +151,4 @@ namespace AzManipulatorTestFramework
{
return 1.0f;
}
}// namespace AzManipulatorTestFramework
} // namespace AzManipulatorTestFramework