PxGjkQuery
Defined in include/geometry/PxGjkQuery.h
-
class PxGjkQuery
Collection of GJK query functions (sweeps, raycasts, overlaps, …).
Public Static Functions
-
static bool proximityInfo(const Support &a, const Support &b, const PxTransform &poseA, const PxTransform &poseB, PxReal contactDistance, PxReal toleranceLength, PxVec3 &pointA, PxVec3 &pointB, PxVec3 &separatingAxis, PxReal &separation)
Computes proximity information for two shapes using GJK-EPA algorithm.
- Parameters
a – [in] Shape A support mapping
b – [in] Shape B support mapping
poseA – [in] Shape A transformation
poseB – [in] Shape B transformation
contactDistance – [in] The distance at which proximity info begins to be computed between the shapes
toleranceLength – [in] The toleranceLength. Used for scaling distance-based thresholds internally to produce appropriate results given simulations in different units
pointA – [out] The closest/deepest point on shape A surface
pointB – [out] The closest/deepest point on shape B surface
separatingAxis – [out] Translating shape B along ‘separatingAxis’ by ‘separation’ makes the shapes touching
separation – [out] Translating shape B along ‘separatingAxis’ by ‘separation’ makes the shapes touching
- Returns
False if the distance greater than contactDistance.
-
static bool raycast(const Support &shape, const PxTransform &pose, const PxVec3 &rayStart, const PxVec3 &unitDir, PxReal maxDist, PxReal &t, PxVec3 &n, PxVec3 &p)
Raycast test against the given shape.
- Parameters
shape – [in] Shape support mapping
pose – [in] Shape transformation
rayStart – [in] The start point of the ray to test the shape against
unitDir – [in] Normalized direction of the ray to test the shape against
maxDist – [in] Maximum ray length, has to be in the [0, inf) range
t – [out] Hit distance
n – [out] Hit normal
p – [out] Hit point
- Returns
True if there is a hit.
-
static bool overlap(const Support &a, const Support &b, const PxTransform &poseA, const PxTransform &poseB)
Overlap test for two shapes.
- Parameters
a – [in] Shape A support mapping
b – [in] Shape B support mapping
poseA – [in] Shape A transformation
poseB – [in] Shape B transformation
- Returns
True if the shapes overlap.
-
static bool sweep(const Support &a, const Support &b, const PxTransform &poseA, const PxTransform &poseB, const PxVec3 &unitDir, PxReal maxDist, PxReal &t, PxVec3 &n, PxVec3 &p)
Sweep the shape B in space and test for collision with the shape A.
- Parameters
a – [in] Shape A support mapping
b – [in] Shape B support mapping
poseA – [in] Shape A transformation
poseB – [in] Shape B transformation
unitDir – [in] Normalized direction of the ray to test the shape against
maxDist – [in] Maximum ray length, has to be in the [0, inf) range
t – [out] Hit distance
n – [out] Hit normal
p – [out] Hit point
- Returns
True if there is a hit.
-
struct Support
Abstract interface for a user defined shape GJK mapping support.
A user defined shape consists of a core shape and a margin. If the distance between two shapes’ cores is equal to the sum of their margins, these shapes are considered touching.
Subclassed by PxGjkQueryExt::BoxSupport, PxGjkQueryExt::CapsuleSupport, PxGjkQueryExt::ConvexGeomSupport, PxGjkQueryExt::ConvexMeshSupport, PxGjkQueryExt::SphereSupport
-
static bool proximityInfo(const Support &a, const Support &b, const PxTransform &poseA, const PxTransform &poseB, PxReal contactDistance, PxReal toleranceLength, PxVec3 &pointA, PxVec3 &pointB, PxVec3 &separatingAxis, PxReal &separation)