37 bool isValid()
const {
return _bsh !=
nullptr; }
57 static void incSphereChecks() { _sphereChecks++; }
58 static void incTriangleChecks() { _triangleChecks++; }
63 WEMBoundingSphereHierarchy::TreeElement* _bsh;
66 int _usedTriangleCount;
69 static int _sphereChecks;
70 static int _triangleChecks;
Result getNearestTriangle(const Vector3 &p) const
Get the nearest triangle point of the WEM relative to p.
~WEMNearestPointOnSurface()
WEMNearestPointOnSurface(WEM *wem)
WEM must solely consist of WEMTrianglePatches, otherwise isValid returns false.
bool isValid() const
Return if the given WEM only had triangle patches.
This represents a WEMPatch consisting of triangles only.
Defines the mesh component: triangle.
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Result structure for getNearestTriangle:
double w[3]
The barycentric coordinates of the nearest point.
WEMTrianglePatch * patch
The patch containing the nearest triangle, may be nullptr if the WEM was empty.
WEMTriangle * triangle
The nearest triangle containing the nearest point, may be nullptr if the WEM was empty.