engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | 友元 | 所有成员列表
FBox2D结构体 参考

Implements a rectangular 2D Box. 更多...

#include <Box2D.h>

Public 成员函数

FORCEINLINE float ComputeSquaredDistanceToPoint (const FVector2D &Point) const
 Calculates the distance of a point to this box. 更多...
 
FBox2D ExpandBy (const float W) const
 Increase the bounding box volume. 更多...
 
 FBox2D ()
 Default constructor (no initialization).
 
 FBox2D (const FVector2D &InMin, const FVector2D &InMax)
 Creates and initializes a new box from the specified parameters. 更多...
 
CORE_API FBox2D (const FVector2D *Points, const int32 Count)
 Creates and initializes a new box from the given set of points. 更多...
 
CORE_API FBox2D (const TArray< FVector2D > &Points)
 Creates and initializes a new box from an array of points. 更多...
 
 FBox2D (EForceInit)
 Creates and initializes a new box. 更多...
 
 FBox2D (int32)
 Creates and initializes a new box. 更多...
 
float GetArea () const
 Gets the box area. 更多...
 
FVector2D GetCenter () const
 Gets the box's center point. 更多...
 
void GetCenterAndExtents (FVector2D &center, FVector2D &Extents) const
 Get the center and extents 更多...
 
FORCEINLINE FVector2D GetClosestPointTo (const FVector2D &Point) const
 Calculates the closest point on or inside the box to a given point in space. 更多...
 
FVector2D GetExtent () const
 Gets the box extents around the center. 更多...
 
FVector2D GetSize () const
 Gets the box size. 更多...
 
void Init ()
 Set the initial values of the bounding box to Zero.
 
FORCEINLINE bool Intersect (const FBox2D &other) const
 Checks whether the given box intersects this box. 更多...
 
bool IsInside (const FBox2D &Other) const
 Checks whether the given box is fully encapsulated by this box. 更多...
 
bool IsInside (const FVector2D &TestPoint) const
 Checks whether the given point is inside this box. 更多...
 
bool operator!= (const FBox2D &Other) const
 Compares two boxes for inequality. 更多...
 
FBox2D operator+ (const FBox2D &Other) const
 Gets the result of addition to this bounding volume. 更多...
 
FBox2D operator+ (const FVector2D &Other) const
 Gets the result of addition to this bounding volume. 更多...
 
FORCEINLINE FBox2D & operator+= (const FBox2D &Other)
 Adds to this bounding box to include a new bounding volume. 更多...
 
FORCEINLINE FBox2D & operator+= (const FVector2D &Other)
 Adds to this bounding box to include a given point. 更多...
 
bool operator== (const FBox2D &Other) const
 Compares two boxes for equality. 更多...
 
FVector2D & operator[] (int32 Index)
 Gets reference to the min or max of this bounding volume. 更多...
 
FBox2D ShiftBy (const FVector2D &Offset) const
 Shift bounding box position. 更多...
 
FString ToString () const
 Get a textual representation of this box. 更多...
 

Public 属性

bool bIsValid
 Holds a flag indicating whether this box is valid.
 
FVector2D Max
 Holds the box's maximum point.
 
FVector2D Min
 Holds the box's minimum point.
 

友元

FArchive & operator<< (FArchive &Ar, FBox2D &Box)
 Serializes the bounding box. 更多...
 

详细描述

Implements a rectangular 2D Box.

构造及析构函数说明

◆ FBox2D() [1/5]

FBox2D::FBox2D ( int32  )
inline

Creates and initializes a new box.

The box extents are initialized to zero and the box is marked as invalid.

◆ FBox2D() [2/5]

FBox2D::FBox2D ( EForceInit  )
inlineexplicit

Creates and initializes a new box.

The box extents are initialized to zero and the box is marked as invalid.

参数
EForceInitForce Init Enum.

◆ FBox2D() [3/5]

FBox2D::FBox2D ( const FVector2D &  InMin,
const FVector2D &  InMax 
)
inline

Creates and initializes a new box from the specified parameters.

参数
InMinThe box's minimum point.
InMaxThe box's maximum point.

◆ FBox2D() [4/5]

CORE_API FBox2D::FBox2D ( const FVector2D *  Points,
const int32  Count 
)

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

参数
PointsArray of Points to create for the bounding volume.
CountThe number of points.

◆ FBox2D() [5/5]

CORE_API FBox2D::FBox2D ( const TArray< FVector2D > &  Points)

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

参数
PointsArray of Points to create for the bounding volume.

成员函数说明

◆ ComputeSquaredDistanceToPoint()

FORCEINLINE float FBox2D::ComputeSquaredDistanceToPoint ( const FVector2D &  Point) const
inline

