UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AxisAngleGizmo.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7#include "CoreMinimal.h"
8#include "InputState.h"
9#include "InteractiveGizmo.h"
11#include "Math/MathFwd.h"
12#include "Math/Ray.h"
13#include "Math/Vector.h"
14#include "Templates/Function.h"
16#include "UObject/ObjectPtr.h"
19
20#include "AxisAngleGizmo.generated.h"
21
27class UObject;
29namespace UE::GizmoUtil
30{
31 struct FTransformSubGizmoCommonParams;
32 struct FTransformSubGizmoSharedState;
33}
34
35UCLASS(MinimalAPI)
37{
39
40public:
41 INTERACTIVETOOLSFRAMEWORK_API virtual UInteractiveGizmo* BuildGizmo(const FToolBuilderState& SceneState) const override;
42};
43
44
48UCLASS(MinimalAPI)
50{
52
53public:
58 INTERACTIVETOOLSFRAMEWORK_API bool InitializeAsRotateGizmo(
61
62 // UInteractiveGizmo overrides
63
64 INTERACTIVETOOLSFRAMEWORK_API virtual void Setup() override;
65
66 // IClickDragBehaviorTarget implementation
67
68 INTERACTIVETOOLSFRAMEWORK_API virtual FInputRayHit CanBeginClickDragSequence(const FInputDeviceRay& PressPos) override;
69 INTERACTIVETOOLSFRAMEWORK_API virtual void OnClickPress(const FInputDeviceRay& PressPos) override;
70 INTERACTIVETOOLSFRAMEWORK_API virtual void OnClickDrag(const FInputDeviceRay& DragPos) override;
71 INTERACTIVETOOLSFRAMEWORK_API virtual void OnClickRelease(const FInputDeviceRay& ReleasePos) override;
72 INTERACTIVETOOLSFRAMEWORK_API virtual void OnTerminateDragSequence() override;
73
74 // IHoverBehaviorTarget implementation
75 INTERACTIVETOOLSFRAMEWORK_API virtual FInputRayHit BeginHoverSequenceHitTest(const FInputDeviceRay& PressPos) override;
76 INTERACTIVETOOLSFRAMEWORK_API virtual void OnBeginHover(const FInputDeviceRay& DevicePos) override;
77 INTERACTIVETOOLSFRAMEWORK_API virtual bool OnUpdateHover(const FInputDeviceRay& DevicePos) override;
78 INTERACTIVETOOLSFRAMEWORK_API virtual void OnEndHover() override;
79
80 // IModifierToggleBehaviorTarget implementation (inherited via IClickDragBehaviorTarget)
81 INTERACTIVETOOLSFRAMEWORK_API virtual void OnUpdateModifierState(int ModifierID, bool bIsOn) override;
82
83public:
84 // The below properties can be manipulated for more fine-grained control, but typically it is sufficient
85 // to use the initialization method above.
86
87 UPROPERTY()
89
90 UPROPERTY()
92
93 UPROPERTY()
95
96 UPROPERTY()
98
100 UPROPERTY()
102
107 TUniqueFunction<bool()> ShouldUseCustomDestinationFunc = []() {return false; };
108
110 {
111 // Right now we use the custom destination function for aligning to items in the scene, which
112 // we just need the world ray for. If we want to use functions that use other inputs as the
113 // basis for the destination, we would add those parameters here and would make sure that the
114 // gizmo passes them in.
115 const FRay* WorldRay = nullptr;
116 };
117
125 TUniqueFunction<bool(const FCustomDestinationParams& WorldRay, FVector& OutputPoint)> CustomDestinationFunc =
126 [](const FCustomDestinationParams& Params, FVector& OutputPoint) { return false; };
127
128public:
129 UPROPERTY()
130 bool bInInteraction = false;
131
132 UPROPERTY()
133 FVector RotationOrigin;
134
135 UPROPERTY()
136 FVector RotationAxis;
137
138 UPROPERTY()
139 FVector RotationPlaneX;
140
141 UPROPERTY()
142 FVector RotationPlaneY;
143
144
145 UPROPERTY()
146 FVector InteractionStartPoint;
147
148 UPROPERTY()
149 FVector InteractionCurPoint;
150
151 UPROPERTY()
152 float InteractionStartAngle;
153
154 UPROPERTY()
155 float InteractionCurAngle;
156
158 FVector LastHitPosition;
159 float InitialTargetAngle;
160
161 // The angle of the closest axis in the plane of the angle gizmo (will be 0, pi/2, pi, or 3pi/2).
162 // Used for snapping the nearest axis to a ray cast point when using CustomDestinationRayCaster.
163 float ClosestAxisStartAngle;
164};
165
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition BehaviorTargetInterfaces.h:91
Definition GizmoInterfaces.h:64
Definition GizmoInterfaces.h:108
Definition GizmoInterfaces.h:301
Definition GizmoInterfaces.h:272
Definition BehaviorTargetInterfaces.h:230
Definition ScriptInterface.h:139
Definition FunctionFwd.h:19
Definition AxisAngleGizmo.h:37
Definition AxisAngleGizmo.h:50
Definition ClickDragBehavior.h:33
Definition InteractiveGizmoBuilder.h:19
Definition InteractiveGizmo.h:29
Definition Object.h:95
Definition FreeRotationSubGizmo.h:18
@ false
Definition radaudio_common.h:23
Definition InputState.h:367
Definition InputState.h:52
Definition ToolContextInterfaces.h:50
Definition ObjectPtr.h:488
Definition AxisAngleGizmo.h:110
Definition TransformSubGizmoUtil.h:37
Definition TransformSubGizmoUtil.h:99