UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BoxTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Math/Box.h"
6#include "Math/Box2D.h"
7#include "VectorTypes.h"
8#include "TransformTypes.h"
9
10namespace UE
11{
12namespace Geometry
13{
14
15using namespace UE::Math;
16
17template <typename RealType>
19{
20 RealType Min;
21 RealType Max;
22
25 {
26 }
27
28 TInterval1(const RealType& Min, const RealType& Max)
29 {
30 this->Min = Min;
31 this->Max = Max;
32 }
33
38
39 static TInterval1<RealType> MakeFromUnordered(const RealType& A, const RealType& B)
40 {
41 TInterval1<RealType> Result(A, B);
42 if (A > B)
43 {
44 Swap(Result.Min, Result.Max);
45 }
46 return Result;
47 }
48
49 RealType Center() const
50 {
51 return (Min + Max) * (RealType)0.5;
52 }
53
54 RealType Extent() const
55 {
56 return (Max - Min)*(RealType).5;
57 }
58 RealType Length() const
59 {
60 return Max - Min;
61 }
62
67
68 void Contain(const RealType& V)
69 {
70 if (V < Min)
71 {
72 Min = V;
73 }
74 if (V > Max)
75 {
76 Max = V;
77 }
78 }
79
81 {
82 if (O.Min < Min)
83 {
84 Min = O.Min;
85 }
86 if (O.Max > Max)
87 {
88 Max = O.Max;
89 }
90 }
91
92 bool Contains(RealType D) const
93 {
94 return D >= Min && D <= Max;
95 }
96
97 bool Contains(const TInterval1<RealType>& O) const
98 {
99 return Contains(O.Min) && Contains(O.Max);
100 }
101
102 bool Overlaps(const TInterval1<RealType>& O) const
103 {
104 return !(O.Min > Max || O.Max < Min);
105 }
106
107 RealType SquaredDist(const TInterval1<RealType>& O) const
108 {
109 if (Max < O.Min)
110 {
111 return (O.Min - Max) * (O.Min - Max);
112 }
113 else if (Min > O.Max)
114 {
115 return (Min - O.Max) * (Min - O.Max);
116 }
117 else
118 {
119 return 0;
120 }
121 }
122 RealType Dist(const TInterval1<RealType>& O) const
123 {
124 if (Max < O.Min)
125 {
126 return O.Min - Max;
127 }
128 else if (Min > O.Max)
129 {
130 return Min - O.Max;
131 }
132 else
133 {
134 return 0;
135 }
136 }
137
146
150 RealType Clamp(RealType f) const
151 {
152 return (f < Min) ? Min : (f > Max) ? Max : f;
153 }
154
158 RealType Interpolate(RealType T) const
159 {
160 return (1 - T) * Min + (T)*Max;
161 }
162
166 RealType GetT(RealType Value) const
167 {
168 if (Value <= Min)
169 {
170 return 0;
171 }
172 else if (Value >= Max)
173 {
174 return 1;
175 }
176 else
177 {
178 return GetUnclampedT(Value);
179 }
180 }
181
185 RealType GetUnclampedT(RealType Value) const
186 {
187 if (Min == Max)
188 {
189 return 0.5;
190 }
191 else
192 {
193 return (Value - Min) / (Max - Min);
194 }
195 }
196
198 {
199 Min = O.Min;
200 Max = O.Max;
201 }
202
203 void Set(RealType A, RealType B)
204 {
205 Min = A;
206 Max = B;
207 }
208
210 {
211 return TInterval1(-V.Min, -V.Max);
212 }
213
214 TInterval1 operator+(RealType f) const
215 {
216 return TInterval1(Min + f, Max + f);
217 }
218
219 TInterval1 operator-(RealType f) const
220 {
221 return TInterval1(Min - f, Max - f);
222 }
223
224 TInterval1 operator*(RealType f) const
225 {
226 return TInterval1(Min * f, Max * f);
227 }
228
229 inline bool IsEmpty() const
230 {
231 return Max < Min;
232 }
233
234 void Expand(RealType Radius)
235 {
236 Max += Radius;
237 Min -= Radius;
238 }
239};
240
243
244
245template <typename RealType>
247{
250
253 {
254 }
255
257 {
258 this->Min = Min;
259 this->Max = Max;
260 }
261
263 {
264 // TMathUtil::MinMax could be used here, but it generates worse code because the Min3's below will be
265 // turned into SSE instructions by the optimizer, while MinMax will not
269 TMathUtil<RealType>::Min3(A.Z, B.Z, C.Z));
273 TMathUtil<RealType>::Max3(A.Z, B.Z, C.Z));
274 }
275
276 template<typename OtherRealType>
278 {
279 this->Min = TVector<RealType>(OtherBox.Min);
280 this->Max = TVector<RealType>(OtherBox.Max);
281 }
282
288
289
291 {
292 if (TransformF == nullptr)
293 {
294 Min = Box.Min;
295 Max = Box.Max;
296 return;
297 }
298
299 TVector<RealType> C0 = TransformF(Box.GetCorner(0));
300 Min = C0;
301 Max = C0;
302 for (int i = 1; i < 8; ++i)
303 {
304 Contain(TransformF(Box.GetCorner(i)));
305 }
306 }
307
309 {
310 if (Box.IsEmpty())
311 {
312 Min = Box.Min;
313 Max = Box.Max;
314 return;
315 }
316
317 TVector<RealType> C0 = Transform.TransformPosition(Box.GetCorner(0));
318 Min = C0;
319 Max = C0;
320 for (int i = 1; i < 8; ++i)
321 {
322 Contain(Transform.TransformPosition(Box.GetCorner(i)));
323 }
324 }
325
331
337
339 {
340 return Max == Other.Max && Min == Other.Min;
341 }
343 {
344 return Max != Other.Max || Min != Other.Min;
345 }
346
347
348 template<typename OutRealType>
349 explicit operator TBox<OutRealType>() const
350 {
352 ToRet.IsValid = !IsEmpty();
353 return ToRet;
354 }
355 template<typename InRealType>
357 {
358 if (Box.IsValid)
359 {
362 }
363 else
364 {
365 *this = Empty();
366 }
367 }
368
374 {
375 check(Index >= 0 && Index <= 7);
376 RealType X = (((Index & 1) != 0) ^ ((Index & 2) != 0)) ? (Max.X) : (Min.X);
377 RealType Y = ((Index / 2) % 2 == 0) ? (Min.Y) : (Max.Y);
378 RealType Z = (Index < 4) ? (Min.Z) : (Max.Z);
379 return TVector<RealType>(X, Y, Z);
380 }
381
388
395
399 template<typename PointFunc>
401 {
403 for (int32 Index = 0; Index < MaxIndex; ++Index)
404 {
405 Result.Contain(GetPoint(Index));
406 }
407 return Result;
408 }
409
413 template<typename EnumerableIntType, typename PointFunc>
415 {
417 for (int32 Index : IndexEnumerable)
418 {
419 Result.Contain(GetPoint(Index));
420 }
421 return Result;
422 }
423
424
426 {
427 return TVector<RealType>(
428 (Min.X + Max.X) * (RealType)0.5,
429 (Min.Y + Max.Y) * (RealType)0.5,
430 (Min.Z + Max.Z) * (RealType)0.5);
431 }
432
434 {
435 return (Max - Min) * (RealType).5;
436 }
437
439 {
440 if (V.X < Min.X)
441 {
442 Min.X = V.X;
443 }
444 if (V.X > Max.X)
445 {
446 Max.X = V.X;
447 }
448 if (V.Y < Min.Y)
449 {
450 Min.Y = V.Y;
451 }
452 if (V.Y > Max.Y)
453 {
454 Max.Y = V.Y;
455 }
456 if (V.Z < Min.Z)
457 {
458 Min.Z = V.Z;
459 }
460 if (V.Z > Max.Z)
461 {
462 Max.Z = V.Z;
463 }
464 }
465
467 {
468 Min.X = Min.X < Other.Min.X ? Min.X : Other.Min.X;
469 Min.Y = Min.Y < Other.Min.Y ? Min.Y : Other.Min.Y;
470 Min.Z = Min.Z < Other.Min.Z ? Min.Z : Other.Min.Z;
471 Max.X = Max.X > Other.Max.X ? Max.X : Other.Max.X;
472 Max.Y = Max.Y > Other.Max.Y ? Max.Y : Other.Max.Y;
473 Max.Z = Max.Z > Other.Max.Z ? Max.Z : Other.Max.Z;
474 }
475
477 {
478 for (const TVector<RealType>& Pt : Pts)
479 {
480 Contain(Pt);
481 }
482 }
483
485 {
486 for (const TVector<RealType>& Pt : Pts)
487 {
488 Contain(Pt);
489 }
490 }
491
492 bool Contains(const TVector<RealType>& V) const
493 {
494 return (Min.X <= V.X) && (Min.Y <= V.Y) && (Min.Z <= V.Z) && (Max.X >= V.X) && (Max.Y >= V.Y) && (Max.Z >= V.Z);
495 }
496
498 {
499 return Contains(Box.Min) && Contains(Box.Max);
500 }
501
503 {
504 return TVector<RealType>(
505 FMath::Clamp(V.X, Min.X, Max.X),
506 FMath::Clamp(V.Y, Min.Y, Max.Y),
507 FMath::Clamp(V.Z, Min.Z, Max.Z)
508 );
509 }
510
512 {
513 TAxisAlignedBox3<RealType> Intersection(
516 if (Intersection.Height() <= 0 || Intersection.Width() <= 0 || Intersection.Depth() <= 0)
517 {
519 }
520 else
521 {
522 return Intersection;
523 }
524 }
525
527 {
528 return !((Box.Max.X <= Min.X) || (Box.Min.X >= Max.X) || (Box.Max.Y <= Min.Y) || (Box.Min.Y >= Max.Y) || (Box.Max.Z <= Min.Z) || (Box.Min.Z >= Max.Z));
529 }
530
531 RealType DistanceSquared(const TVector<RealType>& V) const
532 {
533 RealType dx = (V.X < Min.X) ? Min.X - V.X : (V.X > Max.X ? V.X - Max.X : 0);
534 RealType dy = (V.Y < Min.Y) ? Min.Y - V.Y : (V.Y > Max.Y ? V.Y - Max.Y : 0);
535 RealType dz = (V.Z < Min.Z) ? Min.Z - V.Z : (V.Z > Max.Z ? V.Z - Max.Z : 0);
536 return dx * dx + dy * dy + dz * dz;
537 }
538
540 {
541 // compute lensqr( max(0, abs(center1-center2) - (extent1+extent2)) )
542 RealType delta_x = TMathUtil<RealType>::Abs((Box.Min.X + Box.Max.X) - (Min.X + Max.X))
543 - ((Max.X - Min.X) + (Box.Max.X - Box.Min.X));
544 if (delta_x < 0)
545 {
546 delta_x = 0;
547 }
548 RealType delta_y = TMathUtil<RealType>::Abs((Box.Min.Y + Box.Max.Y) - (Min.Y + Max.Y))
549 - ((Max.Y - Min.Y) + (Box.Max.Y - Box.Min.Y));
550 if (delta_y < 0)
551 {
552 delta_y = 0;
553 }
554 RealType delta_z = TMathUtil<RealType>::Abs((Box.Min.Z + Box.Max.Z) - (Min.Z + Max.Z))
555 - ((Max.Z - Min.Z) + (Box.Max.Z - Box.Min.Z));
556 if (delta_z < 0)
557 {
558 delta_z = 0;
559 }
560 return (RealType)0.25 * (delta_x * delta_x + delta_y * delta_y + delta_z * delta_z);
561 }
562
563 RealType Dimension(int32 Index) const
564 {
565 return TMathUtil<RealType>::Max(Max[Index] - Min[Index], (RealType)0);
566 }
567
568 RealType Width() const
569 {
570 return TMathUtil<RealType>::Max(Max.X - Min.X, (RealType)0);
571 }
572
573 RealType Height() const
574 {
575 return TMathUtil<RealType>::Max(Max.Y - Min.Y, (RealType)0);
576 }
577
578 RealType Depth() const
579 {
580 return TMathUtil<RealType>::Max(Max.Z - Min.Z, (RealType)0);
581 }
582
583 RealType Volume() const
584 {
585 return Width() * Height() * Depth();
586 }
587
588 RealType SurfaceArea() const
589 {
590 return (RealType)2. * ( Width() * ( Height() + Depth() ) + Height() * Depth() );
591 }
592
593 RealType DiagonalLength() const
594 {
595 return TMathUtil<RealType>::Sqrt((Max.X - Min.X) * (Max.X - Min.X) + (Max.Y - Min.Y) * (Max.Y - Min.Y) + (Max.Z - Min.Z) * (Max.Z - Min.Z));
596 }
597
598 RealType MaxDim() const
599 {
601 }
602
603 RealType MinDim() const
604 {
606 }
607
609 {
610 return TVector<RealType>(Max.X - Min.X, Max.Y - Min.Y, Max.Z - Min.Z);
611 }
612
613 inline bool IsEmpty() const
614 {
615 return Max.X < Min.X || Max.Y < Min.Y || Max.Z < Min.Z;
616 }
617
618 void Expand(RealType Radius)
619 {
620 Max.X += Radius;
621 Max.Y += Radius;
622 Max.Z += Radius;
623 Min.X -= Radius;
624 Min.Y -= Radius;
625 Min.Z -= Radius;
626 }
627
629 {
630 Max += ExpandByVec;
631 Min -= ExpandByVec;
632 }
633};
634
635template <typename RealType>
637{
640
645
650
651 template<typename OtherRealType>
653 {
654 this->Min = TVector2<RealType>(OtherBox.Min);
655 this->Max = TVector2<RealType>(OtherBox.Max);
656 }
657
659 : Min((RealType)0, (RealType)0), Max(SquareSize, SquareSize)
660 {
661 }
662 TAxisAlignedBox2(RealType Width, RealType Height)
663 : Min((RealType)0, (RealType)0), Max(Width, Height)
664 {
665 }
666
672
678
684
685 template<typename OutRealType>
686 explicit operator TBox2<OutRealType>() const
687 {
689 ToRet.bIsValid = !IsEmpty();
690 return ToRet;
691 }
692 template<typename InRealType>
694 {
695 if (Box.bIsValid)
696 {
699 }
700 else
701 {
702 *this = Empty();
703 }
704 }
705
712
714 {
715 return TVector2<RealType>(
716 (Min.X + Max.X) * (RealType)0.5,
717 (Min.Y + Max.Y) * (RealType)0.5);
718 }
719
721 {
722 return (Max - Min) * (RealType).5;
723 }
724
731 {
732 check(Index >= 0 && Index <= 3);
733 RealType X = ((Index % 3) == 0) ? (Min.X) : (Max.X);
734 RealType Y = ((Index & 2) == 0) ? (Min.Y) : (Max.Y);
735 return TVector2<RealType>(X, Y);
736 }
737
738 inline void Contain(const TVector2<RealType>& V)
739 {
740 if (V.X < Min.X)
741 {
742 Min.X = V.X;
743 }
744 if (V.X > Max.X)
745 {
746 Max.X = V.X;
747 }
748 if (V.Y < Min.Y)
749 {
750 Min.Y = V.Y;
751 }
752 if (V.Y > Max.Y)
753 {
754 Max.Y = V.Y;
755 }
756 }
757
759 {
760 Min.X = Min.X < Other.Min.X ? Min.X : Other.Min.X;
761 Min.Y = Min.Y < Other.Min.Y ? Min.Y : Other.Min.Y;
762 Max.X = Max.X > Other.Max.X ? Max.X : Other.Max.X;
763 Max.Y = Max.Y > Other.Max.Y ? Max.Y : Other.Max.Y;
764 }
765
767 {
768 for (const TVector2<RealType>& Pt : Pts)
769 {
770 Contain(Pt);
771 }
772 }
773
775 {
776 for (const TVector2<RealType>& Pt : Pts)
777 {
778 Contain(Pt);
779 }
780 }
781
782 bool Contains(const TVector2<RealType>& V) const
783 {
784 return (Min.X <= V.X) && (Min.Y <= V.Y) && (Max.X >= V.X) && (Max.Y >= V.Y);
785 }
786
788 {
789 return Contains(Box.Min) && Contains(Box.Max);
790 }
791
793 {
794 return TVector2<RealType>(
795 FMath::Clamp(V.X, Min.X, Max.X),
796 FMath::Clamp(V.Y, Min.Y, Max.Y)
797 );
798 }
799
801 {
802 return !((Box.Max.X < Min.X) || (Box.Min.X > Max.X) || (Box.Max.Y < Min.Y) || (Box.Min.Y > Max.Y));
803 }
804
806 {
807 TAxisAlignedBox2<RealType> Intersection(
810 if (Intersection.Height() <= 0 || Intersection.Width() <= 0)
811 {
813 }
814 else
815 {
816 return Intersection;
817 }
818 }
819
820 RealType DistanceSquared(const TVector2<RealType>& V) const
821 {
822 RealType dx = (V.X < Min.X) ? Min.X - V.X : (V.X > Max.X ? V.X - Max.X : 0);
823 RealType dy = (V.Y < Min.Y) ? Min.Y - V.Y : (V.Y > Max.Y ? V.Y - Max.Y : 0);
824 return dx * dx + dy * dy;
825 }
826
827 inline RealType Width() const
828 {
829 return TMathUtil<RealType>::Max(Max.X - Min.X, (RealType)0);
830 }
831
832 inline RealType Height() const
833 {
834 return TMathUtil<RealType>::Max(Max.Y - Min.Y, (RealType)0);
835 }
836
837 inline RealType Area() const
838 {
839 return Width() * Height();
840 }
841
842 inline RealType Perimeter() const
843 {
844 return (Width() + Height()) * 2;
845 }
846
847 RealType DiagonalLength() const
848 {
849 return (RealType)TMathUtil<RealType>::Sqrt((Max.X - Min.X) * (Max.X - Min.X) + (Max.Y - Min.Y) * (Max.Y - Min.Y));
850 }
851
852 inline RealType MaxDim() const
853 {
855 }
856
857 inline RealType MinDim() const
858 {
860 }
861
862 inline bool IsEmpty() const
863 {
864 return Max.X < Min.X || Max.Y < Min.Y;
865 }
866
867 void Expand(RealType Radius)
868 {
869 Max.X += Radius;
870 Max.Y += Radius;
871 Min.X -= Radius;
872 Min.Y -= Radius;
873 }
874
876 {
877 Max += ExpandByVec;
878 Min -= ExpandByVec;
879 }
880};
881
886
887} // end namespace UE::Geometry
888} // end namespace UE
#define check(expr)
Definition AssertionMacros.h:314
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 X(Name, Desc)
Definition FormatStringSan.h:47
Definition ArrayView.h:139
Definition Array.h:670
Definition AndroidPlatformMisc.h:14
Definition MathUtil.h:150
static RealType Max(const RealType A, const RealType B)
Definition MathUtil.h:246
static RealType Sqrt(const RealType Value)
Definition MathUtil.h:342
static RealType Abs(const RealType Value)
Definition MathUtil.h:215
static RealType Min(const RealType A, const RealType B)
Definition MathUtil.h:271
TInterval1< float > FInterval1f
Definition BoxTypes.h:241
TAxisAlignedBox3< double > FAxisAlignedBox3d
Definition BoxTypes.h:885
TAxisAlignedBox2< float > FAxisAlignedBox2f
Definition BoxTypes.h:882
TAxisAlignedBox3< float > FAxisAlignedBox3f
Definition BoxTypes.h:884
TInterval1< double > FInterval1d
Definition BoxTypes.h:242
TAxisAlignedBox2< double > FAxisAlignedBox2d
Definition BoxTypes.h:883
Definition Sphere.cpp:10
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition NumericLimits.h:41
Definition BoxTypes.h:637
bool IsEmpty() const
Definition BoxTypes.h:862
RealType Area() const
Definition BoxTypes.h:837
TAxisAlignedBox2(RealType Width, RealType Height)
Definition BoxTypes.h:662
TAxisAlignedBox2(const TArray< TVector2< RealType > > &Pts)
Definition BoxTypes.h:667
TAxisAlignedBox2(RealType SquareSize)
Definition BoxTypes.h:658
RealType DistanceSquared(const TVector2< RealType > &V) const
Definition BoxTypes.h:820
RealType MaxDim() const
Definition BoxTypes.h:852
TVector2< RealType > Max
Definition BoxTypes.h:639
void Expand(RealType Radius)
Definition BoxTypes.h:867
RealType Perimeter() const
Definition BoxTypes.h:842
bool Contains(const TVector2< RealType > &V) const
Definition BoxTypes.h:782
RealType MinDim() const
Definition BoxTypes.h:857
RealType Width() const
Definition BoxTypes.h:827
void Contain(const TArray< TVector2< RealType > > &Pts)
Definition BoxTypes.h:766
TAxisAlignedBox2()
Definition BoxTypes.h:641
void Contain(const TVector2< RealType > &V)
Definition BoxTypes.h:738
TAxisAlignedBox2< RealType > Intersect(const TAxisAlignedBox2< RealType > &Box) const
Definition BoxTypes.h:805
bool Contains(const TAxisAlignedBox2< RealType > &Box) const
Definition BoxTypes.h:787
TVector2< RealType > GetCorner(int Index) const
Definition BoxTypes.h:730
void Contain(TArrayView< const TVector2< RealType > > Pts)
Definition BoxTypes.h:774
RealType DiagonalLength() const
Definition BoxTypes.h:847
TVector2< RealType > Min
Definition BoxTypes.h:638
TVector2< RealType > Center() const
Definition BoxTypes.h:713
TAxisAlignedBox2(const TAxisAlignedBox2< OtherRealType > &OtherBox)
Definition BoxTypes.h:652
void Contain(const TAxisAlignedBox2< RealType > &Other)
Definition BoxTypes.h:758
TAxisAlignedBox2(TArrayView< const TVector2< RealType > > Pts)
Definition BoxTypes.h:673
RealType Height() const
Definition BoxTypes.h:832
void Expand(const TVector2< RealType > &ExpandByVec)
Definition BoxTypes.h:875
TVector< RealType > Clamp(const TVector2< RealType > &V)
Definition BoxTypes.h:792
static TAxisAlignedBox2< RealType > Empty()
Definition BoxTypes.h:706
TAxisAlignedBox2(const TVector2< RealType > &Center, RealType HalfWidth)
Definition BoxTypes.h:679
bool Intersects(const TAxisAlignedBox2< RealType > &Box) const
Definition BoxTypes.h:800
TVector2< RealType > Extents() const
Definition BoxTypes.h:720
TAxisAlignedBox2(const TVector2< RealType > &Min, const TVector2< RealType > &Max)
Definition BoxTypes.h:646
TAxisAlignedBox2(const TBox2< InRealType > &Box)
Definition BoxTypes.h:693
Definition BoxTypes.h:247
static TAxisAlignedBox3< RealType > Empty()
Definition BoxTypes.h:382
static TAxisAlignedBox3< RealType > Infinite()
Definition BoxTypes.h:389
TAxisAlignedBox3(const TVector< RealType > &A, const TVector< RealType > &B, const TVector< RealType > &C)
Definition BoxTypes.h:262
TAxisAlignedBox3(const TVector< RealType > &Center, RealType HalfWidth)
Definition BoxTypes.h:283
bool operator!=(const TAxisAlignedBox3< RealType > &Other) const
Definition BoxTypes.h:342
RealType Depth() const
Definition BoxTypes.h:578
RealType SurfaceArea() const
Definition BoxTypes.h:588
RealType MinDim() const
Definition BoxTypes.h:603
TVector< RealType > GetCorner(int Index) const
Definition BoxTypes.h:373
RealType Width() const
Definition BoxTypes.h:568
bool Contains(const TVector< RealType > &V) const
Definition BoxTypes.h:492
TAxisAlignedBox3(const TBox< InRealType > &Box)
Definition BoxTypes.h:356
bool operator==(const TAxisAlignedBox3< RealType > &Other) const
Definition BoxTypes.h:338
RealType DistanceSquared(const TVector< RealType > &V) const
Definition BoxTypes.h:531
void Contain(TArrayView< const TVector< RealType > > Pts)
Definition BoxTypes.h:476
TAxisAlignedBox3(const TArray< TVector< RealType > > &Pts)
Definition BoxTypes.h:332
void Contain(const TVector< RealType > &V)
Definition BoxTypes.h:438
RealType Dimension(int32 Index) const
Definition BoxTypes.h:563
static TAxisAlignedBox3< RealType > MakeBoundsFromIndices(EnumerableIntType IndexEnumerable, PointFunc GetPoint)
Definition BoxTypes.h:414
static TAxisAlignedBox3< RealType > MakeBoundsFromIndices(int32 MaxIndex, PointFunc GetPoint)
Definition BoxTypes.h:400
void Expand(RealType Radius)
Definition BoxTypes.h:618
bool Contains(const TAxisAlignedBox3< RealType > &Box) const
Definition BoxTypes.h:497
void Expand(const TVector< RealType > &ExpandByVec)
Definition BoxTypes.h:628
TVector< RealType > Max
Definition BoxTypes.h:249
bool IsEmpty() const
Definition BoxTypes.h:613
TVector< RealType > Diagonal() const
Definition BoxTypes.h:608
TAxisAlignedBox3()
Definition BoxTypes.h:251
RealType MaxDim() const
Definition BoxTypes.h:598
TAxisAlignedBox3(const TAxisAlignedBox3 &Box, const FTransformSRT3d &Transform)
Definition BoxTypes.h:308
RealType DiagonalLength() const
Definition BoxTypes.h:593
RealType Height() const
Definition BoxTypes.h:573
TVector< RealType > Extents() const
Definition BoxTypes.h:433
TAxisAlignedBox3(const TVector< RealType > &Min, const TVector< RealType > &Max)
Definition BoxTypes.h:256
TVector< RealType > Center() const
Definition BoxTypes.h:425
TAxisAlignedBox3< RealType > Intersect(const TAxisAlignedBox3< RealType > &Box) const
Definition BoxTypes.h:511
TVector< RealType > Min
Definition BoxTypes.h:248
RealType DistanceSquared(const TAxisAlignedBox3< RealType > &Box) const
Definition BoxTypes.h:539
bool Intersects(TAxisAlignedBox3 Box) const
Definition BoxTypes.h:526
TAxisAlignedBox3(TArrayView< const TVector< RealType > > Pts)
Definition BoxTypes.h:326
void Contain(const TArray< TVector< RealType > > &Pts)
Definition BoxTypes.h:484
TAxisAlignedBox3(const TAxisAlignedBox3< OtherRealType > &OtherBox)
Definition BoxTypes.h:277
TVector< RealType > Clamp(const TVector< RealType > &V) const
Definition BoxTypes.h:502
TAxisAlignedBox3(const TAxisAlignedBox3 &Box, const TFunction< TVector< RealType >(const TVector< RealType > &)> TransformF)
Definition BoxTypes.h:290
void Contain(const TAxisAlignedBox3< RealType > &Other)
Definition BoxTypes.h:466
RealType Volume() const
Definition BoxTypes.h:583
Definition BoxTypes.h:19
RealType MaxAbsExtrema() const
Definition BoxTypes.h:63
void Expand(RealType Radius)
Definition BoxTypes.h:234
RealType Min
Definition BoxTypes.h:20
TInterval1(const RealType &Min, const RealType &Max)
Definition BoxTypes.h:28
RealType GetT(RealType Value) const
Definition BoxTypes.h:166
void Contain(const RealType &V)
Definition BoxTypes.h:68
TInterval1< RealType > IntersectionWith(const TInterval1< RealType > &O) const
Definition BoxTypes.h:138
RealType Max
Definition BoxTypes.h:21
bool IsEmpty() const
Definition BoxTypes.h:229
RealType GetUnclampedT(RealType Value) const
Definition BoxTypes.h:185
void Contain(const TInterval1< RealType > &O)
Definition BoxTypes.h:80
RealType Interpolate(RealType T) const
Definition BoxTypes.h:158
TInterval1()
Definition BoxTypes.h:23
TInterval1 operator*(RealType f) const
Definition BoxTypes.h:224
TInterval1 operator-(TInterval1 V) const
Definition BoxTypes.h:209
RealType Extent() const
Definition BoxTypes.h:54
RealType Length() const
Definition BoxTypes.h:58
static TInterval1< RealType > MakeFromUnordered(const RealType &A, const RealType &B)
Definition BoxTypes.h:39
TInterval1 operator+(RealType f) const
Definition BoxTypes.h:214
RealType Center() const
Definition BoxTypes.h:49
TInterval1 operator-(RealType f) const
Definition BoxTypes.h:219
RealType Dist(const TInterval1< RealType > &O) const
Definition BoxTypes.h:122
bool Overlaps(const TInterval1< RealType > &O) const
Definition BoxTypes.h:102
static TInterval1< RealType > Empty()
Definition BoxTypes.h:34
bool Contains(const TInterval1< RealType > &O) const
Definition BoxTypes.h:97
void Set(TInterval1 O)
Definition BoxTypes.h:197
bool Contains(RealType D) const
Definition BoxTypes.h:92
RealType Clamp(RealType f) const
Definition BoxTypes.h:150
RealType SquaredDist(const TInterval1< RealType > &O) const
Definition BoxTypes.h:107
void Set(RealType A, RealType B)
Definition BoxTypes.h:203
Definition Box2D.h:31
Definition Box.h:35
Definition Vector2D.h:38
T Y
Definition Vector2D.h:52
T X
Definition Vector2D.h:49
Definition Vector.h:51
T Z
Definition Vector.h:68
T Y
Definition Vector.h:65
static TVector< T > Max(const TVector< T > &A, const TVector< T > &B)
Definition Vector.h:2506
static TVector< T > Min(const TVector< T > &A, const TVector< T > &B)
Definition Vector.h:2496
T X
Definition Vector.h:62