Open 3D Engine WhiteBox Gem API Reference 26.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
WhiteBox::DrawShapeMode Class Reference

#include <WhiteBoxDrawShapeMode.h>

Inherits AzFramework::ViewportDebugDisplayEventBus::Handler, and EditorWhiteBoxDrawShapeModeRequestBus::Handler.

Public Member Functions

AZ_CLASS_ALLOCATOR_DECL DrawShapeMode (const AZ::EntityComponentIdPair &entityComponentIdPair)
 
void NumericAppendDigit (char digit) override
 
void NumericAppendDecimal () override
 
void NumericNegate () override
 
void NumericAppendOperatorPlus () override
 
void NumericAppendOperatorMult () override
 
void NumericAppendOperatorDiv () override
 
void NumericBackspace () override
 
void NumericConfirm () override
 
void NumericCancel () override
 
bool HandleMouseInteraction (const ModeMouseInteraction &mouse)
 
void Display (const AZ::EntityComponentIdPair &, const AZ::Transform &, const IntersectionAndRenderData &, const AzFramework::ViewportInfo &, AzFramework::DebugDisplayRequests &)
 
void Refresh ()
 Required by EditorWhiteBoxComponentMode variant dispatch.
 
AZStd::vector< AzToolsFramework::ActionOverride > PopulateActions (const AZ::EntityComponentIdPair &entityComponentIdPair)
 Required by EditorWhiteBoxComponentMode variant dispatch.
 

Static Public Member Functions

static void RegisterActions ()
 Register/assign the numeric-entry keyboard actions for the draw sub-mode.
 
static void BindActionsToModes (const AZStd::string &modeIdentifier)
 

Detailed Description

DrawShapeMode implements Lumberyard-style click-drag-release-pull shape drawing inside the White Box component mode.

Interaction flow:

  1. Left mouse down -> anchor first corner (world hit or ground plane)
  2. Left mouse drag -> size the base rectangle (live preview)
  3. Left mouse up -> lock base, enter height-pull phase
  4. Mouse move -> pull height along up-axis (live preview)
  5. Left mouse down -> commit box to white box mesh + undo batch Right-click / Esc -> cancel at any phase

During the height-pull phase the depth can also be typed (Blender-style numeric entry, expressions allowed e.g. "-5+3"). The first digit/minus locks the mouse pull; Enter commits, Escape cancels the numeric entry. In Ctrl (boolean) mode the sign decides the operation: + adds, - carves.

Member Function Documentation

◆ Display()

void WhiteBox::DrawShapeMode::Display ( const AZ::EntityComponentIdPair &  ,
const AZ::Transform &  ,
const IntersectionAndRenderData &  ,
const AzFramework::ViewportInfo &  ,
AzFramework::DebugDisplayRequests &   
)
inline

Required by EditorWhiteBoxComponentMode variant dispatch. DrawShapeMode draws its own ghost preview through DisplayViewport (ViewportDebugDisplayEventBus), so the shared per-mode Display path is intentionally a no-op here.

◆ HandleMouseInteraction()

bool WhiteBox::DrawShapeMode::HandleMouseInteraction ( const ModeMouseInteraction &  mouse)

Forward a raw mouse interaction event.

Returns
true if the event was consumed (prevents other handlers from seeing it).

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