 # TBox

Inheritance Hierarchy

TBox TBVTree::FElementBox

References

Syntax

template<typename T>
struct TBox

Variables

Name Description

uint8

IsValid

Holds a flag indicating whether this box is valid.

TVector< T >

Max

Holds the box's maximum point.

TVector< T >

Min

Holds the box's minimum point.

Constructors

Name Description

TBox()

Default constructor (no initialization).

TBox

Creates and initializes a new box with zero extent and marks it as invalid.

TBox

(
const TArray< TVector< T >>& Point...
)

Creates and initializes a new box from an array of points.

TBox

(
const TBox< FArg >& From
)

Conversion from other type.

TBox

(
const TVector< T >& InMin,
const TVector< T >& InMax
)

Creates and initializes a new box from the specified extents.

TBox

(
const TVector< T >* Points,
int32 Count
)

Creates and initializes a new box from the given set of points.

Functions

Name Description

TBox< T >

BuildAABB

(
const TVector< T >& Origin,
const TVector< T >& Extent
)

Utility function to build an AABB from Origin and Extent

T

ComputeSquaredDistanceToBox

(
const TBox< T >& Box
)

Calculates squared distance between two boxes.

T

ComputeSquaredDistanceToPoint

(
const TVector< T >& Point
)

Calculates the distance of a point to this box.

bool

Equals

(
const TBox< T >& Other,
T Tolerance
)

Check against another box for equality, within specified error limits.

TBox< T >

ExpandBy

(
const TVector< T >& Neg,
const TVector< T >& Pos
)

Returns a box of increased size.

TBox< T >

ExpandBy

(
const TVector< T >& V
)

Returns a box of increased size.

TBox< T >

ExpandBy

(
T W
)

Returns a box of increased size.

TVector< T >

GetCenter()

Gets the center point of this box.

void

GetCenterAndExtents

(
TVector< T >& Center,
TVector< T >& Extents
)

Gets the center and extents of this box.

TVector< T >

GetClosestPointTo

(
const TVector< T >& Point
)

Calculates the closest point on or inside the box to a given point in space.

TVector< T >

GetExtent()

Gets the extents of this box.

TVector< T >

GetSize()

Gets the size of this box.

T

GetVolume()

Gets the volume of this box.

void

Init()

Set the initial values of the bounding box to Zero.

bool

Intersect

(
const TBox< T >& Other
)

Checks whether the given bounding box intersects this bounding box.

bool

IntersectXY

(
const TBox< T >& Other
)

Checks whether the given bounding box intersects this bounding box in the XY plane.

TBox< T >

InverseTransformBy

(
const FTransform& M
)

Gets a bounding volume transformed by an inverted FTransform object.

bool

IsInside

(
const TBox< T >& Other
)

Checks whether a given box is fully encapsulated by this box.

bool

IsInside

(
const TVector< T >& In
)

Checks whether the given location is inside this box.

bool

IsInsideOrOn

(
const TVector< T >& In
)

Checks whether the given location is inside or on this box.

bool

IsInsideOrOnXY

(
const FVector& In
)

Checks whether the given location is inside or on this box in the XY plane.

bool

IsInsideXY

(
const TVector< T >& In
)

Checks whether the given location is inside this box in the XY plane.

bool

IsInsideXY

(
const TBox< T >& Other
)

Checks whether the given box is fully encapsulated by this box in the XY plane.

TBox< T >

MoveTo

(
const TVector< T >& Destination
)

Returns a box with its center moved to the new destination.

TBox< T >

Overlap

(
const TBox< T >& Other
)

Returns the overlap TBox of two box

bool

Serialize

(
FArchive& Ar
)

bool

Serialize

bool

SerializeFromMismatchedTag

(
FName StructTag,
FArchive& Ar
)

TBox< T >

ShiftBy

(
const TVector< T >& Offset
)

Returns a box with its position shifted.

FString

ToString()

Get a textual representation of this box.

TBox< T >

TransformBy

(
const TMatrix< T >& M
)

Gets a bounding volume transformed by a matrix.

TBox< T >

TransformBy

(
const FTransform& M
)

Gets a bounding volume transformed by a FTransform object.

TBox< T >

TransformProjectBy

(
const TMatrix< T >& ProjM
)

Returns the current world bounding box transformed and projected to screen space

Operators

Name Description

bool

operator!=

(
const TBox< T >& Other
)

Compares two boxes for inequality.

TVector< T >...

operator[]

(
int32 Index
)

Gets reference to the min or max of this bounding volume.

TBox< T >

operator+

(
const TVector< T >& Other
)

Gets the result of addition to this bounding volume.

TBox< T >

operator+

(
const TBox< T >& Other
)

Gets the result of addition to this bounding volume.

TBox< T > &

operator+=

(
const TBox< T >& Other
)

Adds to this bounding box to include a new bounding volume.

TBox< T > &

operator+=

(
const TVector< T >& Other
)

Adds to this bounding box to include a given point.

TBox inline functions

bool

operator==

(
const TBox< T >& Other
)

Compares two boxes for equality.

Typedefs

Name

Description

FReal

Deprecated Functions

Name Description

TVector< T >...

GetExtrema

(
int PointIndex
)

This method performed unsafe operations and should be replaced with using .Min and .Max directly or using the [] operator on this class instead.

const TVecto...

GetExtrema

(
int PointIndex
)

This method performed unsafe operations and should be replaced with using .Min and .Max directly or using the [] operator on this class instead.