UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoElementCircleBase.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"
7#include "InputState.h"
9#include "GizmoElementCircleBase.generated.h"
10
13
17UCLASS(Transient, Abstract, MinimalAPI)
19{
21
23
24public:
25
26 // CircleBase center.
29
30 // Axis0 of plane in which circle lies, must perpendicular to normal.
31 // Start and end angles for partial circles are relative to this axis.
34
35 // Axis1 of plane in which circle lies, must perpendicular to Axis0.
38
39 // Circle radius.
40 INTERACTIVETOOLSFRAMEWORK_API virtual void SetRadius(double InRadius);
41 INTERACTIVETOOLSFRAMEWORK_API virtual double GetRadius() const;
42
43 // Multiplier applied to the circle radius when hovering
44 INTERACTIVETOOLSFRAMEWORK_API virtual void SetHoverRadiusMultiplier(double InHoverRadiusMultiplier);
45 INTERACTIVETOOLSFRAMEWORK_API virtual double GetHoverRadiusMultiplier() const;
46
47 // Multiplier applied to the circle radius when interacting
48 INTERACTIVETOOLSFRAMEWORK_API virtual void SetInteractRadiusMultiplier(double InInteractRadiusMultiplier);
49 INTERACTIVETOOLSFRAMEWORK_API virtual double GetInteractRadiusMultiplier() const;
50
51 // Multiplier applied to the circle radius when selected
52 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSelectRadiusMultiplier(double InSelectRadiusMultiplier);
53 INTERACTIVETOOLSFRAMEWORK_API virtual double GetSelectRadiusMultiplier() const;
54
55 // Multiplier applied to the circle radius when subdued
56 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSubdueRadiusMultiplier(double InSubdueRadiusMultiplier);
57 INTERACTIVETOOLSFRAMEWORK_API virtual double GetSubdueRadiusMultiplier() const;
58
59 // Number of segments for rendering circle.
61 INTERACTIVETOOLSFRAMEWORK_API virtual int32 GetNumSegments() const;
62
63 // When Partial, renders partial arc based on angle.
64 // When PartialViewDependent, same as Partial but renders full arc when arc normal aligns with view direction
67
68 // Start of arc angle of partial torus in radians, relative to Axis0.
69 INTERACTIVETOOLSFRAMEWORK_API virtual void SetPartialStartAngle(double InPartialAngle);
70 INTERACTIVETOOLSFRAMEWORK_API virtual double GetPartialStartAngle() const;
71
72 // Start of arc angle of partial torus in radians, relative to Axis1.
73 INTERACTIVETOOLSFRAMEWORK_API virtual void SetPartialEndAngle(double InPartialAngle);
74 INTERACTIVETOOLSFRAMEWORK_API virtual double GetPartialEndAngle() const;
75
76 // If partial type is PartialViewDependent, when the cosine of angle between the normal and view direction
77 // is within this tolerance, the arc will be rendered as full rather than partial
78 INTERACTIVETOOLSFRAMEWORK_API virtual void SetPartialViewDependentMaxCosTol(double InPartialViewDependentMaxCosTol);
79 INTERACTIVETOOLSFRAMEWORK_API virtual double GetPartialViewDependentMaxCosTol() const;
80
82
83 // CircleBase center.
84 UPROPERTY()
85 FVector Center = FVector::ZeroVector;
86
87 // Axis0 of plane in which circle lies, must perpendicular to normal.
88 // Start and end angles for partial circles are relative to this axis.
89 UPROPERTY()
90 FVector Axis0 = FVector::RightVector;
91
92 // Axis1 of plane in which circle lies, must perpendicular to Axis0.
93 UPROPERTY()
94 FVector Axis1 = FVector::ForwardVector;
95
96 // Radius of main circle, some derived elements have inner radius (e.g. torus and arc)
97 UPROPERTY()
98 double Radius = 100.0;
99
100 // Optional radius multipliers to apply when hovering, interacting, selected or subdued.
101 UPROPERTY()
103
104 // Number of segments for rendering arc.
105 UPROPERTY()
106 int32 NumSegments = 64;
107
108 // True when the arc is not full.
109 UPROPERTY()
111
112 // Start angle to render for partial torus
113 UPROPERTY()
114 double PartialStartAngle = 0.0;
115
116 // End angle to render for partial torus
117 UPROPERTY()
118 double PartialEndAngle = UE_DOUBLE_TWO_PI;
119
120 // For PartialViewDependent, max cosine of angle between the normal and view direction
121 // Within this tolerance, the arc will be rendered as full rather than partial
122 UPROPERTY()
123 double PartialViewDependentMaxCosTol = 0.96f;
124
126
127 // Returns the current radius based on the current interaction state.
128 INTERACTIVETOOLSFRAMEWORK_API double GetCurrentRadius() const;
129
130 // Returns whether element should be partial based on current view
131 INTERACTIVETOOLSFRAMEWORK_API bool IsPartial(const FSceneView* View, const FVector& InWorldCenter, const FVector& InWorldNormal);
132
133 // Returns whether element should be partial based on current view
135
136 // Returns whether element should be partial based on current view
139 const bool bIsPerspectiveProjection);
140
141};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EGizmoElementPartialType
Definition GizmoElementShared.h:79
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UE_DOUBLE_TWO_PI
Definition UnrealMathUtility.h:157
Definition GizmoUtil.h:19
Definition MaterialRenderProxy.h:102
Definition PrimitiveDrawInterface.h:19
Definition SceneView.h:1425
Definition GizmoElementCircleBase.h:19
Definition GizmoElementLineBase.h:18
Definition GizmoViewContext.h:20