RavEngine
Loading...
Searching...
No Matches
physx::PxGjkQuery Class Reference

Collection of GJK query functions (sweeps, raycasts, overlaps, ...). More...

#include <PxGjkQuery.h>

Classes

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. More...
 

Static Public Member Functions

static PX_PHYSX_COMMON_API 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.
 
static PX_PHYSX_COMMON_API 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.
 
static PX_PHYSX_COMMON_API bool overlap (const Support &a, const Support &b, const PxTransform &poseA, const PxTransform &poseB)
 Overlap test for two shapes.
 
static PX_PHYSX_COMMON_API 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.
 

Detailed Description

Collection of GJK query functions (sweeps, raycasts, overlaps, ...).

Member Function Documentation

◆ overlap()

bool PxGjkQuery::overlap ( const Support &  a,
const Support &  b,
const PxTransform &  poseA,
const PxTransform &  poseB 
)
static

Overlap test for two shapes.

Parameters
[in]aShape A support mapping
[in]bShape B support mapping
[in]poseAShape A transformation
[in]poseBShape B transformation
Returns
True if the shapes overlap.

◆ proximityInfo()

bool PxGjkQuery::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 
)
static

Computes proximity information for two shapes using GJK-EPA algorithm.

Parameters
[in]aShape A support mapping
[in]bShape B support mapping
[in]poseAShape A transformation
[in]poseBShape B transformation
[in]contactDistanceThe distance at which proximity info begins to be computed between the shapes
[in]toleranceLengthThe toleranceLength. Used for scaling distance-based thresholds internally to produce appropriate results given simulations in different units
[out]pointAThe closest/deepest point on shape A surface
[out]pointBThe closest/deepest point on shape B surface
[out]separatingAxisTranslating shape B along 'separatingAxis' by 'separation' makes the shapes touching
[out]separationTranslating shape B along 'separatingAxis' by 'separation' makes the shapes touching
Returns
False if the distance greater than contactDistance.

◆ raycast()

bool PxGjkQuery::raycast ( const Support &  shape,
const PxTransform &  pose,
const PxVec3 &  rayStart,
const PxVec3 &  unitDir,
PxReal  maxDist,
PxReal &  t,
PxVec3 &  n,
PxVec3 &  p 
)
static

Raycast test against the given shape.

Parameters
[in]shapeShape support mapping
[in]poseShape transformation
[in]rayStartThe start point of the ray to test the shape against
[in]unitDirNormalized direction of the ray to test the shape against
[in]maxDistMaximum ray length, has to be in the [0, inf) range
[out]tHit distance
[out]nHit normal
[out]pHit point
Returns
True if there is a hit.

◆ sweep()

bool PxGjkQuery::sweep ( const Support &  a,
const Support &  b,
const PxTransform &  poseA,
const PxTransform &  poseB,
const PxVec3 &  unitDir,
PxReal  maxDist,
PxReal &  t,
PxVec3 &  n,
PxVec3 &  p 
)
static

Sweep the shape B in space and test for collision with the shape A.

Parameters
[in]aShape A support mapping
[in]bShape B support mapping
[in]poseAShape A transformation
[in]poseBShape B transformation
[in]unitDirNormalized direction of the ray to test the shape against
[in]maxDistMaximum ray length, has to be in the [0, inf) range
[out]tHit distance
[out]nHit normal
[out]pHit point
Returns
True if there is a hit.

The documentation for this class was generated from the following files: