UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TMeshAABBTree3< TriangleMeshType > Class Template Reference

#include <MeshAABBTree3.h>

+ Inheritance diagram for UE::Geometry::TMeshAABBTree3< TriangleMeshType >:

Classes

struct  FBoxesSet
 
class  FTreeTraversal
 

Public Types

using MeshType = TriangleMeshType
 
using GetSplitAxisFunc = TUniqueFunction< int(int Depth, const FAxisAlignedBox3d &Box)>
 

Public Member Functions

 TMeshAABBTree3 ()
 
 TMeshAABBTree3 (const TriangleMeshType *SourceMesh, bool bAutoBuild=true)
 
void SetMesh (const TriangleMeshType *SourceMesh, bool bAutoBuild=true)
 
const TriangleMeshTypeGetMesh () const
 
bool IsValid (bool bAllowUnsafeModifiedMeshQueries) const
 
void SetBuildOptions (int32 MaxBoxTriCount, GetSplitAxisFunc &&GetSplitAxisIn=MakeDefaultSplitAxisFunc())
 
void Build ()
 
void Build (const TArray< int32 > &TriangleList)
 
virtual bool SupportsNearestTriangle () const override
 
virtual int FindNearestTriangle (const FVector3d &P, double &NearestDistSqr, const FQueryOptions &Options=FQueryOptions()) const override
 
FAxisAlignedBox3d GetBoundingBox () const
 
