#include <BaseShapeViewportEdit.h>
Inherited by AzToolsFramework::BoxViewportEdit, AzToolsFramework::CapsuleViewportEdit, AzToolsFramework::ShapeTranslationOffsetViewportEdit, and AzToolsFramework::SphereViewportEdit.
Public Member Functions | |
virtual void | Setup (const ManipulatorManagerId manipulatorManagerId)=0 |
virtual void | Teardown ()=0 |
Destroy the manipulators for the shape properties being edited. | |
virtual void | UpdateManipulators ()=0 |
Call after modifying the shape to ensure that the space the manipulators operate in is updated, along with other properties. | |
void | ResetValues () |
Reset the shape properties being edited to their default values. | |
void | AddEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) |
virtual void | OnCameraStateChanged (const AzFramework::CameraState &cameraState) |
void | InstallGetManipulatorSpace (AZStd::function< AZ::Transform()> getManipulatorSpace) |
void | InstallGetNonUniformScale (AZStd::function< AZ::Vector3()> getNonUniformScale) |
void | InstallGetTranslationOffset (AZStd::function< AZ::Vector3()> getTranslationOffset) |
void | InstallGetRotationOffset (AZStd::function< AZ::Quaternion()> getRotationOffset) |
void | InstallSetTranslationOffset (AZStd::function< void(const AZ::Vector3 &)> setTranslationOffset) |
void | InstallBeginEditing (AZStd::function< void()> beginEditing) |
void | InstallEndEditing (AZStd::function< void()> endEditing) |
Protected Attributes | |
AZStd::function< AZ::Transform()> | m_getManipulatorSpace |
AZStd::function< AZ::Vector3()> | m_getNonUniformScale |
AZStd::function< AZ::Vector3()> | m_getTranslationOffset |
AZStd::function< AZ::Quaternion()> | m_getRotationOffset |
AZStd::function< void(const AZ::Vector3 &)> | m_setTranslationOffset |
AZStd::function< void()> | m_beginEditing |
AZStd::function< void()> | m_endEditing |
AZStd::unordered_set< AZ::EntityId > | m_entityIds |
UndoSystem::URSequencePoint * | m_undoBatch = nullptr |
Base class for viewport editing of shapes. This class and its descendants are intended to be viewport independent, so avoid using buses addressed by EntityId or EntityComponentIdPair. To facilitate uses in the main viewport, an EntityComponentIdPair can optionally be specified using AddEntityComponentIdPair, in order to hook manipulators up to undo/redo behavior and UI refreshing.
void AzToolsFramework::BaseShapeViewportEdit::AddEntityComponentIdPair | ( | const AZ::EntityComponentIdPair & | entityComponentIdPair | ) |
Optionally used to associate an EntityComponentIdPair with the shape manipulators. This is useful in the main editor viewport for hooking up undo/redo behavior and UI refreshing. This should be called after Setup. Otherwise, the manipulators will not have been created yet.
void AzToolsFramework::BaseShapeViewportEdit::InstallBeginEditing | ( | AZStd::function< void()> | beginEditing | ) |
Install optional functions to provide hooks for connecting to undo/redo systems, refreshing UI etc. These are not expected to be necessary in the main editor viewport, because the manipulators handle those things automatically, but they may be useful in other viewports.
void AzToolsFramework::BaseShapeViewportEdit::InstallGetManipulatorSpace | ( | AZStd::function< AZ::Transform()> | getManipulatorSpace | ) |
Install the functions required for the manipulators to interact with the shape and the viewport.
|
virtual |
Optionally allows the viewport editing to respond to the camera state changing, for example by repositioning manipulators to more conveniently accessible locations.
Reimplemented in AzToolsFramework::CapsuleViewportEdit, and AzToolsFramework::SphereViewportEdit.
|
pure virtual |
Create manipulators for the shape properties to be edited. Make sure to install all the required functions before calling Setup.
Implemented in AzToolsFramework::BoxViewportEdit, AzToolsFramework::CapsuleViewportEdit, AzToolsFramework::ShapeTranslationOffsetViewportEdit, and AzToolsFramework::SphereViewportEdit.
|
pure virtual |
Destroy the manipulators for the shape properties being edited.
Implemented in AzToolsFramework::BoxViewportEdit, AzToolsFramework::CapsuleViewportEdit, AzToolsFramework::ShapeTranslationOffsetViewportEdit, and AzToolsFramework::SphereViewportEdit.
|
pure virtual |
Call after modifying the shape to ensure that the space the manipulators operate in is updated, along with other properties.
Implemented in AzToolsFramework::BoxViewportEdit, AzToolsFramework::CapsuleViewportEdit, AzToolsFramework::ShapeTranslationOffsetViewportEdit, and AzToolsFramework::SphereViewportEdit.