TBox2

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

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

Include

#include "CoreFwd.h"

Syntax

template<typename T>
struct TBox2

Variables

Name Description

Public variable

bool

 

bIsValid

Holds a flag indicating whether this box is valid.

Public variable

TVector2< T >

 

Max

Holds the box's maximum point.

Public variable

TVector2< T >

 

Min

Holds the box's minimum point.

Constructors

Name Description

Public function

TBox2()

Default constructor (no initialization).

Public function

TBox2

(
    int32
)

Use ForceInit constructor instead.

Public function

TBox2

(
    EForceInit
)

Creates and initializes a new box.

Public function

TBox2

(
    const TArray< TVector2< T >>& Poin...
)

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

Public function

TBox2

(
    const TBox2< FArg >& From
)

Conversion from other type.

Public function

TBox2

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

Creates and initializes a new box from the specified parameters.

Public function

TBox2

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

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

Functions

Name Description

Public function Const

T

 

ComputeSquaredDistanceToPoint

(
    const TVector2< T >& Point
)

Calculates the distance of a point to this box.

Public function Const

TBox2< T >

 

ExpandBy

(
    const T W
)

Increase the bounding box volume.

Public function Const

T

 

GetArea()

Gets the box area.

Public function Const

TVector2< T ...

 

GetCenter()

Gets the box's center point.

Public function Const

void

 

GetCenterAndExtents

(
    TVector2< T >& center,
    TVector2< T >& Extents
)

Get the center and extents

Public function Const

TVector2< T ...

 

GetClosestPointTo

(
    const TVector2< T >& Point
)

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

Public function Const

TVector2< T ...

 

GetExtent()

Gets the box extents around the center.

Public function Const

TVector2< T ...

 

GetSize()

Gets the box size.

Public function

void

 

Init()

Set the initial values of the bounding box to Zero.

Public function Const

bool

 

Intersect

(
    const TBox2< T >& other
)

Checks whether the given box intersects this box.

Public function Const

bool

 

IsInside

(
    const TBox2< T >& Other
)

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

Public function Const

bool

 

IsInside

(
    const TVector2< T >& TestPoint
)

Checks whether the given point is inside this box.

Public function Const

TBox2< T >

 

Overlap

(
    const TBox2< T >& Other
)

Returns the overlap box of two boxes

Public function

bool

 

Serialize

(
    FArchive& Ar
)

Public function

bool

 

SerializeFromMismatchedTag

(
    FName StructTag,
    FArchive& Ar
)

Public function Const

TBox2< T >

 

ShiftBy

(
    const TVector2< T >& Offset
)

Shift bounding box position.

Public function Const

FString

 

ToString()

Get a textual representation of this box.

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const TBox2< T >& Other
)

Compares two boxes for inequality.

Public function

TVector2< T ...

 

operator[]

(
    int32 Index
)

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

Public function Const

TBox2< T >

 

operator+

(
    const TBox2< T >& Other
)

Gets the result of addition to this bounding volume.

Public function Const

TBox2< T >

 

operator+

(
    const TVector2< T >& Other
)

Gets the result of addition to this bounding volume.

Public function

TBox2< T > &

 

operator+=

(
    const TBox2< T >& Other
)

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

Public function

TBox2< T > &

 

operator+=

(
    const TVector2< T >& Other
)

Adds to this bounding box to include a given point.

Public function Const

bool

 

operator==

(
    const TBox2< T >& Other
)

Compares two boxes for equality.

Typedefs

Name

Description

FReal

Deprecated Functions

Name Description

Public function

 

TBox2

(
    int32
)

Use ForceInit constructor instead.