RavEngine
Loading...
Searching...
No Matches
PxScene.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PX_SCENE_H
30#define PX_SCENE_H
35#include "PxSceneQuerySystem.h"
36#include "PxSceneDesc.h"
37#include "PxVisualizationParameter.h"
38#include "PxSimulationStatistics.h"
39#include "PxClient.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"
47
48#include "pvd/PxPvdSceneClient.h"
49
50#if !PX_DOXYGEN
51namespace physx
52{
53#endif
54
55class PxCollection;
56class PxConstraint;
57class PxSimulationEventCallback;
58class PxPhysics;
59class PxAggregate;
60class PxRenderBuffer;
61class PxArticulationReducedCoordinate;
62class PxParticleSystem;
63
64struct PxContactPairHeader;
65
66typedef PxU8 PxDominanceGroup;
67
68class PxPvdSceneClient;
69
70class PxSoftBody;
71class PxFEMCloth;
72class PxHairSystem;
73
83{
84 PxDominanceGroupPair(PxU8 a, PxU8 b)
85 : dominance0(a), dominance1(b) {}
86 PxU8 dominance0;
87 PxU8 dominance1;
88};
89
90
99{
100 enum Enum
101 {
106 eRIGID_STATIC = (1 << 0),
107
112 eRIGID_DYNAMIC = (1 << 1)
113 };
114};
115
122PX_FLAGS_OPERATORS(PxActorTypeFlag::Enum,PxU16)
123
124class PxActor;
125
144{
145 public:
146 virtual ~PxBroadPhaseCallback() {}
147
156 virtual void onObjectOutOfBounds(PxShape& shape, PxActor& actor) = 0;
157
165 virtual void onObjectOutOfBounds(PxAggregate& aggregate) = 0;
166};
167
178{
179 protected:
180
181 /************************************************************************************************/
182
186
187 PxScene() : userData(NULL) {}
188 virtual ~PxScene() {}
189
190 public:
191
203 virtual void release() = 0;
204
212 virtual void setFlag(PxSceneFlag::Enum flag, bool value) = 0;
213
221 virtual PxSceneFlags getFlags() const = 0;
222
233 virtual void setLimits(const PxSceneLimits& limits) = 0;
234
240 virtual PxSceneLimits getLimits() const = 0;
241
249 virtual PxPhysics& getPhysics() = 0;
250
256 virtual PxU32 getTimestamp() const = 0;
257
259 /************************************************************************************************/
260
274 virtual bool addArticulation(PxArticulationReducedCoordinate& articulation) = 0;
275
289 virtual void removeArticulation(PxArticulationReducedCoordinate& articulation, bool wakeOnLostTouch = true) = 0;
290
292 /************************************************************************************************/
293
319 virtual bool addActor(PxActor& actor, const PxBVH* bvh = NULL) = 0;
320
341 virtual bool addActors(PxActor*const* actors, PxU32 nbActors) = 0;
342
365 virtual bool addActors(const PxPruningStructure& pruningStructure) = 0;
366
383 virtual void removeActor(PxActor& actor, bool wakeOnLostTouch = true) = 0;
384
403 virtual void removeActors(PxActor*const* actors, PxU32 nbActors, bool wakeOnLostTouch = true) = 0;
404
418 virtual bool addAggregate(PxAggregate& aggregate) = 0;
419
432 virtual void removeAggregate(PxAggregate& aggregate, bool wakeOnLostTouch = true) = 0;
433
447 virtual bool addCollection(const PxCollection& collection) = 0;
449 /************************************************************************************************/
450
454
463 virtual PxU32 getNbActors(PxActorTypeFlags types) const = 0;
464
476 virtual PxU32 getActors(PxActorTypeFlags types, PxActor** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
477
492 virtual PxActor** getActiveActors(PxU32& nbActorsOut) = 0;
493
501 virtual PxU32 getNbSoftBodies() const = 0;
502
513 virtual PxU32 getSoftBodies(PxSoftBody** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
514
524
536 virtual PxU32 getParticleSystems(PxParticleSolverType::Enum type, PxParticleSystem** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
537
546 virtual PxU32 getNbFEMCloths() const = 0;
547
557 virtual PxU32 getFEMCloths(PxFEMCloth** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
558
565 virtual PxU32 getNbHairSystems() const = 0;
566
576 virtual PxU32 getHairSystems(PxHairSystem** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
577
585 virtual PxU32 getNbArticulations() const = 0;
586
597 virtual PxU32 getArticulations(PxArticulationReducedCoordinate** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
598
606 virtual PxU32 getNbConstraints() const = 0;
607
618 virtual PxU32 getConstraints(PxConstraint** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
619
627 virtual PxU32 getNbAggregates() const = 0;
628
639 virtual PxU32 getAggregates(PxAggregate** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
640
642 /************************************************************************************************/
643
647
699 PxDominanceGroup group1, PxDominanceGroup group2, const PxDominanceGroupPair& dominance) = 0;
700
707
709 /************************************************************************************************/
710
714
720 virtual PxCpuDispatcher* getCpuDispatcher() const = 0;
721
729 virtual PxCudaContextManager* getCudaContextManager() const = 0;
730
732 /************************************************************************************************/
746
748
749 /************************************************************************************************/
750
754
765
774
783
792
801
810
818 virtual void setBroadPhaseCallback(PxBroadPhaseCallback* callback) = 0;
819
828
830 /************************************************************************************************/
831
835
852 virtual void setFilterShaderData(const void* data, PxU32 dataSize) = 0;
853
863 virtual const void* getFilterShaderData() const = 0;
864
872 virtual PxU32 getFilterShaderDataSize() const = 0;
873
882
891
924 virtual bool resetFiltering(PxActor& actor) = 0;
925
942 virtual bool resetFiltering(PxRigidActor& actor, PxShape*const* shapes, PxU32 shapeCount) = 0;
943
952
961
963 /************************************************************************************************/
964
1000 virtual bool simulate(PxReal elapsedTime, physx::PxBaseTask* completionTask = NULL,
1001 void* scratchMemBlock = 0, PxU32 scratchMemBlockSize = 0, bool controlSimulation = true) = 0;
1002
1013 virtual bool advance(physx::PxBaseTask* completionTask = 0) = 0;
1014
1032 virtual bool collide(PxReal elapsedTime, physx::PxBaseTask* completionTask = 0, void* scratchMemBlock = 0,
1033 PxU32 scratchMemBlockSize = 0, bool controlSimulation = true) = 0;
1034
1046 virtual bool checkResults(bool block = false) = 0;
1047
1054 virtual bool fetchCollision(bool block = false) = 0;
1055
1077 virtual bool fetchResults(bool block = false, PxU32* errorState = 0) = 0;
1078
1093 virtual bool fetchResultsStart(const PxContactPairHeader*& contactPairs, PxU32& nbContactPairs, bool block = false) = 0;
1094
1103 virtual void processCallbacks(physx::PxBaseTask* continuation) = 0;
1104
1116 virtual void fetchResultsFinish(PxU32* errorState = 0) = 0;
1117
1121 virtual void fetchResultsParticleSystem() = 0;
1122
1133 virtual void flushSimulation(bool sendPendingReports = false) = 0;
1134
1146 virtual void setGravity(const PxVec3& vec) = 0;
1147
1155 virtual PxVec3 getGravity() const = 0;
1156
1164 virtual void setBounceThresholdVelocity(const PxReal t) = 0;
1165
1171 virtual PxReal getBounceThresholdVelocity() const = 0;
1172
1182 virtual void setCCDMaxPasses(PxU32 ccdMaxPasses) = 0;
1183
1191 virtual PxU32 getCCDMaxPasses() const = 0;
1192
1200 virtual void setCCDMaxSeparation(const PxReal t) = 0;
1201
1209 virtual PxReal getCCDMaxSeparation() const = 0;
1210
1218 virtual void setCCDThreshold(const PxReal t) = 0;
1219
1227 virtual PxReal getCCDThreshold() const = 0;
1228
1236 virtual void setMaxBiasCoefficient(const PxReal t) = 0;
1237
1245 virtual PxReal getMaxBiasCoefficient() const = 0;
1246
1254 virtual void setFrictionOffsetThreshold(const PxReal t) = 0;
1255
1261 virtual PxReal getFrictionOffsetThreshold() const = 0;
1262
1270 virtual void setFrictionCorrelationDistance(const PxReal t) = 0;
1271
1277 virtual PxReal getFrictionCorrelationDistance() const = 0;
1278
1284
1290
1292 /************************************************************************************************/
1293
1310 virtual bool setVisualizationParameter(PxVisualizationParameter::Enum param, PxReal value) = 0;
1311
1321
1330 virtual void setVisualizationCullingBox(const PxBounds3& box) = 0;
1331
1339
1351 virtual const PxRenderBuffer& getRenderBuffer() = 0;
1352
1362 virtual void getSimulationStatistics(PxSimulationStatistics& stats) const = 0;
1363
1365
1366 /************************************************************************************************/
1370
1377
1384 virtual bool getBroadPhaseCaps(PxBroadPhaseCaps& caps) const = 0;
1385
1391 virtual PxU32 getNbBroadPhaseRegions() const = 0;
1392
1401 virtual PxU32 getBroadPhaseRegions(PxBroadPhaseRegionInfo* userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
1402
1432 virtual PxU32 addBroadPhaseRegion(const PxBroadPhaseRegion& region, bool populateRegion=false) = 0;
1433
1447 virtual bool removeBroadPhaseRegion(PxU32 handle) = 0;
1448
1450
1451 /************************************************************************************************/
1452
1456
1462 virtual PxTaskManager* getTaskManager() const = 0;
1463
1482 virtual void lockRead(const char* file=NULL, PxU32 line=0) = 0;
1483
1489 virtual void unlockRead() = 0;
1490
1516 virtual void lockWrite(const char* file=NULL, PxU32 line=0) = 0;
1517
1523 virtual void unlockWrite() = 0;
1524
1540 virtual void setNbContactDataBlocks(PxU32 numBlocks) = 0;
1541
1551 virtual PxU32 getNbContactDataBlocksUsed() const = 0;
1552
1562 virtual PxU32 getMaxNbContactDataBlocksUsed() const = 0;
1563
1569 virtual PxU32 getContactReportStreamBufferSize() const = 0;
1570
1580 virtual void setSolverBatchSize(PxU32 solverBatchSize) = 0;
1581
1589 virtual PxU32 getSolverBatchSize() const = 0;
1590
1600 virtual void setSolverArticulationBatchSize(PxU32 solverBatchSize) = 0;
1601
1609 virtual PxU32 getSolverArticulationBatchSize() const = 0;
1610
1612
1620 virtual PxReal getWakeCounterResetValue() const = 0;
1621
1638 virtual void shiftOrigin(const PxVec3& shift) = 0;
1639
1645
1654 virtual void copyArticulationData(void* data, void* index, PxArticulationGpuDataType::Enum dataType, const PxU32 nbCopyArticulations, void* copyEvent = NULL) = 0;
1655
1665 virtual void applyArticulationData(void* data, void* index, PxArticulationGpuDataType::Enum dataType, const PxU32 nbUpdatedArticulations, void* waitEvent = NULL, void* signalEvent = NULL) = 0;
1666
1677 virtual void copySoftBodyData(void** data, void* dataSizes, void* softBodyIndices, PxSoftBodyDataFlag::Enum flag, const PxU32 nbCopySoftBodies, const PxU32 maxSize, void* copyEvent = NULL) = 0;
1678
1679
1690 virtual void applySoftBodyData(void** data, void* dataSizes, void* softBodyIndices, PxSoftBodyDataFlag::Enum flag, const PxU32 nbUpdatedSoftBodies, const PxU32 maxSize, void* applyEvent = NULL) = 0;
1691
1702 virtual void copyContactData(void* data, const PxU32 maxContactPairs, void* numContactPairs, void* copyEvent = NULL) = 0;
1703
1711 virtual void copyBodyData(PxGpuBodyData* data, PxGpuActorPair* index, const PxU32 nbCopyActors, void* copyEvent = NULL) = 0;
1712
1722 virtual void applyActorData(void* data, PxGpuActorPair* index, PxActorCacheFlag::Enum flag, const PxU32 nbUpdatedActors, void* waitEvent = NULL, void* signalEvent = NULL) = 0;
1723
1739 virtual void computeDenseJacobians(const PxIndexDataPair* indices, PxU32 nbIndices, void* computeEvent) = 0;
1740
1755 virtual void computeGeneralizedMassMatrices(const PxIndexDataPair* indices, PxU32 nbIndices, void* computeEvent) = 0;
1756
1771 virtual void computeGeneralizedGravityForces(const PxIndexDataPair* indices, PxU32 nbIndices, void* computeEvent) = 0;
1772
1787 virtual void computeCoriolisAndCentrifugalForces(const PxIndexDataPair* indices, PxU32 nbIndices, void* computeEvent) = 0;
1788
1789 virtual PxgDynamicsMemoryConfig getGpuDynamicsConfig() const = 0;
1790
1806 virtual void applyParticleBufferData(const PxU32* indices, const PxGpuParticleBufferIndexPair* bufferIndexPair, const PxParticleBufferFlags* flags, PxU32 nbUpdatedBuffers, void* waitEvent = NULL, void* signalEvent = NULL) = 0;
1807
1808 void* userData;
1809};
1810
1811#if !PX_DOXYGEN
1812} // namespace physx
1813#endif
1814
1816#endif
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.
An interface class that the user can implement in order to modify CCD contact constraints.
Definition PxContactModifyCallback.h:500
Collection class for serialization.
Definition PxCollection.h:104
A plugin class for implementing constraints.
Definition PxConstraint.h:100
An interface class that the user can implement in order to modify contact constraints.
Definition PxContactModifyCallback.h:459
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 &region, 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
An Instance of this class is passed to PxSimulationEventCallback.onContact().
Definition PxSimulationEventCallback.h:346
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