UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AABB.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Chaos/Core.h"
6#include "Chaos/Raycasts.h"
7
8namespace Chaos
9{
10 template<class T, int d>
11 class TAABB;
12
13 template<typename T, int d>
15 {
17 {
18 check(false);
19 return TArray<TVector<T, d>>();
20 }
21 };
22
28
29 struct FAABBFace
30 {
33 };
34
35 template<class T, int d>
36 class TAABB
37 {
38 public:
39 using TType = T;
40 static constexpr int D = d;
41
43 : MMin(TVector<T, d>(TNumericLimits<T>::Max()))
44 , MMax(TVector<T, d>(-TNumericLimits<T>::Max()))
45 {
46 }
47
49 : MMin(Min)
50 , MMax(Max)
51 {
52 }
53
55 : MMin(Other.MMin)
56 , MMax(Other.MMax)
57 {
58 }
59
60 template<typename OtherType>
62 : MMin(TVector<T, d>(Other.Min()))
63 , MMax(TVector<T, d>(Other.Max()))
64 {
65 }
66
68 : MMin(MoveTemp(Other.MMin))
69 , MMax(MoveTemp(Other.MMax))
70 {
71 }
72
74 {
75 MMin = Other.MMin;
76 MMax = Other.MMax;
77 return *this;
78 }
79
81 {
82 MMin = MoveTemp(Other.MMin);
83 MMax = MoveTemp(Other.MMax);
84 return *this;
85 }
86
95
103
108
110
111 template <typename TReal>
113 {
114 for (int32 i = 0; i < d; ++i)
115 {
116 if (Other.Max()[i] < MMin[i] || Other.Min()[i] > MMax[i])
117 return false;
118 }
119 return true;
120 }
121
123 {
124 return TAABB<T, d>(MMin.ComponentwiseMax(Other.MMin), MMax.ComponentwiseMin(Other.MMax));
125 }
126
128 {
129 for (int i = 0; i < d; i++)
130 {
131 if (Point[i] < MMin[i] || Point[i] > MMax[i])
132 {
133 return false;
134 }
135 }
136 return true;
137 }
138
139 FORCEINLINE bool Contains(const TVector<T, d>& Point, const T Tolerance) const
140 {
141 for (int i = 0; i < d; i++)
142 {
143 if (Point[i] < MMin[i] - Tolerance || Point[i] > MMax[i] + Tolerance)
144 {
145 return false;
146 }
147 }
148 return true;
149 }
150
152 {
153 return Contains(Other.Min()) && Contains(Other.Max());
154 }
155
156 FORCEINLINE const TAABB<T, d>& BoundingBox() const { return *this; }
157
159
165
167 {
168 const TVector<FReal, d> MaxDists = X - MMax;
169 const TVector<FReal, d> MinDists = MMin - X;
173 {
174 const Pair<FReal, int32> MaxAndAxis = TVector<FReal, d>::MaxAndAxis(MinDists, MaxDists);
175 Normal = MaxDists[MaxAndAxis.Second] > MinDists[MaxAndAxis.Second] ? TVector<FReal, d>::AxisVector(MaxAndAxis.Second) : -TVector<FReal, d>::AxisVector(MaxAndAxis.Second);
176 return MaxAndAxis.First;
177 }
178 else
179 {
180 for (int i = 0; i < d; ++i)
181 {
182 if (MaxDists[i] > 0)
183 {
184 Normal[i] = MaxDists[i];
185 }
186 else if (MinDists[i] > 0)
187 {
188 Normal[i] = -MinDists[i];
189 }
190 else
191 {
192 Normal[i] = 0;
193 }
194 }
195 FReal Phi = Normal.SafeNormalize();
196 if (Phi < UE_KINDA_SMALL_NUMBER)
197 {
198 for (int i = 0; i < d; ++i)
199 {
200 if (Normal[i] > 0)
201 {
202 Normal[i] = 1;
203 }
204 else if (Normal[i] < 0)
205 {
206 Normal[i] = -1;
207 }
208 }
209 Normal.Normalize();
210 }
211 return Phi;
212 }
213 }
214
215 CHAOSCORE_API bool Raycast(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& Dir, const FReal Length, const FReal Thickness, FReal& OutTime, TVector<FReal, d>& OutPosition, TVector<FReal, d>& OutNormal, int32& OutFaceIndex) const;
216
217 FORCEINLINE bool RaycastFast(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& Dir, const TVector<FReal, d>& InvDir, const bool* bParallel, const FReal Length, FReal& OutEntryTime, FReal& OutExitTime) const
218 {
219 return Raycasts::RayAabb(StartPoint, Dir, InvDir, bParallel, Length, MMin, MMax, OutEntryTime, OutExitTime);
220 }
221
222 FORCEINLINE bool RaycastFast(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& Dir, const TVector<FReal, d>& InvDir, const bool* bParallel, const FReal Length, const FReal InvLength, FReal& OutEntryTime, FReal& OutExitTime) const
223 {
224 return RaycastFast(StartPoint, Dir, InvDir, bParallel, Length, OutEntryTime, OutExitTime);
225 }
226
227 FORCEINLINE bool RaycastFast(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& Dir, const TVector<FReal, d>& InvDir, const bool* bParallel, const FReal Length, FReal& OutTime, TVector<FReal, d>& OutPosition) const
228 {
231 if (RaycastFast(StartPoint, Dir, InvDir, bParallel, Length, RayEntryTime, RayExitTime))
232 {
233 OutTime = RayEntryTime;
234 OutPosition = StartPoint + RayEntryTime * Dir;
235 return true;
236 }
237 return false;
238 }
239
240 FORCEINLINE bool RaycastFast(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& Dir, const TVector<FReal, d>& InvDir, const bool* bParallel, const FReal Length, const FReal InvLength, FReal& OutTime, TVector<FReal, d>& OutPosition) const
241 {
242 return RaycastFast(StartPoint, Dir, InvDir, bParallel, Length, OutTime, OutPosition);
243 }
244
245 CHAOSCORE_API TVector<T, d> FindClosestPoint(const TVector<T, d>& StartPoint, const T Thickness = (T)0) const;
246
247 CHAOSCORE_API Pair<TVector<FReal, d>, bool> FindClosestIntersectionImp(const TVector<FReal, d>& StartPoint, const TVector<FReal, d>& EndPoint, const FReal Thickness) const;
248
250 {
251 // Find which faces were included in the contact normal, and for multiple faces, use the one most opposing the sweep direction.
254
255 for (int32 Axis = 0; Axis < d; Axis++)
256 {
257 // Select axis of face to compare to, based on normal.
259 {
260 const T TraceDotFaceNormal = DenormDir[Axis]; // TraceDirDenormLocal.dot(BoxFaceNormal)
262 {
265 BestNormal[Axis] = 1;
266 }
267 }
269 {
270 const T TraceDotFaceNormal = -DenormDir[Axis]; // TraceDirDenormLocal.dot(BoxFaceNormal)
272 {
274 BestNormal = FVector(0.f);
275 BestNormal[Axis] = -1.f;
276 }
277 }
278 }
279
280 return BestNormal;
281 }
282
284 {
287 for (int Axis = 0; Axis < d; ++Axis)
288 {
289 if(Direction[Axis] < 0)
290 {
291 ChosenPt[Axis] = MMin[Axis];
292 ChosenAxis[Axis] = 0;
293 }
294 else
295 {
296 ChosenPt[Axis] = MMax[Axis];
297 ChosenAxis[Axis] = 1;
298 }
299 }
300
302
303 if (Thickness != (T)0)
304 {
305 //We want N / ||N|| and to avoid inf
306 //So we want N / ||N|| < 1 / eps => N eps < ||N||, but this is clearly true for all eps < 1 and N > 0
307 T SizeSqr = Direction.SizeSquared();
309 {
310 return ChosenPt;
311 }
312 const TVector<T, d> Normalized = Direction / FMath::Sqrt(SizeSqr);
313
314 const TVector<T, d> InflatedPt = ChosenPt + Normalized.GetSafeNormal() * Thickness;
315 return InflatedPt;
316 }
317
318 return ChosenPt;
319 }
320
321 // Support vertex in the specified direction, assuming each face has been moved inwards by InMargin
323 {
326 for (int Axis = 0; Axis < d; ++Axis)
327 {
328 if(Direction[Axis] < 0)
329 {
330 ChosenPt[Axis] = MMin[Axis] + InMargin;
331 ChosenAxis[Axis] = 0;
332 }
333 else
334 {
335 ChosenPt[Axis] = MMax[Axis] - InMargin;
336 ChosenAxis[Axis] = 1;
337 }
338 }
339
341
342 // Maximum distance between the Core+Margin position and the original outer vertex
343 constexpr FReal RootThreeMinusOne = FReal(1.7320508075688772935274463415059 - 1.0);
344 if (OutSupportDelta != nullptr)
345 {
347 }
348
349 return ChosenPt;
350 }
351
360
362 {
363 const TVector<T, d> ScaledDirection = Direction * Scale; // Compensate for Negative scales, only the signs really matter here
364
367 for (int Axis = 0; Axis < d; ++Axis)
368 {
369 if(ScaledDirection[Axis] < 0)
370 {
371 ChosenPt[Axis] = Scale[Axis] * MMin[Axis] + InMargin;
372 ChosenAxis[Axis] = 0;
373 }
374 else
375 {
376 ChosenPt[Axis] = Scale[Axis] * MMax[Axis] - InMargin;
377 ChosenAxis[Axis] = 1;
378 }
379 }
380
382
383 constexpr T RootThreeMinusOne = T(1.7320508075688772935274463415059 - 1.0);
384 if (OutSupportDelta != nullptr)
385 {
387 }
388
389 return ChosenPt;
390 }
391
392
394 {
395 MMin = TVector<T, d>(FGenericPlatformMath::Min(MMin[0], V[0]), FGenericPlatformMath::Min(MMin[1], V[1]), FGenericPlatformMath::Min(MMin[2], V[2]));
396 MMax = TVector<T, d>(FGenericPlatformMath::Max(MMax[0], V[0]), FGenericPlatformMath::Max(MMax[1], V[1]), FGenericPlatformMath::Max(MMax[2], V[2]));
397 }
398
400 {
401 MMin = TVector<T, d>(FGenericPlatformMath::Min(MMin[0], Other.MMin[0]), FGenericPlatformMath::Min(MMin[1], Other.MMin[1]), FGenericPlatformMath::Min(MMin[2], Other.MMin[2]));
402 MMax = TVector<T, d>(FGenericPlatformMath::Max(MMax[0], Other.MMax[0]), FGenericPlatformMath::Max(MMax[1], Other.MMax[1]), FGenericPlatformMath::Max(MMax[2], Other.MMax[2]));
403 }
404
406 {
407 MMin = TVector<T, d>(FGenericPlatformMath::Max(MMin[0], Other.MMin[0]), FGenericPlatformMath::Max(MMin[1], Other.MMin[1]), FGenericPlatformMath::Max(MMin[2], Other.MMin[2]));
408 MMax = TVector<T, d>(FGenericPlatformMath::Min(MMax[0], Other.MMax[0]), FGenericPlatformMath::Min(MMax[1], Other.MMax[1]), FGenericPlatformMath::Min(MMax[2], Other.MMax[2]));
409 }
410
411 FORCEINLINE TAABB<T, d>& Thicken(const T Thickness)
412 {
413 MMin -= TVector<T, d>(Thickness);
414 MMax += TVector<T, d>(Thickness);
415 return *this;
416 }
417
418 //Grows the box by this vector symmetrically - Changed name because previous Thicken had different semantics which caused several bugs
420 {
422 MMin -= AbsThickness;
423 MMax += AbsThickness;
424 return *this;
425 }
426
428 {
430 MMin += AbsThickness;
431 MMax -= AbsThickness;
432 return *this;
433 }
434
437 {
438 MMin += V.ComponentwiseMin(TVector<T, d>(0));
439 MMax += V.ComponentwiseMax(TVector<T, d>(0));
440 return *this;
441 }
442
443 // Move the bounding box along a vector
445 {
446 MMin += InVector;
447 MMax += InVector;
448 }
449
450 FORCEINLINE TVector<T, d> Center() const { return (MMax - MMin) * T(0.5) + MMin; }
453 FORCEINLINE TVector<T, d> Extents() const { return MMax - MMin; }
454
476 {
477 check(0 <= Index && Index < 8);
478
479 // See GetIndex() for reverse logic
480 return TVector<T, d>(
481 (Index & (1 << 0)) == 0 ? MMin.X : MMax.X,
482 (Index & (1 << 1)) == 0 ? MMin.Y : MMax.Y,
483 (Index & (1 << 2)) == 0 ? MMin.Z : MMax.Z);
484 }
485
493 {
494 // See GetVertex() for reverse logic
495 return AxisSelector[0] + AxisSelector[1] * 2 + AxisSelector[2] * 4;
496 }
497
519 {
520 // See "GetVertex(int32)"
521 check(0 <= Index && Index < 12);
522 static constexpr FAABBEdge Edges[]
523 {
524 { 0, 1 }, { 0, 2 }, { 0, 4 },
525 { 1, 3 }, { 1, 5 }, { 2, 3 },
526 { 2, 6 }, { 3, 7 }, { 4, 5 },
527 { 4, 6 }, { 5, 7 }, { 6, 7 }
528 };
529 return Edges[Index];
530 }
531
533 {
534 // See "GetVertex(int32)"
535 check(0 <= Index && Index < 6);
536 static constexpr FAABBFace Faces[]
537 {
538 {{ 0, 1, 5, 4 }, {0, 4, 8, 2}},
539 {{ 1, 3, 7, 5 }, {3, 7, 10, 4}},
540 {{ 4, 5, 7, 6 }, {8, 10, 11, 9}},
541 {{ 0, 2, 3, 1 }, {1, 5, 3, 0}},
542 {{ 0, 4, 6, 2 }, {2, 9, 6, 1}},
543 {{ 2, 6, 7, 3 }, {6, 11, 7, 5}}
544 };
545 return Faces[Index];
546 }
547
549 {
550 const auto Extents = this->Extents();
551 if (Extents[0] > Extents[1] && Extents[0] > Extents[2])
552 {
553 return 0;
554 }
555 else if (Extents[1] > Extents[2])
556 {
557 return 1;
558 }
559 else
560 {
561 return 2;
562 }
563 }
564
566 {
567 *this = FromPoints(MMin * InScale, MMax * InScale);
568 return *this;
569 }
570
576 {
577 MMin *= InScale;
578 MMax *= InScale;
579 return *this;
580 }
581
587 {
588 const TVector<T, d> BoxCenter = Center();
590 MMin = BoxCenter - ScaledHalfExtents;
591 MMax = BoxCenter + ScaledHalfExtents;
592 return *this;
593 }
594
595 FORCEINLINE const TVector<T, d>& Min() const { return MMin; }
596 FORCEINLINE const TVector<T, d>& Max() const { return MMax; }
597
598 // The radius of the sphere centered on the AABB origin (not the AABB center) which would encompass this AABB
600 {
601 const TVector<T, d> MaxAbs = TVector<T, d>::Max(MMin.GetAbs(), MMax.GetAbs());
602 return MaxAbs.Size();
603 }
604
606 {
607 return (T(0.5) * Extents()).Size();
608 }
609
610 FORCEINLINE T GetArea() const { return GetArea(Extents()); }
611 FORCEINLINE static T GetArea(const TVector<T, d>& Dim) { return d == 2 ? Dim.Product() : (T)2. * (Dim[0] * Dim[1] + Dim[0] * Dim[2] + Dim[1] * Dim[2]); }
612
613 FORCEINLINE T GetVolume() const { return GetVolume(Extents()); }
614 FORCEINLINE static T GetVolume(const TVector<T, 3>& Dim) { return Dim.Product(); }
615
616 FORCEINLINE T GetMargin() const { return 0; }
617 FORCEINLINE T GetRadius() const { return 0; }
618 FORCEINLINE FRealSingle GetMarginf() const { return 0.0f; }
619 FORCEINLINE FRealSingle GetRadiusf() const { return 0.0f; }
620
621 // A bounding box that will fail all overlap tests.
622 // NOTE: this bounds cannot be transformed (all transform return EmptyAABB)
624
625 // A bounding box that overlaps all space.
626 // NOTE: this bounds cannot be transformed (all transforms return FullAABB)
628
629 // A single-point bounds at the origin
631
632
633 // If this AABB covering all of space (all overlap tests will succeed)
634 // NOTE: This just checks if Max.X is Real::Max. The assumption is that max numeric values
635 // are only used when explicitly set in EmptyAABB() and FullAABB().
636 FORCEINLINE bool IsFull() const
637 {
638 return (MMax.X == TNumericLimits<T>::Max());
639 }
640
641 // If this AABB empty (all overlap tests will fail)
642 // NOTE: This just checks if Min.X is Real::Max. The assumption is that max numeric values
643 // are only used when explicitly set in EmptyAABB() and FullAABB().
644 FORCEINLINE bool IsEmpty() const
645 {
646 return (MMin.X == TNumericLimits<T>::Max());
647 }
648
649 // Shrink this AABB to being empty
651 {
652 MMin.X = TNumericLimits<T>::Max();
653 MMin.Y = TNumericLimits<T>::Max();
654 MMin.Z = TNumericLimits<T>::Max();
655 MMax.X = -TNumericLimits<T>::Max();
656 MMax.Y = -TNumericLimits<T>::Max();
657 MMax.Z = -TNumericLimits<T>::Max();
658 }
659
661 {
662 Ar << MMin << MMax;
663 }
664
669
670 FString ToString() const
671 {
672 return FString::Printf(TEXT("AABB: Min: [%s], Max: [%s]"), *MMin.ToString(), *MMax.ToString());
673 }
674
677 {
678 // https://www.wolframalpha.com/input/?i=cuboid
679 const FReal M = Mass / 12;
680 const FReal WW = Dim[0] * Dim[0];
681 const FReal HH = Dim[1] * Dim[1];
682 const FReal DD = Dim[2] * Dim[2];
683 return PMatrix<FReal, 3, 3>(M * (HH + DD), M * (WW + DD), M * (WW + HH));
684 }
685
690
691 FORCEINLINE constexpr bool IsConvex() const { return true; }
692
698 template<typename... Points>
699 static TAABB<T, d> FromPoints(const TVector<T, d>& P0, const Points&... InPoints)
700 {
701 static_assert(sizeof...(InPoints) > 0);
702 static_assert(std::is_same_v<std::common_type_t<Points...>, TVector<T, d>>);
703
704 TAABB<T, d> Result(P0, P0);
705 (Result.GrowToInclude(InPoints), ...);
706 return Result;
707 }
708
709 private:
710 TVector<T, d> MMin, MMax;
711 };
712
713 template<class T, int d>
715 {
716 AABB.Serialize(Ar);
717 return Ar;
718 }
719
720 template<typename T>
722 {
724 {
725 const TVector<T, 2>& Min = AABB.Min();
726 const TVector<T, 2>& Max = AABB.Max();
727 const TVector<T, 2> Mid = AABB.Center();
728
731 //top line (min y)
733 SamplePoints[1] = TVector<T, 2>{Mid.X, Min.Y};
735
736 //mid line (y=0) (mid point removed because internal)
737 SamplePoints[3] = TVector<T, 2>{Min.X, Mid.Y};
738 SamplePoints[4] = TVector<T, 2>{Max.X, Mid.Y};
739
740 //bottom line (max y)
742 SamplePoints[6] = TVector<T, 2>{Mid.X, Max.Y};
744
745 return SamplePoints;
746 }
747 };
748
749 template<typename T>
751 {
753 {
754 const TVector<T, 3>& Min = AABB.Min();
755 const TVector<T, 3>& Max = AABB.Max();
756 const TVector<T, 3> Mid = AABB.Center();
757
758 //todo(ocohen): should order these for best levelset cache traversal
761 {
762 //xy plane for Min Z
763 SamplePoints[0] = TVector<T, 3>{Min.X, Min.Y, Min.Z};
764 SamplePoints[1] = TVector<T, 3>{Mid.X, Min.Y, Min.Z};
765 SamplePoints[2] = TVector<T, 3>{Max.X, Min.Y, Min.Z};
766
767 SamplePoints[3] = TVector<T, 3>{Min.X, Mid.Y, Min.Z};
768 SamplePoints[4] = TVector<T, 3>{Mid.X, Mid.Y, Min.Z};
769 SamplePoints[5] = TVector<T, 3>{Max.X, Mid.Y, Min.Z};
770
771 SamplePoints[6] = TVector<T, 3>{Min.X, Max.Y, Min.Z};
772 SamplePoints[7] = TVector<T, 3>{Mid.X, Max.Y, Min.Z};
773 SamplePoints[8] = TVector<T, 3>{Max.X, Max.Y, Min.Z};
774 }
775
776 {
777 //xy plane for z = 0 (skip mid point since inside)
778 SamplePoints[9] = TVector<T, 3>{Min.X, Min.Y, Mid.Z};
779 SamplePoints[10] = TVector<T, 3>{Mid.X, Min.Y, Mid.Z};
780 SamplePoints[11] = TVector<T, 3>{Max.X, Min.Y, Mid.Z};
781
782 SamplePoints[12] = TVector<T, 3>{Min.X, Mid.Y, Mid.Z};
783 SamplePoints[13] = TVector<T, 3>{Max.X, Mid.Y, Mid.Z};
784
785 SamplePoints[14] = TVector<T, 3>{Min.X, Max.Y, Mid.Z};
786 SamplePoints[15] = TVector<T, 3>{Mid.X, Max.Y, Mid.Z};
787 SamplePoints[16] = TVector<T, 3>{Max.X, Max.Y, Mid.Z};
788 }
789
790 {
791 //xy plane for Max Z
792 SamplePoints[17] = TVector<T, 3>{Min.X, Min.Y, Max.Z};
793 SamplePoints[18] = TVector<T, 3>{Mid.X, Min.Y, Max.Z};
794 SamplePoints[19] = TVector<T, 3>{Max.X, Min.Y, Max.Z};
795
796 SamplePoints[20] = TVector<T, 3>{Min.X, Mid.Y, Max.Z};
797 SamplePoints[21] = TVector<T, 3>{Mid.X, Mid.Y, Max.Z};
798 SamplePoints[22] = TVector<T, 3>{Max.X, Mid.Y, Max.Z};
799
800 SamplePoints[23] = TVector<T, 3>{Min.X, Max.Y, Max.Z};
801 SamplePoints[24] = TVector<T, 3>{Mid.X, Max.Y, Max.Z};
802 SamplePoints[25] = TVector<T, 3>{Max.X, Max.Y, Max.Z};
803 }
804
805 return SamplePoints;
806 }
807 };
808
809 using FAABB3 = TAABB<FReal, 3>;
810}
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define FORCEINLINE_DEBUGGABLE
Definition CoreMiscDefines.h:74
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
#define TEXT(x)
Definition Platform.h:1272
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
#define FVector
Definition IOSSystemIncludes.h:8
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
FORCEINLINE VectorRegister4Float MakeVectorRegister(uint32 X, uint32 Y, uint32 Z, uint32 W)
Definition UnrealMathFPU.h:195
FORCEINLINE void VectorStoreFloat3(const VectorRegister4Float &Vec, float *Dst)
Definition UnrealMathFPU.h:594
FORCEINLINE VectorRegister4Float MakeVectorRegisterFloatFromDouble(const VectorRegister4Double &Vec4d)
Definition UnrealMathFPU.h:262
#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
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Matrix.h:21
Definition AABB.h:37
FORCEINLINE TArray< TVector< T, d > > ComputeLocalSamplePoints() const
Definition AABB.h:90
FORCEINLINE bool Contains(const TAABB< T, d > &Other) const
Definition AABB.h:151
static TAABB< T, d > FromPoints(const TVector< T, d > &P0, const Points &... InPoints)
Definition AABB.h:699
FORCEINLINE FRealSingle GetMarginf() const
Definition AABB.h:618
FORCEINLINE bool RaycastFast(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &Dir, const TVector< FReal, d > &InvDir, const bool *bParallel, const FReal Length, const FReal InvLength, FReal &OutEntryTime, FReal &OutExitTime) const
Definition AABB.h:222
FORCEINLINE TAABB()
Definition AABB.h:42
FORCEINLINE FAABBFace GetFace(const int32 Index) const
Definition AABB.h:532
FORCEINLINE TAABB< T, d > & GrowByVector(const TVector< T, d > &V)
Definition AABB.h:436
FORCEINLINE_DEBUGGABLE TVector< T, d > Support(const TVector< T, d > &Direction, const T Thickness, int32 &OutVertexIndex) const
Definition AABB.h:283
FORCEINLINE FReal SignedDistance(const TVector< FReal, d > &x) const
Definition AABB.h:160
FORCEINLINE TVector< T, d > GetVertex(const int32 Index) const
Definition AABB.h:475
FORCEINLINE T GetArea() const
Definition AABB.h:610
static FORCEINLINE PMatrix< FReal, 3, 3 > GetInertiaTensor(const FReal Mass, const TVector< FReal, 3 > &Dim)
Definition AABB.h:676
FORCEINLINE bool Contains(const TVector< T, d > &Point, const T Tolerance) const
Definition AABB.h:139
FORCEINLINE TArray< TVector< T, d > > ComputeSamplePoints() const
Definition AABB.h:99
FORCEINLINE const TVector< T, d > & Max() const
Definition AABB.h:596
FORCEINLINE PMatrix< FReal, d, d > GetInertiaTensor(const FReal Mass) const
Definition AABB.h:675
FORCEINLINE constexpr bool IsConvex() const
Definition AABB.h:691
FORCEINLINE T GetMargin() const
Definition AABB.h:616
FORCEINLINE T GetVolume() const
Definition AABB.h:613
FORCEINLINE bool Intersects(const TAABB< TReal, d > &Other) const
Definition AABB.h:112
FORCEINLINE FAABBEdge GetEdge(const int32 Index) const
Definition AABB.h:518
FORCEINLINE TAABB< T, d > & Scale(const TVector< T, d > &InScale)
Definition AABB.h:575
CHAOSCORE_API TVector< T, d > FindClosestPoint(const TVector< T, d > &StartPoint, const T Thickness=(T) 0) const
Definition AABB.cpp:39
FORCEINLINE TVector< T, d > FindGeometryOpposingNormal(const TVector< T, d > &DenormDir, int32 FaceIndex, const TVector< T, d > &OriginalNormal) const
Definition AABB.h:249
FORCEINLINE TAABB(TAABB< T, d > &&Other)
Definition AABB.h:67
FORCEINLINE TAABB< T, d > & ThickenSymmetrically(const TVector< T, d > &Thickness)
Definition AABB.h:419
FORCEINLINE bool RaycastFast(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &Dir, const TVector< FReal, d > &InvDir, const bool *bParallel, const FReal Length, FReal &OutEntryTime, FReal &OutExitTime) const
Definition AABB.h:217
FString ToString() const
Definition AABB.h:670
FORCEINLINE bool IsFull() const
Definition AABB.h:636
FORCEINLINE T GetRadius() const
Definition AABB.h:617
FORCEINLINE FReal PhiWithNormal(const TVector< FReal, d > &X, TVector< FReal, d > &Normal) const
Definition AABB.h:166
static constexpr int D
Definition AABB.h:40
FORCEINLINE void Serialize(FArchive &Ar)
Definition AABB.h:660
FORCEINLINE void ShrinkToInclude(const TAABB< T, d > &Other)
Definition AABB.h:405
FORCEINLINE bool IsEmpty() const
Definition AABB.h:644
static FORCEINLINE T GetArea(const TVector< T, d > &Dim)
Definition AABB.h:611
static FORCEINLINE TRotation< FReal, d > GetRotationOfMass()
Definition AABB.h:686
FORCEINLINE const TAABB< T, d > & BoundingBox() const
Definition AABB.h:156
FORCEINLINE TVector< T, d > Center() const
Definition AABB.h:450
FORCEINLINE T CenterRadius() const
Definition AABB.h:605
FORCEINLINE TVector< T, d > GetCenterOfMass() const
Definition AABB.h:452
FORCEINLINE TAABB< T, d > & LocalScale(const TVector< T, d > &InScale)
Definition AABB.h:586
FORCEINLINE TAABB< T, d > & ShrinkSymmetrically(const TVector< T, d > &Thickness)
Definition AABB.h:427
FORCEINLINE TAABB< T, d > & ScaleWithNegative(const TVector< T, d > &InScale)
Definition AABB.h:565
FORCEINLINE TAABB< T, d > & Thicken(const T Thickness)
Definition AABB.h:411
FORCEINLINE bool RaycastFast(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &Dir, const TVector< FReal, d > &InvDir, const bool *bParallel, const FReal Length, FReal &OutTime, TVector< FReal, d > &OutPosition) const
Definition AABB.h:227
FORCEINLINE void GrowToInclude(const TVector< T, d > &V)
Definition AABB.h:393
FORCEINLINE_DEBUGGABLE TVector< T, d > SupportCoreScaled(const TVector< T, d > &Direction, const T InMargin, const TVector< T, d > &Scale, T *OutSupportDelta, int32 &OutVertexIndex) const
Definition AABB.h:361
FORCEINLINE FRealSingle GetRadiusf() const
Definition AABB.h:619
FORCEINLINE_DEBUGGABLE VectorRegister4Float SupportCoreSimd(const VectorRegister4Float &Direction, const FReal InMargin) const
Definition AABB.h:352
CHAOSCORE_API TAABB< T, d > InverseTransformedAABB(const Chaos::FRigidTransform3 &) const
Definition AABB.cpp:412
static FORCEINLINE T GetVolume(const TVector< T, 3 > &Dim)
Definition AABB.h:614
TAABB(const TAABB< OtherType, d > &Other)
Definition AABB.h:61
CHAOSCORE_API Pair< TVector< FReal, d >, bool > FindClosestIntersectionImp(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &EndPoint, const FReal Thickness) const
Definition AABB.cpp:89
FORCEINLINE_DEBUGGABLE FVec3 SupportCore(const FVec3 &Direction, const FReal InMargin, FReal *OutSupportDelta, int32 &OutVertexIndex) const
Definition AABB.h:322
FORCEINLINE TVector< T, d > Extents() const
Definition AABB.h:453
static FORCEINLINE TAABB< T, d > ZeroAABB()
Definition AABB.h:630
FORCEINLINE void GrowToInclude(const TAABB< T, d > &Other)
Definition AABB.h:399
FORCEINLINE int LargestAxis() const
Definition AABB.h:548
FORCEINLINE uint16 GetMaterialIndex(uint32 HintIndex) const
Definition AABB.h:158
CHAOSCORE_API TAABB< T, d > TransformedAABB(const FTransform &) const
Definition AABB.cpp:385
static FORCEINLINE TAABB< T, d > FullAABB()
Definition AABB.h:627
FORCEINLINE TAABB(const TVector< T, d > &Min, const TVector< T, d > &Max)
Definition AABB.h:48
T TType
Definition AABB.h:39
FORCEINLINE T OriginRadius() const
Definition AABB.h:599
FORCEINLINE bool RaycastFast(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &Dir, const TVector< FReal, d > &InvDir, const bool *bParallel, const FReal Length, const FReal InvLength, FReal &OutTime, TVector< FReal, d > &OutPosition) const
Definition AABB.h:240
FORCEINLINE TAABB< T, d > & operator=(TAABB< T, d > &&Other)
Definition AABB.h:80
FORCEINLINE void MoveByVector(TVector< T, d > InVector)
Definition AABB.h:444
FORCEINLINE uint32 GetTypeHash() const
Definition AABB.h:665
FORCEINLINE bool Contains(const TVector< T, d > &Point) const
Definition AABB.h:127
FORCEINLINE void Clear()
Definition AABB.h:650
FORCEINLINE TAABB< T, d > & operator=(const TAABB< T, d > &Other)
Definition AABB.h:73
FORCEINLINE TAABB< T, d > GetIntersection(const TAABB< T, d > &Other) const
Definition AABB.h:122
static FORCEINLINE TAABB< T, d > EmptyAABB()
Definition AABB.h:623
FORCEINLINE const TVector< T, d > & Min() const
Definition AABB.h:595
FORCEINLINE TVector< T, d > GetCenter() const
Definition AABB.h:451
FORCEINLINE TAABB(const TAABB< T, d > &Other)
Definition AABB.h:54
FORCEINLINE int32 GetIndex(const FIntVector &AxisSelector) const
Definition AABB.h:492
Definition Transform.h:115
Definition Rotation.h:41
Definition Vector.h:41
Definition Archive.h:1208
Definition Array.h:670
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
bool RayAabb(const TVector< FReal, d > &RayStart, const TVector< FReal, d > &RayDir, const FReal RayLength, const FReal RayThickness, const TVector< T, d > &AabbMin, const TVector< T, d > &AabbMax, FReal &OutTime, TVector< FReal, d > &OutPosition, TVector< FReal, d > &OutNormal, int32 &OutFaceIndex)
Definition Raycasts.cpp:12
Definition SkeletalMeshComponent.h:307
@ X
Definition SimulationModuleBase.h:152
FChaosArchive & operator<<(FChaosArchive &Ar, FRigidParticleControlFlags &Flags)
Definition RigidParticleControlFlags.cpp:15
FRealDouble FReal
Definition Real.h:22
float FRealSingle
Definition Real.h:14
@ Raycast
Definition SimulationModuleBase.h:145
TAABB< FReal, 3 > FAABB3
Definition ImplicitObject.h:34
uint32 GetTypeHash(const TBox< T > &Box)
Definition Box.h:1008
U16 Index
Definition radfft.cpp:71
Definition AABB.h:24
int8 VertexIndex0
Definition AABB.h:25
int8 VertexIndex1
Definition AABB.h:26
Definition AABB.h:30
int8 EdgeIndex[4]
Definition AABB.h:32
int8 VertexIndex[4]
Definition AABB.h:31
Definition Pair.h:8
T1 First
Definition Pair.h:14
T2 Second
Definition Pair.h:15
static FORCEINLINE TArray< TVector< T, 2 > > ComputeSamplePoints(const TAABB< T, 2 > &AABB)
Definition AABB.h:723
static FORCEINLINE TArray< TVector< T, 3 > > ComputeSamplePoints(const TAABB< T, 3 > &AABB)
Definition AABB.h:752
static FORCEINLINE TArray< TVector< T, d > > ComputeLocalSamplePoints(const class TAABB< T, d > &AABB)
Definition AABB.h:16
static constexpr UE_FORCEINLINE_HINT T Abs(const T A)
Definition GenericPlatformMath.h:949
static constexpr UE_FORCEINLINE_HINT T Min(T A, T B)
Definition GenericPlatformMath.h:985
static constexpr UE_FORCEINLINE_HINT T Max(T A, T B)
Definition GenericPlatformMath.h:963
Definition NumericLimits.h:41
Definition UnrealMathFPU.h:20