UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Box.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5
7#include "Chaos/AABB.h"
9#include "Chaos/Plane.h"
10#include "Chaos/Transform.h"
11#include "ChaosArchive.h"
14
15namespace Chaos
16{
17 /*
18 * Axis-aligned box collision geometry. Consists of a core AABB with a margin. The margin should be considered physically part of the
19 * box - it pads the faces and rounds the corners.
20 */
21 template<class T, int d>
22 class TBox final : public FImplicitObject
23 {
24 public:
27
29
30 // This should never be used outside of creating a default for arrays
32 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box){};
34 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box)
35 , AABB(Min, Max)
36 {
37 //todo: turn back on
38 /*for (int Axis = 0; Axis < d; ++Axis)
39 {
40 ensure(MMin[Axis] <= MMax[Axis]);
41 }*/
42 }
43
48 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box)
49 {
50 AABB = TAABB<T, d>(InMin, InMax);
52 }
53
55 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box)
56 , AABB(Other.AABB)
57 {
58 SetMargin(Other.GetMarginf());
59 }
60
62 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box)
63 , AABB(MoveTemp(Other.AABB))
64 {
65 SetMargin(Other.GetMarginf());
66 }
67
69 {
70 this->Type = Other.Type;
71 this->bIsConvex = Other.bIsConvex;
72 this->bDoCollide = Other.bDoCollide;
73 this->bHasBoundingBox = Other.bHasBoundingBox;
74
75 AABB = Other.AABB;
76 SetMargin(Other.GetMarginf());
77 return *this;
78 }
79
81 {
82 this->Type = Other.Type;
83 this->bIsConvex = Other.bIsConvex;
84 this->bDoCollide = Other.bDoCollide;
85 this->bHasBoundingBox = Other.bHasBoundingBox;
86
87 AABB = MoveTemp(Other.AABB);
88 SetMargin(Other.GetMarginf());
89 return *this;
90 }
91
92 virtual ~TBox() {}
93
94 virtual Chaos::FImplicitObjectPtr CopyGeometry() const override
95 {
96 return Chaos::FImplicitObjectPtr(new TBox<T,d>(*this));
97 }
98
100 {
101 return Chaos::FImplicitObjectPtr(new TBox<T, d>(AABB.Min() * Scale, AABB.Max() * Scale, Margin * Scale.Min()));
102 }
103
104 virtual FReal GetRadius() const override
105 {
106 return 0.0f;
107 }
108
116
124
126 {
127 return BoundingBox().Contains(Point);
128 }
129
130 FORCEINLINE bool Contains(const TVector<T, d>& Point, const T Tolerance) const
131 {
132 return BoundingBox().Contains(Point, Tolerance);
133 }
134
135 // Minimum extents
137 {
138 return AABB.Min();
139 }
140
141 // Maximum extents
143 {
144 return AABB.Max();
145 }
146
147 // Extents
149 {
150 // LWC - necessary if T is different from FReal
151 return TAABB<FReal, 3>(AABB);
152 }
153
154 // Apply a limit to the specified margin that prevents the box inverting
156 {
157 FReal MaxMargin = 0.5f * AABB.Extents().Min();
158 return FMath::Min(InMargin, MaxMargin);
159 }
160
161 // Return the distance and normal is the closest point on the surface to Pos. Negative for penetration.
162 virtual FReal PhiWithNormal(const FVec3& Pos, FVec3& Normal) const override
163 {
164 return AABB.PhiWithNormal(Pos, Normal);
165 }
166
167 virtual FReal PhiWithNormalScaled(const FVec3& Pos, const FVec3& Scale, FVec3& Normal) const override
168 {
169 return TAABB<T, d>(Scale * AABB.Min(), Scale * AABB.Max()).PhiWithNormal(Pos, Normal);
170 }
171
172 static FORCEINLINE bool RaycastFast(const TVector<T,d>& InMin, const TVector<T,d>& InMax, const TVector<T, d>& StartPoint, const TVector<T, d>& Dir, const TVector<T, d>& InvDir, const bool* bParallel, const T Length, const T InvLength, T& OutTime, TVector<T, d>& OutPosition)
173 {
174 return TAABB<T, d>(InMin, InMax).RaycastFast(StartPoint, Dir, InvDir, bParallel, Length, InvLength, OutTime, OutPosition);
175 }
176
177 virtual bool Raycast(const FVec3& StartPoint, const FVec3& Dir, const FReal Length, const FReal Thickness, FReal& OutTime, FVec3& OutPosition, FVec3& OutNormal, int32& OutFaceIndex) const override
178 {
179 if (AABB.Raycast(StartPoint, Dir, Length, Thickness, OutTime, OutPosition, OutNormal, OutFaceIndex))
180 {
181 return true;
182 }
183 return false;
184 }
185
186 TVector<T, d> FindClosestPoint(const TVector<T, d>& StartPoint, const T Thickness = (T)0) const
187 {
188 return AABB.FindClosestPoint(StartPoint, Thickness);
189 }
190
191 virtual Pair<FVec3, bool> FindClosestIntersectionImp(const FVec3& StartPoint, const FVec3& EndPoint, const FReal Thickness) const override
192 {
193 return AABB.FindClosestIntersectionImp(StartPoint, EndPoint, Thickness);
194 }
195
197 {
198 return AABB.FindGeometryOpposingNormal(DenormDir, FaceIndex, OriginalNormal);
199 }
200
201 // Get the index of the plane that most opposes the normal
203 {
204 // NOTE: Index returned here must match indices as set up in SNormals (see Box.cpp)
205 int32 AxisIndex = FVec3(Normal.GetAbs()).MaxAxis();
206 if (Normal[AxisIndex] < 0.0f)
207 {
208 AxisIndex += 3;
209 }
210 return AxisIndex;
211 }
212
214 {
215 // Scale does not affect the face normals of a box
217 }
218
219 // Get the nearest point on an edge and the edge vertices
220 // Used for manifold generation
222 {
224 if (PlaneIndexHint >= 0)
225 {
227
229 if (PlaneVerticesNum > 0)
230 {
233 {
235 const TVector<T, d> P1 = GetVertex(VertexIndex);
236
238 const FReal EdgeDistanceSq = (EdgePosition - Position).SizeSquared();
239
241 {
244 OutEdgePos0 = P0;
245 OutEdgePos1 = P1;
246 }
247
248 P0 = P1;
249 }
250 }
251 }
252 else
253 {
254 // @todo(chaos)
255 check(false);
256 }
257 return ClosestEdgePosition;
258 }
259
260 // Get the nearest point on an edge
266
268 {
269 if (PlaneIndexHint >= 0)
270 {
272
274 if (PlaneVerticesNum > 0)
275 {
277 FVec3 P0 = GetVertex(VertexIndex0);
278
280 {
282 const FVec3 P1 = GetVertex(VertexIndex1);
283
285 const FReal EdgeDistanceSq = (EdgePosition - Position).SizeSquared();
286
288 {
289 OutVertexIndex0 = VertexIndex0;
290 OutVertexIndex1 = VertexIndex1;
292 }
293
294 VertexIndex0 = VertexIndex1;
295 P0 = P1;
296 }
297 return true;
298 }
299 }
300 else
301 {
302 // @todo(chaos)
303 check(false);
304 }
305 return false;
306 }
307
308 // Get an array of all the plane indices that belong to a vertex (up to MaxVertexPlanes).
309 // Returns the number of planes found.
311 {
312 return SStructureData.FindVertexPlanes(VertexIndex, OutVertexPlanes, MaxVertexPlanes);
313 }
314
315 // Get up to the 3 plane indices that belong to a vertex
316 // Returns the number of planes found.
318 {
319 return SStructureData.GetVertexPlanes3(VertexIndex, PlaneIndex0, PlaneIndex1, PlaneIndex2);
320 }
321
322 // The number of vertices that make up the corners of the specified face
323 int32 NumPlaneVertices(int32 PlaneIndex) const
324 {
325 return SStructureData.NumPlaneVertices(PlaneIndex);
326 }
327
328 // Get the vertex index of one of the vertices making up the corners of the specified face
330 {
331 return SStructureData.GetPlaneVertex(PlaneIndex, PlaneVertexIndex);
332 }
333
335 {
336 return SStructureData.GetEdgeVertex(EdgeIndex, EdgeVertexIndex);
337 }
338
340 {
341 return SStructureData.GetEdgePlane(EdgeIndex, EdgePlaneIndex);
342 }
343
344 int32 NumPlanes() const { return SNormals.Num(); }
345
346 int32 NumEdges() const { return SStructureData.NumEdges(); }
347
348 int32 NumVertices() const { return SVertices.Num(); }
349
350 // Get the plane at the specified index (e.g., indices from FindVertexPlanes)
352 {
353 const FVec3& PlaneN = SNormals[FaceIndex];
354 const FVec3 PlaneX = AABB.Center() + 0.5f * (PlaneN * AABB.Extents());
356 }
357
359 {
360 OutN = SNormals[FaceIndex];
361 OutX = AABB.Center() + 0.5f * (SNormals[FaceIndex] * AABB.Extents());
362 }
363
364 // Get the vertex at the specified index (e.g., indices from GetPlaneVertexs)
365 const FVec3 GetVertex(int32 VertexIndex) const
366 {
367 const FVec3& Vertex = SVertices[VertexIndex];
368 return AABB.Center() + 0.5f * (Vertex * AABB.Extents());
369 }
370
371 // Returns a position on the shape
372 FORCEINLINE_DEBUGGABLE TVector<T, d> Support(const TVector<T, d>& Direction, const T Thickness, int32& VertexIndex) const
373 {
374 return AABB.Support(Direction, Thickness, VertexIndex);
375 }
376
377 // Returns a position on the core shape excluding the margin
379 {
380 return AABB.SupportCore(Direction, InMargin, OutSupportDelta, VertexIndex);
381 }
382
383 // Returns a position on the core shape excluding the margin
392
394 {
395 return AABB.SupportCoreScaled(Direction, InMargin, Scale, OutSupportDelta, VertexIndex);
396 // @todo(chaos): Needs to operate in scaled space as margin is not non-uniform scalable
397 //const FReal InvScale = 1.0f / Scale[0];
398 //const FReal NetMargin = InvScale * InMargin;
399 //const FVec3 CoreVertex = AABB.SupportCore(Direction * Scale, NetMargin, OutSupportDelta);
400 //if (OutSupportDelta != nullptr)
401 //{
402 // *OutSupportDelta = *OutSupportDelta * Scale[0];
403 //}
404 //return CoreVertex * Scale;
405 }
406
407 // Returns a winding order multiplier used in the manifold clipping and required when we have negative scales (See ImplicitObjectScaled)
409 {
410 return 1.0f;
411 }
412
413 FORCEINLINE TVector<T, d> Center() const { return AABB.Center(); }
414 FORCEINLINE TVector<T, d> GetCenter() const { return AABB.GetCenter(); }
415 FORCEINLINE TVector<T, d> GetCenterOfMass() const { return AABB.GetCenterOfMass(); }
416 FORCEINLINE TVector<T, d> Extents() const { return AABB.Extents(); }
417
418 int LargestAxis() const
419 {
420 return AABB.LargestAxis();
421 }
422
423 // Area of the box
424 FORCEINLINE T GetArea() const { return BoundingBox().GetArea(); }
425
426 // Volume of the box
427 FORCEINLINE T GetVolume() const { return BoundingBox().GetVolume(); }
428
431 {
432 // https://www.wolframalpha.com/input/?i=cuboid
433 const T M = Mass / 12;
434 const T WW = Dim[0] * Dim[0];
435 const T HH = Dim[1] * Dim[1];
436 const T DD = Dim[2] * Dim[2];
437 return PMatrix<T, 3, 3>(M * (HH + DD), M * (WW + DD), M * (WW + HH));
438 }
439
440
445
446 virtual FString ToString() const override
447 {
448 return FString::Printf(TEXT("Box: Min: [%s], Max: [%s], Margin: %f"), *Min().ToString(), *Max().ToString(), GetMarginf());
449 }
450
464
465 // Some older classes used to use a TBox as a bounding box, but now use a TAABB. However we still need
466 // to be able to read the older files, so those older classes should use TBox::SerializeAsAABB and not TAABB::Serialize
467 static void SerializeAsAABB(FArchive& Ar, TAABB<T,d>& AABB)
468 {
471 {
472 TBox<T, d> Tmp;
473 Ar << Tmp;
474 AABB = Tmp.AABB;
475 }
476 else
477 {
478 AABB.Serialize(Ar);
479 }
480 }
481
482 // See comments on SerializeAsAABB
483 template<typename OtherType>
485 {
488 {
490 Ar << Tmp;
491 AABBs.Reset(Tmp.Num());
492 for (const TBox<T, d>& Box : Tmp)
493 {
494 AABBs.Emplace(TAABB<OtherType, d>(Box.AABB));
495 }
496 }
497 else if (std::is_same_v<T, OtherType>)
498 {
499 Ar << AABBs;
500 }
501 else if (Ar.IsLoading())
502 {
503 // Reload to a different floating point type
505 Ar << TmpAABBs;
506 AABBs.Reset(TmpAABBs.Num());
507 for (const TAABB<T, d>& TmpAABB : TmpAABBs)
508 {
510 }
511 }
512 else
513 {
514 // Serialize from a different floating point type
516 TmpAABBs.Reserve(AABBs.Num());
517 for (const TAABB<OtherType, d>& AABB : AABBs)
518 {
519 TmpAABBs.Emplace(TAABB<T, d>(AABB));
520 }
521 Ar << TmpAABBs;
522 }
523 }
524
525 // See comments on SerializeAsAABB
526 template <typename Key>
528 {
531 {
533 Ar << Tmp;
534
535 for (const auto& Itr : Tmp)
536 {
537 AABBs.Add(Itr.Key, Itr.Value.AABB);
538 }
539 }
540 else
541 {
542 Ar << AABBs;
543 }
544 }
545
546 virtual void Serialize(FChaosArchive& Ar) override
547 {
549 SerializeImp(Ar);
550 }
551
552 virtual void Serialize(FArchive& Ar) override { SerializeImp(Ar); }
553
554 virtual uint32 GetTypeHash() const override
555 {
556 return AABB.GetTypeHash();
557 }
558
559 private:
560 TAABB<T, d> AABB;
561
562 // Structure data shared by all boxes and used for manifold creation
563 static TArray<FVec3> SNormals;
564 static TArray<FVec3> SVertices;
565 static FConvexHalfEdgeStructureDataS16 SStructureData;
566 };
567
568
570 {
571 public:
572
574 : FImplicitObject(EImplicitObject::FiniteConvex, ImplicitObjectType::Box)
575 {}
576
577 virtual FReal PhiWithNormal(const FVec3& x, FVec3& Normal) const override
578 {
579 check(false); // should not be called - empty shell class for legacy serialization
580 return 0.;
581 }
582
594
595 virtual void Serialize(FChaosArchive& Ar) override
596 {
598 SerializeImp(Ar);
599 }
600
601 virtual void Serialize(FArchive& Ar) override { SerializeImp(Ar); }
602
603 virtual uint32 GetTypeHash() const override
604 {
606 }
607
608 private:
609 TVector<float, 3> MMin, MMax;
610 };
611}
#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
#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
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
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Box.h:570
virtual void Serialize(FChaosArchive &Ar) override
Definition Box.h:595
FBoxFloat3()
Definition Box.h:573
FORCEINLINE void SerializeImp(FArchive &Ar)
Definition Box.h:583
virtual FReal PhiWithNormal(const FVec3 &x, FVec3 &Normal) const override
Definition Box.h:577
virtual uint32 GetTypeHash() const override
Definition Box.h:603
virtual void Serialize(FArchive &Ar) override
Definition Box.h:601
Definition ChaosArchive.h:364
Definition ChaosArchive.h:167
Definition ImplicitObject.h:111
bool bHasBoundingBox
Definition ImplicitObject.h:574
CHAOS_API FReal SignedDistance(const FVec3 &x) const
Definition ImplicitObject.cpp:105
FRealSingle Margin
Definition ImplicitObject.h:571
EImplicitObjectType Type
Definition ImplicitObject.h:585
bool bDoCollide
Definition ImplicitObject.h:573
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
CHAOS_API void SerializeImp(FArchive &Ar)
Definition ImplicitObject.cpp:337
void SetMargin(FReal InMargin)
Definition ImplicitObject.h:567
bool bIsConvex
Definition ImplicitObject.h:572
virtual FRealSingle GetMarginf() const
Definition ImplicitObject.h:212
Definition Matrix.h:21
Definition AABB.h:37
FORCEINLINE TArray< TVector< T, d > > ComputeLocalSamplePoints() const
Definition AABB.h:90
FORCEINLINE T GetArea() const
Definition AABB.h:610
FORCEINLINE TArray< TVector< T, d > > ComputeSamplePoints() const
Definition AABB.h:99
FORCEINLINE T GetVolume() const
Definition AABB.h:613
FORCEINLINE void Serialize(FArchive &Ar)
Definition AABB.h:660
static FORCEINLINE TRotation< FReal, d > GetRotationOfMass()
Definition AABB.h:686
FORCEINLINE bool Contains(const TVector< T, d > &Point) const
Definition AABB.h:127
Definition Box.h:23
virtual ~TBox()
Definition Box.h:92
virtual void Serialize(FArchive &Ar) override
Definition Box.h:552
static FORCEINLINE PMatrix< T, 3, 3 > GetInertiaTensor(const T Mass, const TVector< T, 3 > &Dim)
Definition Box.h:430
virtual Pair< FVec3, bool > FindClosestIntersectionImp(const FVec3 &StartPoint, const FVec3 &EndPoint, const FReal Thickness) const override
Definition Box.h:191
int32 GetVertexPlanes3(int32 VertexIndex, int32 &PlaneIndex0, int32 &PlaneIndex1, int32 &PlaneIndex2) const
Definition Box.h:317
FORCEINLINE void SerializeImp(FArchive &Ar)
Definition Box.h:451
int32 GetEdgeVertex(int32 EdgeIndex, int32 EdgeVertexIndex) const
Definition Box.h:334
FORCEINLINE TBox(const TBox< T, d > &Other)
Definition Box.h:54
FORCEINLINE TBox< T, d > & operator=(const TBox< T, d > &Other)
Definition Box.h:68
FORCEINLINE bool Contains(const TVector< T, d > &Point, const T Tolerance) const
Definition Box.h:130
int32 GetMostOpposingPlane(const TVector< T, d > &Normal) const
Definition Box.h:202
static void SerializeAsAABBs(FArchive &Ar, TMap< Key, TAABB< T, d > > &AABBs)
Definition Box.h:527
int32 GetMostOpposingPlaneScaled(const TVector< T, d > &Normal, const TVector< T, d > &Scale) const
Definition Box.h:213
FORCEINLINE PMatrix< T, d, d > GetInertiaTensor(const T Mass) const
Definition Box.h:429
static FORCEINLINE bool RaycastFast(const TVector< T, d > &InMin, const TVector< T, d > &InMax, const TVector< T, d > &StartPoint, const TVector< T, d > &Dir, const TVector< T, d > &InvDir, const bool *bParallel, const T Length, const T InvLength, T &OutTime, TVector< T, d > &OutPosition)
Definition Box.h:172
static FORCEINLINE constexpr EImplicitObjectType StaticType()
Definition Box.h:28
int32 GetPlaneVertex(int32 PlaneIndex, int32 PlaneVertexIndex) const
Definition Box.h:329
FORCEINLINE_DEBUGGABLE VectorRegister4Float SupportCoreSimd(const VectorRegister4Float &Direction, const FReal InMargin) const
Definition Box.h:384
TArray< TVector< T, d > > ComputeLocalSamplePoints() const
Definition Box.h:112
FORCEINLINE_DEBUGGABLE TVector< T, d > SupportCore(const TVector< T, d > &Direction, const FReal InMargin, FReal *OutSupportDelta, int32 &VertexIndex) const
Definition Box.h:378
TVector< T, d > GetClosestEdgePosition(int32 PlaneIndexHint, const TVector< T, d > &Position) const
Definition Box.h:261
FORCEINLINE FReal GetWindingOrder() const
Definition Box.h:408
FORCEINLINE TVector< T, d > GetCenterOfMass() const
Definition Box.h:415
virtual FReal PhiWithNormal(const FVec3 &Pos, FVec3 &Normal) const override
Definition Box.h:162
void GetPlaneNX(const int32 FaceIndex, FVec3 &OutN, FVec3 &OutX) const
Definition Box.h:358
FORCEINLINE TBox(const TVector< T, d > &Min, const TVector< T, d > &Max)
Definition Box.h:33
int32 GetEdgePlane(int32 EdgeIndex, int32 EdgePlaneIndex) const
Definition Box.h:339
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
static void SerializeAsAABB(FArchive &Ar, TAABB< T, d > &AABB)
Definition Box.h:467
virtual FVec3 FindGeometryOpposingNormal(const FVec3 &DenormDir, int32 FaceIndex, const FVec3 &OriginalNormal) const override
Definition Box.h:196
FORCEINLINE const TAABB< FReal, 3 > BoundingBox() const
Definition Box.h:148
FORCEINLINE TBox()
Definition Box.h:31
int32 NumPlanes() const
Definition Box.h:344
virtual Chaos::FImplicitObjectPtr CopyGeometry() const override
Definition Box.h:94
FORCEINLINE const TVector< T, d > & Max() const
Definition Box.h:142
TVector< T, d > FindClosestPoint(const TVector< T, d > &StartPoint, const T Thickness=(T) 0) const
Definition Box.h:186
FVec3 GetClosestEdge(int32 PlaneIndexHint, const FVec3 &Position, FVec3 &OutEdgePos0, FVec3 &OutEdgePos1) const
Definition Box.h:221
FORCEINLINE TVector< T, d > Center() const
Definition Box.h:413
FORCEINLINE TBox(TBox< T, d > &&Other)
Definition Box.h:61
FORCEINLINE bool Contains(const TVector< T, d > &Point) const
Definition Box.h:125
static void SerializeAsAABBs(FArchive &Ar, TArray< TAABB< OtherType, d > > &AABBs)
Definition Box.h:484
const FVec3 GetVertex(int32 VertexIndex) const
Definition Box.h:365
virtual bool Raycast(const FVec3 &StartPoint, const FVec3 &Dir, const FReal Length, const FReal Thickness, FReal &OutTime, FVec3 &OutPosition, FVec3 &OutNormal, int32 &OutFaceIndex) const override
Definition Box.h:177
virtual FReal GetRadius() const override
Definition Box.h:104
int32 NumVertices() const
Definition Box.h:348
int32 FindVertexPlanes(int32 VertexIndex, int32 *OutVertexPlanes, int32 MaxVertexPlanes) const
Definition Box.h:310
FORCEINLINE TBox< T, d > & operator=(TBox< T, d > &&Other)
Definition Box.h:80
int32 NumEdges() const
Definition Box.h:346
static FORCEINLINE TRotation< T, d > GetRotationOfMass()
Definition Box.h:441
TArray< TVector< T, d > > ComputeSamplePoints() const
Definition Box.h:120
FORCEINLINE const TVector< T, d > & Min() const
Definition Box.h:136
int LargestAxis() const
Definition Box.h:418
const TPlaneConcrete< FReal > GetPlane(int32 FaceIndex) const
Definition Box.h:351
bool GetClosestEdgeVertices(int32 PlaneIndexHint, const FVec3 &Position, int32 &OutVertexIndex0, int32 &OutVertexIndex1) const
Definition Box.h:267
virtual uint32 GetTypeHash() const override
Definition Box.h:554
FORCEINLINE TBox(const TVector< T, d > &InMin, const TVector< T, d > &InMax, FReal InMargin)
Definition Box.h:47
virtual FString ToString() const override
Definition Box.h:446
FORCEINLINE TVector< T, d > GetCenter() const
Definition Box.h:414
FORCEINLINE_DEBUGGABLE TVector< T, d > Support(const TVector< T, d > &Direction, const T Thickness, int32 &VertexIndex) const
Definition Box.h:372
FORCEINLINE T GetVolume() const
Definition Box.h:427
int32 NumPlaneVertices(int32 PlaneIndex) const
Definition Box.h:323
FORCEINLINE T GetArea() const
Definition Box.h:424
FORCEINLINE TVector< T, d > Extents() const
Definition Box.h:416
FORCEINLINE FReal ClampedMargin(FReal InMargin) const
Definition Box.h:155
FORCEINLINE_DEBUGGABLE TVector< T, d > SupportCoreScaled(const TVector< T, d > &Direction, const FReal InMargin, const TVector< T, d > &Scale, T *OutSupportDelta, int32 &VertexIndex) const
Definition Box.h:393
virtual Chaos::FImplicitObjectPtr CopyGeometryWithScale(const FVec3 &Scale) const override
Definition Box.h:99
virtual FReal PhiWithNormalScaled(const FVec3 &Pos, const FVec3 &Scale, FVec3 &Normal) const override
Definition Box.h:167
virtual void Serialize(FChaosArchive &Ar) override
Definition Box.h:546
Definition ConvexHalfEdgeStructureData.h:38
int32 GetVertexPlanes3(int32 VertexIndex, int32 &PlaneIndex0, int32 &PlaneIndex1, int32 &PlaneIndex2) const
Definition ConvexHalfEdgeStructureData.h:326
int32 GetPlaneVertex(int32 PlaneIndex, int32 PlaneVertexIndex) const
Definition ConvexHalfEdgeStructureData.h:173
int32 GetEdgePlane(int32 EdgeIndex, int32 EdgePlaneIndex) const
Definition ConvexHalfEdgeStructureData.h:242
int32 NumEdges() const
Definition ConvexHalfEdgeStructureData.h:135
int32 GetEdgeVertex(int32 EdgeIndex, int32 EdgeVertexIndex) const
Definition ConvexHalfEdgeStructureData.h:226
int32 NumPlaneVertices(int32 PlaneIndex) const
Definition ConvexHalfEdgeStructureData.h:164
int32 FindVertexPlanes(int32 VertexIndex, int32 *PlaneIndices, int32 MaxVertexPlanes) const
Definition ConvexHalfEdgeStructureData.h:309
Definition CorePlane.h:12
Definition Rotation.h:41
Definition Vector.h:41
Definition Archive.h:1208
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
CORE_API int32 CustomVer(const struct FGuid &Key) const
Definition Archive.cpp:602
virtual CORE_API void Reset()
Definition Archive.cpp:151
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition UnrealString.h.inl:34
@ Box
Definition ImplicitObjectType.h:14
Definition SkeletalMeshComponent.h:307
TRefCountPtr< FImplicitObject > FImplicitObjectPtr
Definition ImplicitFwd.h:33
uint8 EImplicitObjectType
Definition ImplicitObjectType.h:41
FRealDouble FReal
Definition Real.h:22
float FRealSingle
Definition Real.h:14
FORCEINLINE uint32 GetTypeHash(const FParticleID &Unique)
Definition GeometryParticles.h:99
TVector< FReal, 3 > FVec3
Definition Core.h:17
Definition Pair.h:8
CORE_API static const FGuid GUID
Definition ExternalPhysicsCustomObjectVersion.h:144
@ TBoxReplacedWithTAABB
Definition ExternalPhysicsCustomObjectVersion.h:88
static CORE_API UE::Math::TVector< T > ClosestPointOnLine(const UE::Math::TVector< T > &LineStart, const UE::Math::TVector< T > &LineEnd, const UE::Math::TVector< T > &Point)
CORE_API static const FGuid GUID
Definition ReleaseObjectVersion.h:154
@ MarginAddedToConvexAndBox
Definition ReleaseObjectVersion.h:125
Definition UnrealMathFPU.h:20