virtual FVector3d FindNearestPoint (const FVector3d &Point, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool IsWithinDistanceSquared (const FVector3d &Point, double ThresholdDistanceSqr, int &OutTriangleID, const FQueryOptions &Options=FQueryOptions()) const
 
virtual int FindNearestVertex (const FVector3d &P, double &NearestDistSqr, double MaxDist=TNumericLimits< double >::Max(), const FQueryOptions &Options=FQueryOptions())
 
virtual bool SupportsTriangleRayIntersection () const override
 
virtual int FindNearestHitTriangle (const FRay3d &Ray, const FQueryOptions &Options=FQueryOptions()) const override
 
virtual bool FindNearestHitTriangle (const FRay3d &Ray, double &NearestT, int &TID, const FQueryOptions &Options=FQueryOptions()) const override
 
virtual bool FindNearestHitTriangle (const FRay3d &Ray, double &NearestT, int &TID, FVector3d &BaryCoords, const FQueryOptions &Options=FQueryOptions()) const override
 
bool FindNearestHitTriangle (const FWatertightRay3d &Ray, double &NearestT, int &TID, FVector3d &BaryCoords, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool FindAllHitTriangles (const FRay3d &Ray, TArray< MeshIntersection::FHitIntersectionResult > &OutHits, const FQueryOptions &Options=FQueryOptions()) const override
 
bool FindAllHitTriangles (const FWatertightRay3d &Ray, TArray< MeshIntersection::FHitIntersectionResult > &OutHits, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool TestAnyHitTriangle (const FRay3d &Ray, const FQueryOptions &Options=FQueryOptions()) const
 
virtual FIndex2i FindNearestTriangles (TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF, double &Distance, const FQueryOptions &Options=FQueryOptions(), const FQueryOptions &OtherTreeOptions=FQueryOptions())
 
virtual bool SupportsPointContainment () const override
 
virtual bool IsInside (const FVector3d &P) const override
 
virtual void DoTraversal (FTreeTraversal &Traversal, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool TestIntersection (const TriangleMeshType *TestMesh, FAxisAlignedBox3d TestMeshBounds=FAxisAlignedBox3d::Empty(), const TFunction< FVector3d(const FVector3d &)> &TransformF=nullptr, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool TestIntersection (const TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF=nullptr, const FQueryOptions &Options=FQueryOptions(), const FQueryOptions &OtherTreeOptions=FQueryOptions()) const
 
virtual bool TestIntersection (const FTriangle3d &Triangle, const FQueryOptions &Options=FQueryOptions()) const
 
virtual MeshIntersection::FIntersectionsQueryResult FindAllIntersections (const TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF=nullptr, const FQueryOptions &Options=FQueryOptions(), const FQueryOptions &OtherTreeOptions=FQueryOptions(), TFunction< bool(FIntrTriangle3Triangle3d &)> IntersectionFn=nullptr) const
 
virtual MeshIntersection::FIntersectionsQueryResult FindAllSelfIntersections (bool bIgnoreTopoConnected=true, const FQueryOptions &Options=FQueryOptions(), TFunction< bool(FIntrTriangle3Triangle3d &)> IntersectionFn=nullptr) const
 
virtual bool TestSelfIntersection (bool bIgnoreTopoConnected=true, const FQueryOptions &Options=FQueryOptions()) const
 
void SetTolerance (double Tolerance)
 
double BoxDistanceSqr (int IBox, const FVector3d &V) const
 
bool box_contains (int IBox, const FVector3d &P) const
 
template<typename RayType >
double box_ray_intersect_t (int IBox, const RayType &Ray) const
 
bool box_box_intersect (int IBox, const FAxisAlignedBox3d &TestBox) const
 
SIZE_T GetByteCount () const
 
void BuildTopDown (bool bSorted)
 
template<typename TriIndexEnumerable >
void BuildTopDown (bool bSorted, TriIndexEnumerable TriangleList, int32 NumTriangles)
 
void BuildTopDown (TArray< int > &Triangles, TArray< FVector3d > &Centers, int32 NumTriangles)
 
int SplitTriSetMidpoint (TArray< int > &Triangles, TArray< FVector3d > &Centers, int IStart, int ICount, int Depth, int MinTriCount, FBoxesSet &Tris, FBoxesSet &Nodes, FAxisAlignedBox3d &Box)
 
void find_nearest_triangles (int iBox, TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF, int oBox, int depth, double &nearest_sqr, FIndex2i &nearest_pair, const FQueryOptions &Options, const FQueryOptions &OtherTreeOptions) const
 
double box_box_distsqr (int iBox, const FAxisAlignedBox3d &testBox) const
 
int find_any_intersection (int iBox, const FTriangle3d &Triangle, const FAxisAlignedBox3d &triBounds, TFunctionRef< bool(const FTriangle3d &A, const FTriangle3d &B)> TriangleIntersectionTest, const FQueryOptions &Options) const
 
bool find_any_intersection (int iBox, const TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF, int oBox, int depth, TFunctionRef< bool(const FTriangle3d &A, const FTriangle3d &B)> TriangleIntersectionTest, const FQueryOptions &Options, const FQueryOptions &OtherTreeOptions) const
 
bool find_self_intersections_acrossboxes (int Box1, int Box2, MeshIntersection::FIntersectionsQueryResult *Result, bool bIgnoreTopoConnected, int depth, TFunctionRef< bool(FIntrTriangle3Triangle3d &)> IntersectFn, const FQueryOptions &Options) const
 
bool find_tri_tri_intersections (int TID_A, int IdxRangeStart, int IdxRangeEnd, MeshIntersection::FIntersectionsQueryResult *Result, bool bIgnoreTopoConnected, TFunctionRef< bool(FIntrTriangle3Triangle3d &)> IntersectFn, const FQueryOptions &Options) const
 
bool find_self_intersections (MeshIntersection::FIntersectionsQueryResult *Result, bool bIgnoreTopoConnected, TFunctionRef< bool(FIntrTriangle3Triangle3d &)> IntersectFn, const FQueryOptions &Options) const
 
void find_intersections (int iBox, const TMeshAABBTree3 &OtherTree, const TFunction< FVector3d(const FVector3d &)> &TransformF, int oBox, int depth, MeshIntersection::FIntersectionsQueryResult &result, TFunctionRef< bool(FIntrTriangle3Triangle3d &)> IntersectFn, const FQueryOptions &Options, const FQueryOptions &OtherTreeOptions) const
 
void TestCoverage ()
 
double TotalVolume ()
 
- Public Member Functions inherited from UE::Geometry::IMeshSpatial
virtual ~IMeshSpatial ()=default
 
- Public Member Functions inherited from UE::Geometry::ISpatial
virtual ~ISpatial ()=default
 

Static Public Member Functions

static bool TriangleIntersectionFilter (const FTriangle3d &A, const FTriangle3d &B)
 
static bool TriangleIntersection (FIntrTriangle3Triangle3d &Intr)
 
static void AddTriTriIntersectionResult (const FIntrTriangle3Triangle3d &Intr, int TID_A, int TID_B, MeshIntersection::FIntersectionsQueryResult &Result)
 

Public Attributes

TDynamicVector< int > BoxToIndex
 
TDynamicVector< FVector3dBoxCenters
 
TDynamicVector< FVector3dBoxExtents
 
TDynamicVector< int > IndexList
 
int TrianglesEnd = -1
 
int RootIndex = -1
 

Static Public Attributes

static constexpr double DOUBLE_MAX = TNumericLimits<double>::Max()
 

Protected Member Functions

template<bool bEarlyStop = false>
bool find_nearest_tri (int IBox, const FVector3d &P, double &NearestDistSqr, int &TID, const FQueryOptions &Options) const
 
void find_nearest_vertex (int IBox, const FVector3d &P, double &NearestDistSqr, int &NearestVertexID, const FQueryOptions &Options)
 
template<typename RayType = FRay3d>
void FindHitTriangle (int IBox, const RayType &Ray, double &NearestT, int &TID, FVector3d &BaryCoords, const FQueryOptions &Options=FQueryOptions()) const
 
template<typename RayType = FRay3d>
void FindHitTriangles (int IBox, const RayType &Ray, TArray< MeshIntersection::FHitIntersectionResult > &Intersections, const FQueryOptions &Options=FQueryOptions()) const
 
bool TestAnyHitTriangle (int IBox, const FRay3d &Ray, int32 &HitTIDOut, double MaxDistance, const FQueryOptions &Options=FQueryOptions()) const
 
virtual void TreeTraversalImpl (int IBox, int Depth, FTreeTraversal &Traversal, const FQueryOptions &Options) const
 
FAxisAlignedBox3d GetBox (int IBox) const
 
FAxisAlignedBox3d GetBox (int iBox, const TFunction< FVector3d(const FVector3d &)> &TransformF) const
 
FAxisAlignedBox3d GetBoxEps (int IBox, double Epsilon=FMathd::ZeroTolerance) const
 

Static Protected Member Functions

static GetSplitAxisFunc MakeDefaultSplitAxisFunc ()
 

Protected Attributes

const TriangleMeshTypeMesh
 
uint64 MeshChangeStamp = 0
 
int TopDownLeafMaxTriCount = 3
 
GetSplitAxisFunc GetSplitAxis = MakeDefaultSplitAxisFunc()
 
double BoxEps = FMathd::ZeroTolerance
 

Friends

class TFastWindingTree< TriangleMeshType >
 

Member Typedef Documentation

◆ GetSplitAxisFunc

template<class TriangleMeshType >
using UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetSplitAxisFunc = TUniqueFunction<int(int Depth, const FAxisAlignedBox3d& Box)>

◆ MeshType

Constructor & Destructor Documentation

◆ TMeshAABBTree3() [1/2]

template<class TriangleMeshType >
UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TMeshAABBTree3 ( )
inline

◆ TMeshAABBTree3() [2/2]

template<class TriangleMeshType >
UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TMeshAABBTree3 ( const TriangleMeshType SourceMesh,
bool  bAutoBuild = true 
)
inline

Member Function Documentation

◆ AddTriTriIntersectionResult()

template<class TriangleMeshType >
static void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::AddTriTriIntersectionResult ( const FIntrTriangle3Triangle3d Intr,
int  TID_A,
int  TID_B,
MeshIntersection::FIntersectionsQueryResult Result 
)
inlinestatic

Helper to add a triangle-triangle intersection result from to a intersection result struct

◆ box_box_distsqr()

template<class TriangleMeshType >
double UE::Geometry::TMeshAABBTree3< TriangleMeshType >::box_box_distsqr ( int  iBox,
const FAxisAlignedBox3d testBox 
) const
inline

◆ box_box_intersect()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::box_box_intersect ( int  IBox,
const FAxisAlignedBox3d TestBox 
) const
inline

◆ box_contains()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::box_contains ( int  IBox,
const FVector3d P 
) const
inline

◆ box_ray_intersect_t()

template<class TriangleMeshType >
template<typename RayType >
double UE::Geometry::TMeshAABBTree3< TriangleMeshType >::box_ray_intersect_t ( int  IBox,
const RayType Ray 
) const
inline

◆ BoxDistanceSqr()

template<class TriangleMeshType >
double UE::Geometry::TMeshAABBTree3< TriangleMeshType >::BoxDistanceSqr ( int  IBox,
const FVector3d V 
) const
inline

◆ Build() [1/2]

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::Build ( )
inline

◆ Build() [2/2]

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::Build ( const TArray< int32 > &  TriangleList)
inline

◆ BuildTopDown() [1/3]

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::BuildTopDown ( bool  bSorted)
inline

◆ BuildTopDown() [2/3]

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::BuildTopDown ( bool  bSorted,
TriIndexEnumerable  TriangleList,
int32  NumTriangles 
)
inline

◆ BuildTopDown() [3/3]

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::BuildTopDown ( TArray< int > &  Triangles,
TArray< FVector3d > &  Centers,
int32  NumTriangles 
)
inline

◆ DoTraversal()

template<class TriangleMeshType >
virtual void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::DoTraversal ( FTreeTraversal Traversal,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

Hierarchically descend through the tree Nodes, calling the FTreeTraversal functions at each level

◆ find_any_intersection() [1/2]

template<class TriangleMeshType >
int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_any_intersection ( int  iBox,
const FTriangle3d Triangle,
const FAxisAlignedBox3d triBounds,
TFunctionRef< bool(const FTriangle3d &A, const FTriangle3d &B)>  TriangleIntersectionTest,
const FQueryOptions Options 
) const
inline

◆ find_any_intersection() [2/2]

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_any_intersection ( int  iBox,
const TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF,
int  oBox,
int  depth,
TFunctionRef< bool(const FTriangle3d &A, const FTriangle3d &B)>  TriangleIntersectionTest,
const FQueryOptions Options,
const FQueryOptions OtherTreeOptions 
) const
inline

◆ find_intersections()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_intersections ( int  iBox,
const TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF,
int  oBox,
int  depth,
MeshIntersection::FIntersectionsQueryResult result,
TFunctionRef< bool(FIntrTriangle3Triangle3d &)>  IntersectFn,
const FQueryOptions Options,
const FQueryOptions OtherTreeOptions 
) const
inline

◆ find_nearest_tri()

template<class TriangleMeshType >
template<bool bEarlyStop = false>
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_nearest_tri ( int  IBox,
const FVector3d P,
double NearestDistSqr,
int &  TID,
const FQueryOptions Options 
) const
inlineprotected

◆ find_nearest_triangles()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_nearest_triangles ( int  iBox,
TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF,
int  oBox,
int  depth,
double nearest_sqr,
FIndex2i nearest_pair,
const FQueryOptions Options,
const FQueryOptions OtherTreeOptions 
) const
inline

◆ find_nearest_vertex()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_nearest_vertex ( int  IBox,
const FVector3d P,
double NearestDistSqr,
int &  NearestVertexID,
const FQueryOptions Options 
)
inlineprotected

◆ find_self_intersections()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_self_intersections ( MeshIntersection::FIntersectionsQueryResult Result,
bool  bIgnoreTopoConnected,
TFunctionRef< bool(FIntrTriangle3Triangle3d &)>  IntersectFn,
const FQueryOptions Options 
) const
inline

◆ find_self_intersections_acrossboxes()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_self_intersections_acrossboxes ( int  Box1,
int  Box2,
MeshIntersection::FIntersectionsQueryResult Result,
bool  bIgnoreTopoConnected,
int  depth,
TFunctionRef< bool(FIntrTriangle3Triangle3d &)>  IntersectFn,
const FQueryOptions Options 
) const
inline

◆ find_tri_tri_intersections()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::find_tri_tri_intersections ( int  TID_A,
int  IdxRangeStart,
int  IdxRangeEnd,
MeshIntersection::FIntersectionsQueryResult Result,
bool  bIgnoreTopoConnected,
TFunctionRef< bool(FIntrTriangle3Triangle3d &)>  IntersectFn,
const FQueryOptions Options 
) const
inline

◆ FindAllHitTriangles() [1/2]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindAllHitTriangles ( const FRay3d Ray,
TArray< MeshIntersection::FHitIntersectionResult > &  OutHits,
const FQueryOptions Options = FQueryOptions() 
) const
inlineoverridevirtual

Find all triangles intersected by the given ray sorted by distance

Parameters
Rayquery ray
OutHitsreturned-by-reference hit infos sorted by distance
OptionsQuery options (ex. max distance)
Returns
true if hit, false if no hit found

Implements UE::Geometry::IMeshSpatial.

◆ FindAllHitTriangles() [2/2]

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindAllHitTriangles ( const FWatertightRay3d Ray,
TArray< MeshIntersection::FHitIntersectionResult > &  OutHits,
const FQueryOptions Options = FQueryOptions() 
) const
inline

◆ FindAllIntersections()

template<class TriangleMeshType >
virtual MeshIntersection::FIntersectionsQueryResult UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindAllIntersections ( const TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF = nullptr,
const FQueryOptions Options = FQueryOptions(),
const FQueryOptions OtherTreeOptions = FQueryOptions(),
TFunction< bool(FIntrTriangle3Triangle3d &)>  IntersectionFn = nullptr 
) const
inlinevirtual

Compute all intersections between two meshes. TransformF argument transforms vertices of OtherTree to our tree (can be null if in same coord space) Returns pairs of intersecting triangles, which could intersect in either point or segment Currently does not return coplanar intersections.

◆ FindAllSelfIntersections()

template<class TriangleMeshType >
virtual MeshIntersection::FIntersectionsQueryResult UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindAllSelfIntersections ( bool  bIgnoreTopoConnected = true,
const FQueryOptions Options = FQueryOptions(),
TFunction< bool(FIntrTriangle3Triangle3d &)>  IntersectionFn = nullptr 
) const
inlinevirtual

Compute self intersections on our mesh. Returns pairs of intersecting triangles, which could intersect in either point or segment Currently does not return coplanar intersections.

Parameters
bIgnoreTopoConnectedIgnore intersections between triangles that share a vertex (if false a lot of triangles that simply share an edge will be counted as self intersecting)

◆ FindHitTriangle()

template<class TriangleMeshType >
template<typename RayType = FRay3d>
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindHitTriangle ( int  IBox,
const RayType Ray,
double NearestT,
int &  TID,
FVector3d BaryCoords,
const FQueryOptions Options = FQueryOptions() 
) const
inlineprotected

◆ FindHitTriangles()

template<class TriangleMeshType >
template<typename RayType = FRay3d>
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindHitTriangles ( int  IBox,
const RayType Ray,
TArray< MeshIntersection::FHitIntersectionResult > &  Intersections,
const FQueryOptions Options = FQueryOptions() 
) const
inlineprotected

◆ FindNearestHitTriangle() [1/4]

template<class TriangleMeshType >
virtual int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestHitTriangle ( const FRay3d Ray,
const FQueryOptions Options = FQueryOptions() 
) const
inlineoverridevirtual
Parameters
Rayquery ray
OptionsQuery options (ex. max distance)
Returns
ID of triangle intersected by ray within MaxDistance, or InvalidID if not found

Reimplemented from UE::Geometry::IMeshSpatial.

◆ FindNearestHitTriangle() [2/4]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestHitTriangle ( const FRay3d Ray,
double NearestT,
int &  TID,
const FQueryOptions Options = FQueryOptions() 
) const
inlineoverridevirtual

Find nearest triangle from the given ray

Parameters
Rayquery ray
NearestTreturned-by-reference parameter of the nearest hit
TIDreturned-by-reference ID of triangle intersected by ray within MaxDistance, or InvalidID if not found
OptionsQuery options (ex. max distance)
Returns
true if hit, false if no hit found

Reimplemented from UE::Geometry::IMeshSpatial.

◆ FindNearestHitTriangle() [3/4]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestHitTriangle ( const FRay3d Ray,
double NearestT,
int &  TID,
FVector3d BaryCoords,
const FQueryOptions Options = FQueryOptions() 
) const
inlineoverridevirtual

Find nearest triangle from the given ray

Parameters
Rayquery ray
NearestTreturned-by-reference parameter of the nearest hit
TIDreturned-by-reference ID of triangle intersected by ray within MaxDistance, or InvalidID if not found
BaryCoordsreturned-by-reference Barycentric coordinates of the triangle intersected by ray within MaxDistance, or FVector3d::Zero if not found.
OptionsQuery options (ex. max distance)
Returns
true if hit, false if no hit found

Implements UE::Geometry::IMeshSpatial.

◆ FindNearestHitTriangle() [4/4]

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestHitTriangle ( const FWatertightRay3d Ray,
double NearestT,
int &  TID,
FVector3d BaryCoords,
const FQueryOptions Options = FQueryOptions() 
) const
inline

◆ FindNearestPoint()

template<class TriangleMeshType >
virtual FVector3d UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestPoint ( const FVector3d Point,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

Convenience function that calls FindNearestTriangle and then finds nearest point

Returns
nearest point to Point, or Point itself if a nearest point was not found

◆ FindNearestTriangle()

template<class TriangleMeshType >
virtual int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestTriangle ( const FVector3d P,
double NearestDistSqr,
const FQueryOptions Options = FQueryOptions() 
) const
inlineoverridevirtual

Find the triangle closest to P, and distance to it, within distance MaxDist, or return InvalidID Use MeshQueries.TriangleDistance() to get more information

Implements UE::Geometry::IMeshSpatial.

◆ FindNearestTriangles()

template<class TriangleMeshType >
virtual FIndex2i UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestTriangles ( TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF,
double Distance,
const FQueryOptions Options = FQueryOptions(),
const FQueryOptions OtherTreeOptions = FQueryOptions() 
)
inlinevirtual

Find nearest pair of triangles on this tree with OtherTree, within Options.MaxDistance. TransformF transforms vertices of OtherTree into our coordinates. can be null. returns triangle-id pair (my_tri,other_tri), or FIndex2i::Invalid if not found within max_dist Use MeshQueries.TrianglesDistance() to get more information Note: Only uses MaxDistance from Options; OtherTreeOptions.MaxDistance is not used

◆ FindNearestVertex()

template<class TriangleMeshType >
virtual int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::FindNearestVertex ( const FVector3d P,
double NearestDistSqr,
double  MaxDist = TNumericLimits<double>::Max(),
const FQueryOptions Options = FQueryOptions() 
)
inlinevirtual

Find the Vertex closest to P, and distance to it, within distance MaxDist, or return InvalidID

◆ GetBoundingBox()

template<class TriangleMeshType >
FAxisAlignedBox3d UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetBoundingBox ( ) const
inline

Get the overall bounding box of the whole tree

◆ GetBox() [1/2]

template<class TriangleMeshType >
FAxisAlignedBox3d UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetBox ( int  IBox) const
inlineprotected

◆ GetBox() [2/2]

template<class TriangleMeshType >
FAxisAlignedBox3d UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetBox ( int  iBox,
const TFunction< FVector3d(const FVector3d &)> &  TransformF 
) const
inlineprotected

◆ GetBoxEps()

template<class TriangleMeshType >
FAxisAlignedBox3d UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetBoxEps ( int  IBox,
double  Epsilon = FMathd::ZeroTolerance 
) const
inlineprotected

◆ GetByteCount()

template<class TriangleMeshType >
SIZE_T UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetByteCount ( ) const
inline

◆ GetMesh()

template<class TriangleMeshType >
const TriangleMeshType * UE::Geometry::TMeshAABBTree3< TriangleMeshType >::GetMesh ( ) const
inline

◆ IsInside()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::IsInside ( const FVector3d Point) const
inlineoverridevirtual
Returns
true if the query point is inside the object

Implements UE::Geometry::ISpatial.

◆ IsValid()

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::IsValid ( bool  bAllowUnsafeModifiedMeshQueries) const
inline
Parameters
bAllowUnsafeModifiedMeshQueriesif true, then a built tree will still be considered valid even if the mesh change stamp has been modified
Returns
true if tree is built and mesh is unchanged (identified based on change stamp)

◆ IsWithinDistanceSquared()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::IsWithinDistanceSquared ( const FVector3d Point,
double  ThresholdDistanceSqr,
int &  OutTriangleID,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

Test whether there is any triangle closer than sqrt(ThresholdDistanceSqr) to Point Note that FQueryOptions::MaxDistance is ignored by this query, as ThresholdDistanceSqr controls the query distance instead

Parameters
OutTriangleIDThe ID of a triangle (not necessarily the closest) within the distance threshold, or InvalidID if none found.

◆ MakeDefaultSplitAxisFunc()

template<class TriangleMeshType >
static GetSplitAxisFunc UE::Geometry::TMeshAABBTree3< TriangleMeshType >::MakeDefaultSplitAxisFunc ( )
inlinestaticprotected

◆ SetBuildOptions()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SetBuildOptions ( int32  MaxBoxTriCount,
GetSplitAxisFunc &&  GetSplitAxisIn = MakeDefaultSplitAxisFunc() 
)
inline

◆ SetMesh()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SetMesh ( const TriangleMeshType SourceMesh,
bool  bAutoBuild = true 
)
inline

◆ SetTolerance()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SetTolerance ( double  Tolerance)
inline

Sets the box intersection tolerance TODO: move into the IMeshSpatial::FQueryOptions and delete this function

◆ SplitTriSetMidpoint()

template<class TriangleMeshType >
int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SplitTriSetMidpoint ( TArray< int > &  Triangles,
TArray< FVector3d > &  Centers,
int  IStart,
int  ICount,
int  Depth,
int  MinTriCount,
FBoxesSet Tris,
FBoxesSet Nodes,
FAxisAlignedBox3d Box 
)
inline

◆ SupportsNearestTriangle()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SupportsNearestTriangle ( ) const
inlineoverridevirtual
Returns
true if this object supports nearest-triangle queries

Implements UE::Geometry::IMeshSpatial.

◆ SupportsPointContainment()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SupportsPointContainment ( ) const
inlineoverridevirtual
Returns
true if this object supports point-containment inside/outside queries

Implements UE::Geometry::ISpatial.

◆ SupportsTriangleRayIntersection()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::SupportsTriangleRayIntersection ( ) const
inlineoverridevirtual
Returns
true if this object supports ray-triangle intersection queries

Implements UE::Geometry::IMeshSpatial.

◆ TestAnyHitTriangle() [1/2]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestAnyHitTriangle ( const FRay3d Ray,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual
Returns
true if ray hits the mesh at some point (doesn't necessarily find the nearest hit).

◆ TestAnyHitTriangle() [2/2]

template<class TriangleMeshType >
bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestAnyHitTriangle ( int  IBox,
const FRay3d Ray,
int32 HitTIDOut,
double  MaxDistance,
const FQueryOptions Options = FQueryOptions() 
) const
inlineprotected

◆ TestCoverage()

template<class TriangleMeshType >
void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestCoverage ( )
inline

◆ TestIntersection() [1/3]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestIntersection ( const FTriangle3d Triangle,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

Returns true if triangle intersects any triangle of our mesh

◆ TestIntersection() [2/3]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestIntersection ( const TMeshAABBTree3< TriangleMeshType > &  OtherTree,
const TFunction< FVector3d(const FVector3d &)> &  TransformF = nullptr,
const FQueryOptions Options = FQueryOptions(),
const FQueryOptions OtherTreeOptions = FQueryOptions() 
) const
inlinevirtual

Returns true if there is any intersection between our mesh and 'other' mesh. TransformF takes vertices of OtherTree into our tree - can be null if in same coord space

◆ TestIntersection() [3/3]

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestIntersection ( const TriangleMeshType TestMesh,
FAxisAlignedBox3d  TestMeshBounds = FAxisAlignedBox3d::Empty(),
const TFunction< FVector3d(const FVector3d &)> &  TransformF = nullptr,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

return true if any triangle of TestMesh intersects with our tree. If TestMeshBounds is not empty, only test collision if the provided bounding box intersects the root AABB box Use TransformF to transform vertices of TestMesh into space of this tree.

◆ TestSelfIntersection()

template<class TriangleMeshType >
virtual bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TestSelfIntersection ( bool  bIgnoreTopoConnected = true,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

◆ TotalVolume()

template<class TriangleMeshType >
double UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TotalVolume ( )
inline

Total sum of volumes of all boxes in the tree. Mainly useful to evaluate tree quality.

◆ TreeTraversalImpl()

template<class TriangleMeshType >
virtual void UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TreeTraversalImpl ( int  IBox,
int  Depth,
FTreeTraversal Traversal,
const FQueryOptions Options 
) const
inlineprotectedvirtual

◆ TriangleIntersection()

template<class TriangleMeshType >
static bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TriangleIntersection ( FIntrTriangle3Triangle3d Intr)
inlinestatic

Standard tri tri intersection test (with computing intersection geometry)

Parameters
IntrStores intersection problem; after call, should be set with intersection result
Returns
true if triangles were intersecting

◆ TriangleIntersectionFilter()

template<class TriangleMeshType >
static bool UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TriangleIntersectionFilter ( const FTriangle3d A,
const FTriangle3d B 
)
inlinestatic

Standard tri tri intersection test (without computing intersection geometry)

Friends And Related Symbol Documentation

◆ TFastWindingTree< TriangleMeshType >

template<class TriangleMeshType >
friend class TFastWindingTree< TriangleMeshType >
friend

Member Data Documentation

◆ BoxCenters

◆ BoxEps

template<class TriangleMeshType >
double UE::Geometry::TMeshAABBTree3< TriangleMeshType >::BoxEps = FMathd::ZeroTolerance
protected

◆ BoxExtents

◆ BoxToIndex

◆ DOUBLE_MAX

◆ GetSplitAxis

◆ IndexList

◆ Mesh

◆ MeshChangeStamp

template<class TriangleMeshType >
uint64 UE::Geometry::TMeshAABBTree3< TriangleMeshType >::MeshChangeStamp = 0
protected

◆ RootIndex

template<class TriangleMeshType >
int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::RootIndex = -1

◆ TopDownLeafMaxTriCount

template<class TriangleMeshType >
int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TopDownLeafMaxTriCount = 3
protected

◆ TrianglesEnd

template<class TriangleMeshType >
int UE::Geometry::TMeshAABBTree3< TriangleMeshType >::TrianglesEnd = -1

The documentation for this class was generated from the following file: