Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::ManipulatorManager Class Reference

#include <ManipulatorManager.h>

Inherits ManipulatorManagerRequestBus::Handler, and EditorEntityInfoNotificationBus::Handler.

Public Types

enum class  ConsumeMouseMoveResult { None , Hovering , Interacting }
 The result of consuming a mouse move.
 

Public Member Functions

 ManipulatorManager (ManipulatorManagerId managerId)
 
bool ConsumeViewportMousePress (const ViewportInteraction::MouseInteraction &)
 
ConsumeMouseMoveResult ConsumeViewportMouseMove (const ViewportInteraction::MouseInteraction &)
 
bool ConsumeViewportMouseRelease (const ViewportInteraction::MouseInteraction &)
 
bool ConsumeViewportMouseWheel (const ViewportInteraction::MouseInteraction &)
 
void RegisterManipulator (AZStd::shared_ptr< BaseManipulator > manipulator) override
 
void UnregisterManipulator (BaseManipulator *manipulator) override
 
void DeleteManipulatorBound (Picking::RegisteredBoundId boundId) override
 
void SetBoundDirty (Picking::RegisteredBoundId boundId) override
 
Picking::RegisteredBoundId UpdateBound (ManipulatorId manipulatorId, Picking::RegisteredBoundId boundId, const Picking::BoundRequestShapeBase &boundShapeData) override
 
bool Interacting () const override
 
void DrawManipulators (AzFramework::DebugDisplayRequests &debugDisplay, const AzFramework::CameraState &cameraState, const ViewportInteraction::MouseInteraction &mouseInteraction)
 

Protected Types

using PickedManipulator = AZStd::tuple< AZStd::shared_ptr< BaseManipulator >, float >
 Alias for a Manipulator and intersection distance.
 
using PickedManipulatorId = AZStd::tuple< ManipulatorId, float >
 Alias for a ManipulatorId and intersection distance.
 

Protected Member Functions

AZStd::shared_ptr< BaseManipulatorPerformRaycast (const AZ::Vector3 &rayOrigin, const AZ::Vector3 &rayDirection, float &rayIntersectionDistance)
 
void OnEntityInfoUpdatedVisibility (AZ::EntityId entityId, bool visible) override
 
AZStd::optional< PickedManipulatorPickManipulator (const ViewportInteraction::MousePick &mousePick)
 Return the picked manipulator and intersection distance if a manipulator was intersected.
 
PickedManipulatorId PickManipulatorId (const ViewportInteraction::MousePick &mousePick)
 Wrapper for PickManipulator to return the ManipulatorId directly.
 
void RefreshMouseOverState (const ViewportInteraction::MousePick &mousePick)
 

Protected Attributes

ManipulatorManagerId m_manipulatorManagerId
 This manipulator manager's id.
 
ManipulatorId m_nextManipulatorIdToGenerate
 Id to use for the next manipulator that is registered with this manager.
 
AZStd::unordered_map< ManipulatorId, AZStd::shared_ptr< BaseManipulator > > m_manipulatorIdToPtrMap
 Mapping from a manipulatorId to the corresponding manipulator.
 
AZStd::unordered_map< Picking::RegisteredBoundId, ManipulatorIdm_boundIdToManipulatorIdMap
 Mapping from a boundId to the corresponding manipulatorId.
 
AZStd::shared_ptr< BaseManipulatorm_activeManipulator
 The manipulator we are currently interacting with.
 
Picking::ManipulatorBoundManager m_boundManager
 
AZStd::optional< ManipulatorMouseDownButton > m_mouseDownButton
 The mouse button that is currently pressed (empty if no button is held).
 

Detailed Description

This class serves to manage all relevant mouse events and coordinate all registered manipulators to function properly. ManipulatorManager does not manage the life cycle of specific manipulators. The users of manipulators are responsible for creating and deleting them at right time, as well as registering and unregistering accordingly.

Member Function Documentation

◆ PerformRaycast()

AZStd::shared_ptr< BaseManipulator > AzToolsFramework::ManipulatorManager::PerformRaycast ( const AZ::Vector3 &  rayOrigin,
const AZ::Vector3 &  rayDirection,
float &  rayIntersectionDistance 
)
protected
Parameters
rayOriginThe origin of the ray to test intersection with.
rayDirectionThe direction of the ray to test intersection with.
[out]rayIntersectionDistanceThe result intersecting point equals "rayOrigin + rayIntersectionDistance * rayDirection".
Returns
A pointer to a manipulator that the ray intersects. Null pointer if no intersection is detected.

◆ RefreshMouseOverState()

void AzToolsFramework::ManipulatorManager::RefreshMouseOverState ( const ViewportInteraction::MousePick mousePick)
protected

Called once per frame after all manipulators have been drawn (and their bounds updated if required).

Member Data Documentation

◆ m_boundManager

Picking::ManipulatorBoundManager AzToolsFramework::ManipulatorManager::m_boundManager
protected

All active manipulator bounds that could be interacted with.


The documentation for this class was generated from the following file: