UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::IMeshSpatial Class Referenceabstract

#include <SpatialInterfaces.h>

+ Inheritance diagram for UE::Geometry::IMeshSpatial:

Classes

struct  FQueryOptions
 

Public Member Functions

virtual ~IMeshSpatial ()=default
 
virtual bool SupportsNearestTriangle () const =0
 
virtual int FindNearestTriangle (const FVector3d &Point, double &NearestDistSqrOut, const FQueryOptions &Options=FQueryOptions()) const =0
 
virtual bool SupportsTriangleRayIntersection () const =0
 
virtual int FindNearestHitTriangle (const FRay3d &Ray, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool FindNearestHitTriangle (const FRay3d &Ray, double &NearestT, int &TID, const FQueryOptions &Options=FQueryOptions()) const
 
virtual bool FindNearestHitTriangle (const FRay3d &Ray, double &NearestT, int &TID, FVector3d &BaryCoords, const FQueryOptions &Options=FQueryOptions()) const =0
 
virtual bool FindAllHitTriangles (const FRay3d &Ray, TArray< MeshIntersection::FHitIntersectionResult > &OutHits, const FQueryOptions &Options=FQueryOptions()) const =0
 
- Public Member Functions inherited from UE::Geometry::ISpatial
virtual ~ISpatial ()=default
 
virtual bool SupportsPointContainment () const =0
 
virtual bool IsInside (const FVector3d &Point) const =0
 

Detailed Description

IMeshSpatial is an extension of ISpatial specifically for meshes

Constructor & Destructor Documentation

◆ ~IMeshSpatial()

virtual UE::Geometry::IMeshSpatial::~IMeshSpatial ( )
virtualdefault

Member Function Documentation

◆ FindAllHitTriangles()

virtual bool UE::Geometry::IMeshSpatial::FindAllHitTriangles ( const FRay3d Ray,
TArray< MeshIntersection::FHitIntersectionResult > &  OutHits,
const FQueryOptions Options = FQueryOptions() 
) const
pure virtual

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

Implemented in UE::Geometry::TMeshAABBTree3< TriangleMeshType >, UE::Geometry::TMeshAABBTree3< UE::Geometry::FColliderMesh >, and UE::Geometry::TMeshAABBTree3< UE::Geometry::FDynamicMesh3 >.

◆ FindNearestHitTriangle() [1/3]

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

Reimplemented in UE::Geometry::TMeshAABBTree3< TriangleMeshType >, UE::Geometry::TMeshAABBTree3< UE::Geometry::FColliderMesh >, and UE::Geometry::TMeshAABBTree3< UE::Geometry::FDynamicMesh3 >.

◆ FindNearestHitTriangle() [2/3]

virtual bool UE::Geometry::IMeshSpatial::FindNearestHitTriangle ( const FRay3d Ray,
double NearestT,
int &  TID,
const FQueryOptions Options = FQueryOptions() 
) const
inlinevirtual

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 in UE::Geometry::TMeshAABBTree3< TriangleMeshType >, UE::Geometry::TMeshAABBTree3< UE::Geometry::FColliderMesh >, and UE::Geometry::TMeshAABBTree3< UE::Geometry::FDynamicMesh3 >.

◆ FindNearestHitTriangle() [3/3]

virtual bool UE::Geometry::IMeshSpatial::FindNearestHitTriangle ( const FRay3d Ray,
double NearestT,
int &  TID,
FVector3d BaryCoords,
const FQueryOptions Options = FQueryOptions() 
) const
pure virtual

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

Implemented in UE::Geometry::TMeshAABBTree3< TriangleMeshType >, UE::Geometry::TMeshAABBTree3< UE::Geometry::FColliderMesh >, and UE::Geometry::TMeshAABBTree3< UE::Geometry::FDynamicMesh3 >.

◆ FindNearestTriangle()

virtual int UE::Geometry::IMeshSpatial::FindNearestTriangle ( const FVector3d Point,
double NearestDistSqrOut,
const FQueryOptions Options = FQueryOptions() 
) const
pure virtual
Parameters
Querypoint
NearestDistSqrOutreturned nearest squared distance, if triangle is found
OptionsQuery options (ex. max distance)
Returns
ID of triangle nearest to Point within MaxDistance, or InvalidID if not found

Implemented in UE::Geometry::TMeshAABBTree3< TriangleMeshType >, UE::Geometry::TMeshAABBTree3< UE::Geometry::FColliderMesh >, and UE::Geometry::TMeshAABBTree3< UE::Geometry::FDynamicMesh3 >.

◆ SupportsNearestTriangle()

virtual bool UE::Geometry::IMeshSpatial::SupportsNearestTriangle ( ) const
pure virtual

◆ SupportsTriangleRayIntersection()

virtual bool UE::Geometry::IMeshSpatial::SupportsTriangleRayIntersection ( ) const
pure virtual

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