PxShapeExt

Defined in include/extensions/PxShapeExt.h

class PxShapeExt

utility functions for use with PxShape

See also

PxShape

Public Static Functions

static inline PxTransform getGlobalPose(const PxShape &shape, const PxRigidActor &actor)

Retrieves the world space pose of the shape.

Parameters
  • shape[in] The shape for which to get the global pose.

  • actor[in] The actor to which the shape is attached

Returns

Global pose of shape.

static inline PxU32 raycast(const PxShape &shape, const PxRigidActor &actor, const PxVec3 &rayOrigin, const PxVec3 &rayDir, PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, PxRaycastHit *rayHits)

Raycast test against the shape.

See also

PxRaycastHit PxTransform

Parameters
  • shape[in] the shape

  • actor[in] the actor to which the shape is attached

  • rayOrigin[in] The origin of the ray to test the geometry object against

  • rayDir[in] The direction of the ray to test the geometry object against

  • maxDist[in] Maximum ray length

  • hitFlags[in] Specify which properties per hit should be computed and written to result hit array. Combination of PxHitFlag flags

  • maxHits[in] max number of returned hits = size of ‘rayHits’ buffer

  • rayHits[out] Raycast hits information

Returns

Number of hits between the ray and the shape

static inline bool overlap(const PxShape &shape, const PxRigidActor &actor, const PxGeometry &otherGeom, const PxTransform &otherGeomPose)

Test overlap between the shape and a geometry object.

See also

PxGeometry PxTransform

Parameters
  • shape[in] the shape

  • actor[in] the actor to which the shape is attached

  • otherGeom[in] The other geometry object to test overlap with

  • otherGeomPose[in] Pose of the other geometry object

Returns

True if the shape overlaps the geometry object

static inline bool sweep(const PxShape &shape, const PxRigidActor &actor, const PxVec3 &unitDir, const PxReal distance, const PxGeometry &otherGeom, const PxTransform &otherGeomPose, PxSweepHit &sweepHit, PxHitFlags hitFlags)

Sweep a geometry object against the shape.

Currently only box, sphere, capsule and convex mesh shapes are supported, i.e. the swept geometry object must be one of those types.

See also

PxGeometry PxTransform PxSweepHit

Parameters
  • shape[in] the shape

  • actor[in] the actor to which the shape is attached

  • unitDir[in] Normalized direction along which the geometry object should be swept.

  • distance[in] Sweep distance. Needs to be larger than 0.

  • otherGeom[in] The geometry object to sweep against the shape

  • otherGeomPose[in] Pose of the geometry object

  • sweepHit[out] The sweep hit information. Only valid if this method returns true.

  • hitFlags[in] Specify which properties per hit should be computed and written to result hit array. Combination of PxHitFlag flags

Returns

True if the swept geometry object hits the shape

static inline PxBounds3 getWorldBounds(const PxShape &shape, const PxRigidActor &actor, float inflation = 1.01f)

Retrieves the axis aligned bounding box enclosing the shape.

See also

PxBounds3

Parameters
  • shape[in] the shape

  • actor[in] the actor to which the shape is attached

  • inflation[in] Scale factor for computed world bounds. Box extents are multiplied by this value.

Returns

The shape’s bounding box.