The base class for manipulators, providing interfaces for users of manipulators to talk to. More...
#include <BaseManipulator.h>
Inherits AZStd::enable_shared_from_this< BaseManipulator >.
Inherited by AzToolsFramework::AngularManipulator, AzToolsFramework::LineSegmentSelectionManipulator, AzToolsFramework::LinearManipulator, AzToolsFramework::MultiLinearManipulator, AzToolsFramework::PaintBrushManipulator, AzToolsFramework::PlanarManipulator, AzToolsFramework::SelectionManipulator, AzToolsFramework::SplineSelectionManipulator, and AzToolsFramework::SurfaceManipulator.
Public Types | |
using | UniqueEntityIds = AZStd::unordered_set< AZ::EntityId > |
using | UniqueEntityComponentIds = AZStd::unordered_set< AZ::EntityComponentIdPair > |
Public Member Functions | |
AZ_CLASS_ALLOCATOR_DECL | BaseManipulator (const BaseManipulator &)=delete |
BaseManipulator & | operator= (const BaseManipulator &)=delete |
bool | OnLeftMouseDown (const ViewportInteraction::MouseInteraction &interaction, float rayIntersectionDistance) |
void | OnLeftMouseUp (const ViewportInteraction::MouseInteraction &interaction) |
bool | OnRightMouseDown (const ViewportInteraction::MouseInteraction &interaction, float rayIntersectionDistance) |
void | OnRightMouseUp (const ViewportInteraction::MouseInteraction &interaction) |
void | OnMouseMove (const ViewportInteraction::MouseInteraction &interaction) |
void | OnMouseWheel (const ViewportInteraction::MouseInteraction &interaction) |
bool | OnMouseOver (ManipulatorId manipulatorId, const ViewportInteraction::MouseInteraction &interaction) |
void | Register (ManipulatorManagerId managerId) |
void | Unregister () |
Unregister itself from the manipulator manager it was registered with. | |
void | SetBoundsDirty () |
Bounds will need to be recalculated next time we render. | |
bool | Registered () const |
Is this manipulator currently registered with a manipulator manager. | |
bool | PerformingAction () const |
Is the manipulator in the middle of an action (between mouse down and mouse up). | |
bool | MouseOver () const |
Is the mouse currently over the manipulator (intersecting manipulator bound). | |
ManipulatorId | GetManipulatorId () const |
The unique id of this manipulator. | |
ManipulatorManagerId | GetManipulatorManagerId () const |
The unique id of the manager this manipulator was registered with. | |
const UniqueEntityComponentIds & | EntityComponentIdPairs () const |
Returns all EntityComponentIdPairs associated with this manipulator. | |
void | AddEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) |
Add an entity and component the manipulator is responsible for. | |
UniqueEntityComponentIds::iterator | RemoveEntityId (AZ::EntityId entityId) |
UniqueEntityComponentIds::iterator | RemoveEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) |
Remove a specific component (via a EntityComponentIdPair) being affected by this manipulator. | |
bool | HasEntityId (AZ::EntityId entityId) const |
Is this entity currently being tracked by this manipulator. | |
bool | HasEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) const |
Is this entity component pair currently being tracked by this manipulator. | |
void | ForwardMouseOverEvent (const ViewportInteraction::MouseInteraction &interaction) |
Static Public Attributes | |
static const AZ::Color | s_defaultMouseOverColor |
Protected Member Functions | |
BaseManipulator ()=default | |
Protected constructor. | |
void | Invalidate () |
Called when unregistering - users of manipulators should not call it directly. | |
virtual void | InvalidateImpl () |
The implementation to override in a derived class for Invalidate. | |
virtual void | OnLeftMouseDownImpl (const ViewportInteraction::MouseInteraction &, float) |
void | AttachLeftMouseDownImpl () |
virtual void | OnRightMouseDownImpl (const ViewportInteraction::MouseInteraction &, float) |
void | AttachRightMouseDownImpl () |
virtual void | OnLeftMouseUpImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnLeftMouseUp. | |
virtual void | OnRightMouseUpImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnRightMouseUp. | |
virtual void | OnMouseMoveImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseMove. | |
virtual void | OnMouseOverImpl (ManipulatorId, const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseOver. | |
virtual void | OnMouseWheelImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseWheel. | |
virtual void | SetBoundsDirtyImpl () |
The implementation to override in a derived class for SetBoundsDirty. | |
virtual void | Draw (const ManipulatorManagerState &managerState, AzFramework::DebugDisplayRequests &debugDisplay, const AzFramework::CameraState &cameraState, const ViewportInteraction::MouseInteraction &mouseInteraction)=0 |
Rendering for the manipulator - it is recommended drawing be delegated to a ManipulatorView. | |
Friends | |
class | ManipulatorManager |
The base class for manipulators, providing interfaces for users of manipulators to talk to.
|
protectedpure virtual |
Rendering for the manipulator - it is recommended drawing be delegated to a ManipulatorView.
Implemented in AzToolsFramework::SurfaceManipulator, AzToolsFramework::AngularManipulator, AzToolsFramework::LinearManipulator, AzToolsFramework::LineSegmentSelectionManipulator, AzToolsFramework::MultiLinearManipulator, AzToolsFramework::PaintBrushManipulator, AzToolsFramework::PlanarManipulator, AzToolsFramework::SelectionManipulator, and AzToolsFramework::SplineSelectionManipulator.
void AzToolsFramework::BaseManipulator::ForwardMouseOverEvent | ( | const ViewportInteraction::MouseInteraction & | interaction | ) |
Forward a mouse over event in a case where we need the manipulator to immediately refresh.
bool AzToolsFramework::BaseManipulator::OnLeftMouseDown | ( | const ViewportInteraction::MouseInteraction & | interaction, |
float | rayIntersectionDistance | ||
) |
Callback for the event when the mouse pointer is over this manipulator and the left mouse button is pressed.
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
rayIntersectionDistance | The parameter value in the ray's explicit equation that represents the intersecting point on the target manipulator in world space. |
|
inlineprotectedvirtual |
The implementation to override in a derived class for OnLeftMouseDown. Note: When implementing this function you must also call AttachLeftMouseDownImpl to ensure m_onLeftMouseDownImpl is set to OnLeftMouseDownImpl, otherwise it will not be called
void AzToolsFramework::BaseManipulator::OnLeftMouseUp | ( | const ViewportInteraction::MouseInteraction & | interaction | ) |
Callback for the event when this manipulator is active and the left mouse button is released.
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
void AzToolsFramework::BaseManipulator::OnMouseMove | ( | const ViewportInteraction::MouseInteraction & | interaction | ) |
Callback for the event when this manipulator is active and the mouse is moved.
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
bool AzToolsFramework::BaseManipulator::OnMouseOver | ( | ManipulatorId | manipulatorId, |
const ViewportInteraction::MouseInteraction & | interaction | ||
) |
This function changes the state indicating whether the manipulator is under the mouse pointer. It is called in the event of OnMouseMove and OnMouseWheel only when there is no manipulator currently performing actions.
void AzToolsFramework::BaseManipulator::OnMouseWheel | ( | const ViewportInteraction::MouseInteraction & | interaction | ) |
Callback for the event when this manipulator is active and the mouse wheel is scrolled.
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
bool AzToolsFramework::BaseManipulator::OnRightMouseDown | ( | const ViewportInteraction::MouseInteraction & | interaction, |
float | rayIntersectionDistance | ||
) |
Callback for the event when the mouse pointer is over this manipulator and the right mouse button is pressed .
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
rayIntersectionDistance | The parameter value in the ray's explicit equation that represents the intersecting point on the target manipulator in world space. |
|
inlineprotectedvirtual |
The implementation to override in a derived class for OnRightMouseDown. Note: When implementing this function you must also call AttachRightMouseDownImpl to ensure m_onRightMouseDownImpl is set to OnRightMouseDownImpl, otherwise it will not be called
void AzToolsFramework::BaseManipulator::OnRightMouseUp | ( | const ViewportInteraction::MouseInteraction & | interaction | ) |
Callback for the event when this manipulator is active and the right mouse button is released.
interaction | It contains various mouse states when the event happens, as well as a ray shooting from the viewing camera through the mouse pointer. |
void AzToolsFramework::BaseManipulator::Register | ( | ManipulatorManagerId | managerId | ) |
Register itself to a manipulator manager so that it can receive various mouse events and perform manipulations.
managerId | The id identifying a unique manipulator manager. |
UniqueEntityComponentIds::iterator AzToolsFramework::BaseManipulator::RemoveEntityId | ( | AZ::EntityId | entityId | ) |
Remove an entity from being affected by this manipulator.