PxRigidActorExt Class Reference

utility functions for use with PxRigidActor and subclasses More...

#include <PxRigidActorExt.h>

Static Public Member Functions

static PxShapecreateExclusiveShape (PxRigidActor &actor, const PxGeometry &geometry, PxMaterial *const *materials, PxU16 materialCount, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE)
 Creates a new shape with default properties and a list of materials and adds it to the list of shapes of this actor. More...
 
static PX_FORCE_INLINE PxShapecreateExclusiveShape (PxRigidActor &actor, const PxGeometry &geometry, const PxMaterial &material, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE)
 Creates a new shape with default properties and a single material adds it to the list of shapes of this actor. More...
 
static PxBounds3getRigidActorShapeLocalBoundsList (const PxRigidActor &actor, PxU32 &numBounds)
 Gets a list of bounds based on shapes in rigid actor. This list can be used to cook/create bounding volume hierarchy though PxCooking API. More...
 

Detailed Description

utility functions for use with PxRigidActor and subclasses

See also
PxRigidActor PxRigidStatic PxRigidBody PxRigidDynamic PxArticulationLink

Member Function Documentation

◆ createExclusiveShape() [1/2]

static PxShape* PxRigidActorExt::createExclusiveShape ( PxRigidActor actor,
const PxGeometry geometry,
PxMaterial *const *  materials,
PxU16  materialCount,
PxShapeFlags  shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE 
)
inlinestatic

Creates a new shape with default properties and a list of materials and adds it to the list of shapes of this actor.

This is equivalent to the following

PxShape* shape(...) = PxGetPhysics().createShape(...); // reference count is 1 actor->attachShape(shape); // increments reference count shape->release(); // releases user reference, leaving reference count at 1

As a consequence, detachShape() will result in the release of the last reference, and the shape will be deleted.

Note
The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). Triangle mesh, heightfield or plane geometry shapes configured as eSIMULATION_SHAPE are not supported for non-kinematic PxRigidDynamic instances.
Creating compounds with a very large number of shapes may adversely affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]actorthe actor to which to attach the shape
[in]geometrythe geometry of the shape
[in]materialsa pointer to an array of material pointers
[in]materialCountthe count of materials
[in]shapeFlagsoptional PxShapeFlags
Returns
The newly created shape.
See also
PxShape PxShape::release(), PxPhysics::createShape(), PxRigidActor::attachShape()

References PxRigidActor::attachShape(), geometry, PxGetPhysics(), and PxShape::release().

◆ createExclusiveShape() [2/2]

static PX_FORCE_INLINE PxShape* PxRigidActorExt::createExclusiveShape ( PxRigidActor actor,
const PxGeometry geometry,
const PxMaterial material,
PxShapeFlags  shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE 
)
inlinestatic

Creates a new shape with default properties and a single material adds it to the list of shapes of this actor.

This is equivalent to the following

PxShape* shape(...) = PxGetPhysics().createShape(...); // reference count is 1 actor->attachShape(shape); // increments reference count shape->release(); // releases user reference, leaving reference count at 1

As a consequence, detachShape() will result in the release of the last reference, and the shape will be deleted.

Note
The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). Triangle mesh, heightfield or plane geometry shapes configured as eSIMULATION_SHAPE are not supported for non-kinematic PxRigidDynamic instances.
Creating compounds with a very large number of shapes may adversely affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]actorthe actor to which to attach the shape
[in]geometrythe geometry of the shape
[in]materialthe material for the shape
[in]shapeFlagsoptional PxShapeFlags
Returns
The newly created shape.
See also
PxShape PxShape::release(), PxPhysics::createShape(), PxRigidActor::attachShape()

References geometry.

◆ getRigidActorShapeLocalBoundsList()

static PxBounds3* PxRigidActorExt::getRigidActorShapeLocalBoundsList ( const PxRigidActor actor,
PxU32 numBounds 
)
static

Gets a list of bounds based on shapes in rigid actor. This list can be used to cook/create bounding volume hierarchy though PxCooking API.

Parameters
[in]actorThe actor from which the bounds list is retrieved.
[out]numBoundsNumber of bounds in returned list.
See also
PxShape PxBVHStructure PxCooking::createBVHStructure PxCooking::cookBVHStructure

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