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

Classes

class  FConstantViewRelativeTransformAdjuster
 
struct  FDefaultGizmoMaterialExtraParams
 
class  FSceneViewWrapper
 
class  FSimpleConstantViewScaleAdjuster
 
class  FSubGizmoTransformAdjuster
 
class  ISceneViewInterface
 
class  IViewBasedTransformAdjuster
 

Functions

INTERACTIVETOOLSFRAMEWORK_API UMaterialInterfaceGetDefaultGizmoComponentMaterial (const FLinearColor &Color, UObject *Outer=nullptr)
 
UMaterialInterfaceGetDefaultGizmoComponentMaterial (const FLinearColor &Color, const FDefaultGizmoMaterialExtraParams &Params, UObject *Outer=nullptr)
 
INTERACTIVETOOLSFRAMEWORK_API UViewAdjustedStaticMeshGizmoComponentCreateDefaultMaterialGizmoMeshComponent (UStaticMesh *Mesh, UGizmoViewContext *GizmoViewContext, UObject *OwnerComponentOrActor, const FLinearColor &Color, bool bAddHoverMaterial=true)
 
INTERACTIVETOOLSFRAMEWORK_API UViewAdjustedStaticMeshGizmoComponentCreateDefaultMaterialGizmoMeshComponent (UStaticMesh *Mesh, UInteractiveGizmoManager *GizmoManager, UObject *OwnerComponentOrActor, const FLinearColor &Color, bool bAddHoverMaterial=true)
 
INTERACTIVETOOLSFRAMEWORK_API FLinearColor GetDefaultAxisColor (EAxis::Type Axis)
 
INTERACTIVETOOLSFRAMEWORK_API float CalculateLocalPixelToWorldScale (const FSceneView *View, const FVector &Location, const double InDPIScale=1.0)
 
INTERACTIVETOOLSFRAMEWORK_API float CalculateLocalPixelToWorldScale (const UE::GizmoRenderingUtil::ISceneViewInterface *View, const FVector &Location, const bool bInWithDPIScale=false, const TOptional< double > &InDPIScale=TOptional< double >())
 
INTERACTIVETOOLSFRAMEWORK_API float CalculateViewDependentScaleAndFlatten (const UE::GizmoRenderingUtil::ISceneViewInterface *View, const FVector &Location, const float Scale, FVector &OutWorldFlattenScale)
 
INTERACTIVETOOLSFRAMEWORK_API float CalculateViewDependentScaleAndFlatten (const FSceneView *View, const FVector &Location, const float Scale, FVector &OutWorldFlattenScale)
 

Variables

const int32 GIZMO_TRANSLUCENCY_SORT_PRIORITY = 5000
 

Detailed Description

Utility functions for standard GizmoComponent rendering

Function Documentation

◆ CalculateLocalPixelToWorldScale() [1/2]

float UE::GizmoRenderingUtil::CalculateLocalPixelToWorldScale ( const FSceneView View,
const FVector Location,
const double  InDPIScale = 1.0 
)
Returns
Conversion factor between pixel and world-space coordinates at 3D point Location in View.
Warning
This is a local estimate and is increasingly incorrect as the 3D point gets further from Location

◆ CalculateLocalPixelToWorldScale() [2/2]

float UE::GizmoRenderingUtil::CalculateLocalPixelToWorldScale ( const UE::GizmoRenderingUtil::ISceneViewInterface View,
const FVector Location,
const bool  bInWithDPIScale = false,
const TOptional< double > &  InDPIScale = TOptional<double>() 
)
Note
: if bInWithDPIScale is true, we use ISceneViewInterface::DPIScale or the provided InDPIScale when set.

◆ CalculateViewDependentScaleAndFlatten() [1/2]

float UE::GizmoRenderingUtil::CalculateViewDependentScaleAndFlatten ( const FSceneView View,
const FVector Location,
const float  Scale,
FVector OutWorldFlattenScale 
)

◆ CalculateViewDependentScaleAndFlatten() [2/2]

float UE::GizmoRenderingUtil::CalculateViewDependentScaleAndFlatten ( const UE::GizmoRenderingUtil::ISceneViewInterface View,
const FVector Location,
const float  Scale,
FVector OutWorldFlattenScale 
)
Returns
Legacy view dependent conversion factor.
OutWorldFlattenScale vector to be applied in world space, can be used to flatten excluded dimension in orthographic views as it reverses the scale in that dimension.

◆ CreateDefaultMaterialGizmoMeshComponent() [1/2]

UViewAdjustedStaticMeshGizmoComponent * UE::GizmoRenderingUtil::CreateDefaultMaterialGizmoMeshComponent ( UStaticMesh Mesh,
UGizmoViewContext GizmoViewContext,
UObject OwnerComponentOrActor,
const FLinearColor Color,
bool  bAddHoverMaterial = true 
)

Helper that creates a component with the default gizmo material and sets up the component-side properties that are needed for it to properly work (translucency sort priority, etc). This may not be necessary if your component is using some other gizmo material that doesn't require component-side flags.

◆ CreateDefaultMaterialGizmoMeshComponent() [2/2]

UViewAdjustedStaticMeshGizmoComponent * UE::GizmoRenderingUtil::CreateDefaultMaterialGizmoMeshComponent ( UStaticMesh Mesh,
UInteractiveGizmoManager GizmoManager,
UObject OwnerComponentOrActor,
const FLinearColor Color,
bool  bAddHoverMaterial = true 
)

Overload that takes a gizmo manager to get the view context from that.

◆ GetDefaultAxisColor()

FLinearColor UE::GizmoRenderingUtil::GetDefaultAxisColor ( EAxis::Type  Axis)

Gets a red/green/blue color based on the axis (X, Y, or Z).

◆ GetDefaultGizmoComponentMaterial() [1/2]

UMaterialInterface * UE::GizmoRenderingUtil::GetDefaultGizmoComponentMaterial ( const FLinearColor Color,
const FDefaultGizmoMaterialExtraParams Params,
UObject Outer = nullptr 
)

Like the other overload, but with additional parameters.

◆ GetDefaultGizmoComponentMaterial() [2/2]

UMaterialInterface * UE::GizmoRenderingUtil::GetDefaultGizmoComponentMaterial ( const FLinearColor Color,
UObject Outer = nullptr 
)

Gets a custom material suitable to use for gizmo components. The material is drawn on top of opaque geometry with dithering for portions behind opaque materials, but uses the custom depth buffer to properly occlude itself. Components using this material should set bRenderCustomDepth to true so they can occlude other gizmo elements. It is also suggested that TranslucencySortPriority be set to something like UE::GizmoRenderingUtil::GIZMO_TRANSLUCENCY_SORT_PRIORITY so that the component is drawn on top of other translucent materials.

Parameters
OuterObject to set as outer for the material instance. Typically can be left as nullptr to use transient package.

Variable Documentation

◆ GIZMO_TRANSLUCENCY_SORT_PRIORITY

const int32 UE::GizmoRenderingUtil::GIZMO_TRANSLUCENCY_SORT_PRIORITY = 5000