21namespace WEMBoundingSphereHierarchy {
 
 
   37  bool isValid()
 const { 
return _bsh != 
nullptr; }
 
   42    Result() : patch(nullptr), triangle(nullptr) { w[0] = 0; w[1] = 0; w[2] = 0; }
 
 
   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;
 
 
This class constructs a bounding sphere hierarchy of all non-empty triangles (i.e.
 
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.
 
A WEM comprises a number of WEMPatches.
 
Result structure for getNearestTriangle:
 
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.