RavEngine
Loading...
Searching...
No Matches
physx::PxScene Class Referenceabstract

A scene is a collection of bodies and constraints which can interact. More...

#include <PxScene.h>

Inheritance diagram for physx::PxScene:
[legend]
Collaboration diagram for physx::PxScene:
[legend]

Public Member Functions

Add/Remove Articulations
virtual bool addArticulation (PxArticulationReducedCoordinate &articulation)=0
 Adds an articulation to this scene.
 
virtual void removeArticulation (PxArticulationReducedCoordinate &articulation, bool wakeOnLostTouch=true)=0
 Removes an articulation from this scene.
 
Add/Remove Actors
virtual bool addActor (PxActor &actor, const PxBVH *bvh=NULL)=0
 Adds an actor to this scene.
 
virtual bool addActors (PxActor *const *actors, PxU32 nbActors)=0
 Adds actors to this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.
 
virtual bool addActors (const PxPruningStructure &pruningStructure)=0
 Adds a pruning structure together with its actors to this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.
 
virtual void removeActor (PxActor &actor, bool wakeOnLostTouch=true)=0
 Removes an actor from this scene.
 
virtual void removeActors (PxActor *const *actors, PxU32 nbActors, bool wakeOnLostTouch=true)=0
 Removes actors from this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.
 
virtual bool addAggregate (PxAggregate &aggregate)=0
 Adds an aggregate to this scene.
 
virtual void removeAggregate (PxAggregate &aggregate, bool wakeOnLostTouch=true)=0
 Removes an aggregate from this scene.
 
virtual bool addCollection (const PxCollection &collection)=0
 Adds objects in the collection to this scene.
 
Contained Object Retrieval
virtual PxU32 getNbActors (PxActorTypeFlags types) const =0
 Retrieve the number of actors of certain types in the scene. For supported types, see PxActorTypeFlags.
 
virtual PxU32 getActors (PxActorTypeFlags types, PxActor **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the actors of certain types in the scene. For supported types, see PxActorTypeFlags.
 
virtual PxActor ** getActiveActors (PxU32 &nbActorsOut)=0
 Queries the PxScene for a list of the PxActors whose transforms have been updated during the previous simulation step. Only includes actors of type PxRigidDynamic and PxArticulationLink.
 
virtual PxU32 getNbSoftBodies () const =0
 Retrieve the number of soft bodies in the scene.
 
virtual PxU32 getSoftBodies (PxSoftBody **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the soft bodies in the scene.
 
virtual PxU32 getNbParticleSystems (PxParticleSolverType::Enum type) const =0
 Retrieve the number of particle systems of the requested type in the scene.
 
virtual PxU32 getParticleSystems (PxParticleSolverType::Enum type, PxParticleSystem **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the particle systems of the requested type in the scene.
 
virtual PxU32 getNbFEMCloths () const =0
 Retrieve the number of FEM cloths in the scene.
 
virtual PxU32 getFEMCloths (PxFEMCloth **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the FEM cloths in the scene.
 
virtual PxU32 getNbHairSystems () const =0
 Retrieve the number of hair systems in the scene.
 
virtual PxU32 getHairSystems (PxHairSystem **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve an array of all the hair systems in the scene.
 
virtual PxU32 getNbArticulations () const =0
 Returns the number of articulations in the scene.
 
virtual PxU32 getArticulations (PxArticulationReducedCoordinate **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the articulations in the scene.
 
virtual PxU32 getNbConstraints () const =0
 Returns the number of constraint shaders in the scene.
 
virtual PxU32 getConstraints (PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the constraint shaders in the scene.
 
virtual PxU32 getNbAggregates () const =0
 Returns the number of aggregates in the scene.
 
virtual PxU32 getAggregates (PxAggregate **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the aggregates in the scene.
 
Dominance
virtual void setDominanceGroupPair (PxDominanceGroup group1, PxDominanceGroup group2, const PxDominanceGroupPair &dominance)=0
 Specifies the dominance behavior of contacts between two actors with two certain dominance groups.
 
virtual PxDominanceGroupPair getDominanceGroupPair (PxDominanceGroup group1, PxDominanceGroup group2) const =0
 Samples the dominance matrix.
 
Dispatcher
virtual PxCpuDispatcher * getCpuDispatcher () const =0
 Return the cpu dispatcher that was set in PxSceneDesc::cpuDispatcher when creating the scene with PxPhysics::createScene.
 
virtual PxCudaContextManager * getCudaContextManager () const =0
 Return the CUDA context manager that was set in PxSceneDesc::cudaContextManager when creating the scene with PxPhysics::createScene.
 
Multiclient
virtual PxClientID createClient ()=0
 Reserves a new client ID.
 
Callbacks
virtual void setSimulationEventCallback (PxSimulationEventCallback *callback)=0
 Sets a user notify object which receives special simulation events when they occur.
 
virtual PxSimulationEventCallback * getSimulationEventCallback () const =0
 Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().
 
virtual void setContactModifyCallback (PxContactModifyCallback *callback)=0
 Sets a user callback object, which receives callbacks on all contacts generated for specified actors.
 
virtual void setCCDContactModifyCallback (PxCCDContactModifyCallback *callback)=0
 Sets a user callback object, which receives callbacks on all CCD contacts generated for specified actors.
 
virtual PxContactModifyCallback * getContactModifyCallback () const =0
 Retrieves the PxContactModifyCallback pointer set with setContactModifyCallback().
 
virtual PxCCDContactModifyCallback * getCCDContactModifyCallback () const =0
 Retrieves the PxCCDContactModifyCallback pointer set with setContactModifyCallback().
 
virtual void setBroadPhaseCallback (PxBroadPhaseCallback *callback)=0
 Sets a broad-phase user callback object.
 
virtual PxBroadPhaseCallback * getBroadPhaseCallback () const =0
 Retrieves the PxBroadPhaseCallback pointer set with setBroadPhaseCallback().
 
Collision Filtering
virtual void setFilterShaderData (const void *data, PxU32 dataSize)=0
 Sets the shared global filter data which will get passed into the filter shader.
 
virtual const void * getFilterShaderData () const =0
 Gets the shared global filter data in use for this scene.
 
virtual PxU32 getFilterShaderDataSize () const =0
 Gets the size of the shared global filter data (PxSceneDesc.filterShaderData)
 
virtual PxSimulationFilterShader getFilterShader () const =0
 Gets the custom collision filter shader in use for this scene.
 
virtual PxSimulationFilterCallback * getFilterCallback () const =0
 Gets the custom collision filter callback in use for this scene.
 
virtual bool resetFiltering (PxActor &actor)=0
 Marks the object to reset interactions and re-run collision filters in the next simulation step.
 
virtual bool resetFiltering (PxRigidActor &actor, PxShape *const *shapes, PxU32 shapeCount)=0
 Marks the object to reset interactions and re-run collision filters for specified shapes in the next simulation step.
 
virtual PxPairFilteringMode::Enum getKinematicKinematicFilteringMode () const =0
 Gets the pair filtering mode for kinematic-kinematic pairs.
 
virtual PxPairFilteringMode::Enum getStaticKinematicFilteringMode () const =0
 Gets the pair filtering mode for static-kinematic pairs.
 
Simulation
virtual bool simulate (PxReal elapsedTime, physx::PxBaseTask *completionTask=NULL, void *scratchMemBlock=0, PxU32 scratchMemBlockSize=0, bool controlSimulation=true)=0
 Advances the simulation by an elapsedTime time.
 
virtual bool advance (physx::PxBaseTask *completionTask=0)=0
 Performs dynamics phase of the simulation pipeline.
 
virtual bool collide (PxReal elapsedTime, physx::PxBaseTask *completionTask=0, void *scratchMemBlock=0, PxU32 scratchMemBlockSize=0, bool controlSimulation=true)=0
 Performs collision detection for the scene over elapsedTime.
 
virtual bool checkResults (bool block=false)=0
 This checks to see if the simulation run has completed.
 
virtual bool fetchCollision (bool block=false)=0
 
virtual bool fetchResults (bool block=false, PxU32 *errorState=0)=0
 
virtual bool fetchResultsStart (const PxContactPairHeader *&contactPairs, PxU32 &nbContactPairs, bool block=false)=0
 
virtual void processCallbacks (physx::PxBaseTask *continuation)=0
 
virtual void fetchResultsFinish (PxU32 *errorState=0)=0
 
virtual void fetchResultsParticleSystem ()=0
 
virtual void flushSimulation (bool sendPendingReports=false)=0
 Clear internal buffers and free memory.
 
virtual void setGravity (const PxVec3 &vec)=0
 Sets a constant gravity for the entire scene.
 
virtual PxVec3 getGravity () const =0
 Retrieves the current gravity setting.
 
virtual void setBounceThresholdVelocity (const PxReal t)=0
 Set the bounce threshold velocity. Collision speeds below this threshold will not cause a bounce.
 
virtual PxReal getBounceThresholdVelocity () const =0
 Return the bounce threshold velocity.
 
virtual void setCCDMaxPasses (PxU32 ccdMaxPasses)=0
 Sets the maximum number of CCD passes.
 
virtual PxU32 getCCDMaxPasses () const =0
 Gets the maximum number of CCD passes.
 
virtual void setCCDMaxSeparation (const PxReal t)=0
 Set the maximum CCD separation.
 
virtual PxReal getCCDMaxSeparation () const =0
 Gets the maximum CCD separation.
 
virtual void setCCDThreshold (const PxReal t)=0
 Set the CCD threshold.
 
virtual PxReal getCCDThreshold () const =0
 Gets the CCD threshold.
 
virtual void setMaxBiasCoefficient (const PxReal t)=0
 Set the max bias coefficient.
 
virtual PxReal getMaxBiasCoefficient () const =0
 Gets the max bias coefficient.
 
virtual void setFrictionOffsetThreshold (const PxReal t)=0
 Set the friction offset threshold.
 
virtual PxReal getFrictionOffsetThreshold () const =0
 Gets the friction offset threshold.
 
virtual void setFrictionCorrelationDistance (const PxReal t)=0
 Set the friction correlation distance.
 
virtual PxReal getFrictionCorrelationDistance () const =0
 Gets the friction correlation distance.
 
virtual PxFrictionType::Enum getFrictionType () const =0
 Return the friction model.
 
virtual PxSolverType::Enum getSolverType () const =0
 Return the solver model.
 
Visualization and Statistics
virtual bool setVisualizationParameter (PxVisualizationParameter::Enum param, PxReal value)=0
 Function that lets you set debug visualization parameters.
 
virtual PxReal getVisualizationParameter (PxVisualizationParameter::Enum paramEnum) const =0
 Function that lets you query debug visualization parameters.
 
virtual void setVisualizationCullingBox (const PxBounds3 &box)=0
 Defines a box in world space to which visualization geometry will be (conservatively) culled. Use a non-empty culling box to enable the feature, and an empty culling box to disable it.
 
virtual PxBounds3 getVisualizationCullingBox () const =0
 Retrieves the visualization culling box.
 
virtual const PxRenderBuffer & getRenderBuffer ()=0
 Retrieves the render buffer.
 
virtual void getSimulationStatistics (PxSimulationStatistics &stats) const =0
 Call this method to retrieve statistics for the current simulation step.
 
Broad-phase
virtual PxBroadPhaseType::Enum getBroadPhaseType () const =0
 Returns broad-phase type.
 
virtual bool getBroadPhaseCaps (PxBroadPhaseCaps &caps) const =0
 Gets broad-phase caps.
 
virtual PxU32 getNbBroadPhaseRegions () const =0
 Returns number of regions currently registered in the broad-phase.
 
virtual PxU32 getBroadPhaseRegions (PxBroadPhaseRegionInfo *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Gets broad-phase regions.
 
virtual PxU32 addBroadPhaseRegion (const PxBroadPhaseRegion &region, bool populateRegion=false)=0
 Adds a new broad-phase region.
 
virtual bool removeBroadPhaseRegion (PxU32 handle)=0
 Removes a new broad-phase region.
 
- Public Member Functions inherited from physx::PxSceneSQSystem
PX_FORCE_INLINE void setSceneQueryUpdateMode (PxSceneQueryUpdateMode::Enum updateMode)
 Sets scene query update mode.
 
PX_FORCE_INLINE PxSceneQueryUpdateMode::Enum getSceneQueryUpdateMode () const
 Gets scene query update mode.
 
PX_FORCE_INLINE PxU32 getSceneQueryStaticTimestamp () const
 Retrieves the scene's internal scene query timestamp, increased each time a change to the static scene query structure is performed.
 
PX_FORCE_INLINE void flushQueryUpdates ()
 Flushes any changes to the scene query representation.
 
PX_FORCE_INLINE void forceDynamicTreeRebuild (bool rebuildStaticStructure, bool rebuildDynamicStructure)
 Forces dynamic trees to be immediately rebuilt.
 
virtual PxPruningStructureType::Enum getStaticStructure () const =0
 Return the value of PxSceneQueryDesc::staticStructure that was set when creating the scene with PxPhysics::createScene.
 
virtual PxPruningStructureType::Enum getDynamicStructure () const =0
 Return the value of PxSceneQueryDesc::dynamicStructure that was set when creating the scene with PxPhysics::createScene.
 
virtual void sceneQueriesUpdate (PxBaseTask *completionTask=NULL, bool controlSimulation=true)=0
 Executes scene queries update tasks.
 
virtual bool checkQueries (bool block=false)=0
 This checks to see if the scene queries update has completed.
 
virtual bool fetchQueries (bool block=false)=0
 
- Public Member Functions inherited from physx::PxSceneQuerySystemBase
virtual void setDynamicTreeRebuildRateHint (PxU32 dynamicTreeRebuildRateHint)=0
 Sets the rebuild rate of the dynamic tree pruning structures.
 
virtual PxU32 getDynamicTreeRebuildRateHint () const =0
 Retrieves the rebuild rate of the dynamic tree pruning structures.
 
virtual void forceRebuildDynamicTree (PxU32 prunerIndex)=0
 Forces dynamic trees to be immediately rebuilt.
 
virtual void setUpdateMode (PxSceneQueryUpdateMode::Enum updateMode)=0
 Sets scene query update mode.
 
virtual PxSceneQueryUpdateMode::Enum getUpdateMode () const =0
 Gets scene query update mode.
 
virtual PxU32 getStaticTimestamp () const =0
 Retrieves the system's internal scene query timestamp, increased each time a change to the static scene query structure is performed.
 
virtual void flushUpdates ()=0
 Flushes any changes to the scene query representation.
 
virtual bool raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxRaycastCallback &hitCall, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object or via a custom user callback implementation inheriting from PxRaycastCallback.
 
virtual bool sweep (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSweepCallback &hitCall, PxHitFlags hitFlags=PxHitFlag::eDEFAULT, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, const PxReal inflation=0.0f, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs a sweep test against objects in the scene, returns results in a PxSweepBuffer object or via a custom user callback implementation inheriting from PxSweepCallback.
 
virtual bool overlap (const PxGeometry &geometry, const PxTransform &pose, PxOverlapCallback &hitCall, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxQueryCache *cache=NULL, PxGeometryQueryFlags queryFlags=PxGeometryQueryFlag::eDEFAULT) const =0
 Performs an overlap test of a given geometry against objects in the scene, returns results in a PxOverlapBuffer object or via a custom user callback implementation inheriting from PxOverlapCallback.
 

Threads and Memory

void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object.
 
virtual PxTaskManager * getTaskManager () const =0
 Get the task manager associated with this scene.
 
virtual void lockRead (const char *file=NULL, PxU32 line=0)=0
 Lock the scene for reading from the calling thread.
 
virtual void unlockRead ()=0
 Unlock the scene from reading.
 
virtual void lockWrite (const char *file=NULL, PxU32 line=0)=0
 Lock the scene for writing from this thread.
 
virtual void unlockWrite ()=0
 Unlock the scene from writing.
 
virtual void setNbContactDataBlocks (PxU32 numBlocks)=0
 set the cache blocks that can be used during simulate().
 
virtual PxU32 getNbContactDataBlocksUsed () const =0
 get the number of cache blocks currently used by the scene
 
virtual PxU32 getMaxNbContactDataBlocksUsed () const =0
 get the maximum number of cache blocks used by the scene
 
virtual PxU32 getContactReportStreamBufferSize () const =0
 Return the value of PxSceneDesc::contactReportStreamBufferSize that was set when creating the scene with PxPhysics::createScene.
 
virtual void setSolverBatchSize (PxU32 solverBatchSize)=0
 Sets the number of actors required to spawn a separate rigid body solver thread.
 
virtual PxU32 getSolverBatchSize () const =0
 Retrieves the number of actors required to spawn a separate rigid body solver thread.
 
virtual void setSolverArticulationBatchSize (PxU32 solverBatchSize)=0
 Sets the number of articulations required to spawn a separate rigid body solver thread.
 
virtual PxU32 getSolverArticulationBatchSize () const =0
 Retrieves the number of articulations required to spawn a separate rigid body solver thread.
 
virtual PxReal getWakeCounterResetValue () const =0
 Returns the wake counter reset value.
 
virtual void shiftOrigin (const PxVec3 &shift)=0
 Shift the scene origin by the specified vector.
 
virtual PxPvdSceneClient * getScenePvdClient ()=0
 Returns the Pvd client associated with the scene.
 
virtual void copyArticulationData (void *data, void *index, PxArticulationGpuDataType::Enum dataType, const PxU32 nbCopyArticulations, void *copyEvent=NULL)=0
 Copy GPU articulation data from the internal GPU buffer to a user-provided device buffer.
 
virtual void applyArticulationData (void *data, void *index, PxArticulationGpuDataType::Enum dataType, const PxU32 nbUpdatedArticulations, void *waitEvent=NULL, void *signalEvent=NULL)=0
 Apply GPU articulation data from a user-provided device buffer to the internal GPU buffer.
 
virtual void copySoftBodyData (void **data, void *dataSizes, void *softBodyIndices, PxSoftBodyDataFlag::Enum flag, const PxU32 nbCopySoftBodies, const PxU32 maxSize, void *copyEvent=NULL)=0
 Copy GPU softbody data from the internal GPU buffer to a user-provided device buffer.
 
virtual void applySoftBodyData (void **data, void *dataSizes, void *softBodyIndices, PxSoftBodyDataFlag::Enum flag, const PxU32 nbUpdatedSoftBodies, const PxU32 maxSize, void *applyEvent=NULL)=0
 Apply user-provided data to the internal softbody system.
 
virtual void copyContactData (void *data, const PxU32 maxContactPairs, void *numContactPairs, void *copyEvent=NULL)=0
 Copy contact data from the internal GPU buffer to a user-provided device buffer.
 
virtual void copyBodyData (PxGpuBodyData *data, PxGpuActorPair *index, const PxU32 nbCopyActors, void *copyEvent=NULL)=0
 Copy GPU rigid body data from the internal GPU buffer to a user-provided device buffer.
 
virtual void applyActorData (void *data, PxGpuActorPair *index, PxActorCacheFlag::Enum flag, const PxU32 nbUpdatedActors, void *waitEvent=NULL, void *signalEvent=NULL)=0
 Apply user-provided data to rigid body.
 
virtual void computeDenseJacobians (const PxIndexDataPair *indices, PxU32 nbIndices, void *computeEvent)=0
 Compute dense Jacobian matrices for specified articulations on the GPU.
 
virtual void computeGeneralizedMassMatrices (const PxIndexDataPair *indices, PxU32 nbIndices, void *computeEvent)=0
 Compute the joint-space inertia matrices that maps joint accelerations to joint forces: forces = M * accelerations on the GPU.
 
virtual void computeGeneralizedGravityForces (const PxIndexDataPair *indices, PxU32 nbIndices, void *computeEvent)=0
 Computes the joint DOF forces required to counteract gravitational forces for the given articulation pose.
 
virtual void computeCoriolisAndCentrifugalForces (const PxIndexDataPair *indices, PxU32 nbIndices, void *computeEvent)=0
 Computes the joint DOF forces required to counteract coriolis and centrifugal forces for the given articulation pose.
 
virtual PxgDynamicsMemoryConfig getGpuDynamicsConfig () const =0
 
virtual void applyParticleBufferData (const PxU32 *indices, const PxGpuParticleBufferIndexPair *bufferIndexPair, const PxParticleBufferFlags *flags, PxU32 nbUpdatedBuffers, void *waitEvent=NULL, void *signalEvent=NULL)=0
 Apply user-provided data to particle buffers.
 

Basics

virtual void release ()=0
 Deletes the scene.
 
virtual void setFlag (PxSceneFlag::Enum flag, bool value)=0
 Sets a scene flag. You can only set one flag at a time.
 
virtual PxSceneFlags getFlags () const =0
 Get the scene flags.
 
virtual void setLimits (const PxSceneLimits &limits)=0
 Set new scene limits.
 
virtual PxSceneLimits getLimits () const =0
 Get current scene limits.
 
virtual PxPhysics & getPhysics ()=0
 Call this method to retrieve the Physics SDK.
 
virtual PxU32 getTimestamp () const =0
 Retrieves the scene's internal timestamp, increased each time a simulation step is completed.
 

Detailed Description

A scene is a collection of bodies and constraints which can interact.

The scene simulates the behavior of these objects over time. Several scenes may exist at the same time, but each body or constraint is specific to a scene – they may not be shared.

See also
PxSceneDesc PxPhysics.createScene() release()

Member Function Documentation

◆ addActor()

virtual bool physx::PxScene::addActor ( PxActor &  actor,
const PxBVH *  bvh = NULL 
)
pure virtual

Adds an actor to this scene.

Note
If the actor is already assigned to a scene (see PxActor::getScene), the call is ignored and an error is issued.
If the actor has an invalid constraint, in checked builds the call is ignored and an error is issued.
You can not add individual articulation links (see #PxArticulationLink) to the scene. Use addArticulation() instead.
If the actor is a PxRigidActor then each assigned PxConstraint object will get added to the scene automatically if it connects to another actor that is part of the scene already.
When a BVH is provided the actor shapes are grouped together. The scene query pruning structure inside PhysX SDK will store/update one bound per actor. The scene queries against such an actor will query actor bounds and then make a local space query against the provided BVH, which is in actor's local space.
Parameters
[in]actorActor to add to scene.
[in]bvhBVH for actor shapes.
Returns
True if success
See also
PxActor, PxConstraint::isValid(), PxBVH

Implemented in physx::NpScene.

◆ addActors() [1/2]

virtual bool physx::PxScene::addActors ( const PxPruningStructure &  pruningStructure)
pure virtual

Adds a pruning structure together with its actors to this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.

Note
This method only supports actors of type PxRigidStatic and PxRigidDynamic. For other actors, use addActor() instead. For articulation links, use addArticulation().
If an actor in the pruning structure contains an invalid constraint, in checked builds the call is ignored and an error is issued.
For all actors in the pruning structure each assigned PxConstraint object will get added to the scene automatically if it connects to another actor that is part of the scene already.
This method is optimized for high performance.
Merging a PxPruningStructure into an active scene query optimization AABB tree might unbalance the tree. A typical use case for PxPruningStructure is a large world scenario where blocks of closely positioned actors get streamed in. The merge process finds the best node in the active scene query optimization AABB tree and inserts the PxPruningStructure. Therefore using PxPruningStructure for actors scattered throughout the world will result in an unbalanced tree.
Parameters
[in]pruningStructurePruning structure for a set of actors.
Returns
True if success
See also
PxPhysics::createPruningStructure, PxPruningStructure

Implemented in physx::NpScene.

◆ addActors() [2/2]

virtual bool physx::PxScene::addActors ( PxActor *const *  actors,
PxU32  nbActors 
)
pure virtual

Adds actors to this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.

Note
This method only supports actors of type PxRigidStatic and PxRigidDynamic. For other actors, use addActor() instead. For articulation links, use addArticulation().
If one of the actors is already assigned to a scene (see PxActor::getScene), the call is ignored and an error is issued.
If an actor in the array contains an invalid constraint, in checked builds the call is ignored and an error is issued.
If an actor in the array is a PxRigidActor then each assigned PxConstraint object will get added to the scene automatically if it connects to another actor that is part of the scene already.
this method is optimized for high performance.
Parameters
[in]actorsArray of actors to add to scene.
[in]nbActorsNumber of actors in the array.
Returns
True if success
See also
PxActor, PxConstraint::isValid()

Implemented in physx::NpScene.

◆ addAggregate()

virtual bool physx::PxScene::addAggregate ( PxAggregate &  aggregate)
pure virtual

Adds an aggregate to this scene.

Note
If the aggregate is already assigned to a scene (see PxAggregate::getScene), the call is ignored and an error is issued.
If the aggregate contains an actor with an invalid constraint, in checked builds the call is ignored and an error is issued.
If the aggregate already contains actors, those actors are added to the scene as well.
Parameters
[in]aggregateAggregate to add to scene.
Returns
True if success
See also
PxAggregate, PxConstraint::isValid()

Implemented in physx::NpScene.

◆ addArticulation()

virtual bool physx::PxScene::addArticulation ( PxArticulationReducedCoordinate &  articulation)
pure virtual

Adds an articulation to this scene.

Note
If the articulation is already assigned to a scene (see PxArticulationReducedCoordinate::getScene), the call is ignored and an error is issued.
Parameters
[in]articulationThe articulation to add to the scene.
Returns
True if success
See also
PxArticulationReducedCoordinate

Implemented in physx::NpScene.

◆ addBroadPhaseRegion()

virtual PxU32 physx::PxScene::addBroadPhaseRegion ( const PxBroadPhaseRegion &  region,
bool  populateRegion = false 
)
pure virtual

Adds a new broad-phase region.

The bounds for the new region must be non-empty, otherwise an error occurs and the call is ignored.

Note that by default, objects already existing in the SDK that might touch this region will not be automatically added to the region. In other words the newly created region will be empty, and will only be populated with new objects when they are added to the simulation, or with already existing objects when they are updated.

It is nonetheless possible to override this default behavior and let the SDK populate the new region automatically with already existing objects overlapping the incoming region. This has a cost though, and it should only be used when the game can not guarantee that all objects within the new region will be added to the simulation after the region itself.

Objects automatically move from one region to another during their lifetime. The system keeps tracks of what regions a given object is in. It is legal for an object to be in an arbitrary number of regions. However if an object leaves all regions, or is created outside of all regions, several things happen:

  • collisions get disabled for this object
  • if a PxBroadPhaseCallback object is provided, an "out-of-bounds" event is generated via that callback
  • if a PxBroadPhaseCallback object is not provided, a warning/error message is sent to the error stream

If an object goes out-of-bounds and user deletes it during the same frame, neither the out-of-bounds event nor the error message is generated.

Parameters
[in]regionUser-provided region data
[in]populateRegionAutomatically populate new region with already existing objects overlapping it
Returns
Handle for newly created region, or 0xffffffff in case of failure.
See also
PxBroadPhaseRegion PxBroadPhaseCallback

Implemented in physx::NpScene.

◆ addCollection()

virtual bool physx::PxScene::addCollection ( const PxCollection &  collection)
pure virtual

Adds objects in the collection to this scene.

This function adds the following types of objects to this scene: PxRigidActor (except PxArticulationLink), PxAggregate, PxArticulationReducedCoordinate. This method is typically used after deserializing the collection in order to populate the scene with deserialized objects.

Note
If the collection contains an actor with an invalid constraint, in checked builds the call is ignored and an error is issued.
Parameters
[in]collectionObjects to add to this scene. See #PxCollection
Returns
True if success
See also
PxCollection, PxConstraint::isValid()

Implemented in physx::NpScene.

◆ advance()

virtual bool physx::PxScene::advance ( physx::PxBaseTask *  completionTask = 0)
pure virtual

Performs dynamics phase of the simulation pipeline.

Note
Calls to advance() should follow calls to fetchCollision(). An error message will be issued if this sequence is not followed.
Parameters
[in]completionTaskif non-NULL, this task will have its refcount incremented in advance(), then decremented when the scene is ready to have fetchResults called. So the task will not run until the application also calls removeReference().
Returns
True if success

Implemented in physx::NpScene.

◆ applyActorData()

virtual void physx::PxScene::applyActorData ( void *  data,
PxGpuActorPair *  index,
PxActorCacheFlag::Enum  flag,
const PxU32  nbUpdatedActors,
void *  waitEvent = NULL,
void *  signalEvent = NULL 
)
pure virtual

Apply user-provided data to rigid body.

Parameters
[in]dataUser-provided gpu data buffer which should be sized appropriately for the particular data that is requested. Further details provided in the user guide.
[in]indexUser provided PxGpuActorPair buffer. This buffer stores pairs of indices: the PxNodeIndex corresponding to the rigid body and an index corresponding to the location in the user buffer that this value should be placed.
[in]flagFlag defining which data the user wants to write to the rigid body
[in]nbUpdatedActorsThe number of updated rigid body
[in]waitEventUser-provided event for the rigid body stream to wait for data
[in]signalEventUser-provided event for the rigid body stream to signal when the read from the user buffer has completed

Implemented in physx::NpScene.

◆ applyArticulationData()

virtual void physx::PxScene::applyArticulationData ( void *  data,
void *  index,
PxArticulationGpuDataType::Enum  dataType,
const PxU32  nbUpdatedArticulations,
void *  waitEvent = NULL,
void *  signalEvent = NULL 
)
pure virtual

Apply GPU articulation data from a user-provided device buffer to the internal GPU buffer.

Parameters
[in]dataUser-provided gpu data buffer which should be sized appropriately for the particular data that is requested. Further details provided in the user guide.
[in]indexUser-provided gpu index buffer. This buffer stores the articulation indices which the user wants to write to.
[in]dataTypeEnum specifying the type of data the user wants to write to the articulations.
[in]nbUpdatedArticulationsNumber of articulations that data should be written to.
[in]waitEventUser-provided event for the articulation stream to wait for data.
[in]signalEventUser-provided event for the articulation stream to signal when the data read from the user buffer has completed.

Implemented in physx::NpScene.

◆ applyParticleBufferData()

virtual void physx::PxScene::applyParticleBufferData ( const PxU32 *  indices,
const PxGpuParticleBufferIndexPair *  bufferIndexPair,
const PxParticleBufferFlags *  flags,
PxU32  nbUpdatedBuffers,
void *  waitEvent = NULL,
void *  signalEvent = NULL 
)
pure virtual

Apply user-provided data to particle buffers.

This function should be used if the particle buffer flags are already on the device. Otherwise, use PxParticleBuffer::raiseFlags() from the CPU.

This assumes the data has been changed directly in the PxParticleBuffer.

Parameters
[in]indicesUser-provided index buffer that indexes into the BufferIndexPair and flags list.
[in]bufferIndexPairUser-provided index pair buffer specifying the unique id and GPU particle system for each PxParticleBuffer. See PxGpuParticleBufferIndexPair.
[in]flagsFlags to mark what data needs to be updated. See PxParticleBufferFlags.
[in]nbUpdatedBuffersThe number of particle buffers to update.
[in]waitEventUser-provided event for the particle stream to wait for data.
[in]signalEventUser-provided event for the particle stream to signal when the data read from the user buffer has completed.

Implemented in physx::NpScene.

◆ applySoftBodyData()

virtual void physx::PxScene::applySoftBodyData ( void **  data,
void *  dataSizes,
void *  softBodyIndices,
PxSoftBodyDataFlag::Enum  flag,
const PxU32  nbUpdatedSoftBodies,
const PxU32  maxSize,
void *  applyEvent = NULL 
)
pure virtual

Apply user-provided data to the internal softbody system.

Parameters
[in]dataUser-provided gpu buffer containing a pointer to another gpu buffer for every softbody to process
[in]dataSizesThe size of every buffer in bytes
[in]softBodyIndicesUser provided gpu index buffer. This buffer stores the updated softbody index.
[in]flagFlag defining which data the user wants to write to the softbody system
[in]maxSizeThe largest size stored in dataSizes. Used internally to decide how many threads to launch for the copy process.
[in]nbUpdatedSoftBodiesThe number of updated softbodies
[in]applyEventUser-provided event for the softbody stream to wait for data

Implemented in physx::NpScene.

◆ checkResults()

virtual bool physx::PxScene::checkResults ( bool  block = false)
pure virtual

This checks to see if the simulation run has completed.

This does not cause the data available for reading to be updated with the results of the simulation, it is simply a status check. The bool will allow it to either return immediately or block waiting for the condition to be met so that it can return true

Parameters
[in]blockWhen set to true will block until the condition is met.
Returns
True if the results are available.
See also
simulate() fetchResults()

Implemented in physx::NpScene.

◆ collide()

virtual bool physx::PxScene::collide ( PxReal  elapsedTime,
physx::PxBaseTask *  completionTask = 0,
void *  scratchMemBlock = 0,
PxU32  scratchMemBlockSize = 0,
bool  controlSimulation = true 
)
pure virtual

Performs collision detection for the scene over elapsedTime.

Note
Calls to collide() should be the first method called to simulate a frame.
Parameters
[in]elapsedTimeAmount of time to advance simulation by. The parameter has to be larger than 0, else the resulting behavior will be undefined. Range: (0, PX_MAX_F32)
[in]completionTaskif non-NULL, this task will have its refcount incremented in collide(), then decremented when the scene is ready to have fetchResults called. So the task will not run until the application also calls removeReference().
[in]scratchMemBlocka memory region for physx to use for temporary data during simulation. This block may be reused by the application after fetchResults returns. Must be aligned on a 16-byte boundary
[in]scratchMemBlockSizethe size of the scratch memory block. Must be a multiple of 16K.
[in]controlSimulationif true, the scene controls its PxTaskManager simulation state. Leave true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
Returns
True if success

Implemented in physx::NpScene.

◆ computeCoriolisAndCentrifugalForces()

virtual void physx::PxScene::computeCoriolisAndCentrifugalForces ( const PxIndexDataPair *  indices,
PxU32  nbIndices,
void *  computeEvent 
)
pure virtual

Computes the joint DOF forces required to counteract coriolis and centrifugal forces for the given articulation pose.

The size of the result can vary by articulation, since it depends on the number of links and degrees-of-freedom.

The size is determined using this formula: sizeof(float) * dofCount

The user must ensure that adequate space is provided for each articulation.

Parameters
[in]indicesUser-provided gpu buffer of (index, data) pairs. The entries map a GPU articulation index to a GPU block of memory where the returned matrix will be stored.
[in]nbIndicesThe number of (index, data) pairs provided.
[in]computeEventUser-provided event for the user to sync data.

Implemented in physx::NpScene.

◆ computeDenseJacobians()

virtual void physx::PxScene::computeDenseJacobians ( const PxIndexDataPair *  indices,
PxU32  nbIndices,
void *  computeEvent 
)
pure virtual

Compute dense Jacobian matrices for specified articulations on the GPU.

The size of Jacobians can vary by articulation, since it depends on the number of links, degrees-of-freedom, and whether the base is fixed.

The size is determined using these formulas: nCols = (fixedBase ? 0 : 6) + dofCount nRows = (fixedBase ? 0 : 6) + (linkCount - 1) * 6;

The user must ensure that adequate space is provided for each Jacobian matrix.

Parameters
[in]indicesUser-provided gpu buffer of (index, data) pairs. The entries map a GPU articulation index to a GPU block of memory where the returned Jacobian will be stored.
[in]nbIndicesThe number of (index, data) pairs provided.
[in]computeEventUser-provided event for the user to sync data.

Implemented in physx::NpScene.

◆ computeGeneralizedGravityForces()

virtual void physx::PxScene::computeGeneralizedGravityForces ( const PxIndexDataPair *  indices,
PxU32  nbIndices,
void *  computeEvent 
)
pure virtual

Computes the joint DOF forces required to counteract gravitational forces for the given articulation pose.

The size of the result can vary by articulation, since it depends on the number of links and degrees-of-freedom.

The size is determined using this formula: sizeof(float) * dofCount

The user must ensure that adequate space is provided for each articulation.

Parameters
[in]indicesUser-provided gpu buffer of (index, data) pairs. The entries map a GPU articulation index to a GPU block of memory where the returned matrix will be stored.
[in]nbIndicesThe number of (index, data) pairs provided.
[in]computeEventUser-provided event for the user to sync data.

Implemented in physx::NpScene.

◆ computeGeneralizedMassMatrices()

virtual void physx::PxScene::computeGeneralizedMassMatrices ( const PxIndexDataPair *  indices,
PxU32  nbIndices,
void *  computeEvent 
)
pure virtual

Compute the joint-space inertia matrices that maps joint accelerations to joint forces: forces = M * accelerations on the GPU.

The size of matrices can vary by articulation, since it depends on the number of links and degrees-of-freedom.

The size is determined using this formula: sizeof(float) * dofCount * dofCount

The user must ensure that adequate space is provided for each mass matrix.

Parameters
[in]indicesUser-provided gpu buffer of (index, data) pairs. The entries map a GPU articulation index to a GPU block of memory where the returned matrix will be stored.
[in]nbIndicesThe number of (index, data) pairs provided.
[in]computeEventUser-provided event for the user to sync data.

Implemented in physx::NpScene.

◆ copyArticulationData()

virtual void physx::PxScene::copyArticulationData ( void *  data,
void *  index,
PxArticulationGpuDataType::Enum  dataType,
const PxU32  nbCopyArticulations,
void *  copyEvent = NULL 
)
pure virtual

Copy GPU articulation data from the internal GPU buffer to a user-provided device buffer.

Parameters
[in]dataUser-provided gpu data buffer which should be sized appropriately for the particular data that is requested. Further details provided in the user guide.
[in]indexUser-provided gpu index buffer. This buffer stores the articulation indices which the user wants to copy.
[in]dataTypeEnum specifying the type of data the user wants to read back from the articulations.
[in]nbCopyArticulationsNumber of articulations that data should be copied from.
[in]copyEventUser-provided event for the articulation stream to signal when the data copy to the user buffer has completed.

Implemented in physx::NpScene.

◆ copyBodyData()

virtual void physx::PxScene::copyBodyData ( PxGpuBodyData *  data,
PxGpuActorPair *  index,
const PxU32  nbCopyActors,
void *  copyEvent = NULL 
)
pure virtual

Copy GPU rigid body data from the internal GPU buffer to a user-provided device buffer.

Parameters
[in]dataUser-provided gpu data buffer which should nbCopyActors * sizeof(PxGpuBodyData). The only data it can copy is PxGpuBodyData.
[in]indexUser provided node PxGpuActorPair buffer. This buffer stores pairs of indices: the PxNodeIndex corresponding to the rigid body and an index corresponding to the location in the user buffer that this value should be placed.
[in]nbCopyActorsThe number of rigid body to be copied.
[in]copyEventUser-provided event for the user to sync data.

Implemented in physx::NpScene.

◆ copyContactData()

virtual void physx::PxScene::copyContactData ( void *  data,
const PxU32  maxContactPairs,
void *  numContactPairs,
void *  copyEvent = NULL 
)
pure virtual

Copy contact data from the internal GPU buffer to a user-provided device buffer.

Note
The contact data contains pointers to internal state and is only valid until the next call to simulate().
Parameters
[in]dataUser-provided gpu data buffer, which should be the size of PxGpuContactPair * numContactPairs
[in]maxContactPairsThe maximum number of pairs that the buffer can contain
[in]numContactPairsThe actual number of contact pairs that were written
[in]copyEventUser-provided event for the user to sync data

Implemented in physx::NpScene.

◆ copySoftBodyData()

virtual void physx::PxScene::copySoftBodyData ( void **  data,
void *  dataSizes,
void *  softBodyIndices,
PxSoftBodyDataFlag::Enum  flag,
const PxU32  nbCopySoftBodies,
const PxU32  maxSize,
void *  copyEvent = NULL 
)
pure virtual

Copy GPU softbody data from the internal GPU buffer to a user-provided device buffer.

Parameters
[in]dataUser-provided gpu buffer containing a pointer to another gpu buffer for every softbody to process
[in]dataSizesThe size of every buffer in bytes
[in]softBodyIndicesUser provided gpu index buffer. This buffer stores the softbody index which the user want to copy.
[in]maxSizeThe largest size stored in dataSizes. Used internally to decide how many threads to launch for the copy process.
[in]flagFlag defining which data the user wants to read back from the softbody system
[in]nbCopySoftBodiesThe number of softbodies to be copied.
[in]copyEventUser-provided event for the user to sync data

Implemented in physx::NpScene.

◆ createClient()

virtual PxClientID physx::PxScene::createClient ( )
pure virtual

Reserves a new client ID.

PX_DEFAULT_CLIENT is always available as the default clientID. Additional clients are returned by this function. Clients cannot be released once created. An error is reported when more than a supported number of clients (currently 128) are created.

See also
PxClientID

Implemented in physx::NpScene.

◆ fetchCollision()

virtual bool physx::PxScene::fetchCollision ( bool  block = false)
pure virtual

This method must be called after collide() and before advance(). It will wait for the collision phase to finish. If the user makes an illegal simulation call, the SDK will issue an error message.

Parameters
[in]blockWhen set to true will block until the condition is met, which is collision must finish running.

Implemented in physx::NpScene.

◆ fetchResults()

virtual bool physx::PxScene::fetchResults ( bool  block = false,
PxU32 *  errorState = 0 
)
pure virtual

This is the big brother to checkResults() it basically does the following:

if ( checkResults(block) )
{
fire appropriate callbacks
swap buffers
return true
}
else
return false
virtual bool checkResults(bool block=false)=0
This checks to see if the simulation run has completed.
Parameters
[in]blockWhen set to true will block until results are available.
[out]errorStateUsed to retrieve hardware error codes. A non zero value indicates an error.
Returns
True if the results have been fetched.
See also
simulate() checkResults()

Implemented in physx::NpScene.

◆ fetchResultsFinish()

virtual void physx::PxScene::fetchResultsFinish ( PxU32 *  errorState = 0)
pure virtual

This call performs the second section of fetchResults.

It must be called after fetchResultsStart() returns and contact reports have been processed.

Note that once fetchResultsFinish() has been called, the contact streams returned in fetchResultsStart() will be invalid.

Parameters
[out]errorStateUsed to retrieve hardware error codes. A non zero value indicates an error.
See also
simulate() checkResults() fetchResults() fetchResultsStart()

Implemented in physx::NpScene.

◆ fetchResultsParticleSystem()

virtual void physx::PxScene::fetchResultsParticleSystem ( )
pure virtual

This call performs the synchronization of particle system data copies.

◆ fetchResultsStart()

virtual bool physx::PxScene::fetchResultsStart ( const PxContactPairHeader *&  contactPairs,
PxU32 &  nbContactPairs,
bool  block = false 
)
pure virtual

This call performs the first section of fetchResults, and returns a pointer to the contact streams output by the simulation. It can be used to process contact pairs in parallel, which is often a limiting factor for fetchResults() performance.

After calling this function and processing the contact streams, call fetchResultsFinish(). Note that writes to the simulation are not permitted between the start of fetchResultsStart() and the end of fetchResultsFinish().

Parameters
[in]blockWhen set to true will block until results are available.
[out]contactPairsan array of pointers to contact pair headers
[out]nbContactPairsthe number of contact pairs
Returns
True if the results have been fetched.
See also
simulate() checkResults() fetchResults() fetchResultsFinish()

Implemented in physx::NpScene.

◆ flushSimulation()

virtual void physx::PxScene::flushSimulation ( bool  sendPendingReports = false)
pure virtual

Clear internal buffers and free memory.

This method can be used to clear buffers and free internal memory without having to destroy the scene. Can be useful if the physics data gets streamed in and a checkpoint with a clean state should be created.

Note
It is not allowed to call this method while the simulation is running. The call will fail.
Parameters
[in]sendPendingReportsWhen set to true pending reports will be sent out before the buffers get cleaned up (for instance lost touch contact/trigger reports due to deleted objects).

Implemented in physx::NpScene.

◆ getActiveActors()

virtual PxActor ** physx::PxScene::getActiveActors ( PxU32 &  nbActorsOut)
pure virtual

Queries the PxScene for a list of the PxActors whose transforms have been updated during the previous simulation step. Only includes actors of type PxRigidDynamic and PxArticulationLink.

Note
PxSceneFlag::eENABLE_ACTIVE_ACTORS must be set.
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored and NULL will be returned.
Parameters
[out]nbActorsOutThe number of actors returned.
Returns
A pointer to the list of active PxActors generated during the last call to fetchResults().
See also
PxActor

Implemented in physx::NpScene.

◆ getActors()

virtual PxU32 physx::PxScene::getActors ( PxActorTypeFlags  types,
PxActor **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve an array of all the actors of certain types in the scene. For supported types, see PxActorTypeFlags.

Parameters
[in]typesCombination of actor types to retrieve.
[out]userBufferThe buffer to receive actor pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first actor pointer to be retrieved
Returns
Number of actors written to the buffer.
See also
getNbActors()

Implemented in physx::NpScene.

◆ getAggregates()

virtual PxU32 physx::PxScene::getAggregates ( PxAggregate **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve all the aggregates in the scene.

Parameters
[out]userBufferThe buffer to receive aggregates pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first aggregate pointer to be retrieved
Returns
Number of aggregates written to the buffer.
See also
getNbAggregates()

Implemented in physx::NpScene.

◆ getArticulations()

virtual PxU32 physx::PxScene::getArticulations ( PxArticulationReducedCoordinate **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve all the articulations in the scene.

Parameters
[out]userBufferThe buffer to receive articulations pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first articulations pointer to be retrieved
Returns
Number of articulations written to the buffer.
See also
getNbArticulations()

Implemented in physx::NpScene.

◆ getBounceThresholdVelocity()

virtual PxReal physx::PxScene::getBounceThresholdVelocity ( ) const
pure virtual

Return the bounce threshold velocity.

See also
PxSceneDesc.bounceThresholdVelocity, setBounceThresholdVelocity

Implemented in physx::NpScene.

◆ getBroadPhaseCallback()

virtual PxBroadPhaseCallback * physx::PxScene::getBroadPhaseCallback ( ) const
pure virtual

Retrieves the PxBroadPhaseCallback pointer set with setBroadPhaseCallback().

Returns
The current broad-phase callback pointer. See #PxBroadPhaseCallback.
See also
PxBroadPhaseCallback setBroadPhaseCallback()

Implemented in physx::NpScene.

◆ getBroadPhaseCaps()

virtual bool physx::PxScene::getBroadPhaseCaps ( PxBroadPhaseCaps &  caps) const
pure virtual

Gets broad-phase caps.

Parameters
[out]capsBroad-phase caps
Returns
True if success

Implemented in physx::NpScene.

◆ getBroadPhaseRegions()

virtual PxU32 physx::PxScene::getBroadPhaseRegions ( PxBroadPhaseRegionInfo *  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Gets broad-phase regions.

Parameters
[out]userBufferReturned broad-phase regions
[in]bufferSizeSize of userBuffer
[in]startIndexIndex of first desired region, in [0 ; getNbRegions()[
Returns
Number of written out regions

Implemented in physx::NpScene.

◆ getBroadPhaseType()

virtual PxBroadPhaseType::Enum physx::PxScene::getBroadPhaseType ( ) const
pure virtual

Returns broad-phase type.

Returns
Broad-phase type

Implemented in physx::NpScene.

◆ getCCDContactModifyCallback()

virtual PxCCDContactModifyCallback * physx::PxScene::getCCDContactModifyCallback ( ) const
pure virtual

Retrieves the PxCCDContactModifyCallback pointer set with setContactModifyCallback().

Returns
The current user contact modify callback pointer. See #PxContactModifyCallback.
See also
PxContactModifyCallback setContactModifyCallback()

Implemented in physx::NpScene.

◆ getCCDMaxPasses()

virtual PxU32 physx::PxScene::getCCDMaxPasses ( ) const
pure virtual

Gets the maximum number of CCD passes.

Returns
The maximum number of CCD passes.
See also
PxSceneDesc::ccdMaxPasses setCCDMaxPasses()

Implemented in physx::NpScene.

◆ getCCDMaxSeparation()

virtual PxReal physx::PxScene::getCCDMaxSeparation ( ) const
pure virtual

Gets the maximum CCD separation.

Returns
The maximum CCD separation.
See also
PxSceneDesc::ccdMaxSeparation setCCDMaxSeparation()

Implemented in physx::NpScene.

◆ getCCDThreshold()

virtual PxReal physx::PxScene::getCCDThreshold ( ) const
pure virtual

Gets the CCD threshold.

Returns
The CCD threshold.
See also
PxSceneDesc::ccdThreshold setCCDThreshold()

Implemented in physx::NpScene.

◆ getConstraints()

virtual PxU32 physx::PxScene::getConstraints ( PxConstraint **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve all the constraint shaders in the scene.

Parameters
[out]userBufferThe buffer to receive constraint shader pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first constraint pointer to be retrieved
Returns
Number of constraint shaders written to the buffer.
See also
getNbConstraints()

Implemented in physx::NpScene.

◆ getContactModifyCallback()

virtual PxContactModifyCallback * physx::PxScene::getContactModifyCallback ( ) const
pure virtual

Retrieves the PxContactModifyCallback pointer set with setContactModifyCallback().

Returns
The current user contact modify callback pointer. See #PxContactModifyCallback.
See also
PxContactModifyCallback setContactModifyCallback()

Implemented in physx::NpScene.

◆ getContactReportStreamBufferSize()

virtual PxU32 physx::PxScene::getContactReportStreamBufferSize ( ) const
pure virtual

◆ getCpuDispatcher()

virtual PxCpuDispatcher * physx::PxScene::getCpuDispatcher ( ) const
pure virtual

Return the cpu dispatcher that was set in PxSceneDesc::cpuDispatcher when creating the scene with PxPhysics::createScene.

See also
PxSceneDesc::cpuDispatcher, PxPhysics::createScene

Implemented in physx::NpScene.

◆ getCudaContextManager()

virtual PxCudaContextManager * physx::PxScene::getCudaContextManager ( ) const
pure virtual

Return the CUDA context manager that was set in PxSceneDesc::cudaContextManager when creating the scene with PxPhysics::createScene.

Platform specific: Applies to PC GPU only.

See also
PxSceneDesc::cudaContextManager, PxPhysics::createScene

Implemented in physx::NpScene.

◆ getDominanceGroupPair()

virtual PxDominanceGroupPair physx::PxScene::getDominanceGroupPair ( PxDominanceGroup  group1,
PxDominanceGroup  group2 
) const
pure virtual

◆ getFEMCloths()

virtual PxU32 physx::PxScene::getFEMCloths ( PxFEMCloth **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve an array of all the FEM cloths in the scene.

Warning
Feature under development, only for internal usage.
Parameters
[out]userBufferThe buffer to write the FEM cloth pointers to
[in]bufferSizeSize of the provided user buffer
[in]startIndexIndex of first FEM cloth pointer to be retrieved
Returns
Number of FEM cloths written to the buffer

Implemented in physx::NpScene.

◆ getFilterCallback()

virtual PxSimulationFilterCallback * physx::PxScene::getFilterCallback ( ) const
pure virtual

Gets the custom collision filter callback in use for this scene.

Returns
Filter callback class that defines the collision pair filtering.
See also
PxSceneDesc.filterCallback PxSimulationFilterCallback

Implemented in physx::NpScene.

◆ getFilterShader()

virtual PxSimulationFilterShader physx::PxScene::getFilterShader ( ) const
pure virtual

Gets the custom collision filter shader in use for this scene.

Returns
Filter shader class that defines the collision pair filtering.
See also
PxSceneDesc.filterShader PxSimulationFilterShader

Implemented in physx::NpScene.

◆ getFilterShaderData()

virtual const void * physx::PxScene::getFilterShaderData ( ) const
pure virtual

Gets the shared global filter data in use for this scene.

Note
The reference points to a copy of the original filter data specified in PxSceneDesc.filterShaderData or provided by setFilterShaderData().
Returns
Shared filter data for filter shader.
See also
getFilterShaderDataSize() setFilterShaderData() PxSceneDesc.filterShaderData PxSimulationFilterShader

Implemented in physx::NpScene.

◆ getFilterShaderDataSize()

virtual PxU32 physx::PxScene::getFilterShaderDataSize ( ) const
pure virtual

Gets the size of the shared global filter data (PxSceneDesc.filterShaderData)

Returns
Size of shared filter data [bytes].
See also
getFilterShaderData() PxSceneDesc.filterShaderDataSize PxSimulationFilterShader

Implemented in physx::NpScene.

◆ getFlags()

virtual PxSceneFlags physx::PxScene::getFlags ( ) const
pure virtual

Get the scene flags.

Returns
The scene flags. See #PxSceneFlag
See also
PxSceneFlag

Implemented in physx::NpScene.

◆ getFrictionCorrelationDistance()

virtual PxReal physx::PxScene::getFrictionCorrelationDistance ( ) const
pure virtual

Gets the friction correlation distance.

See also
PxSceneDesc::frictionCorrelationDistance, setFrictionCorrelationDistance

Implemented in physx::NpScene.

◆ getFrictionOffsetThreshold()

virtual PxReal physx::PxScene::getFrictionOffsetThreshold ( ) const
pure virtual

Gets the friction offset threshold.

See also
PxSceneDesc::frictionOffsetThreshold, setFrictionOffsetThreshold

Implemented in physx::NpScene.

◆ getFrictionType()

virtual PxFrictionType::Enum physx::PxScene::getFrictionType ( ) const
pure virtual

Return the friction model.

See also
PxFrictionType, PxSceneDesc::frictionType

Implemented in physx::NpScene.

◆ getGravity()

virtual PxVec3 physx::PxScene::getGravity ( ) const
pure virtual

Retrieves the current gravity setting.

Returns
The current gravity for the scene.
See also
setGravity() PxSceneDesc.gravity

Implemented in physx::NpScene.

◆ getHairSystems()

virtual PxU32 physx::PxScene::getHairSystems ( PxHairSystem **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve an array of all the hair systems in the scene.

Warning
Feature under development, only for internal usage.
Parameters
[out]userBufferThe buffer to write the actor pointers to
[in]bufferSizeSize of the provided user buffer
[in]startIndexIndex of first actor pointer to be retrieved
Returns
Number of actors written to the buffer

Implemented in physx::NpScene.

◆ getKinematicKinematicFilteringMode()

virtual PxPairFilteringMode::Enum physx::PxScene::getKinematicKinematicFilteringMode ( ) const
pure virtual

Gets the pair filtering mode for kinematic-kinematic pairs.

Returns
Filtering mode for kinematic-kinematic pairs.
See also
PxPairFilteringMode PxSceneDesc

Implemented in physx::NpScene.

◆ getLimits()

virtual PxSceneLimits physx::PxScene::getLimits ( ) const
pure virtual

Get current scene limits.

Returns
Current scene limits.
See also
PxSceneLimits

Implemented in physx::NpScene.

◆ getMaxBiasCoefficient()

virtual PxReal physx::PxScene::getMaxBiasCoefficient ( ) const
pure virtual

Gets the max bias coefficient.

Returns
The max bias coefficient.
See also
PxSceneDesc::maxBiasCoefficient setMaxBiasCoefficient()

Implemented in physx::NpScene.

◆ getMaxNbContactDataBlocksUsed()

virtual PxU32 physx::PxScene::getMaxNbContactDataBlocksUsed ( ) const
pure virtual

get the maximum number of cache blocks used by the scene

This function may not be called while the scene is simulating

Returns
the maximum number of cache blocks everused by the scene
See also
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flushSimulation() setNbContactDataBlocks() getNbContactDataBlocksUsed()

Implemented in physx::NpScene.

◆ getNbActors()

virtual PxU32 physx::PxScene::getNbActors ( PxActorTypeFlags  types) const
pure virtual

Retrieve the number of actors of certain types in the scene. For supported types, see PxActorTypeFlags.

Parameters
[in]typesCombination of actor types.
Returns
the number of actors.
See also
getActors()

Implemented in physx::NpScene.

◆ getNbAggregates()

virtual PxU32 physx::PxScene::getNbAggregates ( ) const
pure virtual

Returns the number of aggregates in the scene.

Returns
the number of aggregates in this scene.
See also
getAggregates()

Implemented in physx::NpScene.

◆ getNbArticulations()

virtual PxU32 physx::PxScene::getNbArticulations ( ) const
pure virtual

Returns the number of articulations in the scene.

Returns
the number of articulations in this scene.
See also
getArticulations()

Implemented in physx::NpScene.

◆ getNbBroadPhaseRegions()

virtual PxU32 physx::PxScene::getNbBroadPhaseRegions ( ) const
pure virtual

Returns number of regions currently registered in the broad-phase.

Returns
Number of regions

Implemented in physx::NpScene.

◆ getNbConstraints()

virtual PxU32 physx::PxScene::getNbConstraints ( ) const
pure virtual

Returns the number of constraint shaders in the scene.

Returns
the number of constraint shaders in this scene.
See also
getConstraints()

Implemented in physx::NpScene.

◆ getNbContactDataBlocksUsed()

virtual PxU32 physx::PxScene::getNbContactDataBlocksUsed ( ) const
pure virtual

get the number of cache blocks currently used by the scene

This function may not be called while the scene is simulating

Returns
the number of cache blocks currently used by the scene
See also
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flushSimulation() setNbContactDataBlocks() getMaxNbContactDataBlocksUsed()

Implemented in physx::NpScene.

◆ getNbFEMCloths()

virtual PxU32 physx::PxScene::getNbFEMCloths ( ) const
pure virtual

Retrieve the number of FEM cloths in the scene.

Warning
Feature under development, only for internal usage.
Returns
the number of FEM cloths.

See getFEMCloths()

Implemented in physx::NpScene.

◆ getNbHairSystems()

virtual PxU32 physx::PxScene::getNbHairSystems ( ) const
pure virtual

Retrieve the number of hair systems in the scene.

Warning
Feature under development, only for internal usage.
Returns
the number of hair systems
See also
getActors()

Implemented in physx::NpScene.

◆ getNbParticleSystems()

virtual PxU32 physx::PxScene::getNbParticleSystems ( PxParticleSolverType::Enum  type) const
pure virtual

Retrieve the number of particle systems of the requested type in the scene.

Parameters
[in]typeThe particle system type. See PxParticleSolverType. Only one type can be requested per function call.
Returns
the number particle systems.

See getParticleSystems(), PxParticleSolverType

Implemented in physx::NpScene.

◆ getNbSoftBodies()

virtual PxU32 physx::PxScene::getNbSoftBodies ( ) const
pure virtual

Retrieve the number of soft bodies in the scene.

Returns
the number of soft bodies.
See also
getActors()

Implemented in physx::NpScene.

◆ getParticleSystems()

virtual PxU32 physx::PxScene::getParticleSystems ( PxParticleSolverType::Enum  type,
PxParticleSystem **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve an array of all the particle systems of the requested type in the scene.

Parameters
[in]typeThe particle system type. See PxParticleSolverType. Only one type can be requested per function call.
[out]userBufferThe buffer to receive particle system pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first particle system pointer to be retrieved
Returns
Number of particle systems written to the buffer.

See getNbParticleSystems(), PxParticleSolverType

Implemented in physx::NpScene.

◆ getPhysics()

virtual PxPhysics & physx::PxScene::getPhysics ( )
pure virtual

Call this method to retrieve the Physics SDK.

Returns
The physics SDK this scene is associated with.
See also
PxPhysics

Implemented in physx::NpScene.

◆ getRenderBuffer()

virtual const PxRenderBuffer & physx::PxScene::getRenderBuffer ( )
pure virtual

Retrieves the render buffer.

This will contain the results of any active visualization for this scene.

Note
Do not use this method while the simulation is running. Calls to this method while the simulation is running will result in undefined behaviour.
Returns
The render buffer.
See also
PxRenderBuffer

Implemented in physx::NpScene.

◆ getScenePvdClient()

virtual PxPvdSceneClient * physx::PxScene::getScenePvdClient ( )
pure virtual

Returns the Pvd client associated with the scene.

Returns
the client, NULL if no PVD supported.

Implemented in physx::NpScene.

◆ getSimulationEventCallback()

virtual PxSimulationEventCallback * physx::PxScene::getSimulationEventCallback ( ) const
pure virtual

Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().

Returns
The current user notify pointer. See #PxSimulationEventCallback.
See also
PxSimulationEventCallback setSimulationEventCallback()

Implemented in physx::NpScene.

◆ getSimulationStatistics()

virtual void physx::PxScene::getSimulationStatistics ( PxSimulationStatistics &  stats) const
pure virtual

Call this method to retrieve statistics for the current simulation step.

Note
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[out]statsUsed to retrieve statistics for the current simulation step.
See also
PxSimulationStatistics

Implemented in physx::NpScene.

◆ getSoftBodies()

virtual PxU32 physx::PxScene::getSoftBodies ( PxSoftBody **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
pure virtual

Retrieve an array of all the soft bodies in the scene.

Parameters
[out]userBufferThe buffer to receive actor pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first actor pointer to be retrieved
Returns
Number of actors written to the buffer.
See also
getNbActors()

Implemented in physx::NpScene.

◆ getSolverArticulationBatchSize()

virtual PxU32 physx::PxScene::getSolverArticulationBatchSize ( ) const
pure virtual

Retrieves the number of articulations required to spawn a separate rigid body solver thread.

Returns
Current number of articulations required to spawn a separate rigid body solver thread.
See also
PxSceneDesc.solverBatchSize setSolverArticulationBatchSize()

Implemented in physx::NpScene.

◆ getSolverBatchSize()

virtual PxU32 physx::PxScene::getSolverBatchSize ( ) const
pure virtual

Retrieves the number of actors required to spawn a separate rigid body solver thread.

Returns
Current number of actors required to spawn a separate rigid body solver thread.
See also
PxSceneDesc.solverBatchSize setSolverBatchSize()

Implemented in physx::NpScene.

◆ getSolverType()

virtual PxSolverType::Enum physx::PxScene::getSolverType ( ) const
pure virtual

Return the solver model.

See also
PxSolverType, PxSceneDesc::solverType

Implemented in physx::NpScene.

◆ getStaticKinematicFilteringMode()

virtual PxPairFilteringMode::Enum physx::PxScene::getStaticKinematicFilteringMode ( ) const
pure virtual

Gets the pair filtering mode for static-kinematic pairs.

Returns
Filtering mode for static-kinematic pairs.
See also
PxPairFilteringMode PxSceneDesc

Implemented in physx::NpScene.

◆ getTaskManager()

virtual PxTaskManager * physx::PxScene::getTaskManager ( ) const
pure virtual

Get the task manager associated with this scene.

Returns
the task manager associated with the scene

Implemented in physx::NpScene.

◆ getTimestamp()

virtual PxU32 physx::PxScene::getTimestamp ( ) const
pure virtual

Retrieves the scene's internal timestamp, increased each time a simulation step is completed.

Returns
scene timestamp

Implemented in physx::NpScene.

◆ getVisualizationCullingBox()

virtual PxBounds3 physx::PxScene::getVisualizationCullingBox ( ) const
pure virtual

Retrieves the visualization culling box.

Returns
the box to which the geometry will be culled.
See also
setVisualizationParameter setVisualizationCullingBox

Implemented in physx::NpScene.

◆ getVisualizationParameter()

virtual PxReal physx::PxScene::getVisualizationParameter ( PxVisualizationParameter::Enum  paramEnum) const
pure virtual

Function that lets you query debug visualization parameters.

Parameters
[in]paramEnumThe Parameter to retrieve.
Returns
The value of the parameter.
See also
setVisualizationParameter PxVisualizationParameter

Implemented in physx::NpScene.

◆ getWakeCounterResetValue()

virtual PxReal physx::PxScene::getWakeCounterResetValue ( ) const
pure virtual

Returns the wake counter reset value.

Returns
Wake counter reset value
See also
PxSceneDesc.wakeCounterResetValue

Implemented in physx::NpScene.

◆ lockRead()

virtual void physx::PxScene::lockRead ( const char *  file = NULL,
PxU32  line = 0 
)
pure virtual

Lock the scene for reading from the calling thread.

When the PxSceneFlag::eREQUIRE_RW_LOCK flag is enabled lockRead() must be called before any read calls are made on the scene.

Multiple threads may read at the same time, no threads may read while a thread is writing. If a call to lockRead() is made while another thread is holding a write lock then the calling thread will be blocked until the writing thread calls unlockWrite().

Note
Lock upgrading is not supported, that means it is an error to call lockRead() followed by lockWrite().
Recursive locking is supported but each lockRead() call must be paired with an unlockRead().
Parameters
fileString representing the calling file, for debug purposes
lineThe source file line number, for debug purposes

Implemented in physx::NpScene.

◆ lockWrite()

virtual void physx::PxScene::lockWrite ( const char *  file = NULL,
PxU32  line = 0 
)
pure virtual

Lock the scene for writing from this thread.

When the PxSceneFlag::eREQUIRE_RW_LOCK flag is enabled lockWrite() must be called before any write calls are made on the scene.

Only one thread may write at a time and no threads may read while a thread is writing. If a call to lockWrite() is made and there are other threads reading then the calling thread will be blocked until the readers complete.

Writers have priority. If a thread is blocked waiting to write then subsequent calls to lockRead() from other threads will be blocked until the writer completes.

Note
If multiple threads are waiting to write then the thread that is first granted access depends on OS scheduling.
Recursive locking is supported but each lockWrite() call must be paired with an unlockWrite().
If a thread has already locked the scene for writing then it may call lockRead().
Parameters
fileString representing the calling file, for debug purposes
lineThe source file line number, for debug purposes

Implemented in physx::NpScene.

◆ processCallbacks()

virtual void physx::PxScene::processCallbacks ( physx::PxBaseTask *  continuation)
pure virtual

This call processes all event callbacks in parallel. It takes a continuation task, which will be executed once all callbacks have been processed.

This is a utility function to make it easier to process callbacks in parallel using the PhysX task system. It can only be used in conjunction with fetchResultsStart(...) and fetchResultsFinish(...)

Parameters
[in]continuationThe task that will be executed once all callbacks have been processed.

Implemented in physx::NpScene.

◆ release()

virtual void physx::PxScene::release ( )
pure virtual

Deletes the scene.

Removes any actors and constraint shaders from this scene (if the user hasn't already done so).

Be sure to not keep a reference to this object after calling release. Avoid release calls while the scene is simulating (in between simulate() and fetchResults() calls).

See also
PxPhysics.createScene()

Implemented in physx::NpScene.

◆ removeActor()

virtual void physx::PxScene::removeActor ( PxActor &  actor,
bool  wakeOnLostTouch = true 
)
pure virtual

Removes an actor from this scene.

Note
If the actor is not part of this scene (see PxActor::getScene), the call is ignored and an error is issued.
You can not remove individual articulation links (see #PxArticulationLink) from the scene. Use removeArticulation() instead.
If the actor is a PxRigidActor then all assigned PxConstraint objects will get removed from the scene automatically.
If the actor is in an aggregate it will be removed from the aggregate.
Parameters
[in]actorActor to remove from scene.
[in]wakeOnLostTouchSpecifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCoordinate and PxRigidActor types.
See also
PxActor, PxAggregate

Implemented in physx::NpScene.

◆ removeActors()

virtual void physx::PxScene::removeActors ( PxActor *const *  actors,
PxU32  nbActors,
bool  wakeOnLostTouch = true 
)
pure virtual

Removes actors from this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.

Note
This method only supports actors of type PxRigidStatic and PxRigidDynamic. For other actors, use removeActor() instead. For articulation links, use removeArticulation().
If some actor is not part of this scene (see PxActor::getScene), the actor remove is ignored and an error is issued.
You can not remove individual articulation links (see #PxArticulationLink) from the scene. Use removeArticulation() instead.
If the actor is a PxRigidActor then all assigned PxConstraint objects will get removed from the scene automatically.
Parameters
[in]actorsArray of actors to add to scene.
[in]nbActorsNumber of actors in the array.
[in]wakeOnLostTouchSpecifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCooridnate and PxRigidActor types.
See also
PxActor

Implemented in physx::NpScene.

◆ removeAggregate()

virtual void physx::PxScene::removeAggregate ( PxAggregate &  aggregate,
bool  wakeOnLostTouch = true 
)
pure virtual

Removes an aggregate from this scene.

Note
If the aggregate is not part of this scene (see PxAggregate::getScene), the call is ignored and an error is issued.
If the aggregate contains actors, those actors are removed from the scene as well.
Parameters
[in]aggregateAggregate to remove from scene.
[in]wakeOnLostTouchSpecifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCoordinate and PxRigidActor types.
See also
PxAggregate

Implemented in physx::NpScene.

◆ removeArticulation()

virtual void physx::PxScene::removeArticulation ( PxArticulationReducedCoordinate &  articulation,
bool  wakeOnLostTouch = true 
)
pure virtual

Removes an articulation from this scene.

Note
If the articulation is not part of this scene (see PxArticulationReducedCoordinate::getScene), the call is ignored and an error is issued.
If the articulation is in an aggregate it will be removed from the aggregate.
Parameters
[in]articulationThe articulation to remove from the scene.
[in]wakeOnLostTouchSpecifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCoordinate and PxRigidActor types.
See also
PxArticulationReducedCoordinate, PxAggregate

Implemented in physx::NpScene.

◆ removeBroadPhaseRegion()

virtual bool physx::PxScene::removeBroadPhaseRegion ( PxU32  handle)
pure virtual

Removes a new broad-phase region.

If the region still contains objects, and if those objects do not overlap any region any more, they are not automatically removed from the simulation. Instead, the PxBroadPhaseCallback::onObjectOutOfBounds notification is used for each object. Users are responsible for removing the objects from the simulation if this is the desired behavior.

If the handle is invalid, or if a valid handle is removed twice, an error message is sent to the error stream.

Parameters
[in]handleRegion's handle, as returned by PxScene::addBroadPhaseRegion.
Returns
True if success

Implemented in physx::NpScene.

◆ resetFiltering() [1/2]

virtual bool physx::PxScene::resetFiltering ( PxActor &  actor)
pure virtual

Marks the object to reset interactions and re-run collision filters in the next simulation step.

This call forces the object to remove all existing collision interactions, to search anew for existing contact pairs and to run the collision filters again for found collision pairs.

Note
The operation is supported for PxRigidActor objects only.
All persistent state of existing interactions will be lost and can not be retrieved even if the same collison pair is found again in the next step. This will mean, for example, that you will not get notified about persistent contact for such an interaction (see PxPairFlag::eNOTIFY_TOUCH_PERSISTS), the contact pair will be interpreted as newly found instead.
Lost touch contact reports will be sent for every collision pair which includes this shape, if they have been requested through PxPairFlag::eNOTIFY_TOUCH_LOST or PxPairFlag::eNOTIFY_THRESHOLD_FORCE_LOST.
This is an expensive operation, don't use it if you don't have to.
Can be used to retrieve collision pairs that were killed by the collision filters (see PxFilterFlag::eKILL)
It is invalid to use this method if the actor has not been added to a scene already.
It is invalid to use this method if PxActorFlag::eDISABLE_SIMULATION is set.
Do not use this method while the simulation is running.

Sleeping: Does wake up the actor.

Parameters
[in]actorThe actor for which to re-evaluate interactions.
Returns
True if success
See also
PxSimulationFilterShader PxSimulationFilterCallback

Implemented in physx::NpScene.

◆ resetFiltering() [2/2]

virtual bool physx::PxScene::resetFiltering ( PxRigidActor &  actor,
PxShape *const *  shapes,
PxU32  shapeCount 
)
pure virtual

Marks the object to reset interactions and re-run collision filters for specified shapes in the next simulation step.

This is a specialization of the resetFiltering(PxActor& actor) method and allows to reset interactions for specific shapes of a PxRigidActor.

Note
Do not use this method while the simulation is running.

Sleeping: Does wake up the actor.

Parameters
[in]actorThe actor for which to re-evaluate interactions.
[in]shapesThe shapes for which to re-evaluate interactions.
[in]shapeCountNumber of shapes in the list.
See also
PxSimulationFilterShader PxSimulationFilterCallback

Implemented in physx::NpScene.

◆ setBounceThresholdVelocity()

virtual void physx::PxScene::setBounceThresholdVelocity ( const PxReal  t)
pure virtual

Set the bounce threshold velocity. Collision speeds below this threshold will not cause a bounce.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::bounceThresholdVelocity, getBounceThresholdVelocity

Implemented in physx::NpScene.

◆ setBroadPhaseCallback()

virtual void physx::PxScene::setBroadPhaseCallback ( PxBroadPhaseCallback *  callback)
pure virtual

Sets a broad-phase user callback object.

Note
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[in]callbackAsynchronous broad-phase callback. See #PxBroadPhaseCallback.

Implemented in physx::NpScene.

◆ setCCDContactModifyCallback()

virtual void physx::PxScene::setCCDContactModifyCallback ( PxCCDContactModifyCallback *  callback)
pure virtual

Sets a user callback object, which receives callbacks on all CCD contacts generated for specified actors.

Note
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[in]callbackAsynchronous user contact modification callback. See #PxCCDContactModifyCallback.

Implemented in physx::NpScene.

◆ setCCDMaxPasses()

virtual void physx::PxScene::setCCDMaxPasses ( PxU32  ccdMaxPasses)
pure virtual

Sets the maximum number of CCD passes.

Note
Do not use this method while the simulation is running.
Parameters
[in]ccdMaxPassesMaximum number of CCD passes
See also
PxSceneDesc.ccdMaxPasses getCCDMaxPasses()

Implemented in physx::NpScene.

◆ setCCDMaxSeparation()

virtual void physx::PxScene::setCCDMaxSeparation ( const PxReal  t)
pure virtual

Set the maximum CCD separation.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::ccdMaxSeparation, getCCDMaxSeparation

Implemented in physx::NpScene.

◆ setCCDThreshold()

virtual void physx::PxScene::setCCDThreshold ( const PxReal  t)
pure virtual

Set the CCD threshold.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::ccdThreshold, getCCDThreshold

Implemented in physx::NpScene.

◆ setContactModifyCallback()

virtual void physx::PxScene::setContactModifyCallback ( PxContactModifyCallback *  callback)
pure virtual

Sets a user callback object, which receives callbacks on all contacts generated for specified actors.

Note
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[in]callbackAsynchronous user contact modification callback. See #PxContactModifyCallback.

Implemented in physx::NpScene.

◆ setDominanceGroupPair()

virtual void physx::PxScene::setDominanceGroupPair ( PxDominanceGroup  group1,
PxDominanceGroup  group2,
const PxDominanceGroupPair &  dominance 
)
pure virtual

Specifies the dominance behavior of contacts between two actors with two certain dominance groups.

It is possible to assign each actor to a dominance groups using PxActor::setDominanceGroup().

With dominance groups one can have all contacts created between actors act in one direction only. This is useful, for example, if you want an object to push debris out of its way and be unaffected,while still responding physically to forces and collisions with non-debris objects.

Whenever a contact between two actors (a0, a1) needs to be solved, the groups (g0, g1) of both actors are retrieved. Then the PxDominanceGroupPair setting for this group pair is retrieved with getDominanceGroupPair(g0, g1).

In the contact, PxDominanceGroupPair::dominance0 becomes the dominance setting for a0, and PxDominanceGroupPair::dominance1 becomes the dominance setting for a1. A dominanceN setting of 1.0f, the default, will permit aN to be pushed or pulled by a(1-N) through the contact. A dominanceN setting of 0.0f, will however prevent aN to be pushed by a(1-N) via the contact. Thus, a PxDominanceGroupPair of (1.0f, 0.0f) makes the interaction one-way.

The matrix sampled by getDominanceGroupPair(g1, g2) is initialised by default such that:

if g1 == g2, then (1.0f, 1.0f) is returned if g1 < g2, then (0.0f, 1.0f) is returned if g1 > g2, then (1.0f, 0.0f) is returned

In other words, we permit actors in higher groups to be pushed around by actors in lower groups by default.

These settings should cover most applications, and in fact not overriding these settings may likely result in higher performance.

It is not possible to make the matrix asymetric, or to change the diagonal. In other words:

it is not possible to change (g1, g2) if (g1==g2) if you set

(g1, g2) to X, then (g2, g1) will implicitly and automatically be set to ~X, where:

~(1.0f, 1.0f) is (1.0f, 1.0f) ~(0.0f, 1.0f) is (1.0f, 0.0f) ~(1.0f, 0.0f) is (0.0f, 1.0f)

These two restrictions are to make sure that contacts between two actors will always evaluate to the same dominance setting, regardless of the order of the actors.

Dominance settings are currently specified as floats 0.0f or 1.0f because in the future we may permit arbitrary fractional settings to express 'partly-one-way' interactions.

Sleeping: Does NOT wake actors up automatically.

See also
getDominanceGroupPair() PxDominanceGroup PxDominanceGroupPair PxActor::setDominanceGroup() PxActor::getDominanceGroup()

Implemented in physx::NpScene.

◆ setFilterShaderData()

virtual void physx::PxScene::setFilterShaderData ( const void *  data,
PxU32  dataSize 
)
pure virtual

Sets the shared global filter data which will get passed into the filter shader.

Note
It is the user's responsibility to ensure that changing the shared global filter data does not change the filter output value for existing pairs. If the filter output for existing pairs does change nonetheless then such a change will not take effect until the pair gets refiltered. resetFiltering() can be used to explicitly refilter the pairs of specific objects.
The provided data will get copied to internal buffers and this copy will be used for filtering calls.
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[in]dataThe shared global filter shader data.
[in]dataSizeSize of the shared global filter shader data (in bytes).
See also
getFilterShaderData() PxSceneDesc.filterShaderData PxSimulationFilterShader

Implemented in physx::NpScene.

◆ setFlag()

virtual void physx::PxScene::setFlag ( PxSceneFlag::Enum  flag,
bool  value 
)
pure virtual

Sets a scene flag. You can only set one flag at a time.

Note
Not all flags are mutable and changing some will result in an error. Please check #PxSceneFlag to see which flags can be changed.
See also
PxSceneFlag

Implemented in physx::NpScene.

◆ setFrictionCorrelationDistance()

virtual void physx::PxScene::setFrictionCorrelationDistance ( const PxReal  t)
pure virtual

Set the friction correlation distance.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::frictionCorrelationDistance, getFrictionCorrelationDistance

Implemented in physx::NpScene.

◆ setFrictionOffsetThreshold()

virtual void physx::PxScene::setFrictionOffsetThreshold ( const PxReal  t)
pure virtual

Set the friction offset threshold.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::frictionOffsetThreshold, getFrictionOffsetThreshold

Implemented in physx::NpScene.

◆ setGravity()

virtual void physx::PxScene::setGravity ( const PxVec3 &  vec)
pure virtual

Sets a constant gravity for the entire scene.

Note
Do not use this method while the simulation is running.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]vecA new gravity vector(e.g. PxVec3(0.0f,-9.8f,0.0f) ) Range: force vector
See also
PxSceneDesc.gravity getGravity()

Implemented in physx::NpScene.

◆ setLimits()

virtual void physx::PxScene::setLimits ( const PxSceneLimits &  limits)
pure virtual

Set new scene limits.

Note
Increase the maximum capacity of various data structures in the scene. The new capacities will be at least as large as required to deal with the objects currently in the scene. Further, these values are for preallocation and do not represent hard limits.
Parameters
[in]limitsScene limits.
See also
PxSceneLimits

Implemented in physx::NpScene.

◆ setMaxBiasCoefficient()

virtual void physx::PxScene::setMaxBiasCoefficient ( const PxReal  t)
pure virtual

Set the max bias coefficient.

Note
Do not use this method while the simulation is running.
See also
PxSceneDesc::maxBiasCoefficient, getMaxBiasCoefficient

Implemented in physx::NpScene.

◆ setNbContactDataBlocks()

virtual void physx::PxScene::setNbContactDataBlocks ( PxU32  numBlocks)
pure virtual

set the cache blocks that can be used during simulate().

Each frame the simulation requires memory to store contact, friction, and contact cache data. This memory is used in blocks of 16K. Each frame the blocks used by the previous frame are freed, and may be retrieved by the application using PxScene::flushSimulation()

This call will force allocation of cache blocks if the numBlocks parameter is greater than the currently allocated number of blocks, and less than the max16KContactDataBlocks parameter specified at scene creation time.

Note
Do not use this method while the simulation is running.
Parameters
[in]numBlocksThe number of blocks to allocate.
See also
PxSceneDesc.nbContactDataBlocks PxSceneDesc.maxNbContactDataBlocks flushSimulation() getNbContactDataBlocksUsed getMaxNbContactDataBlocksUsed

Implemented in physx::NpScene.

◆ setSimulationEventCallback()

virtual void physx::PxScene::setSimulationEventCallback ( PxSimulationEventCallback *  callback)
pure virtual

Sets a user notify object which receives special simulation events when they occur.

Note
Do not set the callback while the simulation is running. Calls to this method while the simulation is running will be ignored.
Parameters
[in]callbackUser notification callback. See #PxSimulationEventCallback.
See also
PxSimulationEventCallback getSimulationEventCallback

Implemented in physx::NpScene.

◆ setSolverArticulationBatchSize()

virtual void physx::PxScene::setSolverArticulationBatchSize ( PxU32  solverBatchSize)
pure virtual

Sets the number of articulations required to spawn a separate rigid body solver thread.

Note
Do not use this method while the simulation is running.
Parameters
[in]solverBatchSizeNumber of articulations required to spawn a separate rigid body solver thread.
See also
PxSceneDesc.solverBatchSize getSolverArticulationBatchSize()

Implemented in physx::NpScene.

◆ setSolverBatchSize()

virtual void physx::PxScene::setSolverBatchSize ( PxU32  solverBatchSize)
pure virtual

Sets the number of actors required to spawn a separate rigid body solver thread.

Note
Do not use this method while the simulation is running.
Parameters
[in]solverBatchSizeNumber of actors required to spawn a separate rigid body solver thread.
See also
PxSceneDesc.solverBatchSize getSolverBatchSize()

Implemented in physx::NpScene.

◆ setVisualizationCullingBox()

virtual void physx::PxScene::setVisualizationCullingBox ( const PxBounds3 &  box)
pure virtual

Defines a box in world space to which visualization geometry will be (conservatively) culled. Use a non-empty culling box to enable the feature, and an empty culling box to disable it.

Note
Do not use this method while the simulation is running.
Parameters
[in]boxthe box to which the geometry will be culled. Empty box to disable the feature.
See also
setVisualizationParameter getVisualizationCullingBox getRenderBuffer()

Implemented in physx::NpScene.

◆ setVisualizationParameter()

virtual bool physx::PxScene::setVisualizationParameter ( PxVisualizationParameter::Enum  param,
PxReal  value 
)
pure virtual

Function that lets you set debug visualization parameters.

Returns false if the value passed is out of range for usage specified by the enum.

Note
Do not use this method while the simulation is running.
Parameters
[in]paramParameter to set. See #PxVisualizationParameter
[in]valueThe value to set, see #PxVisualizationParameter for allowable values. Setting to zero disables visualization for the specified property, setting to a positive value usually enables visualization and defines the scale factor.
Returns
False if the parameter is out of range.
See also
getVisualizationParameter PxVisualizationParameter getRenderBuffer()

Implemented in physx::NpScene.

◆ shiftOrigin()

virtual void physx::PxScene::shiftOrigin ( const PxVec3 &  shift)
pure virtual

Shift the scene origin by the specified vector.

The poses of all objects in the scene and the corresponding data structures will get adjusted to reflect the new origin location (the shift vector will get subtracted from all object positions).

Note
It is the user's responsibility to keep track of the summed total origin shift and adjust all input/output to/from PhysX accordingly.
Do not use this method while the simulation is running. Calls to this method while the simulation is running will be ignored.
Make sure to propagate the origin shift to other dependent modules (for example, the character controller module etc.).
This is an expensive operation and we recommend to use it only in the case where distance related precision issues may arise in areas far from the origin.
Parameters
[in]shiftTranslation vector to shift the origin by.

Implemented in physx::NpScene.

◆ simulate()

virtual bool physx::PxScene::simulate ( PxReal  elapsedTime,
physx::PxBaseTask *  completionTask = NULL,
void *  scratchMemBlock = 0,
PxU32  scratchMemBlockSize = 0,
bool  controlSimulation = true 
)
pure virtual

Advances the simulation by an elapsedTime time.

Note
Large elapsedTime values can lead to instabilities. In such cases elapsedTime should be subdivided into smaller time intervals and simulate() should be called multiple times for each interval.

Calls to simulate() should pair with calls to fetchResults(): Each fetchResults() invocation corresponds to exactly one simulate() invocation; calling simulate() twice without an intervening fetchResults() or fetchResults() twice without an intervening simulate() causes an error condition.

scene->simulate(); ...do some processing until physics is computed... scene->fetchResults(); ...now results of run may be retrieved.

Parameters
[in]elapsedTimeAmount of time to advance simulation by. The parameter has to be larger than 0, else the resulting behavior will be undefined. Range: (0, PX_MAX_F32)
[in]completionTaskif non-NULL, this task will have its refcount incremented in simulate(), then decremented when the scene is ready to have fetchResults called. So the task will not run until the application also calls removeReference().
[in]scratchMemBlocka memory region for physx to use for temporary data during simulation. This block may be reused by the application after fetchResults returns. Must be aligned on a 16-byte boundary
[in]scratchMemBlockSizethe size of the scratch memory block. Must be a multiple of 16K.
[in]controlSimulationif true, the scene controls its PxTaskManager simulation state. Leave true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
Returns
True if success
See also
fetchResults() checkResults()

Implemented in physx::NpScene.

◆ unlockRead()

virtual void physx::PxScene::unlockRead ( )
pure virtual

Unlock the scene from reading.

Note
Each unlockRead() must be paired with a lockRead() from the same thread.

Implemented in physx::NpScene.

◆ unlockWrite()

virtual void physx::PxScene::unlockWrite ( )
pure virtual

Unlock the scene from writing.

Note
Each unlockWrite() must be paired with a lockWrite() from the same thread.

Implemented in physx::NpScene.


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