java.lang.Object
physx.NativeObject
physx.extensions.PxMeshOverlapUtil
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxMeshOverlapUtilarrayGet(long baseAddress, int index) voiddestroy()intfindOverlap(PxGeometry geom, PxTransform geomPose, PxTriangleMeshGeometry meshGeom, PxTransform meshPose) Find the mesh triangles which touch the specified geometry object.intRetrieves number of triangle indices after a findOverlap call.Retrieves array of triangle indices after a findOverlap call.static PxMeshOverlapUtilwrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxMeshOverlapUtil
protected PxMeshOverlapUtil(long address) -
PxMeshOverlapUtil
public PxMeshOverlapUtil()
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
findOverlap
public int findOverlap(PxGeometry geom, PxTransform geomPose, PxTriangleMeshGeometry meshGeom, PxTransform meshPose) Find the mesh triangles which touch the specified geometry object.- Parameters:
geom- The geometry object to test for mesh triangle overlaps. Supported geometries are #PxSphereGeometry, #PxCapsuleGeometry and #PxBoxGeometrygeomPose- Pose of the geometry objectmeshGeom- The triangle mesh geometry to check overlap againstmeshPose- Pose of the triangle mesh- Returns:
- Number of overlaps found. Triangle indices can then be accessed through the #getResults() function.
- See Also:
-
getResults
Retrieves array of triangle indices after a findOverlap call.- Returns:
- Indices of touched triangles
-
getNbResults
public int getNbResults()Retrieves number of triangle indices after a findOverlap call.- Returns:
- Number of touched triangles
-