TBox

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/CoreFwd.h

Include

#include "CoreFwd.h"

Syntax

template<typename T>
struct TBox

Variables

Name Description

Public variable

uint8

 

IsValid

Holds a flag indicating whether this box is valid.

Public variable

TVector< T >

 

Max

Holds the box's maximum point.

Public variable

TVector< T >

 

Min

Holds the box's minimum point.

Constructors

Name Description

Public function

TBox()

Default constructor (no initialization).

Public function

TBox

(
    EForceInit
)

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

Public function

TBox

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

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

Public function

TBox

(
    const TBox< FArg >& From
)

Conversion from other type.

Public function

TBox

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

Creates and initializes a new box from the specified extents.

Public function

TBox

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

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

Functions

Name Description

Public function Static

TBox< T >

 

BuildAABB

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

Utility function to build an AABB from Origin and Extent

Public function Const

T

 

ComputeSquaredDistanceToBox

(
    const TBox< T >& Box
)

Calculates squared distance between two boxes.

Public function Const

T

 

ComputeSquaredDistanceToPoint

(
    const TVector< T >& Point
)

Calculates the distance of a point to this box.

Public function Const

bool

 

Equals

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

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

Public function Const

TBox< T >

 

ExpandBy

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

Returns a box of increased size.

Public function Const

TBox< T >

 

ExpandBy

(
    const TVector< T >& V
)

Returns a box of increased size.

Public function Const

TBox< T >

 

ExpandBy

(
    T W
)

Returns a box of increased size.

Public function Const

TVector< T >

 

GetCenter()

Gets the center point of this box.

Public function Const

void

 

GetCenterAndExtents

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

Gets the center and extents of this box.

Public function Const

TVector< T >

 

GetClosestPointTo

(
    const TVector< T >& Point
)

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

Public function Const

TVector< T >

 

GetExtent()

Gets the extents of this box.

Public function Const

TVector< T >

 

GetSize()

Gets the size of this box.

Public function Const

T

 

GetVolume()

Gets the volume of this box.

Public function

void

 

Init()

Set the initial values of the bounding box to Zero.

Public function Const

bool

 

Intersect

(
    const TBox< T >& Other
)

Checks whether the given bounding box intersects this bounding box.

Public function Const

bool

 

IntersectXY

(
    const TBox< T >& Other
)

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

Public function Const

TBox< T >

 

InverseTransformBy

(
    const FTransform& M
)

Gets a bounding volume transformed by an inverted FTransform object.

Public function Const

bool

 

IsInside

(
    const TBox< T >& Other
)

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

Public function Const

bool

 

IsInside

(
    const TVector< T >& In
)

Checks whether the given location is inside this box.

Public function Const

bool

 

IsInsideOrOn

(
    const TVector< T >& In
)

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

Public function Const

bool

 

IsInsideOrOnXY

(
    const FVector& In
)

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

Public function Const

bool

 

IsInsideXY

(
    const TVector< T >& In
)

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

Public function Const

bool

 

IsInsideXY

(
    const TBox< T >& Other
)

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

Public function Const

TBox< T >

 

MoveTo

(
    const TVector< T >& Destination
)

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

Public function Const

TBox< T >

 

Overlap

(
    const TBox< T >& Other
)

Returns the overlap TBox of two box

Public function

bool

 

Serialize

(
    FArchive& Ar
)

Public function

bool

 

Serialize

(
    FStructuredArchive::FSlot Slot
)

Public function

bool

 

SerializeFromMismatchedTag

(
    FName StructTag,
    FArchive& Ar
)

Public function Const

TBox< T >

 

ShiftBy

(
    const TVector< T >& Offset
)

Returns a box with its position shifted.

Public function Const

FString

 

ToString()

Get a textual representation of this box.

Public function Const

TBox< T >

 

TransformBy

(
    const TMatrix< T >& M
)

Gets a bounding volume transformed by a matrix.

Public function Const

TBox< T >

 

TransformBy

(
    const FTransform& M
)

Gets a bounding volume transformed by a FTransform object.

Public function Const

TBox< T >

 

TransformProjectBy

(
    const TMatrix< T >& ProjM
)

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

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const TBox< T >& Other
)

Compares two boxes for inequality.

Public function

TVector< T >...

 

operator[]

(
    int32 Index
)

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

Public function Const

TBox< T >

 

operator+

(
    const TVector< T >& Other
)

Gets the result of addition to this bounding volume.

Public function Const

TBox< T >

 

operator+

(
    const TBox< T >& Other
)

Gets the result of addition to this bounding volume.

Public function

TBox< T > &

 

operator+=

(
    const TBox< T >& Other
)

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

Public function

TBox< T > &

 

operator+=

(
    const TVector< T >& Other
)

Adds to this bounding box to include a given point.

TBox inline functions

Public function Const

bool

 

operator==

(
    const TBox< T >& Other
)

Compares two boxes for equality.

Typedefs

Name

Description

FReal

Deprecated Functions

Name Description

Public function

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.

Public function Const

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.