Navigation
API > API/Editor > API/Editor/EditorInteractiveToolsFramework > API/Editor/EditorInteractiveToolsFramework/EditorGizmos
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UInteractiveGizmo
- UTransformGizmo
- UEditorTransformGizmo
References
| Module | EditorInteractiveToolsFramework |
| Header | /Engine/Source/Editor/Experimental/EditorInteractiveToolsFramework/Public/EditorGizmos/TransformGizmo.h |
| Include | #include "EditorGizmos/TransformGizmo.h" |
Syntax
class UTransformGizmo :
public UInteractiveGizmo,
public IHoverBehaviorTarget,
public IClickDragBehaviorTarget
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).
Variables
| Type | Name | Description | |
|---|---|---|---|
| TObjectPtr< UTransformProxy > | ActiveTarget | The active target object for the Gizmo | |
| TObjectPtr< UMaterialInstanceDynamic > | AxisMaterialX | ||
| TObjectPtr< UMaterialInstanceDynamic > | AxisMaterialY | ||
| TObjectPtr< UMaterialInstanceDynamic > | AxisMaterialZ | ||
| bool | bDisallowNegativeScaling | ||
| bool | bGridSizeIsExplicit | Optional grid size which overrides the Context Grid | |
| bool | bInInteraction | Whether gizmo is interacting. | |
| bool | bRotationGridSizeIsExplicit | Optional grid size which overrides the Context Rotation Grid | |
| bool | bSnapToWorldGrid | If true, then when using world frame, Axis and Plane translation snap to the world grid via the ContextQueriesAPI (in PositionSnapFunction) | |
| bool | bSnapToWorldRotGrid | If true, then when using world frame, Axis and Plane translation snap to the world grid via the ContextQueriesAPI (in RotationSnapFunction) | |
| bool | bVisible | Whether gizmo is visible. | |
| TObjectPtr< UGizmoConstantFrameAxisSource > | CameraAxisSource | Axis that points towards camera, X/Y plane tangents aligned to right/up. | |
| TObjectPtr< UMaterialInstanceDynamic > | CurrentAxisMaterial | ||
| TEnumAsByte< EAxisList::Type > | CurrentAxisToDraw | Currently rendered axis list | |
| EGizmoTransformMode | CurrentMode | Currently rendered transform mode | |
| FTransform | CurrentTransform | Current transform | |
| TFunction< const FGizmoCustomization()> | CustomizationFunction | Customization function (to override default material or increment gizmo size for example) | |
| TUniqueFunction< bool(const FRay &, FVector &)> | DestinationAlignmentRayCaster | ||
| FVector | ExplicitGridSize | ||
| FRotator | ExplicitRotationGridSize | ||
| TObjectPtr< UGizmoElementGroup > | GizmoElementRoot | Root of renderable gizmo elements | |
| TObjectPtr< UGizmoViewContext > | GizmoViewContext | Gizmo view context, needed for screen space interactions | |
| TObjectPtr< UMaterialInstanceDynamic > | GreyMaterial | ||
| TObjectPtr< UMaterialInterface > | GridMaterial | ||
| TObjectPtr< UGizmoElementHitMultiTarget > | HitTarget | The hit target object | |
| float | InteractionAxisCurrParam | Active interaction current hit param (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionAxisDirection | Active world space axis (only valid between state target BeginModify/EndModify) | |
| TEnumAsByte< EAxisList::Type > | InteractionAxisList | The values below are used in the context of a single click-drag interaction, ie if bInInteraction = true They otherwise should be considered uninitializedActive axis type (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionAxisOrigin | Active world space axis origin (only valid between state target BeginModify/EndModify) | |
| float | InteractionAxisStartParam | Active interaction start hit param (only valid between state target BeginModify/EndModify) | |
| float | InteractionCurrAngle | Active interaction rotation curr angle (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarAxisX | Active world space axis X used for planar (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarAxisY | Active world space axis Y used for planar (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarCurrPoint | Active interaction current point planar (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarNormal | Active world space normal used for planar (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarOrigin | Active world space planar origin (only valid between state target BeginModify/EndModify) | |
| FVector | InteractionPlanarStartPoint | Active interaction start point planar (only valid between state target BeginModify/EndModify) | |
| FVector2D | InteractionScreenAxisDirection | Active interaction screen axis dir (only valid between state target BeginModify/EndModify) | |
| FVector2D | InteractionScreenCurrPos | Active interaction screen current pos (only valid between state target BeginModify/EndModify) | |
| FVector2D | InteractionScreenEndPos | Active interaction screen end pos (only valid between state target BeginModify/EndModify) | |
| FVector2D | InteractionScreenStartPos | Active interaction screen start pos (only valid between state target BeginModify/EndModify) | |
| float | InteractionStartAngle | Active interaction rotation start angle (only valid between state target BeginModify/EndModify) | |
| ETransformGizmoPartIdentifier | LastHitPart | Last hit part | |
| TObjectPtr< UClickDragInputBehavior > | MouseBehavior | The mouse click behavior of the gizmo is accessible so that it can be modified to use different mouse keys. | |
| TArray< TFunction< void(UTransformGizmo *TransformGizmo, const FInputDeviceRay &DragPos)> > | OnClickDragFunctions | Array of function pointers, indexed by gizmo part id, to handle click drag behavior | |
| TArray< TFunction< void(UTransformGizmo *TransformGizmo, const FInputDeviceRay &PressPos)> > | OnClickPressFunctions | Array of function pointers, indexed by gizmo part id, to handle click press behavior | |
| TArray< TFunction< void(UTransformGizmo *TransformGizmo, const FInputDeviceRay &ReleasePos)> > | OnClickReleaseFunctions | Array of function pointers, indexed by gizmo part id, to handle click release behavior | |
| TArray< TFunction< void(UTransformGizmo *TransformGizmo, bool bInHover, uint32 InHitParts)> > | OnUpdateHoverFunctions | Array of function pointers, indexed by gizmo part id, to handle update hovering state | |
| TArray< TFunction< void(UTransformGizmo *TransformGizmo, bool bInInteracting, uint32 InHitPart)>... | OnUpdateInteractingFunctions | Array of function pointers, indexed by gizmo part id, to handle update interacting state | |
| TObjectPtr< UMaterialInstanceDynamic > | OpaquePlaneMaterialXY | ||
| TObjectPtr< UGizmoElementCircle > | RotateArcballInnerElement | Rotate arcball inner circle | |
| TObjectPtr< UGizmoElementCircle > | RotateArcballOuterElement | Rotate arcball outer circle | |
| TObjectPtr< UGizmoElementCircle > | RotateOuterCircleElement | Rotate outer circle | |
| TObjectPtr< UGizmoElementCircle > | RotateScreenSpaceElement | Rotate screen space circle | |
| TObjectPtr< UGizmoElementTorus > | RotateXAxisElement | Rotate X Axis | |
| TObjectPtr< UGizmoElementTorus > | RotateYAxisElement | Rotate Y Axis | |
| TObjectPtr< UGizmoElementTorus > | RotateZAxisElement | Rotate Z Axis | |
| double | ScaleMultiplier | Percentage-based scale multiplier | |
| TObjectPtr< UGizmoElementRectangle > | ScalePlanarXYElement | Scale planar XY handle | |
| TObjectPtr< UGizmoElementRectangle > | ScalePlanarXZElement | Scale planar XZ handle | |
| TObjectPtr< UGizmoElementRectangle > | ScalePlanarYZElement | Scale planar YZ handle | |
| TObjectPtr< UGizmoElementBox > | ScaleUniformElement | Uniform scale object | |
| TObjectPtr< UGizmoElementArrow > | ScaleXAxisElement | Scale X Axis object | |
| TObjectPtr< UGizmoElementArrow > | ScaleYAxisElement | Scale Y Axis object | |
| TObjectPtr< UGizmoElementArrow > | ScaleZAxisElement | Scale Z Axis object | |
| TUniqueFunction< bool()> | ShouldAlignDestination | These are used to let the translation subgizmos use raycasts into the scene to align the gizmo with scene geometry. | |
| TScriptInterface< IGizmoStateTarget > | StateTarget | The state target is created internally during SetActiveTarget() if no one is provided. | |
| TScriptInterface< ITransformGizmoSource > | TransformGizmoSource | Transform Gizmo Source | |
| TObjectPtr< UGizmoElementRectangle > | TranslatePlanarXYElement | Translate planar XY handle | |
| TObjectPtr< UGizmoElementRectangle > | TranslatePlanarXZElement | Translate planar XZ handle | |
| TObjectPtr< UGizmoElementRectangle > | TranslatePlanarYZElement | Translate planar YZ handle | |
| TObjectPtr< UGizmoElementRectangle > | TranslateScreenSpaceElement | Translate screen-space | |
| TObjectPtr< UGizmoElementArrow > | TranslateXAxisElement | Gizmo Objects, used for rendering and hit testingTranslate X Axis | |
| TObjectPtr< UGizmoElementArrow > | TranslateYAxisElement | Translate Y Axis | |
| TObjectPtr< UGizmoElementArrow > | TranslateZAxisElement | Translate Z Axis | |
| TObjectPtr< UMaterialInterface > | TransparentVertexColorMaterial | Materials and colors to be used when drawing the items for each axis | |
| TObjectPtr< UMaterialInstanceDynamic > | WhiteMaterial |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyRotateDelta
(
const FQuat& InRotateDelta |
Apply rotate delta to transform proxy | |
| void | ApplyScaleDelta
(
const FVector& InScaleDelta |
Apply scale delta to transform proxy | |
| void | ApplyTranslateDelta
(
const FVector& InTranslateDelta |
Apply transform delta methodsApply translate delta to transform proxy | |
| void | Clear the active target object for the Gizmo | ||
| FQuat | ComputeAngularRotateDelta
(
double InStartAngle, |
Compute rotate delta based on start/end angles | |
| FQuat | ComputeAxisRotateDelta
(
const FVector2D& InStartPos, |
Compute rotate delta based on screen-space start/end positions | |
| FVector | ComputeAxisTranslateDelta
(
double InStartParam, |
Compute translate axis delta based on start/end params | |
| FVector | ComputePlanarTranslateDelta
(
const FVector& InStartPoint, |
Compute translate planar delta based on world space start/end points | |
| FVector | ComputeScaleDelta
(
const FVector2D& InStartPos, |
Compute scale delta based on screen space start/end positions | |
| void | EnableMode
(
EGizmoTransformMode InGizmoMode, |
Enable the given mode with the specified axes, EAxisList::Type::None will hide objects associated with mode | |
| void | EnablePlanarObjects
(
bool bTranslate, |
Enable planar handles used by translate and scale | |
| void | EnableRotate
(
EAxisList::Type InAxisListToDraw |
Enable rotate using specified axis list | |
| void | EnableScale
(
EAxisList::Type InAxisListToDraw |
Enable scale using specified axis list | |
| void | EnableTranslate
(
EAxisList::Type InAxisListToDraw |
Enable translate using specified axis list | |
| FTransform | Get gizmo transform based on cached current transform. | ||
| uint32 | Get max part identifier. | ||
| float | GetNearestRayParamToInteractionAxis
(
const FInputDeviceRay& InRay |
Get nearest param along input ray to the current interaction axis | |
| bool | GetRayParamIntersectionWithInteractionPlane
(
const FInputDeviceRay& InRay, |
Return true if input ray intersects current interaction plane and return param along ray in OutHitParam | |
| FVector2D | GetScreenProjectedAxis
(
const UGizmoViewContext* View, |
Screen-space helper methodReturns 2D vector projection of input axis onto input view plane | |
| FVector2D | GetScreenRotateAxisDir
(
const FVector& InAxis0, |
Get screen-space axis for rotation drag | |
| FVector | GetWorldAxis
(
const FVector& InAxis |
Get current interaction axis | |
| UGizmoElementRectangle * | MakePlanarHandle
(
ETransformGizmoPartIdentifier InPartId, |
Construct planar axis handle | |
| UGizmoElementTorus * | MakeRotateAxis
(
ETransformGizmoPartIdentifier InPartId, |
Construct rotate axis handle | |
| UGizmoElementCircle * | MakeRotateCircleHandle
(
ETransformGizmoPartIdentifier InPartId, |
Construct rotate screen space handle | |
| UGizmoElementArrow * | MakeScaleAxis
(
ETransformGizmoPartIdentifier InPartId, |
Construct scale axis handle | |
| UGizmoElementArrow * | MakeTranslateAxis
(
ETransformGizmoPartIdentifier InPartId, |
Construct translate axis handle | |
| UGizmoElementRectangle * | Construct translate screen space handle | ||
| UGizmoElementBox * | Construct uniform scale handle | ||
| void | OnClickDragRotateAxis
(
const FInputDeviceRay& DragPos |
Handle click drag for rotate axis | |
| void | OnClickDragScale
(
const FInputDeviceRay& DragPos |
Handle click drag for all scale | |
| void | OnClickDragScaleAxis
(
const FInputDeviceRay& DragPos |
Handle click drag for scale axes | |
| void | OnClickDragScalePlanar
(
const FInputDeviceRay& DragPos |
Handle click drag for scale planar | |
| void | OnClickDragScaleXYZ
(
const FInputDeviceRay& DragPos |
Handle click drag for uniform scale | |
| void | OnClickDragScreenSpaceRotate
(
const FInputDeviceRay& DragPos |
Handle click drag for screen-space rotate | |
| void | OnClickDragScreenSpaceTranslate
(
const FInputDeviceRay& DragPos |
Handle click drag for screen-space translate | |
| void | OnClickDragTranslateAxis
(
const FInputDeviceRay& DragPos |
Handle click drag for translate axes | |
| void | OnClickDragTranslatePlanar
(
const FInputDeviceRay& DragPos |
Handle click drag for translate planar | |
| void | OnClickPressAxis
(
const FInputDeviceRay& PressPos |
Handle click press for translate axes | |
| void | OnClickPressPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for generic planar | |
| void | OnClickPressRotateXAxis
(
const FInputDeviceRay& PressPos |
Rotate interaction methodsHandle click press for rotate X axis | |
| void | OnClickPressRotateYAxis
(
const FInputDeviceRay& PressPos |
Handle click press for rotate Y axis | |
| void | OnClickPressRotateZAxis
(
const FInputDeviceRay& PressPos |
Handle click press for rotate Z axis | |
| void | OnClickPressScale
(
const FInputDeviceRay& PressPos |
Handle click press for all scale methods | |
| void | OnClickPressScaleXAxis
(
const FInputDeviceRay& PressPos |
Scale click-drag handling methodsHandle click press for scale X axis | |
| void | OnClickPressScaleXYPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for scale XY planar | |
| void | OnClickPressScaleXYZ
(
const FInputDeviceRay& PressPos |
Handle click press for uniform scale | |
| void | OnClickPressScaleXZPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for scale XZ planar | |
| void | OnClickPressScaleYAxis
(
const FInputDeviceRay& PressPos |
Handle click press for scale Y axis | |
| void | OnClickPressScaleYZPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for scale YZ planar | |
| void | OnClickPressScaleZAxis
(
const FInputDeviceRay& PressPos |
Handle click press for scale Z axis | |
| void | OnClickPressScreenSpaceRotate
(
const FInputDeviceRay& PressPos |
Screen-space rotate interaction methodsHandle click press for screen-space rotate | |
| void | OnClickPressScreenSpaceTranslate
(
const FInputDeviceRay& PressPos |
Screen-space translate interaction methodsHandle click press for screen-space translate | |
| void | OnClickPressTranslateXAxis
(
const FInputDeviceRay& PressPos |
Translate axis click-drag handling methods Handle click press for translate X axis | |
| void | OnClickPressTranslateXYPlanar
(
const FInputDeviceRay& PressPos |
Translate and scale planar click-drag handling methodsHandle click press for translate XY planar | |
| void | OnClickPressTranslateXZPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for translate XZ planar | |
| void | OnClickPressTranslateYAxis
(
const FInputDeviceRay& PressPos |
Handle click press for translate Y axis | |
| void | OnClickPressTranslateYZPlanar
(
const FInputDeviceRay& PressPos |
Handle click press for translate YZ planar | |
| void | OnClickPressTranslateZAxis
(
const FInputDeviceRay& PressPos |
Handle click press for translate Z axis | |
| void | OnClickReleaseRotateAxis
(
const FInputDeviceRay& ReleasePos |
Handle click release for rotate axes | |
| void | OnClickReleaseScaleAxis
(
const FInputDeviceRay& ReleasePos |
Handle click release for scale axes | |
| void | OnClickReleaseScalePlanar
(
const FInputDeviceRay& ReleasePos |
Handle click release for scale planar | |
| void | OnClickReleaseScaleXYZ
(
const FInputDeviceRay& ReleasePos |
Handle click release for uniform scale | |
| void | OnClickReleaseScreenSpaceRotate
(
const FInputDeviceRay& ReleasePos |
Handle click release for screen-space rotate | |
| void | OnClickReleaseScreenSpaceTranslate
(
const FInputDeviceRay& ReleasePos |
Handle click release for screen-space translate | |
| void | OnClickReleaseTranslateAxis
(
const FInputDeviceRay& ReleasePos |
Handle click release for translate axes | |
| void | OnClickReleaseTranslatePlanar
(
const FInputDeviceRay& ReleasePos |
Handle click release for translate planar | |
| bool | PositionSnapFunction
(
const FVector& WorldPosition, |
Axis and Plane TransformSources use this function to execute worldgrid snap queries. | |
| FQuat | RotationSnapFunction
(
const FQuat& DeltaRotation |
||
| void | SetActiveTarget
(
UTransformProxy* Target, |
Set the active target object for the Gizmo | |
| void | SetCustomizationFunction
(
const TFunction< const FGizmoCustomization()>& InFunction |
Set customization function for this Gizmo | |
| void | SetDisallowNegativeScaling
(
bool bDisallow |
By default, the nonuniform scale components can scale negatively. | |
| void | SetNewChildScale
(
const FVector& NewChildScale |
Explicitly set the child scale. | |
| void | Setup behaviors | ||
| void | Setup materials | ||
| void | Setup on click functions | ||
| void | SetVisibility
(
bool bVisible |
Set visibility for this Gizmo | |
| void | Internal function that updates CameraAxisSource by getting current view state from GizmoManager | ||
| FInputRayHit | UpdateHoveredPart
(
const FInputDeviceRay& DevicePos |
Determine hit part and update hover state based on current input ray | |
| void | UpdateHoverState
(
bool bInHover, |
Update hover state for given part id | |
| void | UpdateInteractingState
(
bool bInInteracting, |
Update interacting state for given part id | |
| void | UpdateMode () |
Update current gizmo mode based on transform source | |
| bool | VerifyPartIdentifier
(
uint32 InPartIdentifier |
Verify part identifier is within recognized range of transform gizmo part ids. |
Overridden from UInteractiveGizmo
| Type | Name | Description | |
|---|---|---|---|
| void | Render
(
IToolsContextRenderAPI* RenderAPI |
Allow the Gizmo to do any custom drawing (ie via PDI/RHI) | |
| void | Setup () |
Called by GizmoManager to initialize the Gizmo after GizmoBuilder::BuildGizmo() has been called | |
| void | Shutdown () |
Called by GizmoManager to shut down the Gizmo | |
| void | Tick
(
float DeltaTime |
Allow the Gizmo to do any necessary processing on Tick |
Overridden from IHoverBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| FInputRayHit | BeginHoverSequenceHitTest
(
const FInputDeviceRay& DevicePos |
IHoverBehaviorTarget implementation. | |
| void | OnBeginHover
(
const FInputDeviceRay& DevicePos |
Initialize hover sequence at given position | |
| void | OnEndHover () |
Terminate active hover sequence | |
| bool | OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position |
Overridden from IClickDragBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| FInputRayHit | CanBeginClickDragSequence
(
const FInputDeviceRay& PressPos |
IClickDragBehaviorTarget implementation. | |
| void | OnClickDrag
(
const FInputDeviceRay& DragPos |
Notify Target that input position has changed | |
| void | OnClickPress
(
const FInputDeviceRay& PressPos |
Notify Target that click press ocurred | |
| void | OnClickRelease
(
const FInputDeviceRay& ReleasePos |
Notify Target that click release occurred | |
| void | Notify Target that click-drag sequence has been explicitly terminated (eg by escape key) |