UTransformGizmo

[UTransformGizmo](API\Runtime\InteractiveToolsFramework\BaseGizmos\UTransformGizmo) provides standard Transformation Gizmo interactions, applied to a [UTransformProxy](API\Runtime\InteractiveToolsFramework\BaseGizmos\UTransformProxy) target object.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

InteractiveToolsFramework

Header

/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/BaseGizmos/TransformGizmo.h

Include

#include "BaseGizmos/TransformGizmo.h"

Syntax

class UTransformGizmo :
    public UInteractiveGizmo,
    public IToolCommandChangeSource

Remarks

UTransformGizmo provides standard Transformation Gizmo interactions, applied to a UTransformProxy target object. By default the Gizmo will be a standard XYZ translate/rotate Gizmo (axis and plane translation).

The in-scene representation of the Gizmo is a ATransformGizmoActor (or subclass). This Actor has FProperty members for the various sub-widgets, each as a separate Component. Any particular sub-widget of the Gizmo can be disabled by setting the respective Actor Component to null.

So, to create non-standard variants of the Transform Gizmo, set a new GizmoActorBuilder in the UTransformGizmoBuilder registered with the GizmoManager. Return a suitably-configured GizmoActor and everything else will be handled automatically.

Variables

Name Description

Protected variable

TUniquePtr< FTr...

 

ActiveChange

Ongoing transform change is tracked here, initialized in the IToolCommandChangeSource implementation.

Protected variable

TArray< UPrimit...

 

ActiveComponents

List of current-active child components

Protected variable

TArray< UIntera...

 

ActiveGizmos

List of currently-active child gizmos

Public variable

UTransformProxy...

 

ActiveTarget

The active target object for the Gizmo

Protected variable

UGizmoComponent...

 

AxisXSource

X-axis source is shared across Gizmos, and created internally during SetActiveTarget()

Protected variable

UGizmoComponent...

 

AxisYSource

Y-axis source is shared across Gizmos, and created internally during SetActiveTarget()

Protected variable

UGizmoComponent...

 

AxisZSource

Z-axis source is shared across Gizmos, and created internally during SetActiveTarget()

Public variable

bool

 

bSnapToWorldGrid

If true, then when using world frame, Axis and Plane translation snap to the world grid via the ContextQueriesAPI (in PositionSnapFunction)

Public variable

bool

 

bUseContextCoordinateSystem

Whether to use the World/Local coordinate system provided by the context via the ContextyQueriesAPI.

Protected variable

UGizmoConstantF...

 

CameraAxisSource

Axis SourcesAxis that points towards camera, X/Y plane tangents aligned to right/up.

Public variable

EToolContextCoo...

 

CurrentCoordinateSystem

Current coordinate system in use.

Protected variable

ATransformGizmo...

 

GizmoActor

Current active GizmoActor that was spawned by this Gizmo. Will be destroyed when Gizmo is.

Protected variable

TSharedPtr< FTr...

 

GizmoActorBuilder

Protected variable

TArray< UPrimit...

 

NonuniformScaleComponents

List of nonuniform scale components.

Protected variable

UGizmoScaledTra...

 

ScaledTransformSource

This TransformSource wraps a UGizmoComponentWorldTransformSource that is on the Gizmo Actor directly.

Protected variable

FVector

 

SeparateChildScale

Scaling on the active target UTransformProxy is stored here.

Protected variable

UGizmoTransform...

 

StateTarget

Other Gizmo Components State target is shared across gizmos, and created internally during SetActiveTarget().

Protected variable

UGizmoComponent...

 

UnitAxisXSource

Scaling support.

Protected variable

UGizmoComponent...

 

UnitAxisYSource

Y-axis source (ie 0,1,0) is shared across Scale Gizmos, and created internally during SetActiveTarget()

Protected variable

UGizmoComponent...

 

UnitAxisZSource

Z-axis source (ie 0,0,1) is shared across Scale Gizmos, and created internally during SetActiveTarget()

Protected variable

TFunction< void...

 

UpdateCoordSystemFunction

This function is called on each active GizmoActor Component to update it's coordinate system (eg world/local).

Protected variable

TFunction< void...

 

UpdateHoverFunction

This function is called on each active GizmoActor Component to update it's hover state.

Protected variable

UWorld *

 

World

GizmoActors will be spawned in this World

Functions

Name Description

Protected function Virtual

UInteractive...

 

AddAxisRotationGizmo

(
    UPrimitiveComponent* AxisCompo...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* AxisSource,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Protected function Virtual

UInteractive...

 

AddAxisScaleGizmo

(
    UPrimitiveComponent* AxisCompo...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* GizmoAxisSou...,
    IGizmoAxisSource* ParameterAxi...,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Protected function Virtual

UInteractive...

 

AddAxisTranslationGizmo

(
    UPrimitiveComponent* AxisCompo...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* AxisSource,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Protected function Virtual

UInteractive...

 

AddPlaneScaleGizmo

(
    UPrimitiveComponent* AxisCompo...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* GizmoAxisSou...,
    IGizmoAxisSource* ParameterAxi...,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Protected function Virtual

UInteractive...

 

AddPlaneTranslationGizmo

(
    UPrimitiveComponent* AxisCompo...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* AxisSource,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Protected function Virtual

UInteractive...

 

AddUniformScaleGizmo

(
    UPrimitiveComponent* ScaleComp...,
    USceneComponent* RootComponent,
    IGizmoAxisSource* GizmoAxisSou...,
    IGizmoAxisSource* ParameterAxi...,
    IGizmoTransformSource* Transfo...,
    IGizmoStateTarget* StateTarget
)

Public function Virtual

void

 

ClearActiveTarget()

Clear the active target object for the Gizmo

Protected function

void

 

ExternalSetChildScale

(
    const FVector& NewScale
)

This function is called by FTransformGizmoTransformChange to update SeparateChildScale on Undo/Redo.

Public function Const

ATransformGi...

 

GetGizmoActor()

Protected function

bool

 

PositionSnapFunction

(
    const FVector& WorldPosition,
    FVector& SnappedPositionOut
)

Axis and Plane TransformSources use this function to execute worldgrid snap queries.

Public function Virtual

void

 

SetActiveTarget

(
    UTransformProxy* Target,
    IToolContextTransactionProvider...
)

Set the active target object for the Gizmo

Public function Virtual

void

 

SetGizmoActorBuilder

Public function Virtual

void

 

SetNewChildScale

(
    const FVector& NewChildScale
)

Explicitly set the child scale.

Public function Virtual

void

 

SetNewGizmoTransform

(
    const FTransform& NewTransform
)

Set a new position for the Gizmo.

Public function Virtual

void

 

SetUpdateCoordSystemFunction

(
    TFunction< void...
)

Public function Virtual

void

 

SetUpdateHoverFunction

(
    TFunction< void...
)

Public function Virtual

void

 

SetVisibility

(
    bool bVisible
)

Set visibility for this Gizmo

Public function Virtual

void

 

SetWorld

(
    UWorld* World
)

Protected function

void

 

UpdateCameraAxisSource()

Internal function that updates CameraAxisSource by getting current view state from GizmoManager

Overridden from UInteractiveGizmo

Name Description

Public function Virtual

void

 

Setup()

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

Public function Virtual

void

 

Shutdown()

Called by GizmoManager to shut down the Gizmo

Public function Virtual

void

 

Tick

(
    float DeltaTime
)

Allow the Gizmo to do any necessary processing on Tick

Overridden from IToolCommandChangeSource

Name Description

Public function Virtual

void

 

BeginChange()

IToolCommandChangeSource implementation, used to initialize and emit ActiveChange.

Public function Virtual

TUniquePtr< ...

 

EndChange()

Public function Virtual

FText

 

GetChangeDescription()

Public function Virtual

UObject *...

 

GetChangeTarget()

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss