UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoBaseComponent.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"
8
9#include "GizmoBaseComponent.generated.h"
10
12
13UINTERFACE(MinimalAPI)
18
24{
26public:
27 virtual void UpdateHoverState(bool bHoveringIn) {}
28
29 virtual void UpdateWorldLocalState(bool bWorldIn) {}
30
32};
33
34
41class UGizmoBaseComponent : public UPrimitiveComponent
43{
45
46public:
48 {
49 bUseEditorCompositing = false;
50 }
51
57 {
58 MarkRenderStateDirty();
59 UpdateBounds();
60 }
61
62public:
63 UPROPERTY(EditAnywhere, Category = Options)
65
66
67 UPROPERTY(EditAnywhere, Category = Options)
68 float HoverSizeMultiplier = 2.0f;
69
70
71 UPROPERTY(EditAnywhere, Category = Options)
72 float PixelHitDistanceThreshold = 7.0f;
73
74 void SetGizmoViewContext(UGizmoViewContext* GizmoViewContextIn)
75 {
76 GizmoViewContext = GizmoViewContextIn;
77 bIsViewDependent = (GizmoViewContext != nullptr);
78 }
79
80public:
81 UFUNCTION()
82 virtual void UpdateHoverState(bool bHoveringIn) override
83 {
84 if (bHoveringIn != bHovering)
85 {
86 bHovering = bHoveringIn;
87 }
88 }
89
90 UFUNCTION()
91 virtual void UpdateWorldLocalState(bool bWorldIn) override
92 {
93 if (bWorldIn != bWorld)
94 {
95 bWorld = bWorldIn;
96 }
97 }
98
99
100protected:
101
102 // hover state
103 bool bHovering = false;
104
105 // world/local coordinates state
106 bool bWorld = false;
107
108 UPROPERTY()
109 TObjectPtr<UGizmoViewContext> GizmoViewContext = nullptr;
110
111 // True when GizmoViewContext is not null. Here as a boolean so it
112 // can be pointed to by the proxy to see what it should do.
113 bool bIsViewDependent = false;
114};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UINTERFACE(...)
Definition ObjectMacros.h:780
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition GizmoBaseComponent.h:24
virtual void UpdateHoverState(bool bHoveringIn)
Definition GizmoBaseComponent.h:27
virtual void UpdateInteractingState(bool bInteractingIn)
Definition GizmoBaseComponent.h:31
virtual void UpdateWorldLocalState(bool bWorldIn)
Definition GizmoBaseComponent.h:29
Definition GizmoBaseComponent.h:15
Definition GizmoBaseComponent.h:43
UGizmoBaseComponent()
Definition GizmoBaseComponent.h:47
void NotifyExternalPropertyUpdates()
Definition GizmoBaseComponent.h:56
Definition GizmoViewContext.h:20
Definition Interface.h:19
@ false
Definition radaudio_common.h:23
Definition Color.h:48
Definition ObjectPtr.h:488