UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::GizmoUtil Namespace Reference

Classes

struct  FInitMeshSubGizmoParams
 
struct  FTransformSubGizmoCommonParams
 
struct  FTransformSubGizmoSharedState
 

Functions

EAxis::Type ToAxis (ETransformGizmoSubElements Element)
 
UGizmoViewContextGetGizmoViewContext (UInteractiveGizmoManager *GizmoManager)
 
bool UpdateCameraAxisSource (UGizmoConstantFrameAxisSource &CameraAxisSource, UInteractiveGizmoManager *GizmoManager, const FVector3d &AxisOrigin)
 
template<typename SubGizmoType >
bool SetCommonSubGizmoProperties (SubGizmoType *Gizmo, const UE::GizmoUtil::FTransformSubGizmoCommonParams &Params, UE::GizmoUtil::FTransformSubGizmoSharedState *SharedState, UGizmoScaledAndUnscaledTransformSources *&TransformSourceOut)
 
double ClampRayOrigin (const UGizmoViewContext *InViewContext, FVector &InOutRayOrigin, const FVector &InRayDirection, const double InMaxDepth=UE_OLD_HALF_WORLD_MAX)
 
INTERACTIVETOOLSFRAMEWORK_API UInteractiveGizmoCreateGizmoViaSimpleBuilder (UInteractiveGizmoManager *GizmoManager, TSubclassOf< UInteractiveGizmo > GizmoClass, const FString &InstanceIdentifier, void *Owner)
 
template<typename GizmoClass >
GizmoClassCreateGizmoViaSimpleBuilder (UInteractiveGizmoManager *GizmoManager, const FString &InstanceIdentifier, void *GizmoOwner)
 
INTERACTIVETOOLSFRAMEWORK_API FTransform GetRotatedBasisTransform (const FTransform &TransformIn, EAxis::Type AxisToBeX)
 
INTERACTIVETOOLSFRAMEWORK_API void InitializeSubGizmoElementsWithMesh (const FInitMeshSubGizmoParams &Params, TArray< TPair< ETransformGizmoSubElements, UViewAdjustedStaticMeshGizmoComponent * > > *ElementComponentsOut=nullptr)
 

Detailed Description

This file holds implementation helpers that don't necessarily need exposing. If eventually needed, we can move some of these into GizmoUtil or TransformSubGizmoUtil

This file is meant for utilities that are specific to allowing gizmos to act as sub gizmos inside a UCombinedTransformGizmo.

Function Documentation

◆ ClampRayOrigin()

double UE::GizmoUtil::ClampRayOrigin ( const UGizmoViewContext InViewContext,
FVector InOutRayOrigin,
const FVector InRayDirection,
const double  InMaxDepth = UE_OLD_HALF_WORLD_MAX 
)

Helper to ensure that the ray origin is not too far in orthographic views to avoid numerical imprecision later

Returns
the depth bias between the current ray origin and the updated one if the ray origin is greater than InMaxDepth

◆ CreateGizmoViaSimpleBuilder() [1/2]

template<typename GizmoClass >
GizmoClass * UE::GizmoUtil::CreateGizmoViaSimpleBuilder ( UInteractiveGizmoManager GizmoManager,
const FString &  InstanceIdentifier,
void GizmoOwner 
)

Template version of CreateGizmoViaSimpleBuilder that does a cast on return.

◆ CreateGizmoViaSimpleBuilder() [2/2]

UInteractiveGizmo * UE::GizmoUtil::CreateGizmoViaSimpleBuilder ( UInteractiveGizmoManager GizmoManager,
TSubclassOf< UInteractiveGizmo GizmoClass,
const FString &  InstanceIdentifier,
void Owner 
)

Uses the gizmo manager to create a gizmo of the given class (assuming that the gizmo type does not need any special setup beyond instantiation) without having to register a custom builder for that class ahead of time.

This function lets the user bypass the need to define, register, and use a builder class, while still registering the gizmo properly with the gizmo manager. Under the hood, it creates and registers a temporary generic builder, uses it to make the gizmo, and then immediately deregisters the builder.

◆ GetGizmoViewContext()

UGizmoViewContext * UE::GizmoUtil::GetGizmoViewContext ( UInteractiveGizmoManager GizmoManager)

Simple helper that gets the gizmo view context out of the context object store associated with a gizmo manager. Fires ensures if it does not find the expected objects along the way.

◆ GetRotatedBasisTransform()

FTransform UE::GizmoUtil::GetRotatedBasisTransform ( const FTransform TransformIn,
EAxis::Type  AxisToBeX 
)

Rotates a transform such that its basis still lies along the cardinal axes but rotated in such a way that the given axis is in the X direction. For example, if you have a transform that makes a component work well as an X axis in a TRS gizmo, using this function with AxisToBeX set to Y will rotate the transform to work well as the Y axis, because the basis will have been rotated to be YZX.

◆ InitializeSubGizmoElementsWithMesh()

void UE::GizmoUtil::InitializeSubGizmoElementsWithMesh ( const FInitMeshSubGizmoParams Params,
TArray< TPair< ETransformGizmoSubElements, UViewAdjustedStaticMeshGizmoComponent * > > *  ElementComponentsOut = nullptr 
)

Given a UCombinedTransformGizmo, swaps selected elements with custom meshes.

Parameters
ComponentsOutOptional output array of newly created gizmo components, as pairs with the single element that they were created for.

◆ SetCommonSubGizmoProperties()

template<typename SubGizmoType >
bool UE::GizmoUtil::SetCommonSubGizmoProperties ( SubGizmoType Gizmo,
const UE::GizmoUtil::FTransformSubGizmoCommonParams Params,
UE::GizmoUtil::FTransformSubGizmoSharedState SharedState,
UGizmoScaledAndUnscaledTransformSources *&  TransformSourceOut 
)

Helper that sets some common properties on sub gizmos, namely AxisSource, HitTarget, and StateTarget. Also returns a TransformSource, which typically gets wrapped up in a parameter source.

Template because the properties it manipulates aren't part of a base class. Perhaps they should be, but we have not needed that yet, other than this.

◆ ToAxis()

EAxis::Type UE::GizmoUtil::ToAxis ( ETransformGizmoSubElements  Element)

Given a single element, gives the axis that defines that element (e.g., x for TranslateAxisX or TranslatePlaneYZ, etc). Gives EAxis::None if the element is not a single element.

◆ UpdateCameraAxisSource()

bool UE::GizmoUtil::UpdateCameraAxisSource ( UGizmoConstantFrameAxisSource CameraAxisSource,
UInteractiveGizmoManager GizmoManager,
const FVector3d AxisOrigin 
)

Helper to update an axis source that is based on the camera location, called from tick.