UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Cylinder.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "Chaos/Plane.h"
6#include "Chaos/Rotation.h"
7#include "Chaos/Sphere.h"
8#include "ChaosArchive.h"
9
10namespace Chaos
11{
12 struct FCylinderSpecializeSamplingHelper;
13
14 class FCylinder final : public FImplicitObject
15 {
16 public:
19
20 FCylinder(const FVec3& x1, const FVec3& x2, const FReal Radius)
21 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Cylinder)
22 , MPlane1(x1, (x2 - x1).GetSafeNormal()) // Plane normals point inward
23 , MPlane2(x2, -MPlane1.Normal())
24 , MHeight((x2 - x1).Size())
25 , MRadius(Radius)
26 , MLocalBoundingBox(x1, x1)
27 {
28 MLocalBoundingBox.GrowToInclude(x2);
29 MLocalBoundingBox = FAABB3(MLocalBoundingBox.Min() - FVec3(MRadius), MLocalBoundingBox.Max() + FVec3(MRadius));
30 }
32 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Cylinder)
33 , MPlane1(Other.MPlane1)
34 , MPlane2(Other.MPlane2)
35 , MHeight(Other.MHeight)
36 , MRadius(Other.MRadius)
37 , MLocalBoundingBox(Other.MLocalBoundingBox)
38 {
39 }
41 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Cylinder)
42 , MPlane1(MoveTemp(Other.MPlane1))
43 , MPlane2(MoveTemp(Other.MPlane2))
44 , MHeight(Other.MHeight)
45 , MRadius(Other.MRadius)
46 , MLocalBoundingBox(MoveTemp(Other.MLocalBoundingBox))
47 {
48 }
50
52
60 TArray<FVec3> ComputeLocalSamplePoints(const int32 NumPoints, const bool IncludeEndCaps = true) const;
61
70 TArray<FVec3> ComputeLocalSamplePoints(const FReal PointsPerUnitArea, const bool IncludeEndCaps = true, const int32 MinPoints = 0, const int32 MaxPoints = 1000) const
71 { return ComputeLocalSamplePoints(FMath::Clamp(static_cast<int32>(ceil(PointsPerUnitArea * GetArea(IncludeEndCaps))), MinPoints, MaxPoints), IncludeEndCaps); }
72
80 TArray<FVec3> ComputeSamplePoints(const int32 NumPoints, const bool IncludeEndCaps = true) const;
81
90 TArray<FVec3> ComputeSamplePoints(const FReal PointsPerUnitArea, const bool IncludeEndCaps = true, const int32 MinPoints = 0, const int32 MaxPoints = 1000) const
91 { return ComputeSamplePoints(FMath::Clamp(static_cast<int32>(ceil(PointsPerUnitArea * GetArea(IncludeEndCaps))), MinPoints, MaxPoints), IncludeEndCaps); }
92#if 0
93 /*virtual*/ FReal SignedDistance(const FVec3& x) const /*override*/
94 {
95 FVec3 V = MPlane1.X() - x;
96 FReal Plane1Distance = FVec3::DotProduct(V, MPlane1.Normal());
97 FReal PlaneDistance = FMath::Max(Plane1Distance, -MHeight - Plane1Distance);
98 FReal CylinderDistance = (V - Plane1Distance * MPlane1.Normal()).Size() - MRadius;
99 return CylinderDistance > 0.0 && PlaneDistance > 0.0 ?
102 }
103#endif
104 virtual FReal PhiWithNormal(const FVec3& x, FVec3& Normal) const override
105 {
107 const FReal Distance1 = MPlane1.PhiWithNormal(x, Normal1); // positive on the cylinder side
108 if (Distance1 < 0) // off end 1
109 {
110 check(MPlane2.PhiWithNormal(x, Normal2) > 0);
111 const FVec3 v = x - FVec3(Normal1 * Distance1 + MPlane1.X());
112 if (v.Size() > MRadius)
113 {
114 const FVec3 Corner = v.GetSafeNormal() * MRadius + MPlane1.X();
115 Normal = x - Corner;
116 return Normal.SafeNormalize();
117 }
118 else
119 {
120 Normal = -Normal1;
121 return -Distance1;
122 }
123 }
124 const FReal Distance2 = MPlane2.PhiWithNormal(x, Normal2);
125 if (Distance2 < 0) // off end 2
126 {
127 check(MPlane1.PhiWithNormal(x, Normal1) > 0);
128 const FVec3 v = x - FVec3(Normal2 * Distance2 + MPlane2.X());
129 if (v.Size() > MRadius)
130 {
131 const FVec3 Corner = v.GetSafeNormal() * MRadius + MPlane2.X();
132 Normal = x - Corner;
133 return Normal.SafeNormalize();
134 }
135 else
136 {
137 Normal = -Normal2;
138 return -Distance2;
139 }
140 }
141 // Both distances are positive, should add to the height of the cylinder.
142 check(FMath::Abs(Distance1 + Distance2 - MHeight) < UE_KINDA_SMALL_NUMBER);
143 const FVec3 SideVector = (x - FVec3(Normal1 * Distance1 + MPlane1.X()));
144 const FReal SideDistance = SideVector.Size() - MRadius;
145 if (SideDistance < 0)
146 {
147 // We're inside the cylinder. If the distance to a endcap is less
148 // than the SideDistance, push out the end.
151 {
153 return -TopDistance;
154 }
155 }
156 Normal = SideVector.GetSafeNormal();
157 return SideDistance;
158 }
159
160 virtual const FAABB3 BoundingBox() const override { return MLocalBoundingBox; }
161
162 virtual FReal GetRadius() const override { return MRadius; }
163 FReal GetHeight() const { return MHeight; }
164 const FVec3& GetX1() const { return MPlane1.X(); }
165 const FVec3& GetX2() const { return MPlane2.X(); }
167 const FVec3& GetOrigin() const { return MPlane1.X(); }
169 const FVec3& GetInsertion() const { return MPlane2.X(); }
170 FVec3 GetCenter() const { return (MPlane1.X() + MPlane2.X()) * (FReal)0.5; }
172 FVec3 GetCenterOfMass() const { return GetCenter(); }
173
174 FVec3 GetAxis() const { return (MPlane2.X() - MPlane1.X()).GetSafeNormal(); }
175
176 FReal GetArea(const bool IncludeEndCaps = true) const { return GetArea(MHeight, MRadius, IncludeEndCaps); }
177 static FReal GetArea(const FReal Height, const FReal Radius, const bool IncludeEndCaps)
178 {
179 static const FReal PI2 = 2. * UE_PI;
180 return IncludeEndCaps ?
181 PI2 * Radius * (Height + Radius) :
182 PI2 * Radius * Height;
183 }
184
185 FReal GetVolume() const { return GetVolume(MHeight, MRadius); }
186 static FReal GetVolume(const FReal Height, const FReal Radius) { return UE_PI * Radius * Radius * Height; }
187
188 FMatrix33 GetInertiaTensor(const FReal Mass) const { return GetInertiaTensor(Mass, MHeight, MRadius); }
189 static FMatrix33 GetInertiaTensor(const FReal Mass, const FReal Height, const FReal Radius)
190 {
191 // https://www.wolframalpha.com/input/?i=cylinder
192 const FReal RR = Radius * Radius;
193 const FReal Diag12 = static_cast<FReal>(Mass / 12. * (3.*RR + Height*Height));
194 const FReal Diag3 = static_cast<FReal>(Mass / 2. * RR);
195 return FMatrix33(Diag12, Diag12, Diag3);
196 }
197
200 {
201 // since the cylinder stores an axis and the InertiaTensor is assumed to be along the ZAxis
202 // we need to make sure to return the rotation of the axis from Z
203 return FRotation3::FromRotatedVector(FVec3(0, 0, 1), Axis);
204 }
205
206 virtual void Serialize(FChaosArchive& Ar)
207 {
210 Ar << MPlane1;
211 Ar << MPlane2;
212 Ar << MHeight;
213 Ar << MRadius;
214 TBox<FReal, 3>::SerializeAsAABB(Ar, MLocalBoundingBox);
215 }
216
217 private:
218 virtual Pair<FVec3, bool> FindClosestIntersectionImp(const FVec3& StartPoint, const FVec3& EndPoint, const FReal Thickness) const override
219 {
220 TArray<Pair<FReal, FVec3>> Intersections;
221 // Flatten to Plane defined by StartPoint and MPlane1.Normal()
222 // Project End and Center into Plane
223 FVec3 ProjectedEnd = EndPoint - FVec3::DotProduct(EndPoint - StartPoint, MPlane1.Normal()) * MPlane1.Normal();
224 FVec3 ProjectedCenter = MPlane1.X() - FVec3::DotProduct(MPlane1.X() - StartPoint, MPlane1.Normal()) * MPlane1.Normal();
225 auto ProjectedSphere = FSphere(ProjectedCenter, MRadius);
226 auto InfiniteCylinderIntersection = ProjectedSphere.FindClosestIntersection(StartPoint, ProjectedEnd, Thickness);
228 {
229 auto UnprojectedIntersection = TPlane<FReal, 3>(InfiniteCylinderIntersection.First, (StartPoint - InfiniteCylinderIntersection.First).GetSafeNormal()).FindClosestIntersection(StartPoint, EndPoint, 0);
231 Intersections.Add(MakePair((FReal)(UnprojectedIntersection.First - StartPoint).Size(), UnprojectedIntersection.First));
232 }
233 auto Plane1Intersection = MPlane1.FindClosestIntersection(StartPoint, EndPoint, Thickness);
234 if (Plane1Intersection.Second)
235 Intersections.Add(MakePair((FReal)(Plane1Intersection.First - StartPoint).Size(), Plane1Intersection.First));
236 auto Plane2Intersection = MPlane2.FindClosestIntersection(StartPoint, EndPoint, Thickness);
237 if (Plane2Intersection.Second)
238 Intersections.Add(MakePair((FReal)(Plane2Intersection.First - StartPoint).Size(), Plane2Intersection.First));
239 Intersections.Sort([](const Pair<FReal, FVec3>& Elem1, const Pair<FReal, FVec3>& Elem2) { return Elem1.First < Elem2.First; });
240 for (const auto& Elem : Intersections)
241 {
242 if (SignedDistance(Elem.Second) <= (Thickness + 1e-4))
243 {
244 return MakePair(Elem.Second, true);
245 }
246 }
247 return MakePair(FVec3(0), false);
248 }
249
250 virtual uint32 GetTypeHash() const override
251 {
252 const uint32 PlaneHashes = HashCombine(MPlane1.GetTypeHash(), MPlane2.GetTypeHash());
253 const uint32 PropertyHash = HashCombine(::GetTypeHash(MHeight), ::GetTypeHash(MRadius));
254
256 }
257
258 //needed for serialization
259 FCylinder() : FImplicitObject(EImplicitObject::HasBoundingBox, ImplicitObjectType::Cylinder) {}
260 friend FImplicitObject; //needed for serialization
261
262 private:
263 TPlane<FReal, 3> MPlane1, MPlane2;
264 FReal MHeight, MRadius;
265 FAABB3 MLocalBoundingBox;
266 };
267
269 {
270 static FORCEINLINE void ComputeSamplePoints(TArray<FVec3>& Points, const FCylinder& Cylinder, const int32 NumPoints, const bool IncludeEndCaps = true)
271 {
272 if (NumPoints <= 1 || Cylinder.GetRadius() <= UE_KINDA_SMALL_NUMBER)
273 {
274 const int32 Offset = Points.Num();
275 if (Cylinder.GetHeight() <= UE_KINDA_SMALL_NUMBER)
276 {
277 Points.SetNumUninitialized(Offset + 1);
278 Points[Offset] = Cylinder.GetCenter();
279 }
280 else
281 {
282 Points.SetNumUninitialized(Offset + 3);
283 Points[Offset + 0] = Cylinder.GetOrigin();
284 Points[Offset + 1] = Cylinder.GetCenter();
285 Points[Offset + 2] = Cylinder.GetInsertion();
286 }
287 return;
288 }
290 }
291
292 static FORCEINLINE void ComputeGoldenSpiralPoints(TArray<FVec3>& Points, const FCylinder& Cylinder, const int32 NumPoints, const bool IncludeEndCaps = true)
293 { ComputeGoldenSpiralPoints(Points, Cylinder.GetOrigin(), Cylinder.GetAxis(), Cylinder.GetRadius(), Cylinder.GetHeight(), NumPoints, IncludeEndCaps); }
294
318 TArray<FVec3>& Points,
319 const FVec3& Origin,
320 const FVec3& Axis,
321 const FReal Radius,
322 const FReal Height,
323 const int32 NumPoints,
324 const bool IncludeEndCaps = true,
325 int32 SpiralSeed = 0)
326 {
327 // Axis should be normalized.
328 checkSlow(FMath::Abs(Axis.Size() - 1.0) < UE_KINDA_SMALL_NUMBER);
329
330 const int32 Offset = Points.Num();
331 ComputeGoldenSpiralPointsUnoriented(Points, Radius, Height, NumPoints, IncludeEndCaps, SpiralSeed);
332
333 // At this point, Points are centered about the origin (0,0,0), built
334 // along the Z axis. Transform them to where they should be.
335 const FReal HalfHeight = Height / 2;
336 const FRotation3 Rotation = FRotation3::FromRotatedVector(FVec3(0, 0, 1), Axis);
337 checkSlow(((Origin + Axis * Height) - (Rotation.RotateVector(FVec3(0, 0, Height)) + Origin)).Size() < UE_KINDA_SMALL_NUMBER);
338 for (int32 i = Offset; i < Points.Num(); i++)
339 {
340 FVec3& Point = Points[i];
341 const FVec3 PointNew = Rotation.RotateVector(Point + FVec3(0, 0, HalfHeight)) + Origin;
342 checkSlow(FMath::Abs(FCylinder(Origin, Origin + Axis * Height, Radius).SignedDistance(PointNew)) < UE_KINDA_SMALL_NUMBER);
343 Point = PointNew;
344 }
345 }
346
369 TArray<FVec3>& Points,
370 const FReal Radius,
371 const FReal Height,
372 const int32 NumPoints,
373 const bool IncludeEndCaps = true,
374 int32 SpiralSeed = 0)
375 {
376 // Evenly distribute points between the cylinder body and the end caps.
379 if (IncludeEndCaps)
380 {
381 const FReal CapArea = UE_PI * Radius * Radius;
382 const FReal CylArea = static_cast<FReal>(2.0 * UE_PI * Radius * Height);
383 const FReal AllArea = CylArea + CapArea * 2;
385 {
386 NumPointsCylinder = static_cast<int32>(round(CylArea / AllArea * (FReal)NumPoints));
387 NumPointsCylinder += (NumPoints - NumPointsCylinder) % 2;
388 NumPointsEndCap = (NumPoints - NumPointsCylinder) / 2;
389 }
390 else
391 {
393 NumPointsEndCap = (NumPoints - (NumPoints % 2)) / 2;
394 }
395 }
396 else
397 {
398 NumPointsCylinder = NumPoints;
399 NumPointsEndCap = 0;
400 }
402 Points.Reserve(Points.Num() + NumPointsToAdd);
403
404 int32 Offset = Points.Num();
405 const FReal HalfHeight = Height / 2;
406 TArray<FVec2> Points2D;
407 Points2D.Reserve(NumPointsEndCap);
408 if (IncludeEndCaps)
409 {
411 Points2D, FVec2((FReal)0.0), Radius, NumPointsEndCap, SpiralSeed);
412 Offset = Points.AddUninitialized(Points2D.Num());
413 for (int32 i = 0; i < Points2D.Num(); i++)
414 {
415 const FVec2& Pt = Points2D[i];
416 checkSlow(Pt.Size() < Radius + UE_KINDA_SMALL_NUMBER);
417 Points[i + Offset] = FVec3(Pt[0], Pt[1], -HalfHeight);
418 }
419 // Advance the SpiralSeed by the number of points generated.
420 SpiralSeed += Points2D.Num();
421 }
422
424 static const FReal Increment = static_cast<FReal>(UE_PI * (1.0 + sqrt(5)));
425 for (int32 i = 0; i < NumPointsCylinder; i++)
426 {
427 // In the 2D sphere (disc) case, we vary R so it increases monotonically,
428 // which spreads points out across the disc:
429 // const T R = FMath::Sqrt((0.5 + Index) / NumPoints) * Radius;
430 // But we're mapping to a cylinder, which means we want to keep R constant.
431 const FReal R = Radius;
432 const FReal Theta = Increment * (0.5f + (FReal)i + (FReal)SpiralSeed);
433
434 // Map polar coordinates to Cartesian, and vary Z by [-HalfHeight, HalfHeight].
435 const FReal Z = FMath::LerpStable(-HalfHeight, HalfHeight, static_cast<FReal>(i) / (static_cast<FReal>(NumPointsCylinder) - 1));
436 Points[i + Offset] =
437 FVec3(
438 R * FMath::Cos(Theta),
439 R * FMath::Sin(Theta),
440 Z);
441
442 checkSlow(FMath::Abs(FVec2(Points[i + Offset][0], Points[i + Offset][1]).Size() - Radius) < UE_KINDA_SMALL_NUMBER);
443 }
444 // Advance the SpiralSeed by the number of points generated.
446
447 if (IncludeEndCaps)
448 {
449 Points2D.Reset();
451 Points2D, FVec2((FReal)0.0), Radius, NumPointsEndCap, SpiralSeed);
452 Offset = Points.AddUninitialized(Points2D.Num());
453 for (int32 i = 0; i < Points2D.Num(); i++)
454 {
455 const FVec2& Pt = Points2D[i];
456 checkSlow(Pt.Size() < Radius + UE_KINDA_SMALL_NUMBER);
457 Points[i + Offset] = FVec3(Pt[0], Pt[1], HalfHeight);
458 }
459 }
460 }
461 };
462
464 {
465 TArray<FVec3> Points;
467 return Points;
468 }
469
471 {
472 TArray<FVec3> Points;
473 const FVec3 Mid = GetCenter();
475 Points, FCylinder(MPlane1.X() - Mid, MPlane2.X() - Mid, GetRadius()), NumPoints, IncludeEndCaps);
476 return Points;
477 }
478
479
480 template<class T>
481 using TCylinder UE_DEPRECATED(4.27, "Deprecated. this class is to be deleted, use FCylinder instead") = FCylinder;
482
483 template<class T>
484 using TCylinderSpecializeSamplingHelper UE_DEPRECATED(4.27, "Deprecated. this class is to be deleted, use FCylinderSpecializeSamplingHelper instead") = FCylinderSpecializeSamplingHelper;
485
486} // namespace Chaos
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
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
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
#define UE_PI
Definition UnrealMathUtility.h:129
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
uint32 Size
Definition VulkanMemory.cpp:4034
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ChaosArchive.h:364
Definition ChaosArchive.h:167
Definition Cylinder.h:15
virtual void Serialize(FChaosArchive &Ar)
Definition Cylinder.h:206
FCylinder(const FVec3 &x1, const FVec3 &x2, const FReal Radius)
Definition Cylinder.h:20
CHAOS_API FReal SignedDistance(const FVec3 &x) const
Definition ImplicitObject.cpp:105
~FCylinder()
Definition Cylinder.h:49
FRotation3 GetRotationOfMass() const
Definition Cylinder.h:198
TArray< FVec3 > ComputeSamplePoints(const int32 NumPoints, const bool IncludeEndCaps=true) const
Definition Cylinder.h:463
FReal GetHeight() const
Definition Cylinder.h:163
FVec3 GetCenter() const
Definition Cylinder.h:170
FVec3 GetAxis() const
Definition Cylinder.h:174
FReal GetVolume() const
Definition Cylinder.h:185
virtual const FAABB3 BoundingBox() const override
Definition Cylinder.h:160
FReal GetArea(const bool IncludeEndCaps=true) const
Definition Cylinder.h:176
FCylinder(const FCylinder &Other)
Definition Cylinder.h:31
FCylinder(FCylinder &&Other)
Definition Cylinder.h:40
static FReal GetVolume(const FReal Height, const FReal Radius)
Definition Cylinder.h:186
TArray< FVec3 > ComputeSamplePoints(const FReal PointsPerUnitArea, const bool IncludeEndCaps=true, const int32 MinPoints=0, const int32 MaxPoints=1000) const
Definition Cylinder.h:90
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
FMatrix33 GetInertiaTensor(const FReal Mass) const
Definition Cylinder.h:188
virtual FReal PhiWithNormal(const FVec3 &x, FVec3 &Normal) const override
Definition Cylinder.h:104
static FMatrix33 GetInertiaTensor(const FReal Mass, const FReal Height, const FReal Radius)
Definition Cylinder.h:189
const FVec3 & GetX2() const
Definition Cylinder.h:165
const FVec3 & GetX1() const
Definition Cylinder.h:164
static FRotation3 GetRotationOfMass(const FVec3 &Axis)
Definition Cylinder.h:199
static FReal GetArea(const FReal Height, const FReal Radius, const bool IncludeEndCaps)
Definition Cylinder.h:177
FVec3 GetCenterOfMass() const
Definition Cylinder.h:172
virtual FReal GetRadius() const override
Definition Cylinder.h:162
TArray< FVec3 > ComputeLocalSamplePoints(const FReal PointsPerUnitArea, const bool IncludeEndCaps=true, const int32 MinPoints=0, const int32 MaxPoints=1000) const
Definition Cylinder.h:70
static constexpr EImplicitObjectType StaticType()
Definition Cylinder.h:51
TArray< FVec3 > ComputeLocalSamplePoints(const int32 NumPoints, const bool IncludeEndCaps=true) const
Definition Cylinder.h:470
const FVec3 & GetInsertion() const
Definition Cylinder.h:169
const FVec3 & GetOrigin() const
Definition Cylinder.h:167
Definition ImplicitObject.h:111
CHAOS_API FReal SignedDistance(const FVec3 &x) const
Definition ImplicitObject.cpp:105
bool HasBoundingBox() const
Definition ImplicitObject.h:275
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
CHAOS_API void SerializeImp(FArchive &Ar)
Definition ImplicitObject.cpp:337
CHAOS_API Pair< FVec3, bool > FindClosestIntersection(const FVec3 &StartPoint, const FVec3 &EndPoint, const FReal Thickness) const
Definition ImplicitObject.cpp:183
FORCEINLINE const TVector< T, d > & Max() const
Definition AABB.h:596
FORCEINLINE void GrowToInclude(const TVector< T, d > &V)
Definition AABB.h:393
FORCEINLINE const TVector< T, d > & Min() const
Definition AABB.h:595
static void SerializeAsAABB(FArchive &Ar, TAABB< T, d > &AABB)
Definition Box.h:467
Definition Plane.h:14
virtual uint32 GetTypeHash() const override
Definition Plane.h:99
virtual FReal PhiWithNormal(const FVec3 &x, FVec3 &Normal) const override
Definition Plane.h:58
const TVector< T, d > & Normal() const
Definition Plane.h:79
const TVector< T, d > & X() const
Definition Plane.h:78
Definition Array.h:670
UE_FORCEINLINE_HINT SizeType AddUninitialized()
Definition Array.h:1664
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
void SetNumUninitialized(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2369
UE_NODEBUG void Sort()
Definition Array.h:3418
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
@ Cylinder
Definition ImplicitObjectType.h:23
Definition SkeletalMeshComponent.h:307
TSphere< FReal, 3 > FSphere
Definition ImplicitObject.h:36
uint8 EImplicitObjectType
Definition ImplicitObjectType.h:41
FRealDouble FReal
Definition Real.h:22
PMatrix< FReal, 3, 3 > FMatrix33
Definition Core.h:20
Pair< T1, T2 > MakePair(const T1 &First, const T2 &Second)
Definition Pair.h:45
TVector< FReal, 3 > FVec3
Definition Core.h:17
TAABB< FReal, 3 > FAABB3
Definition ImplicitObject.h:34
TVector< FReal, 2 > FVec2
Definition Core.h:16
float v
Definition radaudio_mdct.cpp:62
static FORCEINLINE void ComputeGoldenSpiralPoints(TArray< FVec3 > &Points, const FCylinder &Cylinder, const int32 NumPoints, const bool IncludeEndCaps=true)
Definition Cylinder.h:292
static FORCEINLINE void ComputeSamplePoints(TArray< FVec3 > &Points, const FCylinder &Cylinder, const int32 NumPoints, const bool IncludeEndCaps=true)
Definition Cylinder.h:270
static FORCEINLINE void ComputeGoldenSpiralPointsUnoriented(TArray< FVec3 > &Points, const FReal Radius, const FReal Height, const int32 NumPoints, const bool IncludeEndCaps=true, int32 SpiralSeed=0)
Definition Cylinder.h:368
static FORCEINLINE void ComputeGoldenSpiralPoints(TArray< FVec3 > &Points, const FVec3 &Origin, const FVec3 &Axis, const FReal Radius, const FReal Height, const int32 NumPoints, const bool IncludeEndCaps=true, int32 SpiralSeed=0)
Definition Cylinder.h:317
Definition Pair.h:8
Definition UnrealMathUtility.h:270
static constexpr UE_FORCEINLINE_HINT T Square(const T A)
Definition UnrealMathUtility.h:578
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
static constexpr UE_FORCEINLINE_HINT T LerpStable(const T &A, const T &B, double Alpha)
Definition UnrealMathUtility.h:1147