PxGeometryQuery Class Reference
[Geomutils]
Collection of geometry object queries (sweeps, raycasts, overlaps, ...).
More...
#include <PxGeometryQuery.h>
Static Public Member Functions | |
static PX_PHYSX_COMMON_API bool | sweep (const PxVec3 &unitDir, const PxReal distance, const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxSweepHit &sweepHit, PxSceneQueryFlags hintFlags=(PxSceneQueryFlags) 0xffffffff) |
Sweep a specified geometry object in space and test for collision with a given object. | |
static PX_PHYSX_COMMON_API bool | overlap (const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1) |
Overlap test for two geometry objects. | |
static PX_PHYSX_COMMON_API PxU32 | raycast (const PxVec3 &rayOrigin, const PxVec3 &rayDir, const PxGeometry &geom, const PxTransform &pose, PxReal maxDist, PxSceneQueryFlags hintFlags, PxU32 maxHits, PxRaycastHit *PX_RESTRICT rayHits, bool firstHit=false) |
Raycast test against a geometry object. | |
static PX_PHYSX_COMMON_API PxReal | pointDistance (const PxVec3 &point, const PxGeometry &geom, const PxTransform &pose, PxVec3 *closestPoint=NULL) |
Computes distance between a point and a geometry object. |
Detailed Description
Collection of geometry object queries (sweeps, raycasts, overlaps, ...).Member Function Documentation
static PX_PHYSX_COMMON_API bool PxGeometryQuery::overlap | ( | const PxGeometry & | geom0, | |
const PxTransform & | pose0, | |||
const PxGeometry & | geom1, | |||
const PxTransform & | pose1 | |||
) | [static] |
Overlap test for two geometry objects.
All combinations are supported except:
- PxPlaneGeometry vs. {PxPlaneGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}
- PxConvexMeshGeometry vs. {PxTriangleMeshGeometry}
- PxTriangleMeshGeometry vs. {PxTriangleMeshGeometry, PxHeightFieldGeometry}
- PxHeightFieldGeometry vs. {PxHeightFieldGeometry}
- Parameters:
-
[in] geom0 The first geometry object [in] pose0 Pose of the first geometry object [in] geom1 The second geometry object [in] pose1 Pose of the second geometry object
- Returns:
- True if the two geometry objects overlap
- See also:
- PxGeometry PxTransform
static PX_PHYSX_COMMON_API PxReal PxGeometryQuery::pointDistance | ( | const PxVec3 & | point, | |
const PxGeometry & | geom, | |||
const PxTransform & | pose, | |||
PxVec3 * | closestPoint = NULL | |||
) | [static] |
Computes distance between a point and a geometry object.
Currently supported geometry objects: box, sphere, capsule, convex.
- Parameters:
-
[in] point The point P [in] geom The geometry object [in] pose Pose of the geometry object [out] closestPoint Optionally returned closest point to P on the geom object. Only valid when returned distance is strictly positive.
- Returns:
- Square distance between the point and the geom object, or 0.0 if the point is inside the object, or -1.0 if the geometry type is not supported.
- See also:
- PxGeometry PxTransform
static PX_PHYSX_COMMON_API PxU32 PxGeometryQuery::raycast | ( | const PxVec3 & | rayOrigin, | |
const PxVec3 & | rayDir, | |||
const PxGeometry & | geom, | |||
const PxTransform & | pose, | |||
PxReal | maxDist, | |||
PxSceneQueryFlags | hintFlags, | |||
PxU32 | maxHits, | |||
PxRaycastHit *PX_RESTRICT | rayHits, | |||
bool | firstHit = false | |||
) | [static] |
Raycast test against a geometry object.
- Parameters:
-
[in] rayOrigin The origin of the ray to test the geometry object against [in] rayDir The direction of the ray to test the geometry object against [in] geom The geometry object to test the ray against [in] pose Pose of the geometry object [in] maxDist Maximum ray length [in] hintFlags Specification of the kind of information to retrieve on hit. Combination of PxSceneQueryFlag flags [in] maxHits max number of returned hits = size of 'rayHits' buffer [out] rayHits Raycast hits information [in] firstHit Set to false if the closest hit point should be computed, else the query aborts as soon as the first valid hit point is found.
- Returns:
- Number of hits between the ray and the geometry object
- See also:
- PxRaycastHit PxGeometry PxTransform
static PX_PHYSX_COMMON_API bool PxGeometryQuery::sweep | ( | const PxVec3 & | unitDir, | |
const PxReal | distance, | |||
const PxGeometry & | geom0, | |||
const PxTransform & | pose0, | |||
const PxGeometry & | geom1, | |||
const PxTransform & | pose1, | |||
PxSweepHit & | sweepHit, | |||
PxSceneQueryFlags | hintFlags = (PxSceneQueryFlags) 0xffffffff | |||
) | [static] |
Sweep a specified geometry object in space and test for collision with a given object.
The following combinations are supported.
- PxSphereGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}
- PxCapsuleGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}
- PxBoxGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}
- PxConvexMeshGeometry vs. {PxSphereGeometry, PxPlaneGeometry, PxCapsuleGeometry, PxBoxGeometry, PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry}
- Parameters:
-
[in] unitDir Normalized direction along which object geom0 should be swept. [in] distance Sweep distance. Needs to be larger than 0. [in] geom0 The geometry object to sweep. Supported geometries are PxSphereGeometry, PxCapsuleGeometry, PxBoxGeometry and PxConvexMeshGeometry [in] pose0 Pose of the geometry object to sweep [in] geom1 The geometry object to test the sweep against [in] pose1 Pose of the geometry object to sweep against [out] sweepHit The sweep hit information. Only valid if this method returns true. [in] hintFlags Specification of the kind of information to retrieve on hit. Combination of PxSceneQueryFlag flags
- Returns:
- True if the swept geometry object geom0 hits the object geom1
- See also:
- PxSweepHit PxGeometry PxTransform
The documentation for this class was generated from the following file:
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com