Abstract singleton factory class used for instancing objects in the Physics SDK. More...
#include <PxPhysics.h>
Public Member Functions | |
Basics | |
virtual | ~PxPhysics () |
virtual void | release ()=0 |
Destroys the instance it is called on. More... | |
virtual PxFoundation & | getFoundation ()=0 |
Retrieves the Foundation instance. More... | |
virtual PxAggregate * | createAggregate (PxU32 maxSize, bool enableSelfCollision)=0 |
Creates an aggregate with the specified maximum size and selfCollision property. More... | |
virtual const PxTolerancesScale & | getTolerancesScale () const =0 |
Returns the simulation tolerance parameters. More... | |
Meshes | |
virtual PxTriangleMesh * | createTriangleMesh (PxInputStream &stream)=0 |
Creates a triangle mesh object. More... | |
virtual PxU32 | getNbTriangleMeshes () const =0 |
Return the number of triangle meshes that currently exist. More... | |
virtual PxU32 | getTriangleMeshes (PxTriangleMesh **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of triangle mesh pointers to a user buffer. More... | |
virtual PxHeightField * | createHeightField (PxInputStream &stream)=0 |
Creates a heightfield object from previously cooked stream. More... | |
virtual PxU32 | getNbHeightFields () const =0 |
Return the number of heightfields that currently exist. More... | |
virtual PxU32 | getHeightFields (PxHeightField **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of heightfield pointers to a user buffer. More... | |
virtual PxConvexMesh * | createConvexMesh (PxInputStream &stream)=0 |
Creates a convex mesh object. More... | |
virtual PxU32 | getNbConvexMeshes () const =0 |
Return the number of convex meshes that currently exist. More... | |
virtual PxU32 | getConvexMeshes (PxConvexMesh **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of convex mesh pointers to a user buffer. More... | |
virtual PxBVHStructure * | createBVHStructure (PxInputStream &stream)=0 |
Creates a bounding volume hierarchy structure. More... | |
virtual PxU32 | getNbBVHStructures () const =0 |
Return the number of bounding volume hierarchy structures that currently exist. More... | |
virtual PxU32 | getBVHStructures (PxBVHStructure **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of bounding volume hierarchy structure pointers to a user buffer. More... | |
Scenes | |
virtual PxScene * | createScene (const PxSceneDesc &sceneDesc)=0 |
Creates a scene. More... | |
virtual PxU32 | getNbScenes () const =0 |
Gets number of created scenes. More... | |
virtual PxU32 | getScenes (PxScene **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of scene pointers to a user buffer. More... | |
Actors | |
virtual PxRigidStatic * | createRigidStatic (const PxTransform &pose)=0 |
Creates a static rigid actor with the specified pose and all other fields initialized to their default values. More... | |
virtual PxRigidDynamic * | createRigidDynamic (const PxTransform &pose)=0 |
Creates a dynamic rigid actor with the specified pose and all other fields initialized to their default values. More... | |
virtual PxPruningStructure * | createPruningStructure (PxRigidActor *const *actors, PxU32 nbActors)=0 |
Creates a pruning structure from actors. More... | |
Shapes | |
PX_FORCE_INLINE PxShape * | createShape (const PxGeometry &geometry, const PxMaterial &material, bool isExclusive=false, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE) |
Creates a shape which may be attached to multiple actors. More... | |
virtual PxShape * | createShape (const PxGeometry &geometry, PxMaterial *const *materials, PxU16 materialCount, bool isExclusive=false, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE)=0 |
Creates a shape which may be attached to multiple actors. More... | |
virtual PxU32 | getNbShapes () const =0 |
Return the number of shapes that currently exist. More... | |
virtual PxU32 | getShapes (PxShape **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of shape pointers to a user buffer. More... | |
Constraints and Articulations | |
virtual PxConstraint * | createConstraint (PxRigidActor *actor0, PxRigidActor *actor1, PxConstraintConnector &connector, const PxConstraintShaderTable &shaders, PxU32 dataSize)=0 |
Creates a constraint shader. More... | |
virtual PxArticulation * | createArticulation ()=0 |
Creates an articulation with all fields initialized to their default values. More... | |
virtual PxArticulationReducedCoordinate * | createArticulationReducedCoordinate ()=0 |
Creates a reduced coordinate articulation with all fields initialized to their default values. More... | |
Materials | |
virtual PxMaterial * | createMaterial (PxReal staticFriction, PxReal dynamicFriction, PxReal restitution)=0 |
Creates a new material with default properties. More... | |
virtual PxU32 | getNbMaterials () const =0 |
Return the number of materials that currently exist. More... | |
virtual PxU32 | getMaterials (PxMaterial **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Writes the array of material pointers to a user buffer. More... | |
Deletion Listeners | |
virtual void | registerDeletionListener (PxDeletionListener &observer, const PxDeletionEventFlags &deletionEvents, bool restrictedObjectSet=false)=0 |
Register a deletion listener. Listeners will be called whenever an object is deleted. More... | |
virtual void | unregisterDeletionListener (PxDeletionListener &observer)=0 |
Unregister a deletion listener. More... | |
virtual void | registerDeletionListenerObjects (PxDeletionListener &observer, const PxBase *const *observables, PxU32 observableCount)=0 |
Register specific objects for deletion events. More... | |
virtual void | unregisterDeletionListenerObjects (PxDeletionListener &observer, const PxBase *const *observables, PxU32 observableCount)=0 |
Unregister specific objects for deletion events. More... | |
virtual PxPhysicsInsertionCallback & | getPhysicsInsertionCallback ()=0 |
Gets PxPhysics object insertion interface. More... | |
Abstract singleton factory class used for instancing objects in the Physics SDK.
In addition you can use PxPhysics to set global parameters which will effect all scenes and create objects that can be shared across multiple scenes.
You can get an instance of this class by calling PxCreateBasePhysics() or PxCreatePhysics() with pre-registered modules.
|
inlinevirtual |
|
pure virtual |
Creates an aggregate with the specified maximum size and selfCollision property.
[in] | maxSize | The maximum number of actors that may be placed in the aggregate. |
[in] | enableSelfCollision | Whether the aggregate supports self-collision |
|
pure virtual |
Creates an articulation with all fields initialized to their default values.
|
pure virtual |
Creates a reduced coordinate articulation with all fields initialized to their default values.
|
pure virtual |
Creates a bounding volume hierarchy structure.
[in] | stream | The stream to load the BVH structure from. |
|
pure virtual |
Creates a constraint shader.
[in] | actor0 | The first actor |
[in] | actor1 | The second actor |
[in] | connector | The connector object, which the SDK uses to communicate with the infrastructure for the constraint |
[in] | shaders | The shader functions for the constraint |
[in] | dataSize | The size of the data block for the shader |
|
pure virtual |
Creates a convex mesh object.
This can then be instanced into PxShape objects.
[in] | stream | The stream to load the convex mesh from. |
|
pure virtual |
Creates a heightfield object from previously cooked stream.
This can then be instanced into PxShape objects.
[in] | stream | The heightfield mesh stream. |
|
pure virtual |
Creates a new material with default properties.
[in] | staticFriction | The coefficient of static friction |
[in] | dynamicFriction | The coefficient of dynamic friction |
[in] | restitution | The coefficient of restitution |
|
pure virtual |
Creates a pruning structure from actors.
[in] | actors | Array of actors to add to the pruning structure. Must be non NULL. |
[in] | nbActors | Number of actors in the array. Must be >0. |
|
pure virtual |
Creates a dynamic rigid actor with the specified pose and all other fields initialized to their default values.
[in] | pose | The initial pose of the actor. Must be a valid transform |
|
pure virtual |
Creates a static rigid actor with the specified pose and all other fields initialized to their default values.
[in] | pose | The initial pose of the actor. Must be a valid transform |
|
pure virtual |
Creates a scene.
[in] | sceneDesc | Scene descriptor. See PxSceneDesc |
|
inline |
Creates a shape which may be attached to multiple actors.
The shape will be created with a reference count of 1.
[in] | geometry | The geometry for the shape |
[in] | material | The material for the shape |
[in] | isExclusive | Whether this shape is exclusive to a single actor or maybe be shared |
[in] | shapeFlags | The PxShapeFlags to be set |
Shared shapes are not mutable when they are attached to an actor
References geometry.
|
pure virtual |
Creates a shape which may be attached to multiple actors.
The shape will be created with a reference count of 1.
[in] | geometry | The geometry for the shape |
[in] | materials | The materials for the shape |
[in] | materialCount | The number of materials |
[in] | isExclusive | Whether this shape is exclusive to a single actor or may be shared |
[in] | shapeFlags | The PxShapeFlags to be set |
Shared shapes are not mutable when they are attached to an actor
|
pure virtual |
Creates a triangle mesh object.
This can then be instanced into PxShape objects.
[in] | stream | The triangle mesh stream. |
|
pure virtual |
Writes the array of bounding volume hierarchy structure pointers to a user buffer.
Returns the number of pointers written.
The ordering of the BVH structures in the array is not specified.
[out] | userBuffer | The buffer to receive BVH structure pointers. |
[in] | bufferSize | The number of BVH structure pointers which can be stored in the buffer. |
[in] | startIndex | Index of first BVH structure pointer to be retrieved |
|
pure virtual |
Writes the array of convex mesh pointers to a user buffer.
Returns the number of pointers written.
The ordering of the convex meshes in the array is not specified.
[out] | userBuffer | The buffer to receive convex mesh pointers. |
[in] | bufferSize | The number of convex mesh pointers which can be stored in the buffer. |
[in] | startIndex | Index of first convex mesh pointer to be retrieved |
|
pure virtual |
Retrieves the Foundation instance.
|
pure virtual |
Writes the array of heightfield pointers to a user buffer.
Returns the number of pointers written.
The ordering of the heightfields in the array is not specified.
[out] | userBuffer | The buffer to receive heightfield pointers. |
[in] | bufferSize | The number of heightfield pointers which can be stored in the buffer. |
[in] | startIndex | Index of first heightfield pointer to be retrieved |
|
pure virtual |
Writes the array of material pointers to a user buffer.
Returns the number of pointers written.
The ordering of the materials in the array is not specified.
[out] | userBuffer | The buffer to receive material pointers. |
[in] | bufferSize | The number of material pointers which can be stored in the buffer. |
[in] | startIndex | Index of first material pointer to be retrieved |
|
pure virtual |
Return the number of bounding volume hierarchy structures that currently exist.
|
pure virtual |
Return the number of convex meshes that currently exist.
|
pure virtual |
Return the number of heightfields that currently exist.
|
pure virtual |
Return the number of materials that currently exist.
|
pure virtual |
Gets number of created scenes.
|
pure virtual |
|
pure virtual |
Return the number of triangle meshes that currently exist.
|
pure virtual |
Gets PxPhysics object insertion interface.
The insertion interface is needed ie. for PxCooking::createTriangleMesh, this allows runtime mesh creation. This is not advised to do, please use offline cooking if possible.
|
pure virtual |
Writes the array of scene pointers to a user buffer.
Returns the number of pointers written.
The ordering of the scene pointers in the array is not specified.
[out] | userBuffer | The buffer to receive scene pointers. |
[in] | bufferSize | The number of scene pointers which can be stored in the buffer. |
[in] | startIndex | Index of first scene pointer to be retrieved |
|
pure virtual |
Writes the array of shape pointers to a user buffer.
Returns the number of pointers written.
The ordering of the shapes in the array is not specified.
[out] | userBuffer | The buffer to receive shape pointers. |
[in] | bufferSize | The number of shape pointers which can be stored in the buffer. |
[in] | startIndex | Index of first shape pointer to be retrieved |
|
pure virtual |
Returns the simulation tolerance parameters.
|
pure virtual |
Writes the array of triangle mesh pointers to a user buffer.
Returns the number of pointers written.
The ordering of the triangle meshes in the array is not specified.
[out] | userBuffer | The buffer to receive triangle mesh pointers. |
[in] | bufferSize | The number of triangle mesh pointers which can be stored in the buffer. |
[in] | startIndex | Index of first mesh pointer to be retrieved |
|
pure virtual |
Register a deletion listener. Listeners will be called whenever an object is deleted.
It is illegal to register or unregister a deletion listener while deletions are being processed.
[in] | observer | Observer object to send notifications to. |
[in] | deletionEvents | The deletion event types to get notified of. |
[in] | restrictedObjectSet | If false, the deletion listener will get events from all objects, else the objects to receive events from have to be specified explicitly through registerDeletionListenerObjects. |
|
pure virtual |
Register specific objects for deletion events.
This method allows for a deletion listener to limit deletion events to specific objects only.
[in] | observer | Observer object to send notifications to. |
[in] | observables | List of objects for which to receive deletion events. Only PhysX core objects are supported. In the case of PxJoint objects, the underlying PxConstraint can be used to get the events. |
[in] | observableCount | Size of the observables list. |
|
pure virtual |
Destroys the instance it is called on.
Use this release method to destroy an instance of this class. Be sure to not keep a reference to this object after calling release. Avoid release calls while a scene is simulating (in between simulate() and fetchResults() calls).
Note that this must be called once for each prior call to PxCreatePhysics, as there is a reference counter. Also note that you mustn't destroy the allocator or the error callback (if available) until after the reference count reaches 0 and the SDK is actually removed.
Releasing an SDK will also release any scenes, triangle meshes, convex meshes, heightfields and shapes created through it, provided the user hasn't already done so.
|
pure virtual |
Unregister a deletion listener.
It is illegal to register or unregister a deletion listener while deletions are being processed.
[in] | observer | Observer object to send notifications to |
|
pure virtual |
Unregister specific objects for deletion events.
This method allows to clear previously registered objects for a deletion listener (see registerDeletionListenerObjects()).
[in] | observer | Observer object to stop sending notifications to. |
[in] | observables | List of objects for which to not receive deletion events anymore. |
[in] | observableCount | Size of the observables list. |