PxTetrahedronMeshExt
Defined in include/extensions/PxTetrahedronMeshExt.h
-
class PxTetrahedronMeshExt
utility functions for use with PxTetrahedronMesh and subclasses
Public Static Functions
-
static PxI32 findTetrahedronContainingPoint(const PxTetrahedronMesh *mesh, const PxVec3 &point, PxVec4 &bary, PxReal tolerance = 1e-6f)
Returns the index of the tetrahedron that contains a point.
- Parameters
mesh – [in] The tetmesh
point – [in] The point to find the enclosing tetrahedron for
bary – [in] The barycentric coordinates of the point inside the enclosing tetrahedron
tolerance – [in] Tolerance value used classify points as inside if they lie exactly a tetrahedron’s surface
- Returns
The index of the tetrahedon containing the point, -1 if not tetrahedron contains the opoint
-
static PxI32 findTetrahedronClosestToPoint(const PxTetrahedronMesh *mesh, const PxVec3 &point, PxVec4 &bary)
Returns the index of the tetrahedron closest to a point.
- Parameters
mesh – [in] The tetmesh
point – [in] The point to find the closest tetrahedron for
bary – [in] The barycentric coordinates of the point in the tetrahedron
- Returns
The index of the tetrahedon closest to the point
-
static void extractTetMeshSurface(const void *tetrahedra, PxU32 numTetrahedra, bool sixteenBitIndices, PxArray<PxU32> &surfaceTriangles, PxArray<PxU32> *surfaceTriangleToTet = NULL, bool flipTriangleOrientation = false)
Extracts the surface triangles of a tetmesh.
The extracted triangle’s vertex indices point to the vertex buffer of the tetmesh.
- Parameters
tetrahedra – [in] The tetrahedra indices
numTetrahedra – [in] The number of tetrahedra
sixteenBitIndices – [in] If set to true, the tetrahedra indices are read as 16bit integers, otherwise 32bit integers are used
surfaceTriangles – [in] The resulting surface triangles
surfaceTriangleToTet – [in] Optional array to get the index of a tetrahedron that is adjacent to the surface triangle with the corresponding index
flipTriangleOrientation – [in] Reverses the orientation of the ouput triangles
-
static void extractTetMeshSurface(const PxTetrahedronMesh *mesh, PxArray<PxU32> &surfaceTriangles, PxArray<PxU32> *surfaceTriangleToTet = NULL, bool flipTriangleOrientation = false)
Extracts the surface triangles of a tetmesh.
The extracted triangle’s vertex indices point to the vertex buffer of the tetmesh.
- Parameters
mesh – [in] The mesh from which the surface shall be computed
surfaceTriangles – [in] The resulting surface triangles
surfaceTriangleToTet – [in] Optional array to get the index of a tetrahedron that is adjacent to the surface triangle with the corresponding index
flipTriangleOrientation – [in] Reverses the orientation of the ouput triangles
-
static PxI32 findTetrahedronContainingPoint(const PxTetrahedronMesh *mesh, const PxVec3 &point, PxVec4 &bary, PxReal tolerance = 1e-6f)