RavEngine
Loading...
Searching...
No Matches
PxSimulationStatistics.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_SIMULATION_STATISTICS_H
30#define PX_SIMULATION_STATISTICS_H
35#include "foundation/PxAssert.h"
36#include "PxPhysXConfig.h"
37#include "geometry/PxGeometry.h"
38
39#if !PX_DOXYGEN
40namespace physx
41{
42#endif
43
50{
51public:
52
88
89
90//objects:
95
102
110
115
123
130
136
141
146
147//solver:
152
157
162
167
168//broadphase:
175 {
176 return nbBroadPhaseAdds;
177 }
178
185 {
186 return nbBroadPhaseRemoves;
187 }
188
189//collisions:
204 {
205 PX_ASSERT_WITH_MESSAGE( (pairType >= eDISCRETE_CONTACT_PAIRS) &&
206 (pairType <= eTRIGGER_PAIRS),
207 "Invalid pairType in PxSimulationStatistics::getRbPairStats");
208
210 {
211 PX_ASSERT(false);
212 return 0;
213 }
214
215 PxU32 nbPairs = 0;
216 switch(pairType)
217 {
219 nbPairs = nbDiscreteContactPairs[g0][g1];
220 break;
221 case eCCD_PAIRS:
222 nbPairs = nbCCDPairs[g0][g1];
223 break;
225 nbPairs = nbModifiedContactPairs[g0][g1];
226 break;
227 case eTRIGGER_PAIRS:
228 nbPairs = nbTriggerPairs[g0][g1];
229 break;
230 }
231 return nbPairs;
232 }
233
238
244
249
254
259
264
269
274
279
284
289
294
299
304
309
314
319
324
329
334
339
344
349
354
359
364
369
374
379 nbStaticBodies (0),
380 nbDynamicBodies (0),
382 nbAggregates (0),
383 nbArticulations (0),
391 nbNewPairs (0),
392 nbLostPairs (0),
393 nbNewTouches (0),
394 nbLostTouches (0),
395 nbPartitions (0),
396 gpuMemParticles (0),
398 gpuMemFEMCloths (0),
400 gpuMemHeap (0),
416 {
417 nbBroadPhaseAdds = 0;
418 nbBroadPhaseRemoves = 0;
419
420 for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
421 {
422 for(PxU32 j=0; j < PxGeometryType::eGEOMETRY_COUNT; j++)
423 {
424 nbDiscreteContactPairs[i][j] = 0;
425 nbModifiedContactPairs[i][j] = 0;
426 nbCCDPairs[i][j] = 0;
427 nbTriggerPairs[i][j] = 0;
428 }
429 }
430
431 for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
432 {
433 nbShapes[i] = 0;
434 }
435 }
436
437
438 //
439 // We advise to not access these members directly. Use the provided accessor methods instead.
440 //
441//broadphase:
442 PxU32 nbBroadPhaseAdds;
443 PxU32 nbBroadPhaseRemoves;
444
445//collisions:
450};
451
452#if !PX_DOXYGEN
453} // namespace physx
454#endif
455
457#endif
Class used to retrieve statistics for a simulation step.
Definition PxSimulationStatistics.h:50
PxU64 gpuMemHeapSoftBodies
GPU device heap memory used for shared buffers in the FEM-based soft body pipeline in bytes.
Definition PxSimulationStatistics.h:358
PxU32 requiredContactConstraintMemory
The total required size (in bytes) of the contact constraints in the current simulation step.
Definition PxSimulationStatistics.h:161
PxU64 gpuMemHeapSimulationFEMCloth
GPU device heap memory used for FEM-cloth in the simulation pipeline in bytes.
Definition PxSimulationStatistics.h:343
PxU32 nbDiscreteContactPairsWithCacheHits
Total number of (non CCD) pairs for which contacts are successfully cached (<=nbDiscreteContactPairsT...
Definition PxSimulationStatistics.h:243
PxU64 gpuMemSoftBodies
GPU device memory in bytes allocated for FEM-based soft body state accessible through API.
Definition PxSimulationStatistics.h:283
PxU32 getRbPairStats(RbPairStatsType pairType, PxGeometryType::Enum g0, PxGeometryType::Enum g1) const
Get number of shape collision pairs of a certain type processed for the current simulation step.
Definition PxSimulationStatistics.h:203
PxU32 peakConstraintMemory
The peak amount of memory (in bytes) that was allocated for constraints (this includes joints) in the...
Definition PxSimulationStatistics.h:166
PxU32 nbPartitions
Number of partitions used by the solver this frame.
Definition PxSimulationStatistics.h:273
PxU32 nbDynamicBodies
Number of dynamic bodies for the current simulation step.
Definition PxSimulationStatistics.h:122
PxU64 gpuMemHeapNarrowPhase
GPU device heap memory used for narrow phase in bytes.
Definition PxSimulationStatistics.h:308
PxU64 gpuMemHeap
GPU device memory in bytes allocated for internal heap allocation.
Definition PxSimulationStatistics.h:298
PxU64 gpuMemHeapSimulationHairSystem
GPU device heap memory used for hairsystem in the simulation pipeline in bytes.
Definition PxSimulationStatistics.h:348
PxU32 compressedContactSize
The size (in bytes) of the compressed contact stream in the current simulation step.
Definition PxSimulationStatistics.h:156
PxU32 nbNewPairs
Number of new pairs found by BP this frame.
Definition PxSimulationStatistics.h:253
RbPairStatsType
Different types of rigid body collision pair statistics.
Definition PxSimulationStatistics.h:58
@ eMODIFIED_CONTACT_PAIRS
Shape pairs processed with user contact modification enabled for the current simulation step.
Definition PxSimulationStatistics.h:79
@ eTRIGGER_PAIRS
Trigger shape pairs processed for the current simulation step.
Definition PxSimulationStatistics.h:86
@ eCCD_PAIRS
Shape pairs processed as swept integration pairs for the current simulation step.
Definition PxSimulationStatistics.h:72
@ eDISCRETE_CONTACT_PAIRS
Shape pairs processed as discrete contact pairs for the current simulation step.
Definition PxSimulationStatistics.h:62
PxU32 nbActiveKinematicBodies
Number of active kinematic bodies for the current simulation step.
Definition PxSimulationStatistics.h:109
PxU32 nbStaticBodies
Number of static bodies for the current simulation step.
Definition PxSimulationStatistics.h:114
PxU64 gpuMemHeapSimulationParticles
GPU device heap memory used for particles in the simulation pipeline in bytes.
Definition PxSimulationStatistics.h:333
PxU64 gpuMemHeapBroadPhase
GPU device heap memory used for broad phase in bytes.
Definition PxSimulationStatistics.h:303
PxU32 nbActiveConstraints
Number of active PxConstraint objects (joints etc.) for the current simulation step.
Definition PxSimulationStatistics.h:94
PxU64 gpuMemHeapHairSystems
GPU device heap memory used for shared buffers in the hairsystem pipeline in bytes.
Definition PxSimulationStatistics.h:368
PxU32 nbAxisSolverConstraints
The number of 1D axis constraints(joints+contact) present in the current simulation step.
Definition PxSimulationStatistics.h:151
PxU64 gpuMemHeapFEMCloths
GPU device heap memory used for shared buffers in the FEM-based cloth pipeline in bytes.
Definition PxSimulationStatistics.h:363
PxU32 nbLostTouches
Number of lost touches from NP this frame.
Definition PxSimulationStatistics.h:268
PX_FORCE_INLINE PxU32 getNbBroadPhaseRemoves() const
Get number of broadphase volumes removed for the current simulation step.
Definition PxSimulationStatistics.h:184
PxU64 gpuMemHeapSimulationArticulation
GPU device heap memory used for articulations in the simulation pipeline in bytes.
Definition PxSimulationStatistics.h:328
PxU32 nbActiveDynamicBodies
Number of active dynamic bodies for the current simulation step.
Definition PxSimulationStatistics.h:101
PxU32 nbLostPairs
Number of lost pairs from BP this frame.
Definition PxSimulationStatistics.h:258
PxU64 gpuMemHeapSimulation
GPU device heap memory used for simulation pipeline in bytes.
Definition PxSimulationStatistics.h:323
PxU32 nbArticulations
Number of articulations in the scene.
Definition PxSimulationStatistics.h:145
PxU32 nbShapes[PxGeometryType::eGEOMETRY_COUNT]
Number of shapes of each geometry type.
Definition PxSimulationStatistics.h:135
PxU64 gpuMemParticles
GPU device memory in bytes allocated for particle state accessible through API.
Definition PxSimulationStatistics.h:278
PxU64 gpuMemHeapSolver
GPU device heap memory used for solver in bytes.
Definition PxSimulationStatistics.h:313
PxU64 gpuMemHeapSimulationSoftBody
GPU device heap memory used for soft bodies in the simulation pipeline in bytes.
Definition PxSimulationStatistics.h:338
PxU32 nbDiscreteContactPairsTotal
Total number of (non CCD) pairs reaching narrow phase.
Definition PxSimulationStatistics.h:237
PxU64 gpuMemHeapParticles
GPU device heap memory used for shared buffers in the particles pipeline in bytes.
Definition PxSimulationStatistics.h:353
PxU32 nbNewTouches
Number of new touches found by NP this frame.
Definition PxSimulationStatistics.h:263
PxU64 gpuMemFEMCloths
GPU device memory in bytes allocated for FEM-based cloth state accessible through API.
Definition PxSimulationStatistics.h:288
PxU64 gpuMemHeapArticulation
GPU device heap memory used for articulations in bytes.
Definition PxSimulationStatistics.h:318
PxU64 gpuMemHeapOther
GPU device heap memory not covered by other stats in bytes.
Definition PxSimulationStatistics.h:373
PxU32 nbDiscreteContactPairsWithContacts
Total number of (non CCD) pairs for which at least 1 contact was generated (<=nbDiscreteContactPairsT...
Definition PxSimulationStatistics.h:248
PxU32 nbKinematicBodies
Number of kinematic bodies for the current simulation step.
Definition PxSimulationStatistics.h:129
PxU32 nbAggregates
Number of aggregates in the scene.
Definition PxSimulationStatistics.h:140
PX_FORCE_INLINE PxU32 getNbBroadPhaseAdds() const
Get number of broadphase volumes added for the current simulation step.
Definition PxSimulationStatistics.h:174
PxU64 gpuMemHairSystems
GPU device memory in bytes allocated for hairsystem state accessible through API.
Definition PxSimulationStatistics.h:293
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Enum
Definition PxGeometry.h:52
@ eGEOMETRY_COUNT
internal use only!
Definition PxGeometry.h:65