Static Public Member Functions | List of all members
PxShapeExt Class Reference

utility functions for use with PxShape More...

#include <PxShapeExt.h>

Static Public Member Functions

static PX_INLINE PxTransform getGlobalPose (const PxShape &shape, const PxRigidActor &actor)
 Retrieves the world space pose of the shape. More...
 
static PX_INLINE PxU32 raycast (const PxShape &shape, const PxRigidActor &actor, const PxVec3 &rayOrigin, const PxVec3 &rayDir, PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, PxRaycastHit *rayHits, bool anyHit)
 Raycast test against the shape. More...
 
static PX_INLINE bool overlap (const PxShape &shape, const PxRigidActor &actor, const PxGeometry &otherGeom, const PxTransform &otherGeomPose)
 Test overlap between the shape and a geometry object. More...
 
static PX_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. More...
 
static PX_INLINE PxBounds3 getWorldBounds (const PxShape &shape, const PxRigidActor &actor, float inflation=1.01f)
 Retrieves the axis aligned bounding box enclosing the shape. More...
 

Detailed Description

utility functions for use with PxShape

See Also
PxShape

Member Function Documentation

static PX_INLINE PxTransform PxShapeExt::getGlobalPose ( const PxShape shape,
const PxRigidActor actor 
)
inlinestatic

Retrieves the world space pose of the shape.

Parameters
[in]shapeThe shape for which to get the global pose.
[in]actorThe actor to which the shape is attached
Returns
Global pose of shape.

References PxRigidActor::getGlobalPose(), and PxShape::getLocalPose().

static PX_INLINE PxBounds3 PxShapeExt::getWorldBounds ( const PxShape shape,
const PxRigidActor actor,
float  inflation = 1.01f 
)
inlinestatic

Retrieves the axis aligned bounding box enclosing the shape.

Returns
The shape's bounding box.
Parameters
[in]shapethe shape
[in]actorthe actor to which the shape is attached
[in]inflationScale factor for computed world bounds. Box extents are multiplied by this value.
See Also
PxBounds3

References PxGeometryHolder::any(), PxShape::getGeometry(), and PxGeometryQuery::getWorldBounds().

static PX_INLINE bool PxShapeExt::overlap ( const PxShape shape,
const PxRigidActor actor,
const PxGeometry otherGeom,
const PxTransform otherGeomPose 
)
inlinestatic

Test overlap between the shape and a geometry object.

Parameters
[in]shapethe shape
[in]actorthe actor to which the shape is attached
[in]otherGeomThe other geometry object to test overlap with
[in]otherGeomPosePose of the other geometry object
Returns
True if the shape overlaps the geometry object
See Also
PxGeometry PxTransform

References PxGeometryHolder::any(), PxShape::getGeometry(), and PxGeometryQuery::overlap().

static PX_INLINE PxU32 PxShapeExt::raycast ( const PxShape shape,
const PxRigidActor actor,
const PxVec3 rayOrigin,
const PxVec3 rayDir,
PxReal  maxDist,
PxHitFlags  hitFlags,
PxU32  maxHits,
PxRaycastHit rayHits,
bool  anyHit 
)
inlinestatic

Raycast test against the shape.

Parameters
[in]shapethe shape
[in]actorthe actor to which the shape is attached
[in]rayOriginThe origin of the ray to test the geometry object against
[in]rayDirThe direction of the ray to test the geometry object against
[in]maxDistMaximum ray length
[in]hitFlagsSpecify which properties per hit should be computed and written to result hit array. Combination of PxHitFlag flags
[in]maxHitsmax number of returned hits = size of 'rayHits' buffer
[out]rayHitsRaycast hits information
[in]anyHitSet to false if the closest hit point should be computed, else the query aborts as soon as any valid hit point is found.
Returns
Number of hits between the ray and the shape
See Also
PxRaycastHit PxTransform

References PxGeometryHolder::any(), PxShape::getGeometry(), and PxGeometryQuery::raycast().

static PX_INLINE bool PxShapeExt::sweep ( const PxShape shape,
const PxRigidActor actor,
const PxVec3 unitDir,
const PxReal  distance,
const PxGeometry otherGeom,
const PxTransform otherGeomPose,
PxSweepHit sweepHit,
PxHitFlags  hitFlags 
)
inlinestatic

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.

Parameters
[in]shapethe shape
[in]actorthe actor to which the shape is attached
[in]unitDirNormalized direction along which the geometry object should be swept.
[in]distanceSweep distance. Needs to be larger than 0.
[in]otherGeomThe geometry object to sweep against the shape
[in]otherGeomPosePose of the geometry object
[out]sweepHitThe sweep hit information. Only valid if this method returns true.
[in]hitFlagsSpecify 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
See Also
PxGeometry PxTransform PxSweepHit

References PxGeometryHolder::any(), PxShape::getGeometry(), and PxGeometryQuery::sweep().


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


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com