#include <PxMeshQuery.h>
|
static PX_PHYSX_COMMON_API void | getTriangle (const PxTriangleMeshGeometry &triGeom, const PxTransform &transform, PxTriangleID triangleIndex, PxTriangle &triangle, PxU32 *vertexIndices=NULL, PxU32 *adjacencyIndices=NULL) |
| Retrieves triangle data from a triangle ID. More...
|
|
static PX_PHYSX_COMMON_API void | getTriangle (const PxHeightFieldGeometry &hfGeom, const PxTransform &transform, PxTriangleID triangleIndex, PxTriangle &triangle, PxU32 *vertexIndices=NULL, PxU32 *adjacencyIndices=NULL) |
| Retrieves triangle data from a triangle ID. More...
|
|
static PX_PHYSX_COMMON_API PxU32 | findOverlapTriangleMesh (const PxGeometry &geom, const PxTransform &geomPose, const PxTriangleMeshGeometry &meshGeom, const PxTransform &meshPose, PxU32 *results, PxU32 maxResults, PxU32 startIndex, bool &overflow) |
| Find the mesh triangles which touch the specified geometry object. More...
|
|
static PX_PHYSX_COMMON_API PxU32 | findOverlapHeightField (const PxGeometry &geom, const PxTransform &geomPose, const PxHeightFieldGeometry &hfGeom, const PxTransform &hfPose, PxU32 *results, PxU32 maxResults, PxU32 startIndex, bool &overflow) |
| Find the height field triangles which touch the specified geometry object. More...
|
|
static PX_PHYSX_COMMON_API bool | sweep (const PxVec3 &unitDir, const PxReal distance, const PxGeometry &geom, const PxTransform &pose, PxU32 triangleCount, const PxTriangle *triangles, PxSweepHit &sweepHit, PxHitFlags hintFlags=PxHitFlag::eDEFAULT, const PxU32 *cachedIndex=NULL, const PxReal inflation=0.0f, bool doubleSided=false) |
| Sweep a specified geometry object in space and test for collision with a set of given triangles. More...
|
|
Find the height field triangles which touch the specified geometry object.
Returned triangle indices can be used with getTriangle() to retrieve the triangle properties.
- Parameters
-
[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 |
[out] | results | Indices of overlapping triangles |
[in] | maxResults | Size of 'results' buffer |
[in] | startIndex | Index of first result to be retrieved. Previous indices are skipped. |
[out] | overflow | True if a buffer overflow occured |
- Returns
- Number of overlaps found, i.e. number of elements written to the results buffer
- See Also
- PxHeightFieldGeometry getTriangle()
Find the mesh triangles which touch the specified geometry object.
Returned triangle indices can be used with getTriangle() to retrieve the triangle properties.
- Parameters
-
[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 |
[out] | results | Indices of overlapping triangles |
[in] | maxResults | Size of 'results' buffer |
[in] | startIndex | Index of first result to be retrieved. Previous indices are skipped. |
[out] | overflow | True if a buffer overflow occured |
- Returns
- Number of overlaps found, i.e. number of elements written to the results buffer
- See Also
- PxTriangleMeshGeometry getTriangle()
Retrieves triangle data from a triangle ID.
This function can be used together with findOverlapTriangleMesh() to retrieve triangle properties.
- Parameters
-
[in] | triGeom | Geometry of the triangle mesh to extract the triangle from. |
[in] | transform | Transform for the triangle mesh |
[in] | triangleIndex | The index of the triangle to retrieve. |
[out] | triangle | Triangle points in world space. |
[out] | vertexIndices | Returned vertex indices for given triangle |
[out] | adjacencyIndices | Returned 3 triangle adjacency internal face indices (0xFFFFFFFF if no adjacency). The mesh must be cooked with cooking param buildTriangleAdjacencies enabled. |
- See Also
- PxTriangle PxTriangleFlags PxTriangleID findOverlapTriangleMesh()
Retrieves triangle data from a triangle ID.
This function can be used together with findOverlapHeightField() to retrieve triangle properties.
- Parameters
-
[in] | hfGeom | Geometry of the height field to extract the triangle from. |
[in] | transform | Transform for the height field. |
[in] | triangleIndex | The index of the triangle to retrieve. |
[out] | triangle | Triangle points in world space. |
[out] | vertexIndices | Returned vertex indices for given triangle |
[out] | adjacencyIndices | Returned 3 triangle adjacency triangle indices (0xFFFFFFFF if no adjacency). |
- See Also
- PxTriangle PxTriangleFlags PxTriangleID findOverlapHeightField()
static PX_PHYSX_COMMON_API bool PxMeshQuery::sweep |
( |
const PxVec3 & |
unitDir, |
|
|
const PxReal |
distance, |
|
|
const PxGeometry & |
geom, |
|
|
const PxTransform & |
pose, |
|
|
PxU32 |
triangleCount, |
|
|
const PxTriangle * |
triangles, |
|
|
PxSweepHit & |
sweepHit, |
|
|
PxHitFlags |
hintFlags = PxHitFlag::eDEFAULT , |
|
|
const PxU32 * |
cachedIndex = NULL , |
|
|
const PxReal |
inflation = 0.0f , |
|
|
bool |
doubleSided = false |
|
) |
| |
|
static |
Sweep a specified geometry object in space and test for collision with a set of given triangles.
This function simply sweeps input geometry against each input triangle. This is an O(N) operation with N = number of input triangles. It does not use any particular acceleration structure.
- Parameters
-
[in] | unitDir | Normalized direction of the sweep. |
[in] | distance | Sweep distance. Needs to be larger than 0. Clamped to PX_MAX_SWEEP_DISTANCE. |
[in] | geom | The geometry object to sweep. Supported geometries are PxSphereGeometry, PxCapsuleGeometry and PxBoxGeometry |
[in] | pose | Pose of the geometry object to sweep. |
[in] | triangleCount | Number of specified triangles |
[in] | triangles | Array of triangles to sweep against |
[out] | sweepHit | The sweep hit information. See the notes below for limitations about returned results. |
[in] | hintFlags | Specification of the kind of information to retrieve on hit. Combination of PxHitFlag flags. See the notes below for limitations about supported flags. |
[in] | cachedIndex | Cached triangle index for subsequent calls. Cached triangle is tested first. Optional parameter. |
[in] | inflation | This parameter creates a skin around the swept geometry which increases its extents for sweeping. The sweep will register a hit as soon as the skin touches a shape, and will return the corresponding distance and normal. |
[in] | doubleSided | Counterpart of PxMeshGeometryFlag::eDOUBLE_SIDED for input triangles. |
- Returns
- True if the swept geometry object hits the specified triangles
- Note
- Only the following geometry types are currently supported: PxSphereGeometry, PxCapsuleGeometry, PxBoxGeometry
-
If a shape from the scene is already overlapping with the query shape in its starting position, the hit is returned unless eASSUME_NO_INITIAL_OVERLAP was specified.
-
This function returns a single closest hit across all the input triangles. Multiple hits are not supported.
-
Only PxHitFlag::eASSUME_NO_INITIAL_OVERLAP, PxHitFlag::ePRECISE_SWEEP and PxHitFlag::eMESH_BOTH_SIDES are supported in hintFlags.
-
Unlike scene queries the validity flags in sweepHit are not set by this call and only eDISTANCE and eNORMAL fields are always defined.
-
ePOSITION is only defined when there is no initial overlap (sweepHit.hadInitialOverlap() == false)
-
The returned normal for initially overlapping sweeps is set to -unitDir.
-
The returned PxSweepHit::faceIndex parameter will hold the index of the hit triangle in input array, i.e. the range is [0; triangleCount). For initially overlapping sweeps, this is the index of overlapping triangle.
-
The returned PxSweepHit::actor and PxSweepHit::shape pointers are not filled.
-
The inflation parameter is not compatible with PxHitFlag::ePRECISE_SWEEP.
- See Also
- PxTriangle PxSweepHit PxGeometry PxTransform
The documentation for this class was generated from the following file: