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::LinearManipulator Class Reference

#include <LinearManipulator.h>

Inherits AzToolsFramework::BaseManipulator, and AzToolsFramework::ManipulatorSpaceWithLocalTransform.

Classes

struct  Action
 Mouse action data used by MouseActionCallback (wraps Fixed, Start and Current manipulator state). More...
 
struct  Current
 The state of the manipulator during an interaction. More...
 
struct  Fixed
 Unchanging data set once for the linear manipulator. More...
 
struct  Start
 The state of the manipulator at the start of an interaction. More...
 
struct  StartTransition
 Data passed between the initial press and first movement of the linear manipulator. More...
 

Public Types

using MouseActionCallback = AZStd::function< void(const Action &)>
 
using Starter = AZStd::tuple< StartTransition, Start >
 Tuple of StartTransition (initial mouse down to mouse move) and Start state.
 
- Public Types inherited from AzToolsFramework::BaseManipulator
using UniqueEntityIds = AZStd::unordered_set< AZ::EntityId >
 
using UniqueEntityComponentIds = AZStd::unordered_set< AZ::EntityComponentIdPair >
 

Public Member Functions

 LinearManipulator (const LinearManipulator &)=delete
 
LinearManipulatoroperator= (const LinearManipulator &)=delete
 
void InstallLeftMouseDownCallback (const MouseActionCallback &onMouseDownCallback)
 
void InstallMouseMoveCallback (const MouseActionCallback &onMouseMoveCallback)
 
void InstallLeftMouseUpCallback (const MouseActionCallback &onMouseUpCallback)
 
void Draw (const ManipulatorManagerState &managerState, AzFramework::DebugDisplayRequests &debugDisplay, const AzFramework::CameraState &cameraState, const ViewportInteraction::MouseInteraction &mouseInteraction) override
 Rendering for the manipulator - it is recommended drawing be delegated to a ManipulatorView.
 
void SetAxis (const AZ::Vector3 &axis)
 
const AZ::Vector3 & GetAxis () const
 
template<typename Views >
void SetViews (Views &&views)
 
void UseVisualOrientationOverride (const bool useVisualOverride)
 
void SetVisualOrientationOverride (const AZ::Quaternion &visualOrientation)
 
- Public Member Functions inherited from AzToolsFramework::BaseManipulator
AZ_CLASS_ALLOCATOR_DECL BaseManipulator (const BaseManipulator &)=delete
 
BaseManipulatoroperator= (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)
 
- Public Member Functions inherited from AzToolsFramework::ManipulatorSpaceWithLocalTransform
const AZ::Vector3 & GetLocalPosition () const
 
void SetLocalPosition (const AZ::Vector3 &localPosition)
 
const AZ::Transform & GetLocalTransform () const
 
const AZ::Quaternion & GetLocalOrientation () const
 
void SetLocalTransform (const AZ::Transform &localTransform)
 
void SetLocalOrientation (const AZ::Quaternion &localOrientation)
 
- Public Member Functions inherited from AzToolsFramework::ManipulatorSpace
const AZ::Transform & GetSpace () const
 
void SetSpace (const AZ::Transform &space)
 
const AZ::Vector3 & GetNonUniformScale () const
 
void SetNonUniformScale (const AZ::Vector3 &nonUniformScale)
 
AZ::Transform ApplySpace (const AZ::Transform &localTransform) const
 Calculates a transform combining the space and local transform, taking non-uniform scale into account.
 

Static Public Member Functions

static AZStd::shared_ptr< LinearManipulatorMakeShared (const AZ::Transform &worldFromLocal)
 

Additional Inherited Members

- Static Public Attributes inherited from AzToolsFramework::BaseManipulator
static const AZ::Color s_defaultMouseOverColor
 
- Protected Member Functions inherited from AzToolsFramework::BaseManipulator
 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.
 

Detailed Description

LinearManipulator serves as a visual tool for users to modify values in one dimension on an axis defined in 3D space.

Member Typedef Documentation

◆ MouseActionCallback

This is the function signature of callbacks that will be invoked whenever a manipulator is clicked on or dragged.

Member Function Documentation

◆ Draw()

void AzToolsFramework::LinearManipulator::Draw ( const ManipulatorManagerState managerState,
AzFramework::DebugDisplayRequests &  debugDisplay,
const AzFramework::CameraState &  cameraState,
const ViewportInteraction::MouseInteraction mouseInteraction 
)
overridevirtual

Rendering for the manipulator - it is recommended drawing be delegated to a ManipulatorView.

Implements AzToolsFramework::BaseManipulator.

◆ MakeShared()

static AZStd::shared_ptr< LinearManipulator > AzToolsFramework::LinearManipulator::MakeShared ( const AZ::Transform &  worldFromLocal)
static

A Manipulator must only be created and managed through a shared_ptr.

Note
worldFromLocal should not contain scale.

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