|
RavEngine
|
Collection of geometry object queries (sweeps, raycasts, overlaps, ...). More...
#include <PxGeometryQuery.h>
Static Public Member Functions | |
| static PX_PHYSX_COMMON_API PxU32 | raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxGeometry &geom, const PxTransform &pose, PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit *PX_RESTRICT rayHits, PxU32 stride, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT, PxRaycastThreadContext *threadContext=NULL) |
| Raycast test against a geometry object. | |
| template<class HitT > | |
| PX_DEPRECATED static PX_FORCE_INLINE PxU32 | raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxGeometry &geom, const PxTransform &pose, PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, HitT *PX_RESTRICT rayHits) |
| Backward compatibility helper. | |
| static PX_PHYSX_COMMON_API bool | overlap (const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT, PxOverlapThreadContext *threadContext=NULL) |
| Overlap test for two geometry objects. | |
| static PX_PHYSX_COMMON_API bool | sweep (const PxVec3 &unitDir, const PxReal maxDist, const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxGeomSweepHit &sweepHit, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxReal inflation=0.0f, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT, PxSweepThreadContext *threadContext=NULL) |
| Sweep a specified geometry object in space and test for collision with a given object. | |
| static PX_PHYSX_COMMON_API bool | computePenetration (PxVec3 &direction, PxF32 &depth, const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) |
| Compute minimum translational distance (MTD) between two geometry objects. | |
| static PX_PHYSX_COMMON_API PxReal | pointDistance (const PxVec3 &point, const PxGeometry &geom, const PxTransform &pose, PxVec3 *closestPoint=NULL, PxU32 *closestIndex=NULL, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) |
| Computes distance between a point and a geometry object. | |
| static PX_PHYSX_COMMON_API void | computeGeomBounds (PxBounds3 &bounds, const PxGeometry &geom, const PxTransform &pose, float offset=0.0f, float inflation=1.0f, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) |
| computes the bounds for a geometry object | |
| PX_DEPRECATED static PX_PHYSX_COMMON_API PxBounds3 | getWorldBounds (const PxGeometry &geom, const PxTransform &pose, float inflation=1.01f) |
| get the bounds for a geometry object | |
| static PX_PHYSX_COMMON_API bool | generateTriangleContacts (const PxGeometry &geom, const PxTransform &pose, const PxVec3 triangleVertices[3], PxU32 triangleIndex, PxReal contactDistance, PxReal meshContactMargin, PxReal toleranceLength, PxContactBuffer &contactBuffer) |
| Generate collision contacts between a convex geometry and a single triangle. | |
| static PX_PHYSX_COMMON_API bool | isValid (const PxGeometry &geom) |
| Checks if provided geometry is valid. | |
Collection of geometry object queries (sweeps, raycasts, overlaps, ...).
|
static |
computes the bounds for a geometry object
| [out] | bounds | Returned computed bounds |
| [in] | geom | The geometry object |
| [in] | pose | Pose of the geometry object |
| [in] | offset | Offset for computed bounds. This value is added to the geom's extents. |
| [in] | inflation | Scale factor for computed bounds. The geom's extents are multiplied by this value. |
| [in] | queryFlags | Optional flags controlling the query. |
|
static |
Compute minimum translational distance (MTD) between two geometry objects.
All combinations of geom objects are supported except:
The function returns a unit vector ('direction') and a penetration depth ('depth').
The depenetration vector D = direction * depth should be applied to the first object, to get out of the second object.
Returned depth should always be positive or null.
If objects do not overlap, the function can not compute the MTD and returns false.
| [out] | direction | Computed MTD unit direction |
| [out] | depth | Penetration depth. Always positive or null. |
| [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 |
| [in] | queryFlags | Optional flags controlling the query. |
|
static |
Generate collision contacts between a convex geometry and a single triangle.
| [in] | geom | The geometry object. Can be a capsule, a box or a convex mesh |
| [in] | pose | Pose of the geometry object |
| [in] | triangleVertices | Triangle vertices in local space |
| [in] | triangleIndex | Triangle index |
| [in] | contactDistance | The distance at which contacts begin to be generated between the pairs |
| [in] | meshContactMargin | The mesh contact margin. |
| [in] | toleranceLength | The toleranceLength. Used for scaling distance-based thresholds internally to produce appropriate results given simulations in different units |
| [out] | contactBuffer | A buffer to write contacts to. |
|
static |
get the bounds for a geometry object
| [in] | geom | The geometry object |
| [in] | pose | Pose of the geometry object |
| [in] | inflation | Scale factor for computed world bounds. Box extents are multiplied by this value. |
|
static |
Checks if provided geometry is valid.
| [in] | geom | The geometry object. |
|
static |
Overlap test for two geometry objects.
All combinations are supported except:
| [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 |
| [in] | queryFlags | Optional flags controlling the query. |
| [in] | threadContext | Optional user-defined per-thread context. |
|
static |
Computes distance between a point and a geometry object.
Currently supported geometry objects: box, sphere, capsule, convex, mesh.
| [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. |
| [out] | closestIndex | Optionally returned closest (triangle) index. Only valid for triangle meshes. |
| [in] | queryFlags | Optional flags controlling the query. |
|
inlinestatic |
Backward compatibility helper.
|
static |
Raycast test against a geometry object.
All geometry types are supported except PxParticleSystemGeometry, PxTetrahedronMeshGeometry and PxHairSystemGeometry.
| [in] | origin | The origin of the ray to test the geometry object against |
| [in] | unitDir | Normalized 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, has to be in the [0, inf) range |
| [in] | hitFlags | Specification of the kind of information to retrieve on hit. Combination of #PxHitFlag flags |
| [in] | maxHits | max number of returned hits = size of 'rayHits' buffer |
| [out] | rayHits | Raycast hits information |
| [in] | stride | Stride value (in number of bytes) for rayHits array. Typically sizeof(PxGeomRaycastHit) for packed arrays. |
| [in] | queryFlags | Optional flags controlling the query. |
| [in] | threadContext | Optional user-defined per-thread context. |
|
static |
Sweep a specified geometry object in space and test for collision with a given object.
The following combinations are supported.
| [in] | unitDir | Normalized direction along which object geom0 should be swept |
| [in] | maxDist | Maximum sweep distance, has to be in the [0, inf) range |
| [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] | hitFlags | Specify which properties per hit should be computed and written to result hit array. Combination of #PxHitFlag flags |
| [in] | inflation | Surface of the swept shape is additively extruded in the normal direction, rounding corners and edges. |
| [in] | queryFlags | Optional flags controlling the query. |
| [in] | threadContext | Optional user-defined per-thread context. |