UAxisPositionGizmo

[UAxisPositionGizmo](API\Runtime\InteractiveToolsFramework\BaseGizmos\UAxisPositionGizmo) implements a gizmo interaction where 1D parameter value is manipulated by dragging a point on a 3D line/axis in space.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseGizmos/AxisPositionGizmo.h

Include

#include "BaseGizmos/AxisPositionGizmo.h"

Syntax

class UAxisPositionGizmo :
    public UInteractiveGizmo,
    public IClickDragBehaviorTarget,
    public IHoverBehaviorTarget

Remarks

UAxisPositionGizmo implements a gizmo interaction where 1D parameter value is manipulated by dragging a point on a 3D line/axis in space. The 3D point is converted to the axis parameter at the nearest point, giving us the 1D parameter value.

As with other base gizmos, this class only implements the interaction. The visual aspect of the gizmo, the axis, and the parameter storage are all provided externally.

The axis direction+origin is provided by an IGizmoAxisSource.

The interaction target (ie the thing you have to click on to start the dragging interaction) is provided by an IGizmoClickTarget.

The new 1D parameter value is sent to an IGizmoFloatParameterSource

Internally a UClickDragInputBehavior is used to handle mouse input, configured in Setup()

Variables

Name Description

Public variable

TScriptInterfac...

 

AxisSource

AxisSource provides the 3D line on which the interaction happens

Public variable

bool

 

bCustomDestinationAlignsAxisOrigin

Only used when a custom destination is obtained from CustomDestinationFunc.

Public variable

bool

 

bEnableSignedAxis

If enabled, then the sign on the parameter delta is always "increasing" when moving away from the origin point, rather than just being a projection onto the axis

Public variable

bool

 

bInInteraction

If true, we are in an active click+drag interaction, otherwise we are not

Public variable

TUniqueFunction...

 

CustomDestinationFunc

If ShouldUseCustomDestinationFunc() returns true, this function gets queried to get a destination point.

Public variable

TObjectPtr< UGi...

 

GizmoViewContext

Public variable

TScriptInterfac...

 

HitTarget

The HitTarget provides a hit-test against some 3D element (presumably a visual widget) that controls when interaction can start

Protected variable

float

 

InitialTargetParameter

Public variable

FVector

 

InteractionAxis

Public variable

float

 

InteractionCurParameter

Public variable

FVector

 

InteractionCurPoint

Public variable

FVector

 

InteractionOrigin

The values below are used in the context of a single click-drag interaction, ie if bInInteraction = true They otherwise should be considered uninitialized

Protected variable

float

 

InteractionStartAxisOriginParameterOffset

Public variable

float

 

InteractionStartParameter

Public variable

FVector

 

InteractionStartPoint

Protected variable

FVector

 

LastHitPosition

Public variable

TObjectPtr< UCl...

 

MouseBehavior

The mouse click behavior of the gizmo is accessible so that it can be modified to use different mouse keys.

Public variable

float

 

ParameterSign

Public variable

TScriptInterfac...

 

ParameterSource

The 3D line-nearest-point is converted to a 1D coordinate along the line, and the change in value is sent to this ParameterSource

Public variable

TUniqueFunction...

 

ShouldUseCustomDestinationFunc

This gets checked to see if we should use the custom destination function to get a destination point for the gizmo, rather than grabbing the closest point on axis to ray.

Public variable

TScriptInterfac...

 

StateTarget

StateTarget is notified when interaction starts and ends, so that things like undo/redo can be handled externally.

Overridden from UInteractiveGizmo

Name Description

Public function Virtual

void

 

Setup()

Called by GizmoManager to initialize the Gizmo after GizmoBuilder::BuildGizmo() has been called

Overridden from IClickDragBehaviorTarget

Name Description

Public function Virtual

FInputRayHit

 

CanBeginClickDragSequence

(
    const FInputDeviceRay& PressPos
)

Test if target can begin click-drag interaction at this point

Public function Virtual

void

 

OnClickDrag

(
    const FInputDeviceRay& DragPos
)

Notify Target that input position has changed

Public function Virtual

void

 

OnClickPress

(
    const FInputDeviceRay& PressPos
)

Notify Target that click press ocurred

Public function Virtual

void

 

OnClickRelease

(
    const FInputDeviceRay& ReleasePos
)

Notify Target that click release occurred

Public function Virtual

void

 

OnTerminateDragSequence()

Notify Target that click-drag sequence has been explicitly terminated (eg by escape key)

Overridden from IHoverBehaviorTarget

Name Description

Public function Virtual

FInputRayHit

 

BeginHoverSequenceHitTest

(
    const FInputDeviceRay& PressPos
)

IHoverBehaviorTarget implementation.

Public function Virtual

void

 

OnBeginHover

(
    const FInputDeviceRay& DevicePos
)

Initialize hover sequence at given position

Public function Virtual

void

 

OnEndHover()

Terminate active hover sequence

Public function Virtual

bool

 

OnUpdateHover

(
    const FInputDeviceRay& DevicePos
)

Update active hover sequence with new input position

Classes

Name

Description

Public struct

FCustomDestinationParams