TBox

Axis-aligned box collision geometry.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Box.h

Include

#include "Chaos/Box.h"

Syntax

template<class T, int d>
class TBox : public Chaos::FImplicitObject

Remarks

Axis-aligned box collision geometry. Consists of a core AABB with a margin. The margin should be considered physically part of the box - it pads the faces and rounds the corners.

Constructors

Name Description

Public function

TBox()

This should never be used outside of creating a default for arrays.

Public function

TBox

(
    const TBox< T, d >& Other
)

Public function

TBox

(
    TBox< T, d >&& Other
)

Public function

TBox

(
    const TVector< T, d >& Min,
    const TVector< T, d >& Max
)

This should never be used outside of creating a default for arrays.

Public function

TBox

(
    const TVector< T, d >& InMin,
    const TVector< T, d >& InMax,
    FReal InMargin
)

Create a box with the specified size and margin (Min and Max is the desired size including the margin).

Destructors

Name Description

Public function Virtual

~TBox()

Functions

Name Description

Public function Const

TVector< T, ...

 

Center()

Public function Const

FReal

 

ClampedMargin

(
    FReal InMargin
)

Apply a limit to the specified margin that prevents the box inverting.

Public function Const

TArray< TVec...

 

ComputeLocalSamplePoints()

Returns sample points centered about the origin.

Public function Const

TArray< TVec...

 

ComputeSamplePoints()

Returns sample points at the current location of the box.

Public function Const

bool

 

Contains

(
    const TVector< T, d >& Point,
    const T Tolerance
)

Public function Const

bool

 

Contains

(
    const TVector< T, d >& Point
)

Public function Const

TVector< T, ...

 

Extents()

Public function Virtual Const

Pair< TVecto...

 

FindClosestIntersectionImp

(
    const TVector< T, d >& StartPoint,
    const TVector< T, d >& EndPoint,
    const T Thickness
)

Public function Const

TVector< T, ...

 

FindClosestPoint

(
    const TVector< T, d >& StartPoint,
    const T Thickness
)

Public function Virtual Const

TVector< T, ...

 

FindGeometryOpposingNormal

(
    const TVector< T, d >& DenormDir,
    int32 FaceIndex,
    const TVector< T, d >& OriginalNor...
)

Public function Const

int32

 

FindVertexPlanes

(
    int32 VertexIndex,
    int32* OutVertexPlanes,
    int32 MaxVertexPlanes
)

Get an array of all the plane indices that belong to a vertex (up to MaxVertexPlanes).

Public function Const

T

 

GetArea()

Area of the box.

Public function Const

TVector< T, ...

 

GetCenter()

Public function Const

TVector< T, ...

 

GetCenterOfMass()

Public function Const

TVector< T, ...

 

GetClosestEdgePosition

(
    int32 PlaneIndexHint,
    const TVector< T, d >& Position
)

Get the nearest point on an edge.

Public function Const

bool

 

GetClosestEdgeVertices

(
    int32 PlaneIndexHint,
    const FVec3& Position,
    int32& OutVertexIndex0,
    int32& OutVertexIndex1
)

Public function Const

int32

 

GetEdgePlane

(
    int32 EdgeIndex,
    int32 EdgePlaneIndex
)

Public function Const

int32

 

GetEdgeVertex

(
    int32 EdgeIndex,
    int32 EdgeVertexIndex
)

Public function Static

PMatrix< T, ...

 

GetInertiaTensor

(
    const T Mass,
    const TVector< T, 3 >& Dim
)

Public function Const

PMatrix< T, ...

 

GetInertiaTensor

(
    const T Mass
)

Public function Const

int32

 

GetMostOpposingPlane

(
    const TVector< T, d >& Normal
)

Get the index of the plane that most opposes the normal.

Public function Const

int32

 

GetMostOpposingPlaneScaled

(
    const TVector< T, d >& Normal,
    const TVector< T, d >& Scale
)

Public function Const

const TPlane...

 

GetPlane

(
    int32 FaceIndex
)

Get the plane at the specified index (e.g., indices from FindVertexPlanes)

Public function Const

int32

 

GetPlaneVertex

(
    int32 PlaneIndex,
    int32 PlaneVertexIndex
)

Get the vertex index of one of the vertices making up the corners of the specified face.

Public function Const

FReal

 

GetRadius()

Public function Static

TRotation< T...

 

GetRotationOfMass()

Public function Const

const FVec3

 

GetVertex

(
    int32 VertexIndex
)

Get the vertex at the specified index (e.g., indices from GetPlaneVertexs)

Public function Const

T

 

GetVolume()

Volume of the box.

Public function Const

FReal

 

GetWindingOrder()

Returns a winding order multiplier used in the manifold clipping and required when we have negative scales (See ImplicitObjectScaled)

Public function Const

int

 

LargestAxis()

Public function Const

const TVecto...

 

Max()

Maximum extents.

Public function Const

const TVecto...

 

Min()

Minimum extents.

Public function Const

int32

 

NumEdges()

Public function Const

int32

 

NumPlanes()

Public function Const

int32

 

NumPlaneVertices

(
    int32 PlaneIndex
)

The number of vertices that make up the corners of the specified face.

Public function Const

int32

 

NumVertices()

Public function Virtual Const

T

 

PhiWithNormal

(
    const TVector< T, d >& Pos,
    TVector< T, d >& Normal
)

Return the distance and normal is the closest point on the surface to Pos. Negative for penetration.

Public function Virtual Const

T

 

PhiWithNormalScaled

(
    const TVector< T, d >& Pos,
    const TVector< T, d >& Scale,
    TVector< T, d >& Normal
)

Public function Virtual Const

bool

 

Raycast

(
    const TVector< T, d >& StartPoint,
    const TVector< T, d >& Dir,
    const T Length,
    const T Thickness,
    T& OutTime,
    TVector< T, d >& OutPosition,
    TVector< T, d >& OutNormal,
    int32& OutFaceIndex
)

Public function Static

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
)

Public function Static

void

 

SerializeAsAABB

(
    FArchive& Ar,
    TAABB< T, d >& AABB
)

Some older classes used to use a TBox as a bounding box, but now use a TAABB.

Public function Static

void

 

SerializeAsAABBs

(
    FArchive& Ar,
    TArray< TAABB< T, d >>& AABBs
)

See comments on SerializeAsAABB.

Public function Static

void

 

SerializeAsAABBs

(
    FArchive& Ar,
    TMap< Key, TAABB< T, d >>& AABBs
)

See comments on SerializeAsAABB.

Public function

void

 

SerializeImp

(
    FArchive& Ar
)

Public function Static

constexpr EI...

 

StaticType()

Public function Const

TVector< T, ...

 

Support

(
    const TVector< T, d >& Direction,
    const T Thickness
)

Returns a position on the shape.

Public function Const

TVector< T, ...

 

SupportCore

(
    const TVector< T, d >& Direction,
    FReal InMargin
)

Returns a position on the core shape excluding the margin.

Public function Const

TVector< T, ...

 

SupportCoreScaled

(
    const TVector< T, d >& Direction,
    FReal InMargin,
    const TVector< T, d >& Scale
)

Overridden from FImplicitObject

Name Description

Public function Virtual Const

const TAABB<...

 

BoundingBox()

Extents.

Public function Virtual Const

TUniquePtr< ...

 

Copy()

Public function Virtual Const

uint32

 

GetTypeHash()

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Public function Virtual

void

 

Serialize

(
    FChaosArchive& Ar
)

Public function Virtual Const

FString

 

ToString()

Operators

Name Description

Public function

TBox< T, d >...

 

operator=

(
    TBox< T, d >&& Other
)

Public function

TBox< T, d >...

 

operator=

(
    const TBox< T, d >& Other
)

Constants

Name

Description

SNormals

Structure data shared by all boxes and used for manifold creation.

SStructureData

SVertices

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss