UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TOrientedBox3< RealType > Struct Template Reference

#include <OrientedBoxTypes.h>

Public Member Functions

 TOrientedBox3 ()
 
 TOrientedBox3 (const TVector< RealType > &Origin, const TVector< RealType > &ExtentsIn)
 
 TOrientedBox3 (const TFrame3< RealType > &FrameIn, const TVector< RealType > &ExtentsIn)
 
 TOrientedBox3 (const TAxisAlignedBox3< RealType > &AxisBox)
 
 operator FOrientedBox () const
 
 TOrientedBox3 (const FOrientedBox &Box)
 
TVector< RealType > Center () const
 
TVector< RealType > AxisX () const
 
TVector< RealType > AxisY () const
 
TVector< RealType > AxisZ () const
 
TVector< RealType > GetAxis (int AxisIndex) const
 
TVector< RealType > Diagonal () const
 
RealType Volume () const
 
RealType SurfaceArea () const
 
bool Contains (const TVector< RealType > &Point) const
 
bool IsValid () const
 
TVector< RealType > GetCorner (int Index) const
 
template<typename PointFuncType >
void EnumerateCorners (PointFuncType CornerPointFunc) const
 
template<typename PointPredicateType >
bool TestCorners (PointPredicateType CornerPointPredicate) const
 
RealType DistanceSquared (TVector< RealType > Point) const
 
RealType SignedDistance (TVector< RealType > Point) const
 
TVector< RealType > ClosestPoint (const TVector< RealType > &Point) const
 
GEOMETRYCORE_API TOrientedBox3< RealType > Merge (const TOrientedBox3< RealType > &Other, bool bOnlyConsiderExistingAxes=false) const
 
GEOMETRYCORE_API TOrientedBox3< RealType > ReparameterizedCloserToWorldFrame () const
 
GEOMETRYCORE_API bool Intersects (const TOrientedBox3 &OtherBox, RealType ParallelAxesTolerance=TMathUtil< RealType >::ZeroTolerance) const
 
GEOMETRYCORE_API bool Intersects (const TAxisAlignedBox3< RealType > &OtherBox, RealType ParallelAxesTolerance=TMathUtil< RealType >::ZeroTolerance) const
 

Static Public Member Functions

static TOrientedBox3< RealType > UnitZeroCentered ()
 
static TOrientedBox3< RealType > UnitPositive ()
 
static FIndex3i GetCornerSide (int Index)
 

Public Attributes

TFrame3< RealType > Frame
 
TVector< RealType > Extents
 

Detailed Description

template<typename RealType>
struct UE::Geometry::TOrientedBox3< RealType >

TOrientedBox3 is a non-axis-aligned 3D box defined by a 3D frame and extents along the axes of that frame The frame is at the center of the box.

Constructor & Destructor Documentation

◆ TOrientedBox3() [1/5]

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::TOrientedBox3 ( )
inline

◆ TOrientedBox3() [2/5]

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::TOrientedBox3 ( const TVector< RealType > &  Origin,
const TVector< RealType > &  ExtentsIn 
)
inline

Create axis-aligned box with given Origin and Extents

◆ TOrientedBox3() [3/5]

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::TOrientedBox3 ( const TFrame3< RealType > &  FrameIn,
const TVector< RealType > &  ExtentsIn 
)
inline

Create oriented box with given Frame and Extents

◆ TOrientedBox3() [4/5]

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::TOrientedBox3 ( const TAxisAlignedBox3< RealType > &  AxisBox)
inline

Create oriented box from axis-aligned box

◆ TOrientedBox3() [5/5]

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::TOrientedBox3 ( const FOrientedBox Box)
inline

Member Function Documentation

◆ AxisX()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::AxisX ( ) const
inline
Returns
X axis of the box

◆ AxisY()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::AxisY ( ) const
inline
Returns
Y axis of the box

◆ AxisZ()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::AxisZ ( ) const
inline
Returns
Z axis of the box

◆ Center()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::Center ( ) const
inline
Returns
center of the box

◆ ClosestPoint()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::ClosestPoint ( const TVector< RealType > &  Point) const
inline

Find closest point on box

Parameters
Pointinput point
Returns
Closest point on box. Input point is returned if it is inside box.

◆ Contains()

template<typename RealType >
bool UE::Geometry::TOrientedBox3< RealType >::Contains ( const TVector< RealType > &  Point) const
inline
Returns
true if box contains point

◆ Diagonal()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::Diagonal ( ) const
inline
Returns
vector from minimum-corner to maximum-corner of box

◆ DistanceSquared()

template<typename RealType >
RealType UE::Geometry::TOrientedBox3< RealType >::DistanceSquared ( TVector< RealType >  Point) const
inline

Find squared distance to box.

Parameters
Pointinput point
Returns
Squared distance from point to box, or 0 if point is inside box

◆ EnumerateCorners()

template<typename RealType >
template<typename PointFuncType >
void UE::Geometry::TOrientedBox3< RealType >::EnumerateCorners ( PointFuncType  CornerPointFunc) const
inline

