UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ScalableSphereGizmo.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "InteractiveGizmo.h"
8#include "TransformProxy.h"
11
12#include "ScalableSphereGizmo.generated.h"
13
14UCLASS(MinimalAPI)
16{
18
19public:
20 INTERACTIVETOOLSFRAMEWORK_API virtual UInteractiveGizmo* BuildGizmo(const FToolBuilderState& SceneState) const override;
21};
22
27UCLASS(MinimalAPI)
29{
31
32public:
33 // UInteractiveGizmo interface
34 INTERACTIVETOOLSFRAMEWORK_API virtual void Setup() override;
36
37 // IHoverBehaviorTarget interface
38 INTERACTIVETOOLSFRAMEWORK_API virtual FInputRayHit BeginHoverSequenceHitTest(const FInputDeviceRay& PressPos) override;
39 virtual void OnBeginHover(const FInputDeviceRay& DevicePos) override { }
40 INTERACTIVETOOLSFRAMEWORK_API virtual bool OnUpdateHover(const FInputDeviceRay& DevicePos);
41 INTERACTIVETOOLSFRAMEWORK_API virtual void OnEndHover();
42
47
48 INTERACTIVETOOLSFRAMEWORK_API virtual void OnBeginDrag(const FInputDeviceRay& Ray);
49 INTERACTIVETOOLSFRAMEWORK_API virtual void OnUpdateDrag(const FInputDeviceRay& Ray);
50 INTERACTIVETOOLSFRAMEWORK_API virtual void OnEndDrag(const FInputDeviceRay& Ray);
51
53 INTERACTIVETOOLSFRAMEWORK_API bool HitTest(const FRay& Ray, FHitResult& OutHit, FVector& OutAxis, FTransform& OutTransform);
54
55 /* Set the Radius of the Sphere*/
56 INTERACTIVETOOLSFRAMEWORK_API void SetRadius(float InRadius);
57
59 TFunction<void(const float)> UpdateRadiusFunc = nullptr;
60
61 // The error threshold for hit detection with the sphere
62 UPROPERTY()
63 float HitErrorThreshold{ 12.f };
64
65 // The text that will be used as the transaction description for undo/redo
66 UPROPERTY()
67 FText TransactionDescription;
68
70
71 // Check if the Circle represented by CircleNormal centered at the gizmos location has been hit by the Ray
73
74 // The radius of the sphere
75 UPROPERTY()
76 float Radius;
77
78 // Whether the sphere is currently being hovered over
79 UPROPERTY()
80 bool bIsHovering{ false };
81
82 // Whether the sphere is currently being dragged
83 UPROPERTY()
84 bool bIsDragging{ false };
85
86 UPROPERTY()
87 TObjectPtr<UTransformProxy> ActiveTarget;
88
89 // The current axis that is being dragged along
90 UPROPERTY()
91 FVector ActiveAxis;
92
93 // The position the drag was started on
94 UPROPERTY()
95 FVector DragStartWorldPosition;
96
97 // The position the drag is on currently (projected onto the line it is being dragged along)
98 UPROPERTY()
99 FVector DragCurrentPositionProjected;
100
101 // The initial parameter along the drag axist
102 UPROPERTY()
103 float InteractionStartParameter;
104};
105
106
110UCLASS(MinimalAPI)
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EInputCaptureSide
Definition InputBehavior.h:20
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
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
Definition Text.h:385
Definition BehaviorTargetInterfaces.h:230
Definition ToolContextInterfaces.h:427
Definition AndroidPlatformMisc.h:14
Definition AnyButtonInputBehavior.h:33
Definition InteractiveGizmoBuilder.h:19
Definition InteractiveGizmo.h:29
Definition ScalableSphereGizmo.h:16
Definition ScalableSphereGizmo.h:112
FVector2D LastScreenPosition
Definition ScalableSphereGizmo.h:128
virtual FInputCapturePriority GetPriority() override
Definition ScalableSphereGizmo.h:116
bool bInputDragCaptured
Definition ScalableSphereGizmo.h:129
FRay LastWorldRay
Definition ScalableSphereGizmo.h:127
UScalableSphereGizmo * Gizmo
Definition ScalableSphereGizmo.h:126
Definition ScalableSphereGizmo.h:29
virtual void OnBeginHover(const FInputDeviceRay &DevicePos) override
Definition ScalableSphereGizmo.h:39
Definition TransformProxy.h:40
Definition HitResult.h:21
Definition InputBehavior.h:35
Definition InputBehavior.h:189
static constexpr int DEFAULT_GIZMO_PRIORITY
Definition InputBehavior.h:190
Definition InputBehavior.h:67
Definition InputBehavior.h:132
Definition InputState.h:367
Definition InputState.h:264
Definition InputState.h:52
Definition ToolContextInterfaces.h:50
Definition ObjectPtr.h:488