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

#include <EditorPickEntitySelection.h>

Public Member Functions

AZ_CLASS_ALLOCATOR_DECL EditorPickEntitySelectionHelper (const EditorVisibleEntityDataCacheInterface *entityDataCache, ViewportEditorModeTrackerInterface *viewportEditorModeTracker)
 
bool HandleMouseViewportInteraction (const ViewportInteraction::MouseInteractionEvent &mouseInteraction)
 
void HighlightSelectedEntity ()
 Highlight the currently-selected entity in the viewport.
 
void DisplayEditorHelpers (const AzFramework::ViewportInfo &viewportInfo, AzFramework::DebugDisplayRequests &debugDisplay)
 

Protected Attributes

AZStd::unique_ptr< EditorHelpersm_editorHelpers
 Editor visualization of entities (icons, shapes, debug visuals etc).
 
AZ::EntityId m_hoveredEntityId
 What EntityId is the mouse currently hovering over (if any).
 
AZ::EntityId m_cachedEntityIdUnderCursor
 
ViewportEditorModeTrackerInterfacem_viewportEditorModeTracker = nullptr
 Tracker for activating/deactivating viewport editor modes.
 

Detailed Description

Viewport interaction helper that handles highlighting entities and picking them within the viewport. This helper can be used from within other Viewport Interaction modes, such as the EditorDefaultSelection mode.

Member Function Documentation

◆ DisplayEditorHelpers()

void AzToolsFramework::EditorPickEntitySelectionHelper::DisplayEditorHelpers ( const AzFramework::ViewportInfo &  viewportInfo,
AzFramework::DebugDisplayRequests &  debugDisplay 
)

Draw the EditorHelpers. This should only need to get called when used from EditorPickEntitySelection, since ViewportInteraction modes need to own the full display of the EditorHelpers. If this is being used as a helper with a different ViewportInteraction mode such as EditorDefaultSelection, then calling this would cause a crash due to a recursive loop from multiple EditorHelper display calls.

◆ HandleMouseViewportInteraction()

bool AzToolsFramework::EditorPickEntitySelectionHelper::HandleMouseViewportInteraction ( const ViewportInteraction::MouseInteractionEvent mouseInteraction)

Detects the entity under the cursor and the viewport and selects it when the button is pressed.

Parameters
mouseInteractionThe mouse interaction event to use for entity detection and selection.
Returns
True if the event was handled, false if it should continue being processed. (Currently always returns false)

Member Data Documentation

◆ m_cachedEntityIdUnderCursor

AZ::EntityId AzToolsFramework::EditorPickEntitySelectionHelper::m_cachedEntityIdUnderCursor
protected

Store the EntityId on each mouse move for use in Display.


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