Call CornerPointFunc(FVector3) for each of the 8 box corners. Order is the same as GetCorner(X). This is more efficient than calling GetCorner(X) because the Rotation matrix is only computed once.

◆ GetAxis()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::GetAxis ( int  AxisIndex) const
inline
Returns
an axis of the box

◆ GetCorner()

template<typename RealType >
TVector< RealType > UE::Geometry::TOrientedBox3< RealType >::GetCorner ( int  Index) const
inline
Parameters
Indexcorner index in range 0-7
Returns
Corner point on the box identified by the given index. See diagram in OrientedBoxTypes.h for index/corner mapping.

◆ GetCornerSide()

template<typename RealType >
static FIndex3i UE::Geometry::TOrientedBox3< RealType >::GetCornerSide ( int  Index)
inlinestatic

Get whether the corner at Index (see diagram in GetCorner documentation comment) is in the negative or positive direction for each axis

Parameters
Indexcorner index in range 0-7
Returns
Index3i with 0 or 1 for each axis, 0 if corner is in the negative direction for that axis, 1 if in the positive direction

◆ Intersects() [1/2]

template<typename RealType >
bool UE::Geometry::TOrientedBox3< RealType >::Intersects ( const TAxisAlignedBox3< RealType > &  OtherBox,
RealType  ParallelAxesTolerance = TMathUtil<RealType>::ZeroTolerance 
) const
Parameters
OtherBoxAn axis-aligned box to test for intersection against this box
ParallelAxesToleranceTolerance for handling the special case where the box axes are nearly parallel
Returns
Whether the boxes overlap

◆ Intersects() [2/2]

template<typename RealType >
bool UE::Geometry::TOrientedBox3< RealType >::Intersects ( const TOrientedBox3< RealType > &  OtherBox,
RealType  ParallelAxesTolerance = TMathUtil<RealType>::ZeroTolerance 
) const
Parameters
OtherBoxAn oriented box to test for intersection against this box
ParallelAxesToleranceTolerance for handling the special case where the box axes are nearly parallel
Returns
Whether the boxes overlap

◆ IsValid()

template<typename RealType >
bool UE::Geometry::TOrientedBox3< RealType >::IsValid ( ) const
inline
Returns
true if box is valid (has non-negative extents)

◆ Merge()

template<typename RealType >
TOrientedBox3< RealType > UE::Geometry::TOrientedBox3< RealType >::Merge ( const TOrientedBox3< RealType > &  Other,
bool  bOnlyConsiderExistingAxes = false 
) const

◆ operator FOrientedBox()

template<typename RealType >
UE::Geometry::TOrientedBox3< RealType >::operator FOrientedBox ( ) const
inlineexplicit

◆ ReparameterizedCloserToWorldFrame()

template<typename RealType >
TOrientedBox3< RealType > UE::Geometry::TOrientedBox3< RealType >::ReparameterizedCloserToWorldFrame ( ) const

Transform the frame of the oriented box so its local axes are closer to the corresponding world axes (Does not change the shape of the box, just re-orders the axes if needed)

◆ SignedDistance()

template<typename RealType >
RealType UE::Geometry::TOrientedBox3< RealType >::SignedDistance ( TVector< RealType >  Point) const
inline

Find signed distance to box surface

Parameters
Pointinput point
Returns
Signed distance from point to box surface; negative if point is inside box

◆ SurfaceArea()

template<typename RealType >
RealType UE::Geometry::TOrientedBox3< RealType >::SurfaceArea ( ) const
inline
Returns
surface area of box

◆ TestCorners()

template<typename RealType >
bool UE::Geometry::TOrientedBox3< RealType >::TestCorners ( PointPredicateType  CornerPointPredicate) const
inline

Call CornerPointPredicate(FVector3) for each of the 8 box corners, with early-out if any call returns false

Returns
true if all tests pass

◆ UnitPositive()

template<typename RealType >
static TOrientedBox3< RealType > UE::Geometry::TOrientedBox3< RealType >::UnitPositive ( )
inlinestatic
Returns
box with unit dimensions where minimum corner is at origin

◆ UnitZeroCentered()

template<typename RealType >
static TOrientedBox3< RealType > UE::Geometry::TOrientedBox3< RealType >::UnitZeroCentered ( )
inlinestatic
Returns
box with unit dimensions centered at origin

◆ Volume()

template<typename RealType >
RealType UE::Geometry::TOrientedBox3< RealType >::Volume ( ) const
inline
Returns
volume of box

Member Data Documentation

◆ Extents

template<typename RealType >
TVector<RealType> UE::Geometry::TOrientedBox3< RealType >::Extents

Half-dimensions of box measured along the three axes

◆ Frame

template<typename RealType >
TFrame3<RealType> UE::Geometry::TOrientedBox3< RealType >::Frame

3D position (center) and orientation (axes) of the box


The documentation for this struct was generated from the following files: