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