35#include "PxSceneQuerySystem.h"
36#include "PxSceneDesc.h"
37#include "PxVisualizationParameter.h"
38#include "PxSimulationStatistics.h"
40#include "task/PxTask.h"
41#include "PxArticulationFlag.h"
42#include "PxSoftBodyFlag.h"
43#include "PxHairSystemFlag.h"
44#include "PxActorData.h"
45#include "PxParticleSystemFlag.h"
46#include "PxParticleSolverType.h"
48#include "pvd/PxPvdSceneClient.h"
57class PxSimulationEventCallback;
61class PxArticulationReducedCoordinate;
62class PxParticleSystem;
64struct PxContactPairHeader;
68class PxPvdSceneClient;
85 : dominance0(a), dominance1(b) {}
557 virtual PxU32
getFEMCloths(PxFEMCloth** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0)
const = 0;
576 virtual PxU32
getHairSystems(PxHairSystem** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0)
const = 0;
1001 void* scratchMemBlock = 0, PxU32 scratchMemBlockSize = 0,
bool controlSimulation =
true) = 0;
1033 PxU32 scratchMemBlockSize = 0,
bool controlSimulation =
true) = 0;
1482 virtual void lockRead(
const char* file=NULL, PxU32 line=0) = 0;
1516 virtual void lockWrite(
const char* file=NULL, PxU32 line=0) = 0;
1702 virtual void copyContactData(
void* data,
const PxU32 maxContactPairs,
void* numContactPairs,
void* copyEvent = NULL) = 0;
1722 virtual void applyActorData(
void* data,
PxGpuActorPair* index, PxActorCacheFlag::Enum flag,
const PxU32 nbUpdatedActors,
void* waitEvent = NULL,
void* signalEvent = NULL) = 0;
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
Class to aggregate actors into a single broad-phase entry.
Definition PxAggregate.h:98
Enum
Definition PxArticulationFlag.h:52
A tree structure of bodies connected by joints that is treated as a unit by the dynamics solver....
Definition PxArticulationReducedCoordinate.h:448
Class representing a bounding volume hierarchy.
Definition PxBVH.h:63
Base class of all task types.
Definition PxTask.h:45
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Broad-phase callback to receive broad-phase related events.
Definition PxScene.h:144
virtual void onObjectOutOfBounds(PxAggregate &aggregate)=0
Out-of-bounds notification.
virtual void onObjectOutOfBounds(PxShape &shape, PxActor &actor)=0
Out-of-bounds notification.
Collection class for serialization.
Definition PxCollection.h:104
A plugin class for implementing constraints.
Definition PxConstraint.h:100
A CpuDispatcher is responsible for scheduling the execution of tasks passed to it by the SDK.
Definition PxCpuDispatcher.h:50
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
The shared base class for all particle systems.
Definition PxParticleSystem.h:137
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition PxPhysics.h:91
A precomputed pruning structure to accelerate scene queries against newly added actors.
Definition PxPruningStructure.h:61
Special client for PxScene. It provides access to the PxPvdSceneFlag. It also provides simple user de...
Definition PxPvdSceneClient.h:86
Interface for points, lines, triangles, and text buffer.
Definition PxRenderBuffer.h:136
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Class used to retrieve limits(e.g. maximum number of bodies) for a scene. The limits are used as a hi...
Definition PxSceneDesc.h:318
Traditional SQ system for PxScene.
Definition PxSceneQuerySystem.h:257
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
virtual bool checkResults(bool block=false)=0
This checks to see if the simulation run has completed.
virtual bool setVisualizationParameter(PxVisualizationParameter::Enum param, PxReal value)=0
Function that lets you set debug visualization parameters.
virtual bool fetchResults(bool block=false, PxU32 *errorState=0)=0
virtual void fetchResultsFinish(PxU32 *errorState=0)=0
virtual PxU32 getNbSoftBodies() const =0
Retrieve the number of soft bodies in the scene.
virtual PxU32 getBroadPhaseRegions(PxBroadPhaseRegionInfo *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Gets broad-phase regions.
virtual void setSimulationEventCallback(PxSimulationEventCallback *callback)=0
Sets a user notify object which receives special simulation events when they occur.
virtual PxU32 getContactReportStreamBufferSize() const =0
Return the value of PxSceneDesc::contactReportStreamBufferSize that was set when creating the scene w...
virtual void setBounceThresholdVelocity(const PxReal t)=0
Set the bounce threshold velocity. Collision speeds below this threshold will not cause a bounce.
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 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 PxCpuDispatcher * getCpuDispatcher() const =0
Return the cpu dispatcher that was set in PxSceneDesc::cpuDispatcher when creating the scene with PxP...
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 PxU32 getSoftBodies(PxSoftBody **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve an array of all the soft bodies in the scene.
virtual PxU32 getAggregates(PxAggregate **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the aggregates in the scene.
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 processCallbacks(physx::PxBaseTask *continuation)=0
virtual PxCCDContactModifyCallback * getCCDContactModifyCallback() const =0
Retrieves the PxCCDContactModifyCallback pointer set with setContactModifyCallback().
virtual PxU32 getFEMCloths(PxFEMCloth **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve an array of all the FEM cloths in the scene.
virtual bool resetFiltering(PxActor &actor)=0
Marks the object to reset interactions and re-run collision filters in the next simulation step.
virtual PxBroadPhaseCallback * getBroadPhaseCallback() const =0
Retrieves the PxBroadPhaseCallback pointer set with setBroadPhaseCallback().
virtual void removeArticulation(PxArticulationReducedCoordinate &articulation, bool wakeOnLostTouch=true)=0
Removes an articulation from this scene.
virtual void setVisualizationCullingBox(const PxBounds3 &box)=0
Defines a box in world space to which visualization geometry will be (conservatively) culled....
virtual bool addActor(PxActor &actor, const PxBVH *bvh=NULL)=0
Adds an actor to this scene.
virtual void setContactModifyCallback(PxContactModifyCallback *callback)=0
Sets a user callback object, which receives callbacks on all contacts generated for specified actors.
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 * ...
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 ...
virtual void setCCDContactModifyCallback(PxCCDContactModifyCallback *callback)=0
Sets a user callback object, which receives callbacks on all CCD contacts generated for specified act...
virtual PxU32 getConstraints(PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the constraint shaders in the scene.
virtual PxU32 getSolverArticulationBatchSize() const =0
Retrieves the number of articulations required to spawn a separate rigid body solver thread.
virtual PxReal getCCDThreshold() const =0
Gets the CCD threshold.
virtual PxReal getVisualizationParameter(PxVisualizationParameter::Enum paramEnum) const =0
Function that lets you query debug visualization parameters.
virtual bool addActors(const PxPruningStructure &pruningStructure)=0
Adds a pruning structure together with its actors to this scene. Only supports actors of type PxRigid...
virtual PxU32 getNbContactDataBlocksUsed() const =0
get the number of cache blocks currently used by the scene
virtual void setFrictionCorrelationDistance(const PxReal t)=0
Set the friction correlation distance.
virtual bool fetchCollision(bool block=false)=0
virtual void setCCDMaxPasses(PxU32 ccdMaxPasses)=0
Sets the maximum number of CCD passes.
virtual void removeActor(PxActor &actor, bool wakeOnLostTouch=true)=0
Removes an actor from this scene.
virtual PxSimulationEventCallback * getSimulationEventCallback() const =0
Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxScene.h:1808
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 void removeAggregate(PxAggregate &aggregate, bool wakeOnLostTouch=true)=0
Removes an aggregate from this scene.
virtual PxU32 getNbHairSystems() const =0
Retrieve the number of hair systems in 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 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 PxSceneFlags getFlags() const =0
Get the scene flags.
virtual PxSimulationFilterShader getFilterShader() const =0
Gets the custom collision filter shader in use for this scene.
virtual bool removeBroadPhaseRegion(PxU32 handle)=0
Removes a new broad-phase region.
virtual PxReal getBounceThresholdVelocity() const =0
Return the bounce threshold velocity.
virtual void setGravity(const PxVec3 &vec)=0
Sets a constant gravity for the entire scene.
virtual PxU32 getMaxNbContactDataBlocksUsed() const =0
get the maximum number of cache blocks used by the scene
virtual bool advance(physx::PxBaseTask *completionTask=0)=0
Performs dynamics phase of the simulation pipeline.
virtual PxPvdSceneClient * getScenePvdClient()=0
Returns the Pvd client associated with the scene.
virtual PxPhysics & getPhysics()=0
Call this method to retrieve the Physics SDK.
virtual PxDominanceGroupPair getDominanceGroupPair(PxDominanceGroup group1, PxDominanceGroup group2) const =0
Samples the dominance matrix.
virtual PxReal getMaxBiasCoefficient() const =0
Gets the max bias coefficient.
virtual void fetchResultsParticleSystem()=0
virtual void setCCDThreshold(const PxReal t)=0
Set the CCD threshold.
virtual const PxRenderBuffer & getRenderBuffer()=0
Retrieves the render buffer.
virtual PxTaskManager * getTaskManager() const =0
Get the task manager associated with this scene.
virtual void setFrictionOffsetThreshold(const PxReal t)=0
Set the friction offset threshold.
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 void setFilterShaderData(const void *data, PxU32 dataSize)=0
Sets the shared global filter data which will get passed into the filter shader.
virtual bool getBroadPhaseCaps(PxBroadPhaseCaps &caps) const =0
Gets broad-phase caps.
virtual PxSceneLimits getLimits() const =0
Get current scene limits.
virtual void setNbContactDataBlocks(PxU32 numBlocks)=0
set the cache blocks that can be used during simulate().
virtual void getSimulationStatistics(PxSimulationStatistics &stats) const =0
Call this method to retrieve statistics for the current simulation step.
virtual PxReal getFrictionCorrelationDistance() const =0
Gets the friction correlation distance.
virtual void flushSimulation(bool sendPendingReports=false)=0
Clear internal buffers and free memory.
virtual PxCudaContextManager * getCudaContextManager() const =0
Return the CUDA context manager that was set in PxSceneDesc::cudaContextManager when creating the sce...
virtual void unlockRead()=0
Unlock the scene from reading.
virtual PxReal getCCDMaxSeparation() const =0
Gets the maximum CCD separation.
virtual PxU32 getFilterShaderDataSize() const =0
Gets the size of the shared global filter data (PxSceneDesc.filterShaderData)
virtual PxBounds3 getVisualizationCullingBox() const =0
Retrieves the visualization culling box.
virtual PxU32 getTimestamp() const =0
Retrieves the scene's internal timestamp, increased each time a simulation step is completed.
virtual PxSolverType::Enum getSolverType() const =0
Return the solver model.
virtual void setBroadPhaseCallback(PxBroadPhaseCallback *callback)=0
Sets a broad-phase user callback object.
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 void setLimits(const PxSceneLimits &limits)=0
Set new scene limits.
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 ...
virtual PxBroadPhaseType::Enum getBroadPhaseType() const =0
Returns broad-phase type.
virtual void setFlag(PxSceneFlag::Enum flag, bool value)=0
Sets a scene flag. You can only set one flag at a time.
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 getNbAggregates() const =0
Returns the number of aggregates in the scene.
virtual PxU32 getNbConstraints() const =0
Returns the number of constraint shaders in the scene.
virtual const void * getFilterShaderData() const =0
Gets the shared global filter data in use for this scene.
virtual PxReal getFrictionOffsetThreshold() const =0
Gets the friction offset threshold.
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 ar...
virtual bool fetchResultsStart(const PxContactPairHeader *&contactPairs, PxU32 &nbContactPairs, bool block=false)=0
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,...
virtual PxU32 getCCDMaxPasses() const =0
Gets the maximum number of CCD passes.
virtual PxU32 getNbBroadPhaseRegions() const =0
Returns number of regions currently registered in the broad-phase.
virtual bool addArticulation(PxArticulationReducedCoordinate &articulation)=0
Adds an articulation to this scene.
virtual void unlockWrite()=0
Unlock the scene from writing.
virtual PxU32 getNbFEMCloths() const =0
Retrieve the number of FEM cloths in the scene.
virtual PxContactModifyCallback * getContactModifyCallback() const =0
Retrieves the PxContactModifyCallback pointer set with setContactModifyCallback().
virtual PxActor ** getActiveActors(PxU32 &nbActorsOut)=0
Queries the PxScene for a list of the PxActors whose transforms have been updated during the previous...
virtual PxSimulationFilterCallback * getFilterCallback() const =0
Gets the custom collision filter callback in use for this scene.
virtual void setSolverArticulationBatchSize(PxU32 solverBatchSize)=0
Sets the number of articulations required to spawn a separate rigid body solver thread.
virtual PxU32 getNbParticleSystems(PxParticleSolverType::Enum type) const =0
Retrieve the number of particle systems of the requested type in the scene.
virtual void shiftOrigin(const PxVec3 &shift)=0
Shift the scene origin by the specified vector.
virtual void setCCDMaxSeparation(const PxReal t)=0
Set the maximum CCD separation.
virtual bool addActors(PxActor *const *actors, PxU32 nbActors)=0
Adds actors to this scene. Only supports actors of type PxRigidStatic and PxRigidDynamic.
virtual PxReal getWakeCounterResetValue() const =0
Returns the wake counter reset value.
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 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.
virtual void computeDenseJacobians(const PxIndexDataPair *indices, PxU32 nbIndices, void *computeEvent)=0
Compute dense Jacobian matrices for specified articulations on the GPU.
virtual PxU32 getSolverBatchSize() const =0
Retrieves the number of actors required to spawn a separate rigid body solver thread.
virtual PxFrictionType::Enum getFrictionType() const =0
Return the friction model.
virtual PxPairFilteringMode::Enum getKinematicKinematicFilteringMode() const =0
Gets the pair filtering mode for kinematic-kinematic pairs.
virtual PxU32 getArticulations(PxArticulationReducedCoordinate **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the articulations in the scene.
virtual bool addAggregate(PxAggregate &aggregate)=0
Adds an aggregate to this scene.
virtual PxU32 addBroadPhaseRegion(const PxBroadPhaseRegion ®ion, bool populateRegion=false)=0
Adds a new broad-phase region.
virtual void release()=0
Deletes the scene.
virtual void lockWrite(const char *file=NULL, PxU32 line=0)=0
Lock the scene for writing from this thread.
virtual PxClientID createClient()=0
Reserves a new client ID.
virtual PxU32 getNbActors(PxActorTypeFlags types) const =0
Retrieve the number of actors of certain types in the scene. For supported types, see PxActorTypeFlag...
virtual PxU32 getNbArticulations() const =0
Returns the number of articulations in the scene.
virtual void lockRead(const char *file=NULL, PxU32 line=0)=0
Lock the scene for reading from the calling thread.
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 bool addCollection(const PxCollection &collection)=0
Adds objects in the collection to this scene.
virtual PxPairFilteringMode::Enum getStaticKinematicFilteringMode() const =0
Gets the pair filtering mode for static-kinematic pairs.
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 setSolverBatchSize(PxU32 solverBatchSize)=0
Sets the number of actors required to spawn a separate rigid body solver thread.
virtual PxVec3 getGravity() const =0
Retrieves the current gravity setting.
virtual void setMaxBiasCoefficient(const PxReal t)=0
Set the max bias coefficient.
Abstract class for collision shapes.
Definition PxShape.h:146
An interface class that the user can implement in order to receive simulation events.
Definition PxSimulationEventCallback.h:792
Filter callback to specify handling of collision pairs.
Definition PxFiltering.h:633
Class used to retrieve statistics for a simulation step.
Definition PxSimulationStatistics.h:50
Enum
Definition PxSoftBodyFlag.h:49
Represents a FEM softbody including everything to calculate its definition like geometry and material...
Definition PxSoftBody.h:104
The PxTaskManager interface.
Definition PxTaskManager.h:81
3 Element vector class.
Definition PxVec3.h:50
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFilterFlags(* PxSimulationFilterShader)(PxFilterObjectAttributes attributes0, PxFilterData filterData0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, PxPairFlags &pairFlags, const void *constantBlock, PxU32 constantBlockSize)
Filter method to specify how a pair of potentially colliding objects should be processed.
Definition PxFiltering.h:604
PxU8 PxClientID
An ID to identify different clients for multiclient support.
Definition PxClient.h:44
PxU8 PxDominanceGroup
Group index which allows to specify 1- or 2-way interaction.
Definition PxActor.h:56
PxFlags< PxActorTypeFlag::Enum, PxU16 > PxActorTypeFlags
Collection of set bits defined in PxActorTypeFlag.
Definition PxScene.h:121
Identifies each type of actor for retrieving actors from a scene.
Definition PxScene.h:99
Enum
Definition PxScene.h:101
@ eRIGID_DYNAMIC
A dynamic rigid body.
Definition PxScene.h:112
@ eRIGID_STATIC
A static rigid body.
Definition PxScene.h:106
Caps class for broad phase.
Definition PxBroadPhase.h:131
Information & stats structure for a region.
Definition PxBroadPhase.h:119
"Region of interest" for the broad-phase.
Definition PxBroadPhase.h:110
Enum
Definition PxBroadPhase.h:79
Expresses the dominance relationship of a contact. For the time being only three settings are permitt...
Definition PxScene.h:83
Enum
Definition PxSceneDesc.h:71
Pair correspondence used for matching array indices with body node indices.
Definition PxActorData.h:89
State of a body used when interfacing with the GPU rigid body pipeline.
Definition PxActorData.h:76
A pair of particle buffer unique id and GPU particle system index.
Definition PxParticleSystemFlag.h:72
Maps numeric index to a data pointer.
Definition PxActorData.h:101
Enum
Definition PxFiltering.h:717
Enum
Definition PxParticleSolverType.h:53
Enum
Definition PxSceneDesc.h:103
Enum
Definition PxSceneDesc.h:89
Enum
Definition PxVisualizationParameter.h:63
Sizes of pre-allocated buffers use for GPU dynamics.
Definition PxSceneDesc.h:377