Navigation
API > API/Runtime > API/Runtime/GeometryCore
| Name | TMeshAABBTree3 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Spatial/MeshAABBTree3.h |
| Include Path | #include "Spatial/MeshAABBTree3.h" |
Syntax
template<class TriangleMeshType>
class TMeshAABBTree3 : public UE::Geometry::IMeshSpatial
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMeshAABBTree3
(
const TriangleMeshType* SourceMesh, |
Spatial/MeshAABBTree3.h | ||
| Spatial/MeshAABBTree3.h |
Classes
| Name | Remarks |
|---|---|
| FTreeTraversal |
Structs
| Name | Remarks |
|---|---|
| FBoxesSet |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| GetSplitAxisFunc | TUniqueFunction< int(int Depth, const FAxisAlignedBox3d &Box)> | Spatial/MeshAABBTree3.h | |
| MeshType | TriangleMeshType | Spatial/MeshAABBTree3.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bValidatePerAccess | bool | Spatial/MeshAABBTree3.h | |
| DOUBLE_MAX | double | Spatial/MeshAABBTree3.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BoxCenters | TDynamicVector< FVector3d > | Spatial/MeshAABBTree3.h | ||
| BoxExtents | TDynamicVector< FVector3d > | Spatial/MeshAABBTree3.h | ||
| BoxToIndex | TDynamicVector< int > | Storage for Box Nodes. | Spatial/MeshAABBTree3.h | |
| IndexList | TDynamicVector< int > | List of indices for a given Box. | Spatial/MeshAABBTree3.h | |
| RootIndex | int | BoxToIndex[RootIndex] is the root node of the tree. | Spatial/MeshAABBTree3.h | |
| TrianglesEnd | int | IndexList[i] for i < TrianglesEnd is a triangle-index list, otherwise Box-index pair/single. | Spatial/MeshAABBTree3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
double box_box_distsqr
(
int iBox, |
Spatial/MeshAABBTree3.h | ||
bool box_box_intersect
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
bool box_contains
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
double box_ray_intersect_t
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
double BoxDistanceSqr
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
| Spatial/MeshAABBTree3.h | |||
void Build () |
Spatial/MeshAABBTree3.h | ||
void BuildTopDown
(
TArray< int >& Triangles, |
Spatial/MeshAABBTree3.h | ||
void BuildTopDown
(
bool bSorted, |
Spatial/MeshAABBTree3.h | ||
void BuildTopDown
(
bool bSorted |
Spatial/MeshAABBTree3.h | ||
virtual void DoTraversal
(
FTreeTraversal& Traversal, |
Hierarchically descend through the tree Nodes, calling the FTreeTraversal functions at each level | Spatial/MeshAABBTree3.h | |
int find_any_intersection
(
int iBox, |
Spatial/MeshAABBTree3.h | ||
bool find_any_intersection
(
int iBox, |
Spatial/MeshAABBTree3.h | ||
void find_intersections
(
int iBox, |
Spatial/MeshAABBTree3.h | ||
void find_nearest_triangles
(
int iBox, |
Spatial/MeshAABBTree3.h | ||
bool find_self_intersections
(
MeshIntersection::FIntersectionsQueryResult* Result, |
Spatial/MeshAABBTree3.h | ||
bool find_self_intersections_acrossboxes
(
int Box1, |
Helper for find_self_intersections that checks intersections between triangles from separate boxes | Spatial/MeshAABBTree3.h | |
bool find_tri_tri_intersections
(
int TID_A, |
Helper for find_self_intersections that intersects a single triangle vs a range of triangles | Spatial/MeshAABBTree3.h | |
bool FindAllHitTriangles
(
const FWatertightRay3d& Ray, |
Spatial/MeshAABBTree3.h | ||
virtual MeshIntersection::FIntersectionsQueryResult FindAllIntersections
(
const TMeshAABBTree3& OtherTree, |
Compute all intersections between two meshes. | Spatial/MeshAABBTree3.h | |
virtual MeshIntersection::FIntersectionsQueryResult FindAllSelfIntersections
(
bool bIgnoreTopoConnected, |
Compute self intersections on our mesh. | Spatial/MeshAABBTree3.h | |
bool FindNearestHitTriangle
(
const FWatertightRay3d& Ray, |
Spatial/MeshAABBTree3.h | ||
virtual FVector3d FindNearestPoint
(
const FVector3d& Point, |
Convenience function that calls FindNearestTriangle and then finds nearest point | Spatial/MeshAABBTree3.h | |
virtual FIndex2i FindNearestTriangles
(
TMeshAABBTree3& OtherTree, |
Find nearest pair of triangles on this tree with OtherTree, within Options.MaxDistance. | Spatial/MeshAABBTree3.h | |
virtual int FindNearestVertex
(
const FVector3d& P, |
Find the Vertex closest to P, and distance to it, within distance MaxDist, or return InvalidID | Spatial/MeshAABBTree3.h | |
FAxisAlignedBox3d GetBoundingBox() |
Get the overall bounding box of the whole tree | Spatial/MeshAABBTree3.h | |
SIZE_T GetByteCount() |
Spatial/MeshAABBTree3.h | ||
const TriangleMeshType * GetMesh() |
Spatial/MeshAABBTree3.h | ||
bool IsValid
(
bool bAllowUnsafeModifiedMeshQueries |
Spatial/MeshAABBTree3.h | ||
virtual bool IsWithinDistanceSquared
(
const FVector3d& Point, |
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 | Spatial/MeshAABBTree3.h | |
void SetBuildOptions
(
int32 MaxBoxTriCount, |
Spatial/MeshAABBTree3.h | ||
void SetMesh
(
const TriangleMeshType* SourceMesh, |
Spatial/MeshAABBTree3.h | ||
void SetTolerance
(
double Tolerance |
Sets the box intersection tolerance TODO: move into the IMeshSpatial::FQueryOptions and delete this function | Spatial/MeshAABBTree3.h | |
| Spatial/MeshAABBTree3.h | |||
virtual bool TestAnyHitTriangle
(
const FRay3d& Ray, |
Spatial/MeshAABBTree3.h | ||
void TestCoverage() |
1) make sure we can reach every Tri in Mesh through tree (also demo of how to traverse tree...) 2) make sure that Triangles are contained in parent boxes | Spatial/MeshAABBTree3.h | |
virtual bool TestIntersection
(
const TMeshAABBTree3& OtherTree, |
Returns true if there is any intersection between our mesh and 'other' mesh. | Spatial/MeshAABBTree3.h | |
virtual bool TestIntersection
(
const TriangleMeshType* TestMesh, |
Return true if any triangle of TestMesh intersects with our tree. | Spatial/MeshAABBTree3.h | |
virtual bool TestIntersection
(
const FTriangle3d& Triangle, |
Returns true if triangle intersects any triangle of our mesh | Spatial/MeshAABBTree3.h | |
virtual bool TestSelfIntersection
(
bool bIgnoreTopoConnected, |
Spatial/MeshAABBTree3.h | ||
double TotalVolume() |
Total sum of volumes of all boxes in the tree. Mainly useful to evaluate tree quality. | Spatial/MeshAABBTree3.h |
Overridden from IMeshSpatial
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool FindAllHitTriangles
(
const FRay3d& Ray, |
Find all triangles intersected by the given ray sorted by distance | Spatial/MeshAABBTree3.h | |
virtual int FindNearestHitTriangle
(
const FRay3d& Ray, |
Spatial/MeshAABBTree3.h | ||
virtual bool FindNearestHitTriangle
(
const FRay3d& Ray, |
Find nearest triangle from the given ray | Spatial/MeshAABBTree3.h | |
virtual bool FindNearestHitTriangle
(
const FRay3d& Ray, |
Find nearest triangle from the given ray | Spatial/MeshAABBTree3.h | |
virtual int FindNearestTriangle
(
const FVector3d& P, |
Find the triangle closest to P, and distance to it, within distance MaxDist, or return InvalidID Use MeshQueries.TriangleDistance() to get more information | Spatial/MeshAABBTree3.h | |
virtual bool SupportsNearestTriangle() |
Spatial/MeshAABBTree3.h | ||
virtual bool SupportsTriangleRayIntersection() |
Spatial/MeshAABBTree3.h |
Overridden from ISpatial
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsInside
(
const FVector3d& Point |
Spatial/MeshAABBTree3.h | ||
virtual bool SupportsPointContainment() |
Spatial/MeshAABBTree3.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool find_nearest_tri
(
int IBox, |
BEarlyStop causes the traversal to stop as soon as any triangle closer than NearestDistSqr is found | Spatial/MeshAABBTree3.h | |
void find_nearest_vertex
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
void FindHitTriangle
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
void FindHitTriangles
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
| Spatial/MeshAABBTree3.h | |||
FAxisAlignedBox3d GetBox
(
int IBox |
Internals - data structures, construction, etc | Spatial/MeshAABBTree3.h | |
FAxisAlignedBox3d GetBoxEps
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
bool TestAnyHitTriangle
(
int IBox, |
Spatial/MeshAABBTree3.h | ||
virtual void TreeTraversalImpl
(
int IBox, |
Traversal implementation. you can override to customize this if necessary. | Spatial/MeshAABBTree3.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddTriTriIntersectionResult
(
const FIntrTriangle3Triangle3d& Intr, |
Helper to add a triangle-triangle intersection result from to a intersection result struct | Spatial/MeshAABBTree3.h | |
static GetSplitAxisFunc MakeDefaultSplitAxisFunc() |
Spatial/MeshAABBTree3.h | ||
static bool TriangleIntersection
(
FIntrTriangle3Triangle3d& Intr |
Standard tri tri intersection test (with computing intersection geometry) | Spatial/MeshAABBTree3.h | |
static bool TriangleIntersectionFilter
(
const FTriangle3d& A, |
Standard tri tri intersection test (without computing intersection geometry) | Spatial/MeshAABBTree3.h |