UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoElementTorus.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 "
BaseGizmos/GizmoElementCircleBase.h
"
7
#include "
InputState.h
"
8
#include "
UObject/ObjectMacros.h
"
9
#include "GizmoElementTorus.generated.h"
10
11
class
FPrimitiveDrawInterface
;
12
class
FMaterialRenderProxy
;
13
21
UCLASS
(
Transient
, MinimalAPI)
22
class
UGizmoElementTorus
:
public
UGizmoElementCircleBase
23
{
24
GENERATED_BODY
()
25
26
public
:
27
28
//~ Begin UGizmoElementBase Interface.
29
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
Render
(
IToolsContextRenderAPI
*
RenderAPI
,
const
FRenderTraversalState
&
RenderState
)
override
;
30
31
// LineTrace approximates ray-torus intersection by intersecting the ray with the plane in which the torus
32
// lies, then determining a hit point closest to the linear circle defined by torus center and torus outer radius.
33
// If the torus lies at a glancing angle, the ray-torus intersection is performed against cylinders approximating
34
// the shape of the torus.
35
INTERACTIVETOOLSFRAMEWORK_API
virtual
FInputRayHit
LineTrace(
const
UGizmoViewContext
*
ViewContext
,
const
FLineTraceTraversalState
&
LineTraceState
,
const
FVector
& RayOrigin,
const
FVector
& RayDirection,
FLineTraceOutput
&
OutLineTraceOutput
)
override
;
36
//~ End UGizmoElementBase Interface.
37
38
// Inner circles radius.
39
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetInnerRadius(
double
InInnerRadius
);
40
INTERACTIVETOOLSFRAMEWORK_API
virtual
double
GetInnerRadius()
const
;
41
42
// Multiplier applied to the inner radius when hovering
43
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetHoverInnerRadiusMultiplier(
double
InHoverInnerRadiusMultiplier
);
44
INTERACTIVETOOLSFRAMEWORK_API
virtual
double
GetHoverInnerRadiusMultiplier()
const
;
45
46
// Multiplier applied to the inner radius when interacting
47
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetInteractInnerRadiusMultiplier(
double
InInteractInnerRadiusMultiplier
);
48
INTERACTIVETOOLSFRAMEWORK_API
virtual
double
GetInteractInnerRadiusMultiplier()
const
;
49
50
// Multiplier applied to the inner radius when selected
51
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetSelectInnerRadiusMultiplier(
double
InSelectInnerRadiusMultiplier
);
52
INTERACTIVETOOLSFRAMEWORK_API
virtual
double
GetSelectInnerRadiusMultiplier()
const
;
53
54
// Multiplier applied to the inner radius when subdued
55
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetSubdueInnerRadiusMultiplier(
double
InSubdueInnerRadiusMultiplier
);
56
INTERACTIVETOOLSFRAMEWORK_API
virtual
double
GetSubdueInnerRadiusMultiplier()
const
;
57
58
// Number of inner slices for rendering torus.
59
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetNumInnerSlices(
int32
InNumInnerSlices
);
60
INTERACTIVETOOLSFRAMEWORK_API
virtual
int32
GetNumInnerSlices()
const
;
61
62
// If partial, renders end caps when true.
63
INTERACTIVETOOLSFRAMEWORK_API
virtual
void
SetEndCaps(
bool
InEndCaps
);
64
INTERACTIVETOOLSFRAMEWORK_API
virtual
bool
GetEndCaps()
const
;
65
66
protected
:
67
68
// Torus inner radius.
69
UPROPERTY
()
70
double
InnerRadius = 5.0;
71
72
// Optional inner radius multipliers to apply when hovering, interacting, selected or subdued.
73
UPROPERTY
()
74
FGizmoPerStateValueDouble
InnerRadiusMultiplier;
75
76
// Number of slices to render in each torus segment.
77
UPROPERTY
()
78
int32
NumInnerSlices = 8;
79
80
// Whether to render end caps on a partial torus.
81
UPROPERTY
()
82
bool
bEndCaps =
false
;
83
84
protected
:
85
86
// Returns the current inner radius based on the current interaction state.
87
INTERACTIVETOOLSFRAMEWORK_API
double
GetCurrentInnerRadius() const;
88
89
INTERACTIVETOOLSFRAMEWORK_API
bool
IsGlancingAngle(const
UGizmoViewContext
* View, const
FVector
&
InWorldCenter
, const
FVector
&
InWorldNormal
);
90
91
};
CoreMinimal.h
int32
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition
Platform.h:1125
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
EPackageAutoSaveType::Transient
@ Transient
GizmoElementCircleBase.h
InputState.h
ObjectMacros.h
UPROPERTY
#define UPROPERTY(...)
UObject definition macros.
Definition
ObjectMacros.h:744
GENERATED_BODY
#define GENERATED_BODY(...)
Definition
ObjectMacros.h:765
UCLASS
#define UCLASS(...)
Definition
ObjectMacros.h:776
EOpenGLFormatCapabilities::Render
@ Render
EBulkReregister::RenderState
@ RenderState
FMaterialRenderProxy
Definition
MaterialRenderProxy.h:102
FPrimitiveDrawInterface
Definition
PrimitiveDrawInterface.h:19
IToolsContextRenderAPI
Definition
ToolContextInterfaces.h:427
UGizmoElementCircleBase
Definition
GizmoElementCircleBase.h:19
UGizmoElementTorus
Definition
GizmoElementTorus.h:23
UGizmoViewContext
Definition
GizmoViewContext.h:20
false
@ false
Definition
radaudio_common.h:23
FInputRayHit
Definition
InputState.h:52
UE::Math::TVector< double >
UGizmoElementBase::FLineTraceOutput
Definition
GizmoElementBase.h:125
UGizmoElementBase::FLineTraceTraversalState
Definition
GizmoElementBase.h:96
UGizmoElementBase::FRenderTraversalState
Definition
GizmoElementBase.h:52
Engine
Source
Runtime
InteractiveToolsFramework
Public
BaseGizmos
GizmoElementTorus.h
Generated by
1.9.8