Navigation
API > API/Runtime > API/Runtime/InteractiveToolsFramework
UPlanePositionGizmo implements a gizmo interaction where 2D parameter value is manipulated by dragging a point on a 3D plane in space. The 3D position is converted to 2D coordinates based on the tangent axes of the plane.
As with other base gizmos, this class only implements the interaction. The visual aspect of the gizmo, the plane, and the parameter storage are all provided externally.
The plane is provided by an IGizmoAxisSource. The origin and normal define the plane and then the tangent axes of the source define the coordinate space.
The interaction target (ie the thing you have to click on to start the dragging interaction) is provided by an IGizmoClickTarget.
The new 2D parameter value is sent to an IGizmoVec2ParameterSource
Internally a UClickDragInputBehavior is used to handle mouse input, configured in Setup()
| Name | UPlanePositionGizmo |
| Type | class |
| Header File | /Engine/Source/Runtime/InteractiveToolsFramework/Public/BaseGizmos/PlanePositionGizmo.h |
| Include Path | #include "BaseGizmos/PlanePositionGizmo.h" |
Syntax
UCLASS (MinimalAPI)
class UPlanePositionGizmo :
public UInteractiveGizmo ,
public IClickDragBehaviorTarget ,
public IHoverBehaviorTarget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveGizmo → UPlanePositionGizmo
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/PlanePositionGizmo.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/PlanePositionGizmo.h | |
| bFlipX | bool | If enabled, flip sign of parameter delta on X axis | BaseGizmos/PlanePositionGizmo.h | |
| bFlipY | bool | If enabled, flip sign of parameter delta on Y axis | BaseGizmos/PlanePositionGizmo.h | |
| bInInteraction | bool | If true, we are in an active click+drag interaction, otherwise we are not | BaseGizmos/PlanePositionGizmo.h | |
| CustomDestinationFunc | TUniqueFunction< bool(const FCustomDestinationParams &WorldRay, FVector &OutputPoint)> | If ShouldUseCustomDestinationFunc() returns true, this function is used to get a destination point, and the output parameters are picked in such a way that the axis origin moves to the closest point in the plane to the destination point. | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.h | |
| InteractionAxisX | FVector | BaseGizmos/PlanePositionGizmo.h | ||
| InteractionAxisY | FVector | BaseGizmos/PlanePositionGizmo.h | ||
| InteractionCurParameter | FVector2D | BaseGizmos/PlanePositionGizmo.h | ||
| InteractionCurPoint | FVector | BaseGizmos/PlanePositionGizmo.h | ||
| InteractionNormal | FVector | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.h | |
| InteractionStartParameter | FVector2D | BaseGizmos/PlanePositionGizmo.h | ||
| InteractionStartPoint | FVector | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.h | |
| ParameterSigns | FVector2D | BaseGizmos/PlanePositionGizmo.h | ||
| ParameterSource | TScriptInterface< IGizmoVec2ParameterSource > | The 3D plane coordinates are converted to 2D coordinates in the plane tangent space, and the change in value is sent to this ParameterSource | BaseGizmos/PlanePositionGizmo.h | |
| ShouldUseCustomDestinationFunc | TUniqueFunction< bool()> | This gets checked to see if we should use the custom ray caster to get a destination point for the gizmo, rather than grabbing the intersection with the gizmo plane. | BaseGizmos/PlanePositionGizmo.h | |
| StateTarget | TScriptInterface< IGizmoStateTarget > | StateTarget is notified when interaction starts and ends, so that things like undo/redo can be handled externally | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.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/PlanePositionGizmo.h | |
bool InitializeAsUniformScaleGizmo
(
const UE::GizmoUtil::FTransformSubGizmoCommonParams& Params, |
Helper that initializes AxisSource, ParameterSource, HitTarget, and StateTarget for the common case of being used to control the uniform scale of a transform, where the interaction plane remains aligned to the camera. | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.h | |
virtual void Tick
(
float DeltaTime |
Allow the Gizmo to do any necessary processing on Tick | BaseGizmos/PlanePositionGizmo.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/PlanePositionGizmo.h | |
virtual void OnClickDrag
(
const FInputDeviceRay& DragPos |
Notify Target that input position has changed | BaseGizmos/PlanePositionGizmo.h | |
virtual void OnClickPress
(
const FInputDeviceRay& PressPos |
Notify Target that click press ocurred | BaseGizmos/PlanePositionGizmo.h | |
virtual void OnClickRelease
(
const FInputDeviceRay& ReleasePos |
Notify Target that click release occurred | BaseGizmos/PlanePositionGizmo.h | |
virtual void OnTerminateDragSequence() |
Notify Target that click-drag sequence has been explicitly terminated (eg by escape key) | BaseGizmos/PlanePositionGizmo.h |
Overridden from IHoverBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit BeginHoverSequenceHitTest
(
const FInputDeviceRay& PressPos |
IHoverBehaviorTarget implementation. | BaseGizmos/PlanePositionGizmo.h | |
virtual void OnBeginHover
(
const FInputDeviceRay& DevicePos |
Initialize hover sequence at given position | BaseGizmos/PlanePositionGizmo.h | |
virtual void OnEndHover() |
Terminate active hover sequence | BaseGizmos/PlanePositionGizmo.h | |
virtual bool OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position | BaseGizmos/PlanePositionGizmo.h |