Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
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()
| Name | UAxisPositionGizmo |
| Type | class |
| Header File | /Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseGizmos/AxisPositionGizmo.h |
| Include Path | #include "BaseGizmos/AxisPositionGizmo.h" |
Syntax
UCLASS (MinimalAPI)
class UAxisPositionGizmo :
public UInteractiveGizmo ,
public IClickDragBehaviorTarget ,
public IHoverBehaviorTarget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveGizmo → UAxisPositionGizmo
Implements Interfaces
Structs
| Name | Remarks |
|---|---|
| FCustomDestinationParams |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AxisSource | TScriptInterface< IGizmoAxisSource > | The below properties can be manipulated for more fine-grained control, but typically it is sufficient to use one of the initialization methods above. | BaseGizmos/AxisPositionGizmo.h | |
| bCustomDestinationAlignsAxisOrigin | bool | Only used when a custom destination is obtained from CustomDestinationFunc. | BaseGizmos/AxisPositionGizmo.h | |
| bEnableSignedAxis | bool | 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 | BaseGizmos/AxisPositionGizmo.h | |
| bInInteraction | bool | If true, we are in an active click+drag interaction, otherwise we are not | BaseGizmos/AxisPositionGizmo.h | |
| CustomDestinationFunc | TUniqueFunction< bool(const FCustomDestinationParams &WorldRay, FVector &OutputPoint)> | If ShouldUseCustomDestinationFunc() returns true, this function gets queried to get a destination point. | BaseGizmos/AxisPositionGizmo.h | |
| GizmoViewContext | TObjectPtr< UGizmoViewContext > | BaseGizmos/AxisPositionGizmo.h | ||
| HitTarget | TScriptInterface< IGizmoClickTarget > | The HitTarget provides a hit-test against some 3D element (presumably a visual widget) that controls when interaction can start | BaseGizmos/AxisPositionGizmo.h | |
| InteractionAxis | FVector | BaseGizmos/AxisPositionGizmo.h | ||
| InteractionCurParameter | float | BaseGizmos/AxisPositionGizmo.h | ||
| InteractionCurPoint | FVector | BaseGizmos/AxisPositionGizmo.h | ||
| InteractionOrigin | FVector | The values below are used in the context of a single click-drag interaction, ie if bInInteraction = true They otherwise should be considered uninitialized | BaseGizmos/AxisPositionGizmo.h | |
| InteractionStartParameter | float | BaseGizmos/AxisPositionGizmo.h | ||
| InteractionStartPoint | FVector | BaseGizmos/AxisPositionGizmo.h | ||
| MouseBehavior | TObjectPtr< UClickDragInputBehavior > | The mouse click behavior of the gizmo is accessible so that it can be modified to use different mouse keys. | BaseGizmos/AxisPositionGizmo.h | |
| ParameterSign | float | BaseGizmos/AxisPositionGizmo.h | ||
| ParameterSource | TScriptInterface< IGizmoFloatParameterSource > | The 3D line-nearest-point is converted to a 1D coordinate along the line, and the change in value is sent to this ParameterSource | BaseGizmos/AxisPositionGizmo.h | |
| ShouldUseCustomDestinationFunc | TUniqueFunction< bool()> | 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. | BaseGizmos/AxisPositionGizmo.h | |
| StateTarget | TScriptInterface< IGizmoStateTarget > | StateTarget is notified when interaction starts and ends, so that things like undo/redo can be handled externally. | BaseGizmos/AxisPositionGizmo.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool InitializeAsScaleGizmo
(
const UE::GizmoUtil::FTransformSubGizmoCommonParams& InitializationParams, |
Helper that initializes AxisSource, ParameterSource, HitTarget, and StateTarget for the common case of being used to control the scale of a transform. | BaseGizmos/AxisPositionGizmo.h | |
bool InitializeAsTranslateGizmo
(
const UE::GizmoUtil::FTransformSubGizmoCommonParams& InitializationParams, |
Helper that initializes AxisSource, ParameterSource, HitTarget, and StateTarget for the common case of being used to control the translation of a transform. | BaseGizmos/AxisPositionGizmo.h |
Overridden from UInteractiveGizmo
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Setup() |
Called by GizmoManager to initialize the Gizmo after GizmoBuilder::BuildGizmo() has been called | BaseGizmos/AxisPositionGizmo.h |
Overridden from IClickDragBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit CanBeginClickDragSequence
(
const FInputDeviceRay& PressPos |
Test if target can begin click-drag interaction at this point | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnClickDrag
(
const FInputDeviceRay& DragPos |
Notify Target that input position has changed | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnClickPress
(
const FInputDeviceRay& PressPos |
Notify Target that click press ocurred | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnClickRelease
(
const FInputDeviceRay& ReleasePos |
Notify Target that click release occurred | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnTerminateDragSequence() |
Notify Target that click-drag sequence has been explicitly terminated (eg by escape key) | BaseGizmos/AxisPositionGizmo.h |
Overridden from IHoverBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit BeginHoverSequenceHitTest
(
const FInputDeviceRay& PressPos |
IHoverBehaviorTarget implementation. | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnBeginHover
(
const FInputDeviceRay& DevicePos |
Initialize hover sequence at given position | BaseGizmos/AxisPositionGizmo.h | |
virtual void OnEndHover() |
Terminate active hover sequence | BaseGizmos/AxisPositionGizmo.h | |
virtual bool OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position | BaseGizmos/AxisPositionGizmo.h |