Utility class to find mesh triangles touched by a specified geometry object. More...
#include <PxTriangleMeshExt.h>
Public Member Functions | |
| PxMeshOverlapUtil () | |
| ~PxMeshOverlapUtil () | |
| PxU32 | findOverlap (const PxGeometry &geom, const PxTransform &geomPose, const PxTriangleMeshGeometry &meshGeom, const PxTransform &meshPose) |
| Find the mesh triangles which touch the specified geometry object. More... | |
| PxU32 | findOverlap (const PxGeometry &geom, const PxTransform &geomPose, const PxHeightFieldGeometry &hfGeom, const PxTransform &hfPose) |
| Find the height field triangles which touch the specified geometry object. More... | |
| PX_FORCE_INLINE const PxU32 * | getResults () const |
| Retrieves array of triangle indices after a findOverlap call. More... | |
| PX_FORCE_INLINE PxU32 | getNbResults () const |
| Retrieves number of triangle indices after a findOverlap call. More... | |
Private Attributes | |
| PxU32 * | mResultsMemory |
| PxU32 | mResults [64] |
| PxU32 | mNbResults |
| PxU32 | mMaxNbResults |
Utility class to find mesh triangles touched by a specified geometry object.
This class is a helper calling PxMeshQuery::findOverlapTriangleMesh or PxMeshQuery::findOverlapHeightField under the hood, while taking care of necessary memory management issues.
PxMeshQuery::findOverlapTriangleMesh and PxMeshQuery::findOverlapHeightField are the "raw" functions operating on user-provided fixed-size buffers. These functions abort with an error code in case of buffer overflow. PxMeshOverlapUtil is a convenient helper function checking this error code, and resizing buffers appropriately, until the desired call succeeds.
Returned triangle indices are stored within the class, and can be used with PxMeshQuery::getTriangle() to retrieve the triangle properties.
| PxMeshOverlapUtil::PxMeshOverlapUtil | ( | ) |
| PxMeshOverlapUtil::~PxMeshOverlapUtil | ( | ) |
| PxU32 PxMeshOverlapUtil::findOverlap | ( | const PxGeometry & | geom, |
| const PxTransform & | geomPose, | ||
| const PxTriangleMeshGeometry & | meshGeom, | ||
| const PxTransform & | meshPose | ||
| ) |
Find the mesh triangles which touch the specified geometry object.
| [in] | geom | The geometry object to test for mesh triangle overlaps. Supported geometries are PxSphereGeometry, PxCapsuleGeometry and PxBoxGeometry |
| [in] | geomPose | Pose of the geometry object |
| [in] | meshGeom | The triangle mesh geometry to check overlap against |
| [in] | meshPose | Pose of the triangle mesh |
| PxU32 PxMeshOverlapUtil::findOverlap | ( | const PxGeometry & | geom, |
| const PxTransform & | geomPose, | ||
| const PxHeightFieldGeometry & | hfGeom, | ||
| const PxTransform & | hfPose | ||
| ) |
Find the height field triangles which touch the specified geometry object.
| [in] | geom | The geometry object to test for height field overlaps. Supported geometries are PxSphereGeometry, PxCapsuleGeometry and PxBoxGeometry. The sphere and capsule queries are currently conservative estimates. |
| [in] | geomPose | Pose of the geometry object |
| [in] | hfGeom | The height field geometry to check overlap against |
| [in] | hfPose | Pose of the height field |
|
inline |
Retrieves number of triangle indices after a findOverlap call.
|
inline |
Retrieves array of triangle indices after a findOverlap call.
|
private |
|
private |
|
private |
|
private |