TMeshAABBTree3

Windows
MacOS
Linux

Inheritance Hierarchy

ISpatial

IMeshSpatial

TMeshAABBTree3

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Spatial/MeshAABBTree3.h

Include

#include "Spatial/MeshAABBTree3.h"

Syntax

template<class TriangleMeshType>
class TMeshAABBTree3 : public IMeshSpatial

Variables

Name Description

Protected variable

TDynamicVector<...

 

BoxCenters

Protected variable

const double

 

BoxEps

Protected variable

TDynamicVector<...

 

BoxExtents

Protected variable

TDynamicVector<...

 

BoxToIndex

Storage for Box Nodes.

Protected variable

TDynamicVector<...

 

IndexList

List of indices for a given Box.

Protected variable

const TriangleM...

 

Mesh

Protected variable

int

 

MeshTimestamp

Protected variable

int

 

RootIndex

BoxToIndex[RootIndex] is the root node of the tree.

Protected variable

int

 

TopDownLeafMaxTriCount

Public variable

TFunction< bool...

 

TriangleFilterF

If non-null, only triangle IDs that pass this filter (ie filter is true) are considered

Protected variable

int

 

TrianglesEnd

IndexList[i] for i < TrianglesEnd is a triangle-index list, otherwise Box-index pair/single.

Constructors

Name Description

Public function

TMeshAABBTree3()

Public function

TMeshAABBTree3

(
    const TriangleMeshType* Source...,
    bool bAutoBuild
)

Functions

Name Description

Protected function

double

 

box_box_distsqr

(
    int iBox,
    const FAxisAlignedBox3d& testBox
)

Protected function Const

bool

 

box_contains

(
    int IBox,
    const FVector3d& P
)

Protected function Const

double

 

box_ray_intersect_t

(
    int IBox,
    const FRay3d& Ray
)

Protected function Const

double

 

BoxDistanceSqr

(
    int IBox,
    const FVector3d& V
)

Public function

void

 

Build()

Protected function

void

 

BuildTopDown

(
    bool bSorted
)

Public function Virtual

void

 

DoTraversal

(
    FTreeTraversal& Traversal
)

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

Protected function

void

 

find_nearest_tri

(
    int IBox,
    const FVector3d& P,
    double& NearestDistSqr,
    int& TID
)

Protected function

void

 

find_nearest_triangles

(
    int iBox,
    TMeshAABBTree3& otherTree,
    TFunction< FVector3d...,
    int oBox,
    int depth,
    double& nearest_sqr,
    FIndex2i& nearest_pair
)

Protected function

void

 

find_nearest_vertex

(
    int IBox,
    const FVector3d& P,
    double& NearestDistSqr,
    int& NearestVertexID
)

Public function

void

 

FindHitTriangle

(
    int IBox,
    const FRay3d& Ray,
    double& NearestT,
    int& TID
)

Public function Virtual

FVector3d

 

FindNearestPoint

(
    const FVector3d& Point,
    double MaxDist
)

Convenience function that calls FindNearestTriangle and then finds nearest point

Public function Virtual

FIndex2i

 

FindNearestTriangles

(
    TMeshAABBTree3& OtherTree,
    TFunction< FVector3d...,
    double& Distance,
    double MaxDist
)

Find nearest pair of triangles on this tree with otherTree, within max_dist.

Public function Virtual

int

 

FindNearestVertex

(
    const FVector3d& P,
    double& NearestDistSqr,
    double MaxDist
)

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

Protected function

FAxisAligned...

 

GetBox

(
    int iBox,
    TFunction< FVector3d...
)

Protected function Const

FAxisAligned...

 

GetBox

(
    int IBox
)

Internals - data structures, construction, etc

Protected function Const

FAxisAligned...

 

GetBoxEps

(
    int IBox,
    double Epsilon
)

Public function Const

const Triang...

 

GetMesh()

Public function Const

bool

 

IsValid()

Public function

void

 

SetMesh

(
    const TriangleMeshType* Source...,
    bool bAutoBuild
)

Protected function

int

 

SplitTriSetMidpoint

(
    TArray< int >& Triangles,
    TArray< FVector3d >& Centers,
    int IStart,
    int ICount,
    int Depth,
    int MinTriCount,
    FBoxesSet& Tris,
    FBoxesSet& Nodes,
    FAxisAlignedBox3d& Box
)

Public function

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

Public function

double

 

TotalVolume()

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

Public function Virtual

void

 

TreeTraversalImpl

(
    int IBox,
    int Depth,
    FTreeTraversal& Traversal
)

Traversal implementation. you can override to customize this if necessary.

Overridden from IMeshSpatial

Name Description

Public function Virtual

bool

 

FindNearestHitTriangle

(
    const FRay3d& Ray,
    double& NearestT,
    int& TID,
    double MaxDistance
)

Find nearest triangle from the given ray

Public function Virtual

int

 

FindNearestHitTriangle

(
    const FRay3d& Ray,
    double MaxDistance
)

Public function Virtual

int

 

FindNearestTriangle

(
    const FVector3d& P,
    double& NearestDistSqr,
    double MaxDist
)

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

Public function Virtual

bool

 

SupportsNearestTriangle()

Public function Virtual

bool

 

SupportsTriangleRayIntersection()

Overridden from ISpatial

Name Description

Public function Virtual

bool

 

IsInside

(
    const FVector3d& Point
)

Public function Virtual

bool

 

SupportsPointContainment()

Classes

Name

Description

Protected struct

FBoxesSet

Public class

FTreeTraversal

Constants

Name

Description

DOUBLE_MAX

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss