Navigation
API > API/Runtime > API/Runtime/Core
| Name | TBox2 |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Math/Box2D.h |
| Include Path | #include "Math/Box2D.h" |
| Source | /Engine/Source/Runtime/Core/Public/Math/MathFwd.h |
Syntax
template<typename T>
struct TBox2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Creates and initializes a new box from the specified parameters. | Math/Box2D.h | ||
TBox2 () |
Default constructor (no initialization). | Math/Box2D.h | |
TBox2
(
EForceInit |
Creates and initializes a new box. | Math/Box2D.h | |
| Creates and initializes a new box from an array of points. | Math/Box2D.h | ||
| Conversion from other type. | Math/Box2D.h | ||
| Creates and initializes a new box from the given set of points. | Math/Box2D.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FReal | T | Math/Box2D.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsValid | bool | Holds a flag indicating whether this box is valid. | Math/Box2D.h | |
| Max | TVector2< T > | Holds the box's maximum point. | Math/Box2D.h | |
| Min | TVector2< T > | Holds the box's minimum point. | Math/Box2D.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T ComputeSquaredDistanceToPoint
(
const TVector2< T >& Point |
Calculates the distance of a point to this box. | Math/Box2D.h | |
bool Equals
(
const TBox2< T >& Other, |
Checks for equality with error-tolerant comparison. | Math/Box2D.h | |
| Returns a box of increased size. | Math/Box2D.h | ||
| Increase the bounding box volume. | Math/Box2D.h | ||
T GetArea () |
Gets the box area. | Math/Box2D.h | |
| Gets the box's center point. | Math/Box2D.h | ||
void GetCenterAndExtents
(
TVector2< T >& center, |
Get the center and extents | Math/Box2D.h | |
| Calculates the closest point on or inside the box to a given point in space. | Math/Box2D.h | ||
| Gets the box extents around the center. | Math/Box2D.h | ||
| Gets the box size. | Math/Box2D.h | ||
void Init() |
Set the initial values of the bounding box to Zero. | Math/Box2D.h | |
bool Intersect
(
const TBox2< T >& other |
Checks whether the given box intersects this box. | Math/Box2D.h | |
| Checks whether the given box is fully encapsulated by this box. | Math/Box2D.h | ||
| Checks whether the given point is inside this box. | Math/Box2D.h | ||
bool IsInsideOrOn
(
const TVector2< T >& TestPoint |
Checks whether the given point is inside or on this box. | Math/Box2D.h | |
| Returns a box with its center moved to the new destination. | Math/Box2D.h | ||
| Returns the overlap box of two boxes | Math/Box2D.h | ||
bool Serialize
(
FArchive& Ar |
Note: TBox2 is usually written via binary serialization. This function exists for SerializeFromMismatchedTag conversion usage. | Math/Box2D.h | |
| Math/Box2D.h | |||
| Shift bounding box position. | Math/Box2D.h | ||
FString ToString() |
Get a textual representation of this box. | Math/Box2D.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Utility function to build an AABB from Origin and Extent | Math/Box2D.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TBox2< T >& Other |
Compares two boxes for inequality. | Math/Box2D.h | |
const TVector2< T > & operator[]
(
int32 Index |
Gets reference to the min or max of this bounding volume. | Math/Box2D.h | |
TVector2< T > & operator[]
(
int32 Index |
Gets reference to the min or max of this bounding volume. | Math/Box2D.h | |
| Gets the result of addition to this bounding volume. | Math/Box2D.h | ||
| Gets the result of addition to this bounding volume. | Math/Box2D.h | ||
TBox2< T > & operator+=
(
const TVector2< T >& Other |
Adds to this bounding box to include a given point. | Math/Box2D.h | |
TBox2< T > & operator+=
(
const TBox2< T >& Other |
Adds to this bounding box to include a new bounding volume. | Math/Box2D.h | |
bool operator==
(
const TBox2< T >& Other |
Compares two boxes for equality. | Math/Box2D.h |