PxSimulationStatistics.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 
14 #ifndef PX_SIMULATION_STATISTICS
15 #define PX_SIMULATION_STATISTICS
16 
20 #include "PxPhysXConfig.h"
21 #include "geometry/PxGeometry.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
34 {
35 public:
41  {
47 
53 
59 
60  eVOLUME_COUNT
61  };
62 
68  {
73 
83 
90 
96  eTRIGGER_PAIRS
97  };
98 
99 
100 //objects:
105 
112 
120 
125 
132 
138 
139 //solver:
144 
149 
154 
159 
160 //broadphase:
169  PxU32 getNbBroadPhaseAdds(VolumeType type) const
170  {
171  if (type != eVOLUME_COUNT)
172  return nbBroadPhaseAdds[type];
173  else
174  {
175  PX_ASSERT(false);
176  return 0;
177  }
178  }
179 
188  PxU32 getNbBroadPhaseRemoves(VolumeType type) const
189  {
190  if (type != eVOLUME_COUNT)
191  return nbBroadPhaseRemoves[type];
192  else
193  {
194  PX_ASSERT(false);
195  return 0;
196  }
197  }
198 
199 //collisions:
213  PxU32 getRbPairStats(RbPairStatsType pairType, PxGeometryType::Enum g0, PxGeometryType::Enum g1) const
214  {
216  {
217  PX_ASSERT(false);
218  return 0;
219  }
220 
221  switch(pairType)
222  {
223  case eDISCRETE_CONTACT_PAIRS:
224  return nbDiscreteContactPairs[g0][g1];
225 
226  case eCCD_PAIRS:
227  return nbCCDPairs[g0][g1];
228 
229  case eMODIFIED_CONTACT_PAIRS:
230  return nbModifiedContactPairs[g0][g1];
231 
232  case eTRIGGER_PAIRS:
233  return nbTriggerPairs[g0][g1];
234 
235  default:
236  PX_ASSERT(false);
237  return 0;
238  }
239  }
240 
242  {
243  for(PxU32 i=0; i < eVOLUME_COUNT; i++)
244  {
245  nbBroadPhaseAdds[i] = 0;
246  nbBroadPhaseRemoves[i] = 0;
247  }
248 
249  for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
250  {
251  for(PxU32 j=0; j < PxGeometryType::eGEOMETRY_COUNT; j++)
252  {
253  nbDiscreteContactPairs[i][j] = 0;
254  nbModifiedContactPairs[i][j] = 0;
255  nbCCDPairs[i][j] = 0;
256  nbTriggerPairs[i][j] = 0;
257  }
258  }
259 
260  for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
261  {
262  nbShapes[i] = 0;
263  }
264 
265  totalDiscreteContactPairsAnyShape = 0;
266 
267  nbActiveConstraints = 0;
268  nbActiveDynamicBodies = 0;
269  nbActiveKinematicBodies = 0;
270  nbStaticBodies = 0;
271  nbDynamicBodies = 0;
272  compressedContactSize = 0;
273  requiredContactConstraintMemory = 0;
274  peakConstraintMemory = 0;
275 
276  nbAxisSolverConstraints = 0;
277 
278  particlesGpuMeshCacheSize = 0;
279  particlesGpuMeshCacheUsed = 0;
280  particlesGpuMeshCacheHitrate = 0.0f;
281  }
282 
283 
284  //
285  // We advise to not access these members directly. Use the provided accessor methods instead.
286  //
287 //broadphase:
288  PxU32 nbBroadPhaseAdds[eVOLUME_COUNT];
289  PxU32 nbBroadPhaseRemoves[eVOLUME_COUNT];
290 
291 //collisions:
297 
298 //triangle mesh cache statistics
302 };
303 
304 #ifndef PX_DOXYGEN
305 } // namespace physx
306 #endif
307 
309 #endif


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com