PhysX SDK 3.2 API Reference: PxSimulationStatistics.h Source File

PhysX SDK 3.2 API

PxSimulationStatistics.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you 
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and 
00007 // any modifications thereto. Any use, reproduction, disclosure, or 
00008 // distribution of this software and related documentation without an express 
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 // 
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_SIMULATION_STATISTICS
00032 #define PX_SIMULATION_STATISTICS
00033 
00037 #include "PxPhysX.h"
00038 #include "geometry/PxGeometry.h"
00039 
00040 #ifndef PX_DOXYGEN
00041 namespace physx
00042 {
00043 #endif
00044 
00056 class PxSimulationStatistics
00057 {
00058 public:
00063     enum VolumeType
00064     {
00069         eRIGID_BODY,
00070 
00075         ePARTICLE_SYSTEM,
00076 
00077         eVOLUME_COUNT
00078     };
00079 
00084     enum RbPairStatsType
00085     {
00089         eDISCRETE_CONTACT_PAIRS,
00090 
00099         eSWEPT_INTEGRATION_PAIRS,
00100 
00106         eMODIFIED_CONTACT_PAIRS,
00107 
00113         eTRIGGER_PAIRS
00114     };
00115 
00116 
00117 //objects:
00121     PxU32   numActiveConstraints;
00122 
00128     PxU32   numActiveDynamicBodies;
00129 
00133     PxU32   numActiveKinematicBodies;
00134 
00138     PxU32   numStaticBodies;
00139 
00145     PxU32   numDynamicBodies;
00146 
00151     PxU32   numShapes[PxGeometryType::eGEOMETRY_COUNT];
00152 
00153 //solver:
00157     PxU32   numAxisSolverConstraints;
00158 
00159 //broadphase:
00168     PxU32 getNumBroadPhaseAdds(VolumeType type) const
00169     {
00170         if (type != eVOLUME_COUNT)
00171             return numBroadPhaseAdds[type];
00172         else
00173         {
00174             PX_ASSERT(false);
00175             return 0;
00176         }
00177     }
00178 
00187     PxU32 getNumBroadPhaseRemoves(VolumeType type) const
00188     {
00189         if (type != eVOLUME_COUNT)
00190             return numBroadPhaseRemoves[type];
00191         else
00192         {
00193             PX_ASSERT(false);
00194             return 0;
00195         }
00196     }
00197 
00198 //collisions:
00212     PxU32 getRbPairStats(RbPairStatsType pairType, PxGeometryType::Enum g0, PxGeometryType::Enum g1) const
00213     {
00214         if (g0 >= PxGeometryType::eGEOMETRY_COUNT || g1 >= PxGeometryType::eGEOMETRY_COUNT)
00215         {
00216             PX_ASSERT(false);
00217             return 0;
00218         }
00219 
00220         switch(pairType)
00221         {
00222             case eDISCRETE_CONTACT_PAIRS:
00223                 return numDiscreteContactPairs[g0][g1];
00224 
00225             case eSWEPT_INTEGRATION_PAIRS:
00226                 return numSweptIntegrationPairs[g0][g1];
00227 
00228             case eMODIFIED_CONTACT_PAIRS:
00229                 return numModifiedContactPairs[g0][g1];
00230 
00231             case eTRIGGER_PAIRS:
00232                 return numTriggerPairs[g0][g1];
00233 
00234             default:
00235                 PX_ASSERT(false);
00236                 return 0;
00237         }
00238     }
00239 
00240     PxSimulationStatistics()
00241     {
00242         for(PxU32 i=0; i < eVOLUME_COUNT; i++)
00243         {
00244             numBroadPhaseAdds[i] = 0;
00245             numBroadPhaseRemoves[i] = 0;
00246         }
00247 
00248         for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
00249         {
00250             for(PxU32 j=0; j < PxGeometryType::eGEOMETRY_COUNT; j++)
00251             {
00252                 numDiscreteContactPairs[i][j] = 0;
00253                 numModifiedContactPairs[i][j] = 0;
00254                 numSweptIntegrationPairs[i][j] = 0;
00255                 numTriggerPairs[i][j] = 0;
00256             }
00257         }
00258 
00259         for(PxU32 i=0; i < PxGeometryType::eGEOMETRY_COUNT; i++)
00260         {
00261             numShapes[i] = 0;
00262         }
00263 
00264         numActiveConstraints = 0;
00265         numActiveDynamicBodies = 0;
00266         numActiveKinematicBodies = 0;
00267         numStaticBodies = 0;
00268         numDynamicBodies = 0;
00269 
00270         numAxisSolverConstraints = 0;
00271     }
00272 
00273 
00274     //
00275     // We advise to not access these members directly. Use the provided accessor methods instead.
00276     //
00277 //broadphase:
00278     PxU32   numBroadPhaseAdds[eVOLUME_COUNT];
00279     PxU32   numBroadPhaseRemoves[eVOLUME_COUNT];
00280 
00281 //collisions:
00282     PxU32   numDiscreteContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
00283     PxU32   numSweptIntegrationPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
00284     PxU32   numModifiedContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
00285     PxU32   numTriggerPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
00286 };
00287 
00288 #ifndef PX_DOXYGEN
00289 } // namespace physx
00290 #endif
00291 
00293 #endif


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