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