Calculates the distance of a point to this box.

参数
PointThe point.
返回
The distance.

◆ ExpandBy()

FBox2D FBox2D::ExpandBy ( const float  W) const
inline

Increase the bounding box volume.

参数
WThe size to increase volume by.
返回
A new bounding box increased in size.

◆ GetArea()

float FBox2D::GetArea ( ) const
inline

Gets the box area.

返回
Box area.
参见
GetCenter, GetCenterAndExtents, GetExtent, GetSize

◆ GetCenter()

FVector2D FBox2D::GetCenter ( ) const
inline

Gets the box's center point.

返回
Th center point.
参见
GetArea, GetCenterAndExtents, GetExtent, GetSize

◆ GetCenterAndExtents()

void FBox2D::GetCenterAndExtents ( FVector2D &  center,
FVector2D &  Extents 
) const
inline

Get the center and extents

参数
center[out]reference to center point
Extents[out]reference to the extent around the center
参见
GetArea, GetCenter, GetExtent, GetSize

◆ GetClosestPointTo()

FORCEINLINE FVector2D FBox2D::GetClosestPointTo ( const FVector2D &  Point) const

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

参数
PointThe point in space.
返回
The closest point on or inside the box.

◆ GetExtent()

FVector2D FBox2D::GetExtent ( ) const
inline

Gets the box extents around the center.

返回
Box extents.
参见
GetArea, GetCenter, GetCenterAndExtents, GetSize

◆ GetSize()

FVector2D FBox2D::GetSize ( ) const
inline

Gets the box size.

返回
Box size.
参见
GetArea, GetCenter, GetCenterAndExtents, GetExtent

◆ Intersect()

FORCEINLINE bool FBox2D::Intersect ( const FBox2D &  other) const

Checks whether the given box intersects this box.

参数
otherbounding box to test intersection
返回
true if boxes intersect, false otherwise.

◆ IsInside() [1/2]

bool FBox2D::IsInside ( const FBox2D &  Other) const
inline

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

参数
OtherThe box to test for encapsulation within the bounding volume.
返回
true if box is inside this volume, false otherwise.

◆ IsInside() [2/2]

bool FBox2D::IsInside ( const FVector2D &  TestPoint) const
inline

Checks whether the given point is inside this box.

参数
PointThe point to test.
返回
true if the point is inside this box, otherwise false.

◆ operator!=()

bool FBox2D::operator!= ( const FBox2D &  Other) const
inline

Compares two boxes for inequality.

参数
OtherThe other box to compare with.
返回
true if the boxes are not equal, false otherwise.

◆ operator+() [1/2]

FBox2D FBox2D::operator+ ( const FBox2D &  Other) const
inline

Gets the result of addition to this bounding volume.

参数
OtherThe other volume to add to this.
返回
A new bounding volume.

◆ operator+() [2/2]

FBox2D FBox2D::operator+ ( const FVector2D &  Other) const
inline

Gets the result of addition to this bounding volume.

参数
OtherThe other point to add to this.
返回
A new bounding volume.

◆ operator+=() [1/2]

FORCEINLINE FBox2D & FBox2D::operator+= ( const FBox2D &  Other)

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

参数
OtherThe bounding volume to increase the bounding volume to.
返回
Reference to this bounding volume after resizing to include the other bounding volume.

◆ operator+=() [2/2]

FORCEINLINE FBox2D & FBox2D::operator+= ( const FVector2D &  Other)

Adds to this bounding box to include a given point.

参数
OtherThe point to increase the bounding volume to.
返回
Reference to this bounding box after resizing to include the other point.

◆ operator==()

bool FBox2D::operator== ( const FBox2D &  Other) const
inline

Compares two boxes for equality.

参数
OtherThe other box to compare with.
返回
true if the boxes are equal, false otherwise.

◆ operator[]()

FVector2D & FBox2D::operator[] ( int32  Index)
inline

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

参数
IndexThe index into points of the bounding volume.
返回
A reference to a point of the bounding volume.

◆ ShiftBy()

FBox2D FBox2D::ShiftBy ( const FVector2D &  Offset) const
inline

Shift bounding box position.

参数
Theoffset vector to shift by.
返回
A new shifted bounding box.

◆ ToString()

FORCEINLINE FString FBox2D::ToString ( ) const

Get a textual representation of this box.

返回
A string describing the box.

友元及相关函数文档

◆ operator<<

FArchive & operator<< ( FArchive &  Ar,
FBox2D &  Box 
)
friend

Serializes the bounding box.

参数
ArThe archive to serialize into.
BoxThe box to serialize.
返回
Reference to the Archive after serialization.

该结构体的文档由以下文件生成: