#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< BaseManipulator > | PerformRaycast (const AZ::Vector3 &rayOrigin, const AZ::Vector3 &rayDirection, float &rayIntersectionDistance) |
void | OnEntityInfoUpdatedVisibility (AZ::EntityId entityId, bool visible) override |
AZStd::optional< PickedManipulator > | PickManipulator (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, ManipulatorId > | m_boundIdToManipulatorIdMap |
Mapping from a boundId to the corresponding manipulatorId. | |
AZStd::shared_ptr< BaseManipulator > | m_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). | |
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.
|
protected |
rayOrigin | The origin of the ray to test intersection with. | |
rayDirection | The direction of the ray to test intersection with. | |
[out] | rayIntersectionDistance | The result intersecting point equals "rayOrigin + rayIntersectionDistance * rayDirection". |
|
protected |
Called once per frame after all manipulators have been drawn (and their bounds updated if required).
|
protected |
All active manipulator bounds that could be interacted with.