UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoElementArrow.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#include "GizmoElementGroup.h"
9#include "InputState.h"
11
12#include "GizmoElementArrow.generated.h"
13
18
23UCLASS(Transient, MinimalAPI)
25{
27
28public:
30
31 //~ Begin UGizmoElementBase Interface.
34 //~ End UGizmoElementBase Interface.
35
36 // Location of the base of arrow cylinder
37 INTERACTIVETOOLSFRAMEWORK_API virtual void SetBase(const FVector& InBase);
38 INTERACTIVETOOLSFRAMEWORK_API virtual FVector GetBase() const;
39
40 // Arrow direction.
41 INTERACTIVETOOLSFRAMEWORK_API virtual void SetDirection(const FVector& InDirection);
42 INTERACTIVETOOLSFRAMEWORK_API virtual FVector GetDirection() const;
43
44 // Arrow side direction for box head.
45 INTERACTIVETOOLSFRAMEWORK_API virtual void SetSideDirection(const FVector& InSideDirection);
46 INTERACTIVETOOLSFRAMEWORK_API virtual FVector GetSideDirection() const;
47
48 // Arrow body length.
49 INTERACTIVETOOLSFRAMEWORK_API virtual void SetBodyLength(float InBodyLength);
50 INTERACTIVETOOLSFRAMEWORK_API virtual float GetBodyLength() const;
51
52 // Arrow body cylinder radius.
53 INTERACTIVETOOLSFRAMEWORK_API virtual void SetBodyRadius(float InBodyRadius);
54 INTERACTIVETOOLSFRAMEWORK_API virtual float GetBodyRadius() const;
55
56 // Arrow head length, used for both cone and cube head.
57 INTERACTIVETOOLSFRAMEWORK_API virtual void SetHeadLength(float InHeadLength);
58 INTERACTIVETOOLSFRAMEWORK_API virtual float GetHeadLength() const;
59
60 // Arrow head radius, if cone.
61 INTERACTIVETOOLSFRAMEWORK_API virtual void SetHeadRadius(float InHeadRadius);
62 INTERACTIVETOOLSFRAMEWORK_API virtual float GetHeadRadius() const;
63
64 // Number of sides for cylinder and cone, if relevant.
67
68 // Whether to render and end cap on the base of the arrow head. Applicable when the ArrowHeadType is Cone.
69 INTERACTIVETOOLSFRAMEWORK_API virtual void SetEndCaps(bool InEndCaps);
70 INTERACTIVETOOLSFRAMEWORK_API virtual bool GetEndCaps() const;
71
72 // Head type cone or cube.
75
76 // Whether to render the body element with dashing.
77 INTERACTIVETOOLSFRAMEWORK_API virtual void SetIsDashed(bool bInDashing);
78 INTERACTIVETOOLSFRAMEWORK_API virtual bool IsDashed() const;
79
80 // The dash parameters for the body element, if enabled. If GapLength is not specified, it defaults to half DashLength.
81 INTERACTIVETOOLSFRAMEWORK_API virtual void SetDashParameters(const float InDashLength = 10.0f, const TOptional<float>& InGapLength = TOptional<float>());
82 INTERACTIVETOOLSFRAMEWORK_API virtual void GetDashParameters(float& OutDashLength, float& OutGapLength) const;
83
84 // Pixel hit distance threshold, element will be scaled enough to add this threshold when line-tracing.
86
87 // Minimum Pixel hit distance threshold, element will be scaled enough to add this threshold when line-tracing.
89
90 // Hit Mask Gizmo element used for adaptive pixel hit threshold
92
93protected:
94
95 // Update arrow cylinder based on parameters
96 INTERACTIVETOOLSFRAMEWORK_API virtual void UpdateArrowBody();
97
98 // Update arrow cone or box based on parameters
99 INTERACTIVETOOLSFRAMEWORK_API virtual void UpdateArrowHead();
100
101 // Flag indicating body properties need to be updated prior to render
102 bool bUpdateArrowBody = true;
103
104 // Flag indicating head properties need to be updated prior to render
105 bool bUpdateArrowHead = true;
106
107 // Arrow cylinder body
108 UPROPERTY()
110
111 // Arrow head
112 UPROPERTY()
114
115 // Location of center of arrow base circle.
116 UPROPERTY()
117 FVector Base = FVector::ZeroVector;
118
119 // Direction of arrow axis
120 UPROPERTY()
121 FVector Direction = FVector(0.0f, 0.0f, 1.0f);
122
123 // Side direction for box head
124 UPROPERTY()
125 FVector SideDirection = FVector(0.0f, 1.0f, 0.0f);
126
127 // Arrow body length
128 UPROPERTY()
129 float BodyLength = 1.5f;
130
131 // Radius of arrow cylinder
132 UPROPERTY()
133 float BodyRadius = 0.5f;
134
135 // Length of head, cone or box
136 UPROPERTY()
137 float HeadLength = 0.5f;
138
139 // Radius of head cone
140 UPROPERTY()
141 float HeadRadius = 0.75f;
142
143 // Number of sides for tessellating cone and cylinder
144 UPROPERTY()
146
147 // Whether to render an end cap on the base of the arrow head.
148 UPROPERTY()
149 bool bEndCaps = false;
150
151 // Head type
152 UPROPERTY()
154
155 // Hit mask
156 UPROPERTY()
158};
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
EGizmoElementArrowHeadType
Definition GizmoElementArrowHead.h:16
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition ToolContextInterfaces.h:427
Definition GizmoElementArrowHead.h:29
Definition GizmoElementArrow.h:25
Definition GizmoElementBase.h:26
virtual FInputRayHit LineTrace(const UGizmoViewContext *ViewContext, const FLineTraceTraversalState &LineTraceState, const FVector &RayOrigin, const FVector &RayDirection, FLineTraceOutput &OutLineTraceOutput) PURE_VIRTUAL(UGizmoElementBase
Definition GizmoElementBase.h:142
virtual INTERACTIVETOOLSFRAMEWORK_API void SetPixelHitDistanceThreshold(float InPixelHitDistanceThreshold)
Definition GizmoElementBase.cpp:830
virtual INTERACTIVETOOLSFRAMEWORK_API void SetMinimumPixelHitDistanceThreshold(const float InMinimumPixelHitDistanceThreshold)
Definition GizmoElementBase.cpp:840
Definition GizmoElementBox.h:18
Definition GizmoElementCone.h:18
Definition GizmoElementCylinder.h:18
Definition GizmoElementGroup.h:17
Definition GizmoElementSphere.h:18
virtual INTERACTIVETOOLSFRAMEWORK_API void SetNumSides(int32 InNumSides)
Definition GizmoElementSphere.cpp:78
virtual INTERACTIVETOOLSFRAMEWORK_API int32 GetNumSides() const
Definition GizmoElementSphere.cpp:83
int32 NumSides
Definition GizmoElementSphere.h:52
Definition GizmoViewContext.h:20
@ false
Definition radaudio_common.h:23
Definition InputState.h:52
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition WeakObjectPtrTemplates.h:25
Definition GizmoElementBase.h:125
Definition GizmoElementBase.h:96
Definition GizmoElementBase.h:52