UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoElementShared.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6
7#include "GizmoElementShared.generated.h"
8
9//
10// Visible/hittable state of gizmo element
11//
12UENUM()
14{
15 None = 0x00,
16 Visible = 1<<1,
17 Hittable = 1<<2,
19};
20
22
23//
24// Interaction state of gizmo element
25//
26UENUM()
28{
29 None,
32 Selected, // When an element is "Selected", it is considered to be the target of Interaction via indirect manipulation (not hit tested).
33 Subdued, // When one or more other elements considered part of a set is active, but this one is not (ie. X Axis is Interacting, Y and Z are Subdued).
34
35 Max
36};
37
38//
39// View dependent type: automatically cull gizmo element based on view.
40//
41// Axis - Cull object when angle between axis and view direction is within a given tolerance
42// Plane - Cull object when angle between plane normal and view direction is perpendicular within a given tolerance
43//
44UENUM()
51
52//
53// View align type: automatically align gizmo element towards a view.
54//
55// PointOnly - Align object forward axis to view direction only, useful for symmetrical objects such as a circle
56// PointEye - Align object forward axis to -camera view direction (camera pos - object center), align object up axis to scene view up
57// PointScreen - Align object forward axis to scene view forward direction (view up ^ view right), align object up axis to scene view up
58// Axial - Rotate object around up axis, minimizing angle between forward axis and view direction
59//
60UENUM()
69
70
71//
72// Partial type: render partial element for those elements which support it.
73//
74// Partial - Render partial element.
75// PartialViewDependent - Render partial unless view direction aligns with an axis or normal specified by the element type.
76//
77UENUM()
84
85// Can be used to specify what visuals should be created for a given element, when multiple are available, ie. Fill and Line
86UENUM()
88{
89 None = 0x00,
90
91 Fill = 1 << 1,
92 Line = 1 << 2,
93
95};
97
98// Used to specify the sort criteria when hit testing against multiple elements
101{
102 Closest = 1 << 0, // Sort hits by the closest to ray origin (default)
103 Priority = 1 << 1, // Sort hits by hit priority (see UGizmoElementBase::HitPriority)
104 Surface = 1 << 2, // Sort hits by whether they are surface hits (not proximity hits)
105
106 PriorityThenSurfaceThenClosest = Priority | Surface | Closest, // Sort by all three listed criteria, in order
107};
109
110
114USTRUCT(MinimalAPI, meta = (DisplayName = "Per-State Value (Double)"))
116{
118
119 using FValueType = double;
120
125 UPROPERTY(EditAnywhere, Category = "Value")
127
129 UPROPERTY(EditAnywhere, Category = "Value")
131
133 UPROPERTY(EditAnywhere, Category = "Value")
135
137 UPROPERTY(EditAnywhere, Category = "Value")
139
141 UPROPERTY(EditAnywhere, Category = "Value")
143
145 INTERACTIVETOOLSFRAMEWORK_API double GetValueForState(const EGizmoElementInteractionState InState) const;
146
148 double GetDefaultValue() const { return Default.Get(ValueDefault); }
149
151 double GetHoverValue() const { return Hover.Get(GetDefaultValue()); }
152
154 double GetInteractValue() const { return Interact.Get(GetDefaultValue()); }
155
157 double GetSelectValue() const { return Select.Get(GetDefaultValue()); }
158
160 double GetSubdueValue() const { return Subdue.Get(GetDefaultValue()); }
161
162 friend bool operator==(const FGizmoPerStateValueDouble& InLeft, const FGizmoPerStateValueDouble& InRight)
163 {
164 return InLeft.Default == InRight.Default
165 && InLeft.Hover == InRight.Hover
166 && InLeft.Interact == InRight.Interact
167 && InLeft.Select == InRight.Select
168 && InLeft.Subdue == InRight.Subdue;
169 }
170
172 {
173 return !(InLeft == InRight);
174 }
175
176private:
177 static constexpr double ValueDefault = 1.0;
178};
179
184USTRUCT(MinimalAPI, meta = (DisplayName = "Per-State Value (LinearColor)"))
186{
188
189 using FValueType = FLinearColor;
190
195 UPROPERTY(EditAnywhere, Category = "Value")
197
199 UPROPERTY(EditAnywhere, Category = "Value")
201
203 UPROPERTY(EditAnywhere, Category = "Value")
205
207 UPROPERTY(EditAnywhere, Category = "Value")
209
211 UPROPERTY(EditAnywhere, Category = "Value")
213
216
218 const FLinearColor& GetDefaultValue() const { return Default.Get(FLinearColor::Transparent); }
219
221 const FLinearColor& GetHoverValue() const { return Hover.Get(GetDefaultValue()); }
222
224 const FLinearColor& GetInteractValue() const { return Interact.Get(GetDefaultValue()); }
225
227 const FLinearColor& GetSelectValue() const { return Select.Get(GetDefaultValue()); }
228
230 const FLinearColor& GetSubdueValue() const { return Subdue.Get(GetDefaultValue()); }
231
233 {
234 return InLeft.Default == InRight.Default
235 && InLeft.Hover == InRight.Hover
236 && InLeft.Interact == InRight.Interact
237 && InLeft.Select == InRight.Select
238 && InLeft.Subdue == InRight.Subdue;
239 }
240
242 {
243 return !(Lhs == RHS);
244 }
245};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
EGizmoElementInteractionState
Definition GizmoElementShared.h:28
EGizmoElementViewAlignType
Definition GizmoElementShared.h:62
EGizmoElementViewDependentType
Definition GizmoElementShared.h:46
EGizmoElementDrawType
Definition GizmoElementShared.h:88
EGizmoElementHitSortType
Definition GizmoElementShared.h:101
EGizmoElementPartialType
Definition GizmoElementShared.h:79
EGizmoElementState
Definition GizmoElementShared.h:14
UE_FORCEINLINE_HINT bool operator!=(const FIndexedPointer &Other) const
Definition LockFreeList.h:76
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
uint8_t uint8
Definition binka_ue_file_header.h:8
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
Definition Color.h:48
static CORE_API const FLinearColor Transparent
Definition Color.h:459
Definition Optional.h:131