file_path
stringlengths
21
224
content
stringlengths
0
80.8M
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PxAutoGeneratedMetaDataObjectNames.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. // This code is auto-generated by the PhysX Clang metadata generator. Do not edit or be // prepared for your edits to be quietly ignored next time the clang metadata generator is // run. You can find the most recent version of clang metadata generator by contacting // Chris Nuernberger <[email protected]> or Dilip or Adam. // The source code for the generate was at one time checked into: // physx/PhysXMetaDataGenerator/llvm/tools/clang/lib/Frontend/PhysXMetaDataAction.cpp #define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON PxPhysics_PropertiesStart, PxPhysics_TolerancesScale, PxPhysics_TriangleMeshes, PxPhysics_TetrahedronMeshes, PxPhysics_HeightFields, PxPhysics_ConvexMeshes, PxPhysics_BVHs, PxPhysics_Scenes, PxPhysics_Shapes, PxPhysics_Materials, PxPhysics_FEMSoftBodyMaterials, PxPhysics_FEMClothMaterials, PxPhysics_PBDMaterials, PxPhysics_PropertiesStop, PxRefCounted_PropertiesStart, PxRefCounted_ReferenceCount, PxRefCounted_PropertiesStop, PxBaseMaterial_PropertiesStart, PxBaseMaterial_UserData, PxBaseMaterial_PropertiesStop, PxMaterial_PropertiesStart, PxMaterial_DynamicFriction, PxMaterial_StaticFriction, PxMaterial_Restitution, PxMaterial_Damping, PxMaterial_Flags, PxMaterial_FrictionCombineMode, PxMaterial_RestitutionCombineMode, PxMaterial_ConcreteTypeName, PxMaterial_PropertiesStop, PxFEMMaterial_PropertiesStart, PxFEMMaterial_YoungsModulus, PxFEMMaterial_Poissons, PxFEMMaterial_DynamicFriction, PxFEMMaterial_PropertiesStop, PxFEMSoftBodyMaterial_PropertiesStart, PxFEMSoftBodyMaterial_Damping, PxFEMSoftBodyMaterial_DampingScale, PxFEMSoftBodyMaterial_MaterialModel, PxFEMSoftBodyMaterial_ConcreteTypeName, PxFEMSoftBodyMaterial_PropertiesStop, PxParticleMaterial_PropertiesStart, PxParticleMaterial_Friction, PxParticleMaterial_Damping, PxParticleMaterial_Adhesion, PxParticleMaterial_GravityScale, PxParticleMaterial_AdhesionRadiusScale, PxParticleMaterial_PropertiesStop, PxPBDMaterial_PropertiesStart, PxPBDMaterial_Viscosity, PxPBDMaterial_VorticityConfinement, PxPBDMaterial_SurfaceTension, PxPBDMaterial_Cohesion, PxPBDMaterial_Lift, PxPBDMaterial_Drag, PxPBDMaterial_CFLCoefficient, PxPBDMaterial_ParticleFrictionScale, PxPBDMaterial_ParticleAdhesionScale, PxPBDMaterial_ConcreteTypeName, PxPBDMaterial_PropertiesStop, PxActor_PropertiesStart, PxActor_Scene, PxActor_Name, PxActor_ActorFlags, PxActor_DominanceGroup, PxActor_OwnerClient, PxActor_Aggregate, PxActor_UserData, PxActor_PropertiesStop, PxRigidActor_PropertiesStart, PxRigidActor_GlobalPose, PxRigidActor_Shapes, PxRigidActor_Constraints, PxRigidActor_PropertiesStop, PxRigidBody_PropertiesStart, PxRigidBody_CMassLocalPose, PxRigidBody_Mass, PxRigidBody_InvMass, PxRigidBody_MassSpaceInertiaTensor, PxRigidBody_MassSpaceInvInertiaTensor, PxRigidBody_LinearDamping, PxRigidBody_AngularDamping, PxRigidBody_MaxLinearVelocity, PxRigidBody_MaxAngularVelocity, PxRigidBody_RigidBodyFlags, PxRigidBody_MinCCDAdvanceCoefficient, PxRigidBody_MaxDepenetrationVelocity, PxRigidBody_MaxContactImpulse, PxRigidBody_ContactSlopCoefficient, PxRigidBody_PropertiesStop, PxRigidDynamic_PropertiesStart, PxRigidDynamic_IsSleeping, PxRigidDynamic_SleepThreshold, PxRigidDynamic_StabilizationThreshold, PxRigidDynamic_RigidDynamicLockFlags, PxRigidDynamic_LinearVelocity, PxRigidDynamic_AngularVelocity, PxRigidDynamic_WakeCounter, PxRigidDynamic_SolverIterationCounts, PxRigidDynamic_ContactReportThreshold, PxRigidDynamic_ConcreteTypeName, PxRigidDynamic_PropertiesStop, PxRigidStatic_PropertiesStart, PxRigidStatic_ConcreteTypeName, PxRigidStatic_PropertiesStop, PxArticulationLink_PropertiesStart, PxArticulationLink_InboundJoint, PxArticulationLink_InboundJointDof, PxArticulationLink_LinkIndex, PxArticulationLink_Children, PxArticulationLink_CfmScale, PxArticulationLink_LinearVelocity, PxArticulationLink_AngularVelocity, PxArticulationLink_ConcreteTypeName, PxArticulationLink_PropertiesStop, PxArticulationJointReducedCoordinate_PropertiesStart, PxArticulationJointReducedCoordinate_ParentPose, PxArticulationJointReducedCoordinate_ChildPose, PxArticulationJointReducedCoordinate_JointType, PxArticulationJointReducedCoordinate_Motion, PxArticulationJointReducedCoordinate_LimitParams, PxArticulationJointReducedCoordinate_DriveParams, PxArticulationJointReducedCoordinate_Armature, PxArticulationJointReducedCoordinate_FrictionCoefficient, PxArticulationJointReducedCoordinate_MaxJointVelocity, PxArticulationJointReducedCoordinate_JointPosition, PxArticulationJointReducedCoordinate_JointVelocity, PxArticulationJointReducedCoordinate_ConcreteTypeName, PxArticulationJointReducedCoordinate_UserData, PxArticulationJointReducedCoordinate_PropertiesStop, PxArticulationReducedCoordinate_PropertiesStart, PxArticulationReducedCoordinate_Scene, PxArticulationReducedCoordinate_SolverIterationCounts, PxArticulationReducedCoordinate_IsSleeping, PxArticulationReducedCoordinate_SleepThreshold, PxArticulationReducedCoordinate_StabilizationThreshold, PxArticulationReducedCoordinate_WakeCounter, PxArticulationReducedCoordinate_MaxCOMLinearVelocity, PxArticulationReducedCoordinate_MaxCOMAngularVelocity, PxArticulationReducedCoordinate_Links, PxArticulationReducedCoordinate_Name, PxArticulationReducedCoordinate_Aggregate, PxArticulationReducedCoordinate_ArticulationFlags, PxArticulationReducedCoordinate_RootGlobalPose, PxArticulationReducedCoordinate_RootLinearVelocity, PxArticulationReducedCoordinate_RootAngularVelocity, PxArticulationReducedCoordinate_UserData, PxArticulationReducedCoordinate_PropertiesStop, PxAggregate_PropertiesStart, PxAggregate_MaxNbActors, PxAggregate_MaxNbShapes, PxAggregate_Actors, PxAggregate_SelfCollision, PxAggregate_ConcreteTypeName, PxAggregate_UserData, PxAggregate_PropertiesStop, PxConstraint_PropertiesStart, PxConstraint_Scene, PxConstraint_Actors, PxConstraint_Flags, PxConstraint_IsValid, PxConstraint_BreakForce, PxConstraint_MinResponseThreshold, PxConstraint_ConcreteTypeName, PxConstraint_UserData, PxConstraint_PropertiesStop, PxShape_PropertiesStart, PxShape_LocalPose, PxShape_SimulationFilterData, PxShape_QueryFilterData, PxShape_Materials, PxShape_ContactOffset, PxShape_RestOffset, PxShape_DensityForFluid, PxShape_TorsionalPatchRadius, PxShape_MinTorsionalPatchRadius, PxShape_InternalShapeIndex, PxShape_Flags, PxShape_IsExclusive, PxShape_Name, PxShape_ConcreteTypeName, PxShape_UserData, PxShape_Geom, PxShape_PropertiesStop, PxPruningStructure_PropertiesStart, PxPruningStructure_RigidActors, PxPruningStructure_StaticMergeData, PxPruningStructure_DynamicMergeData, PxPruningStructure_ConcreteTypeName, PxPruningStructure_PropertiesStop, PxTolerancesScale_PropertiesStart, PxTolerancesScale_IsValid, PxTolerancesScale_Length, PxTolerancesScale_Speed, PxTolerancesScale_PropertiesStop, PxGeometry_PropertiesStart, PxGeometry_PropertiesStop, PxBoxGeometry_PropertiesStart, PxBoxGeometry_HalfExtents, PxBoxGeometry_PropertiesStop, PxCapsuleGeometry_PropertiesStart, PxCapsuleGeometry_Radius, PxCapsuleGeometry_HalfHeight, PxCapsuleGeometry_PropertiesStop, PxMeshScale_PropertiesStart, PxMeshScale_Scale, PxMeshScale_Rotation, PxMeshScale_PropertiesStop, PxConvexMeshGeometry_PropertiesStart, PxConvexMeshGeometry_Scale, PxConvexMeshGeometry_ConvexMesh, PxConvexMeshGeometry_MeshFlags, PxConvexMeshGeometry_PropertiesStop, PxSphereGeometry_PropertiesStart, PxSphereGeometry_Radius, PxSphereGeometry_PropertiesStop, PxPlaneGeometry_PropertiesStart, PxPlaneGeometry_PropertiesStop, PxTriangleMeshGeometry_PropertiesStart, PxTriangleMeshGeometry_Scale, PxTriangleMeshGeometry_MeshFlags, PxTriangleMeshGeometry_TriangleMesh, PxTriangleMeshGeometry_PropertiesStop, PxHeightFieldGeometry_PropertiesStart, PxHeightFieldGeometry_HeightField, PxHeightFieldGeometry_HeightScale, PxHeightFieldGeometry_RowScale, PxHeightFieldGeometry_ColumnScale, PxHeightFieldGeometry_HeightFieldFlags, PxHeightFieldGeometry_PropertiesStop, PxSceneQuerySystemBase_PropertiesStart, PxSceneQuerySystemBase_DynamicTreeRebuildRateHint, PxSceneQuerySystemBase_UpdateMode, PxSceneQuerySystemBase_StaticTimestamp, PxSceneQuerySystemBase_PropertiesStop, PxSceneSQSystem_PropertiesStart, PxSceneSQSystem_SceneQueryUpdateMode, PxSceneSQSystem_SceneQueryStaticTimestamp, PxSceneSQSystem_StaticStructure, PxSceneSQSystem_DynamicStructure, PxSceneSQSystem_PropertiesStop, PxScene_PropertiesStart, PxScene_Flags, PxScene_Limits, PxScene_Timestamp, PxScene_Name, PxScene_Actors, PxScene_SoftBodies, PxScene_Articulations, PxScene_Constraints, PxScene_Aggregates, PxScene_CpuDispatcher, PxScene_CudaContextManager, PxScene_SimulationEventCallback, PxScene_ContactModifyCallback, PxScene_CCDContactModifyCallback, PxScene_BroadPhaseCallback, PxScene_FilterShaderDataSize, PxScene_FilterShader, PxScene_FilterCallback, PxScene_KinematicKinematicFilteringMode, PxScene_StaticKinematicFilteringMode, PxScene_Gravity, PxScene_BounceThresholdVelocity, PxScene_CCDMaxPasses, PxScene_CCDMaxSeparation, PxScene_CCDThreshold, PxScene_MaxBiasCoefficient, PxScene_FrictionOffsetThreshold, PxScene_FrictionCorrelationDistance, PxScene_FrictionType, PxScene_SolverType, PxScene_VisualizationCullingBox, PxScene_BroadPhaseType, PxScene_BroadPhaseRegions, PxScene_TaskManager, PxScene_NbContactDataBlocks, PxScene_MaxNbContactDataBlocksUsed, PxScene_ContactReportStreamBufferSize, PxScene_SolverBatchSize, PxScene_SolverArticulationBatchSize, PxScene_WakeCounterResetValue, PxScene_GpuDynamicsConfig, PxScene_UserData, PxScene_SimulationStatistics, PxScene_PropertiesStop, PxTetrahedronMeshGeometry_PropertiesStart, PxTetrahedronMeshGeometry_TetrahedronMesh, PxTetrahedronMeshGeometry_PropertiesStop, PxCustomGeometry_PropertiesStart, PxCustomGeometry_CustomType, PxCustomGeometry_PropertiesStop, PxHeightFieldDesc_PropertiesStart, PxHeightFieldDesc_NbRows, PxHeightFieldDesc_NbColumns, PxHeightFieldDesc_Format, PxHeightFieldDesc_Samples, PxHeightFieldDesc_ConvexEdgeThreshold, PxHeightFieldDesc_Flags, PxHeightFieldDesc_PropertiesStop, PxArticulationLimit_PropertiesStart, PxArticulationLimit_Low, PxArticulationLimit_High, PxArticulationLimit_PropertiesStop, PxArticulationDrive_PropertiesStart, PxArticulationDrive_Stiffness, PxArticulationDrive_Damping, PxArticulationDrive_MaxForce, PxArticulationDrive_DriveType, PxArticulationDrive_PropertiesStop, PxSceneQueryDesc_PropertiesStart, PxSceneQueryDesc_IsValid, PxSceneQueryDesc_StaticStructure, PxSceneQueryDesc_DynamicStructure, PxSceneQueryDesc_DynamicTreeRebuildRateHint, PxSceneQueryDesc_DynamicTreeSecondaryPruner, PxSceneQueryDesc_StaticBVHBuildStrategy, PxSceneQueryDesc_DynamicBVHBuildStrategy, PxSceneQueryDesc_StaticNbObjectsPerNode, PxSceneQueryDesc_DynamicNbObjectsPerNode, PxSceneQueryDesc_SceneQueryUpdateMode, PxSceneQueryDesc_PropertiesStop, PxSceneDesc_PropertiesStart, PxSceneDesc_ToDefault, PxSceneDesc_Gravity, PxSceneDesc_SimulationEventCallback, PxSceneDesc_ContactModifyCallback, PxSceneDesc_CcdContactModifyCallback, PxSceneDesc_FilterShaderData, PxSceneDesc_FilterShaderDataSize, PxSceneDesc_FilterShader, PxSceneDesc_FilterCallback, PxSceneDesc_KineKineFilteringMode, PxSceneDesc_StaticKineFilteringMode, PxSceneDesc_BroadPhaseType, PxSceneDesc_BroadPhaseCallback, PxSceneDesc_Limits, PxSceneDesc_FrictionType, PxSceneDesc_SolverType, PxSceneDesc_BounceThresholdVelocity, PxSceneDesc_FrictionOffsetThreshold, PxSceneDesc_FrictionCorrelationDistance, PxSceneDesc_Flags, PxSceneDesc_CpuDispatcher, PxSceneDesc_CudaContextManager, PxSceneDesc_UserData, PxSceneDesc_SolverBatchSize, PxSceneDesc_SolverArticulationBatchSize, PxSceneDesc_NbContactDataBlocks, PxSceneDesc_MaxNbContactDataBlocks, PxSceneDesc_MaxBiasCoefficient, PxSceneDesc_ContactReportStreamBufferSize, PxSceneDesc_CcdMaxPasses, PxSceneDesc_CcdThreshold, PxSceneDesc_CcdMaxSeparation, PxSceneDesc_WakeCounterResetValue, PxSceneDesc_SanityBounds, PxSceneDesc_GpuDynamicsConfig, PxSceneDesc_GpuMaxNumPartitions, PxSceneDesc_GpuMaxNumStaticPartitions, PxSceneDesc_GpuComputeVersion, PxSceneDesc_ContactPairSlabSize, PxSceneDesc_PropertiesStop, PxBroadPhaseDesc_PropertiesStart, PxBroadPhaseDesc_IsValid, PxBroadPhaseDesc_MType, PxBroadPhaseDesc_MContextID, PxBroadPhaseDesc_MContextManager, PxBroadPhaseDesc_MFoundLostPairsCapacity, PxBroadPhaseDesc_MDiscardStaticVsKinematic, PxBroadPhaseDesc_MDiscardKinematicVsKinematic, PxBroadPhaseDesc_PropertiesStop, PxSceneLimits_PropertiesStart, PxSceneLimits_MaxNbActors, PxSceneLimits_MaxNbBodies, PxSceneLimits_MaxNbStaticShapes, PxSceneLimits_MaxNbDynamicShapes, PxSceneLimits_MaxNbAggregates, PxSceneLimits_MaxNbConstraints, PxSceneLimits_MaxNbRegions, PxSceneLimits_MaxNbBroadPhaseOverlaps, PxSceneLimits_PropertiesStop, PxgDynamicsMemoryConfig_PropertiesStart, PxgDynamicsMemoryConfig_IsValid, PxgDynamicsMemoryConfig_TempBufferCapacity, PxgDynamicsMemoryConfig_MaxRigidContactCount, PxgDynamicsMemoryConfig_MaxRigidPatchCount, PxgDynamicsMemoryConfig_HeapCapacity, PxgDynamicsMemoryConfig_FoundLostPairsCapacity, PxgDynamicsMemoryConfig_FoundLostAggregatePairsCapacity, PxgDynamicsMemoryConfig_TotalAggregatePairsCapacity, PxgDynamicsMemoryConfig_MaxSoftBodyContacts, PxgDynamicsMemoryConfig_MaxFemClothContacts, PxgDynamicsMemoryConfig_MaxParticleContacts, PxgDynamicsMemoryConfig_CollisionStackSize, PxgDynamicsMemoryConfig_MaxHairContacts, PxgDynamicsMemoryConfig_PropertiesStop, PxSimulationStatistics_PropertiesStart, PxSimulationStatistics_NbActiveConstraints, PxSimulationStatistics_NbActiveDynamicBodies, PxSimulationStatistics_NbActiveKinematicBodies, PxSimulationStatistics_NbStaticBodies, PxSimulationStatistics_NbDynamicBodies, PxSimulationStatistics_NbKinematicBodies, PxSimulationStatistics_NbAggregates, PxSimulationStatistics_NbArticulations, PxSimulationStatistics_NbAxisSolverConstraints, PxSimulationStatistics_CompressedContactSize, PxSimulationStatistics_RequiredContactConstraintMemory, PxSimulationStatistics_PeakConstraintMemory, PxSimulationStatistics_NbDiscreteContactPairsTotal, PxSimulationStatistics_NbDiscreteContactPairsWithCacheHits, PxSimulationStatistics_NbDiscreteContactPairsWithContacts, PxSimulationStatistics_NbNewPairs, PxSimulationStatistics_NbLostPairs, PxSimulationStatistics_NbNewTouches, PxSimulationStatistics_NbLostTouches, PxSimulationStatistics_NbPartitions, PxSimulationStatistics_GpuMemParticles, PxSimulationStatistics_GpuMemSoftBodies, PxSimulationStatistics_GpuMemFEMCloths, PxSimulationStatistics_GpuMemHairSystems, PxSimulationStatistics_GpuMemHeap, PxSimulationStatistics_GpuMemHeapBroadPhase, PxSimulationStatistics_GpuMemHeapNarrowPhase, PxSimulationStatistics_GpuMemHeapSolver, PxSimulationStatistics_GpuMemHeapArticulation, PxSimulationStatistics_GpuMemHeapSimulation, PxSimulationStatistics_GpuMemHeapSimulationArticulation, PxSimulationStatistics_GpuMemHeapSimulationParticles, PxSimulationStatistics_GpuMemHeapSimulationSoftBody, PxSimulationStatistics_GpuMemHeapSimulationFEMCloth, PxSimulationStatistics_GpuMemHeapSimulationHairSystem, PxSimulationStatistics_GpuMemHeapParticles, PxSimulationStatistics_GpuMemHeapSoftBodies, PxSimulationStatistics_GpuMemHeapFEMCloths, PxSimulationStatistics_GpuMemHeapHairSystems, PxSimulationStatistics_GpuMemHeapOther, PxSimulationStatistics_NbBroadPhaseAdds, PxSimulationStatistics_NbBroadPhaseRemoves, PxSimulationStatistics_NbDiscreteContactPairs, PxSimulationStatistics_NbModifiedContactPairs, PxSimulationStatistics_NbCCDPairs, PxSimulationStatistics_NbTriggerPairs, PxSimulationStatistics_NbShapes, PxSimulationStatistics_PropertiesStop, #undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PxAutoGeneratedMetaDataObjects.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. // This code is auto-generated by the PhysX Clang metadata generator. Do not edit or be // prepared for your edits to be quietly ignored next time the clang metadata generator is // run. You can find the most recent version of clang metadata generator by contacting // Chris Nuernberger <[email protected]> or Dilip or Adam. // The source code for the generate was at one time checked into: // physx/PhysXMetaDataGenerator/llvm/tools/clang/lib/Frontend/PhysXMetaDataAction.cpp #define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON #define PX_PROPERTY_INFO_NAME PxPropertyInfoName static PxU32ToName g_physx__PxShapeFlag__EnumConversion[] = { { "eSIMULATION_SHAPE", static_cast<PxU32>( physx::PxShapeFlag::eSIMULATION_SHAPE ) }, { "eSCENE_QUERY_SHAPE", static_cast<PxU32>( physx::PxShapeFlag::eSCENE_QUERY_SHAPE ) }, { "eTRIGGER_SHAPE", static_cast<PxU32>( physx::PxShapeFlag::eTRIGGER_SHAPE ) }, { "eVISUALIZATION", static_cast<PxU32>( physx::PxShapeFlag::eVISUALIZATION ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxShapeFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxShapeFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxPhysics; struct PxPhysicsGeneratedValues { PxTolerancesScale TolerancesScale; PX_PHYSX_CORE_API PxPhysicsGeneratedValues( const PxPhysics* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPhysics, TolerancesScale, PxPhysicsGeneratedValues) struct PxPhysicsGeneratedInfo { static const char* getClassName() { return "PxPhysics"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_TolerancesScale, PxPhysics, const PxTolerancesScale > TolerancesScale; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_TriangleMeshes, PxPhysics, PxTriangleMesh *, PxInputStream & > TriangleMeshes; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_TetrahedronMeshes, PxPhysics, PxTetrahedronMesh *, PxInputStream & > TetrahedronMeshes; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_HeightFields, PxPhysics, PxHeightField *, PxInputStream & > HeightFields; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_ConvexMeshes, PxPhysics, PxConvexMesh *, PxInputStream & > ConvexMeshes; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_BVHs, PxPhysics, PxBVH *, PxInputStream & > BVHs; PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Scenes, PxPhysics, PxScene *, const PxSceneDesc & > Scenes; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Shapes, PxPhysics, PxShape * > Shapes; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Materials, PxPhysics, PxMaterial * > Materials; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_FEMSoftBodyMaterials, PxPhysics, PxFEMSoftBodyMaterial * > FEMSoftBodyMaterials; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_FEMClothMaterials, PxPhysics, PxFEMClothMaterial * > FEMClothMaterials; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_PBDMaterials, PxPhysics, PxPBDMaterial * > PBDMaterials; PX_PHYSX_CORE_API PxPhysicsGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxPhysics*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 12; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( TolerancesScale, inStartIndex + 0 );; inOperator( TriangleMeshes, inStartIndex + 1 );; inOperator( TetrahedronMeshes, inStartIndex + 2 );; inOperator( HeightFields, inStartIndex + 3 );; inOperator( ConvexMeshes, inStartIndex + 4 );; inOperator( BVHs, inStartIndex + 5 );; inOperator( Scenes, inStartIndex + 6 );; inOperator( Shapes, inStartIndex + 7 );; inOperator( Materials, inStartIndex + 8 );; inOperator( FEMSoftBodyMaterials, inStartIndex + 9 );; inOperator( FEMClothMaterials, inStartIndex + 10 );; inOperator( PBDMaterials, inStartIndex + 11 );; return 12 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxPhysics> { PxPhysicsGeneratedInfo Info; const PxPhysicsGeneratedInfo* getInfo() { return &Info; } }; class PxRefCounted; struct PxRefCountedGeneratedValues { PxU32 ReferenceCount; PX_PHYSX_CORE_API PxRefCountedGeneratedValues( const PxRefCounted* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRefCounted, ReferenceCount, PxRefCountedGeneratedValues) struct PxRefCountedGeneratedInfo { static const char* getClassName() { return "PxRefCounted"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRefCounted_ReferenceCount, PxRefCounted, PxU32 > ReferenceCount; PX_PHYSX_CORE_API PxRefCountedGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxRefCounted*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( ReferenceCount, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxRefCounted> { PxRefCountedGeneratedInfo Info; const PxRefCountedGeneratedInfo* getInfo() { return &Info; } }; class PxBaseMaterial; struct PxBaseMaterialGeneratedValues : PxRefCountedGeneratedValues { void * UserData; PX_PHYSX_CORE_API PxBaseMaterialGeneratedValues( const PxBaseMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBaseMaterial, UserData, PxBaseMaterialGeneratedValues) struct PxBaseMaterialGeneratedInfo : PxRefCountedGeneratedInfo { static const char* getClassName() { return "PxBaseMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBaseMaterial_UserData, PxBaseMaterial, void *, void * > UserData; PX_PHYSX_CORE_API PxBaseMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxBaseMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRefCountedGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRefCountedGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRefCountedGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRefCountedGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( UserData, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxBaseMaterial> { PxBaseMaterialGeneratedInfo Info; const PxBaseMaterialGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxMaterialFlag__EnumConversion[] = { { "eDISABLE_FRICTION", static_cast<PxU32>( physx::PxMaterialFlag::eDISABLE_FRICTION ) }, { "eDISABLE_STRONG_FRICTION", static_cast<PxU32>( physx::PxMaterialFlag::eDISABLE_STRONG_FRICTION ) }, { "eIMPROVED_PATCH_FRICTION", static_cast<PxU32>( physx::PxMaterialFlag::eIMPROVED_PATCH_FRICTION ) }, { "eCOMPLIANT_CONTACT", static_cast<PxU32>( physx::PxMaterialFlag::eCOMPLIANT_CONTACT ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxMaterialFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxMaterialFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxCombineMode__EnumConversion[] = { { "eAVERAGE", static_cast<PxU32>( physx::PxCombineMode::eAVERAGE ) }, { "eMIN", static_cast<PxU32>( physx::PxCombineMode::eMIN ) }, { "eMULTIPLY", static_cast<PxU32>( physx::PxCombineMode::eMULTIPLY ) }, { "eMAX", static_cast<PxU32>( physx::PxCombineMode::eMAX ) }, { "eN_VALUES", static_cast<PxU32>( physx::PxCombineMode::eN_VALUES ) }, { "ePAD_32", static_cast<PxU32>( physx::PxCombineMode::ePAD_32 ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxCombineMode::Enum > { PxEnumTraits() : NameConversion( g_physx__PxCombineMode__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxMaterial; struct PxMaterialGeneratedValues : PxBaseMaterialGeneratedValues { PxReal DynamicFriction; PxReal StaticFriction; PxReal Restitution; PxReal Damping; PxMaterialFlags Flags; PxCombineMode::Enum FrictionCombineMode; PxCombineMode::Enum RestitutionCombineMode; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxMaterialGeneratedValues( const PxMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, DynamicFriction, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, StaticFriction, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, Restitution, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, Damping, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, Flags, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, FrictionCombineMode, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, RestitutionCombineMode, PxMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMaterial, ConcreteTypeName, PxMaterialGeneratedValues) struct PxMaterialGeneratedInfo : PxBaseMaterialGeneratedInfo { static const char* getClassName() { return "PxMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_DynamicFriction, PxMaterial, PxReal, PxReal > DynamicFriction; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_StaticFriction, PxMaterial, PxReal, PxReal > StaticFriction; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_Restitution, PxMaterial, PxReal, PxReal > Restitution; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_Damping, PxMaterial, PxReal, PxReal > Damping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_Flags, PxMaterial, PxMaterialFlags, PxMaterialFlags > Flags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_FrictionCombineMode, PxMaterial, PxCombineMode::Enum, PxCombineMode::Enum > FrictionCombineMode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_RestitutionCombineMode, PxMaterial, PxCombineMode::Enum, PxCombineMode::Enum > RestitutionCombineMode; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_ConcreteTypeName, PxMaterial, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxBaseMaterialGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxBaseMaterialGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxBaseMaterialGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 8; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxBaseMaterialGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( DynamicFriction, inStartIndex + 0 );; inOperator( StaticFriction, inStartIndex + 1 );; inOperator( Restitution, inStartIndex + 2 );; inOperator( Damping, inStartIndex + 3 );; inOperator( Flags, inStartIndex + 4 );; inOperator( FrictionCombineMode, inStartIndex + 5 );; inOperator( RestitutionCombineMode, inStartIndex + 6 );; inOperator( ConcreteTypeName, inStartIndex + 7 );; return 8 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxMaterial> { PxMaterialGeneratedInfo Info; const PxMaterialGeneratedInfo* getInfo() { return &Info; } }; class PxFEMMaterial; struct PxFEMMaterialGeneratedValues : PxBaseMaterialGeneratedValues { PxReal YoungsModulus; PxReal Poissons; PxReal DynamicFriction; PX_PHYSX_CORE_API PxFEMMaterialGeneratedValues( const PxFEMMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMMaterial, YoungsModulus, PxFEMMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMMaterial, Poissons, PxFEMMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMMaterial, DynamicFriction, PxFEMMaterialGeneratedValues) struct PxFEMMaterialGeneratedInfo : PxBaseMaterialGeneratedInfo { static const char* getClassName() { return "PxFEMMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMMaterial_YoungsModulus, PxFEMMaterial, PxReal, PxReal > YoungsModulus; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMMaterial_Poissons, PxFEMMaterial, PxReal, PxReal > Poissons; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMMaterial_DynamicFriction, PxFEMMaterial, PxReal, PxReal > DynamicFriction; PX_PHYSX_CORE_API PxFEMMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxFEMMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxBaseMaterialGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxBaseMaterialGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxBaseMaterialGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxBaseMaterialGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( YoungsModulus, inStartIndex + 0 );; inOperator( Poissons, inStartIndex + 1 );; inOperator( DynamicFriction, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxFEMMaterial> { PxFEMMaterialGeneratedInfo Info; const PxFEMMaterialGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxFEMSoftBodyMaterialModel__EnumConversion[] = { { "eCO_ROTATIONAL", static_cast<PxU32>( physx::PxFEMSoftBodyMaterialModel::eCO_ROTATIONAL ) }, { "eNEO_HOOKEAN", static_cast<PxU32>( physx::PxFEMSoftBodyMaterialModel::eNEO_HOOKEAN ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxFEMSoftBodyMaterialModel::Enum > { PxEnumTraits() : NameConversion( g_physx__PxFEMSoftBodyMaterialModel__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxFEMSoftBodyMaterial; struct PxFEMSoftBodyMaterialGeneratedValues : PxFEMMaterialGeneratedValues { PxReal Damping; PxReal DampingScale; PxFEMSoftBodyMaterialModel::Enum MaterialModel; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxFEMSoftBodyMaterialGeneratedValues( const PxFEMSoftBodyMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMSoftBodyMaterial, Damping, PxFEMSoftBodyMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMSoftBodyMaterial, DampingScale, PxFEMSoftBodyMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMSoftBodyMaterial, MaterialModel, PxFEMSoftBodyMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxFEMSoftBodyMaterial, ConcreteTypeName, PxFEMSoftBodyMaterialGeneratedValues) struct PxFEMSoftBodyMaterialGeneratedInfo : PxFEMMaterialGeneratedInfo { static const char* getClassName() { return "PxFEMSoftBodyMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMSoftBodyMaterial_Damping, PxFEMSoftBodyMaterial, PxReal, PxReal > Damping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMSoftBodyMaterial_DampingScale, PxFEMSoftBodyMaterial, PxReal, PxReal > DampingScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMSoftBodyMaterial_MaterialModel, PxFEMSoftBodyMaterial, PxFEMSoftBodyMaterialModel::Enum, PxFEMSoftBodyMaterialModel::Enum > MaterialModel; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxFEMSoftBodyMaterial_ConcreteTypeName, PxFEMSoftBodyMaterial, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxFEMSoftBodyMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxFEMSoftBodyMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxFEMMaterialGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxFEMMaterialGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxFEMMaterialGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 4; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxFEMMaterialGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Damping, inStartIndex + 0 );; inOperator( DampingScale, inStartIndex + 1 );; inOperator( MaterialModel, inStartIndex + 2 );; inOperator( ConcreteTypeName, inStartIndex + 3 );; return 4 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxFEMSoftBodyMaterial> { PxFEMSoftBodyMaterialGeneratedInfo Info; const PxFEMSoftBodyMaterialGeneratedInfo* getInfo() { return &Info; } }; class PxParticleMaterial; struct PxParticleMaterialGeneratedValues : PxBaseMaterialGeneratedValues { PxReal Friction; PxReal Damping; PxReal Adhesion; PxReal GravityScale; PxReal AdhesionRadiusScale; PX_PHYSX_CORE_API PxParticleMaterialGeneratedValues( const PxParticleMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxParticleMaterial, Friction, PxParticleMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxParticleMaterial, Damping, PxParticleMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxParticleMaterial, Adhesion, PxParticleMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxParticleMaterial, GravityScale, PxParticleMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxParticleMaterial, AdhesionRadiusScale, PxParticleMaterialGeneratedValues) struct PxParticleMaterialGeneratedInfo : PxBaseMaterialGeneratedInfo { static const char* getClassName() { return "PxParticleMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxParticleMaterial_Friction, PxParticleMaterial, PxReal, PxReal > Friction; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxParticleMaterial_Damping, PxParticleMaterial, PxReal, PxReal > Damping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxParticleMaterial_Adhesion, PxParticleMaterial, PxReal, PxReal > Adhesion; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxParticleMaterial_GravityScale, PxParticleMaterial, PxReal, PxReal > GravityScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxParticleMaterial_AdhesionRadiusScale, PxParticleMaterial, PxReal, PxReal > AdhesionRadiusScale; PX_PHYSX_CORE_API PxParticleMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxParticleMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxBaseMaterialGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxBaseMaterialGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxBaseMaterialGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 5; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxBaseMaterialGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Friction, inStartIndex + 0 );; inOperator( Damping, inStartIndex + 1 );; inOperator( Adhesion, inStartIndex + 2 );; inOperator( GravityScale, inStartIndex + 3 );; inOperator( AdhesionRadiusScale, inStartIndex + 4 );; return 5 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxParticleMaterial> { PxParticleMaterialGeneratedInfo Info; const PxParticleMaterialGeneratedInfo* getInfo() { return &Info; } }; class PxPBDMaterial; struct PxPBDMaterialGeneratedValues : PxParticleMaterialGeneratedValues { PxReal Viscosity; PxReal VorticityConfinement; PxReal SurfaceTension; PxReal Cohesion; PxReal Lift; PxReal Drag; PxReal CFLCoefficient; PxReal ParticleFrictionScale; PxReal ParticleAdhesionScale; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxPBDMaterialGeneratedValues( const PxPBDMaterial* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, Viscosity, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, VorticityConfinement, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, SurfaceTension, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, Cohesion, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, Lift, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, Drag, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, CFLCoefficient, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, ParticleFrictionScale, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, ParticleAdhesionScale, PxPBDMaterialGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPBDMaterial, ConcreteTypeName, PxPBDMaterialGeneratedValues) struct PxPBDMaterialGeneratedInfo : PxParticleMaterialGeneratedInfo { static const char* getClassName() { return "PxPBDMaterial"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_Viscosity, PxPBDMaterial, PxReal, PxReal > Viscosity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_VorticityConfinement, PxPBDMaterial, PxReal, PxReal > VorticityConfinement; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_SurfaceTension, PxPBDMaterial, PxReal, PxReal > SurfaceTension; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_Cohesion, PxPBDMaterial, PxReal, PxReal > Cohesion; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_Lift, PxPBDMaterial, PxReal, PxReal > Lift; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_Drag, PxPBDMaterial, PxReal, PxReal > Drag; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_CFLCoefficient, PxPBDMaterial, PxReal, PxReal > CFLCoefficient; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_ParticleFrictionScale, PxPBDMaterial, PxReal, PxReal > ParticleFrictionScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_ParticleAdhesionScale, PxPBDMaterial, PxReal, PxReal > ParticleAdhesionScale; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPBDMaterial_ConcreteTypeName, PxPBDMaterial, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxPBDMaterialGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxPBDMaterial*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxParticleMaterialGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxParticleMaterialGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxParticleMaterialGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 10; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxParticleMaterialGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Viscosity, inStartIndex + 0 );; inOperator( VorticityConfinement, inStartIndex + 1 );; inOperator( SurfaceTension, inStartIndex + 2 );; inOperator( Cohesion, inStartIndex + 3 );; inOperator( Lift, inStartIndex + 4 );; inOperator( Drag, inStartIndex + 5 );; inOperator( CFLCoefficient, inStartIndex + 6 );; inOperator( ParticleFrictionScale, inStartIndex + 7 );; inOperator( ParticleAdhesionScale, inStartIndex + 8 );; inOperator( ConcreteTypeName, inStartIndex + 9 );; return 10 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxPBDMaterial> { PxPBDMaterialGeneratedInfo Info; const PxPBDMaterialGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxActorType__EnumConversion[] = { { "eRIGID_STATIC", static_cast<PxU32>( physx::PxActorType::eRIGID_STATIC ) }, { "eRIGID_DYNAMIC", static_cast<PxU32>( physx::PxActorType::eRIGID_DYNAMIC ) }, { "eARTICULATION_LINK", static_cast<PxU32>( physx::PxActorType::eARTICULATION_LINK ) }, { "eSOFTBODY", static_cast<PxU32>( physx::PxActorType::eSOFTBODY ) }, { "eFEMCLOTH", static_cast<PxU32>( physx::PxActorType::eFEMCLOTH ) }, { "ePBD_PARTICLESYSTEM", static_cast<PxU32>( physx::PxActorType::ePBD_PARTICLESYSTEM ) }, { "eFLIP_PARTICLESYSTEM", static_cast<PxU32>( physx::PxActorType::eFLIP_PARTICLESYSTEM ) }, { "eMPM_PARTICLESYSTEM", static_cast<PxU32>( physx::PxActorType::eMPM_PARTICLESYSTEM ) }, { "eHAIRSYSTEM", static_cast<PxU32>( physx::PxActorType::eHAIRSYSTEM ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxActorType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxActorType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxActorFlag__EnumConversion[] = { { "eVISUALIZATION", static_cast<PxU32>( physx::PxActorFlag::eVISUALIZATION ) }, { "eDISABLE_GRAVITY", static_cast<PxU32>( physx::PxActorFlag::eDISABLE_GRAVITY ) }, { "eSEND_SLEEP_NOTIFIES", static_cast<PxU32>( physx::PxActorFlag::eSEND_SLEEP_NOTIFIES ) }, { "eDISABLE_SIMULATION", static_cast<PxU32>( physx::PxActorFlag::eDISABLE_SIMULATION ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxActorFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxActorFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxActor; struct PxActorGeneratedValues { PxScene * Scene; const char * Name; PxActorFlags ActorFlags; PxDominanceGroup DominanceGroup; PxClientID OwnerClient; PxAggregate * Aggregate; void * UserData; PX_PHYSX_CORE_API PxActorGeneratedValues( const PxActor* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, Scene, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, Name, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, ActorFlags, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, DominanceGroup, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, OwnerClient, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, Aggregate, PxActorGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxActor, UserData, PxActorGeneratedValues) struct PxActorGeneratedInfo { static const char* getClassName() { return "PxActor"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Scene, PxActor, PxScene * > Scene; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Name, PxActor, const char *, const char * > Name; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_ActorFlags, PxActor, PxActorFlags, PxActorFlags > ActorFlags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_DominanceGroup, PxActor, PxDominanceGroup, PxDominanceGroup > DominanceGroup; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_OwnerClient, PxActor, PxClientID, PxClientID > OwnerClient; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Aggregate, PxActor, PxAggregate * > Aggregate; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_UserData, PxActor, void *, void * > UserData; PX_PHYSX_CORE_API PxActorGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxActor*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 7; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scene, inStartIndex + 0 );; inOperator( Name, inStartIndex + 1 );; inOperator( ActorFlags, inStartIndex + 2 );; inOperator( DominanceGroup, inStartIndex + 3 );; inOperator( OwnerClient, inStartIndex + 4 );; inOperator( Aggregate, inStartIndex + 5 );; inOperator( UserData, inStartIndex + 6 );; return 7 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxActor> { PxActorGeneratedInfo Info; const PxActorGeneratedInfo* getInfo() { return &Info; } }; class PxRigidActor; struct PxRigidActorGeneratedValues : PxActorGeneratedValues { PxTransform GlobalPose; PX_PHYSX_CORE_API PxRigidActorGeneratedValues( const PxRigidActor* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidActor, GlobalPose, PxRigidActorGeneratedValues) struct PxRigidActorGeneratedInfo : PxActorGeneratedInfo { static const char* getClassName() { return "PxRigidActor"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidActor_GlobalPose, PxRigidActor, const PxTransform &, PxTransform > GlobalPose; PxRigidActorShapeCollection Shapes; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidActor_Constraints, PxRigidActor, PxConstraint * > Constraints; PX_PHYSX_CORE_API PxRigidActorGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxRigidActor*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxActorGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxActorGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxActorGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxActorGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( GlobalPose, inStartIndex + 0 );; inOperator( Shapes, inStartIndex + 1 );; inOperator( Constraints, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxRigidActor> { PxRigidActorGeneratedInfo Info; const PxRigidActorGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxForceMode__EnumConversion[] = { { "eFORCE", static_cast<PxU32>( physx::PxForceMode::eFORCE ) }, { "eIMPULSE", static_cast<PxU32>( physx::PxForceMode::eIMPULSE ) }, { "eVELOCITY_CHANGE", static_cast<PxU32>( physx::PxForceMode::eVELOCITY_CHANGE ) }, { "eACCELERATION", static_cast<PxU32>( physx::PxForceMode::eACCELERATION ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxForceMode::Enum > { PxEnumTraits() : NameConversion( g_physx__PxForceMode__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxRigidBodyFlag__EnumConversion[] = { { "eKINEMATIC", static_cast<PxU32>( physx::PxRigidBodyFlag::eKINEMATIC ) }, { "eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES", static_cast<PxU32>( physx::PxRigidBodyFlag::eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES ) }, { "eENABLE_CCD", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_CCD ) }, { "eENABLE_CCD_FRICTION", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_CCD_FRICTION ) }, { "eENABLE_SPECULATIVE_CCD", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_SPECULATIVE_CCD ) }, { "eENABLE_POSE_INTEGRATION_PREVIEW", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_POSE_INTEGRATION_PREVIEW ) }, { "eENABLE_CCD_MAX_CONTACT_IMPULSE", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_CCD_MAX_CONTACT_IMPULSE ) }, { "eRETAIN_ACCELERATIONS", static_cast<PxU32>( physx::PxRigidBodyFlag::eRETAIN_ACCELERATIONS ) }, { "eFORCE_KINE_KINE_NOTIFICATIONS", static_cast<PxU32>( physx::PxRigidBodyFlag::eFORCE_KINE_KINE_NOTIFICATIONS ) }, { "eFORCE_STATIC_KINE_NOTIFICATIONS", static_cast<PxU32>( physx::PxRigidBodyFlag::eFORCE_STATIC_KINE_NOTIFICATIONS ) }, { "eENABLE_GYROSCOPIC_FORCES", static_cast<PxU32>( physx::PxRigidBodyFlag::eENABLE_GYROSCOPIC_FORCES ) }, { "eRESERVED", static_cast<PxU32>( physx::PxRigidBodyFlag::eRESERVED ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxRigidBodyFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxRigidBodyFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxRigidBody; struct PxRigidBodyGeneratedValues : PxRigidActorGeneratedValues { PxTransform CMassLocalPose; PxReal Mass; PxReal InvMass; PxVec3 MassSpaceInertiaTensor; PxVec3 MassSpaceInvInertiaTensor; PxReal LinearDamping; PxReal AngularDamping; PxReal MaxLinearVelocity; PxReal MaxAngularVelocity; PxRigidBodyFlags RigidBodyFlags; PxReal MinCCDAdvanceCoefficient; PxReal MaxDepenetrationVelocity; PxReal MaxContactImpulse; PxReal ContactSlopCoefficient; PX_PHYSX_CORE_API PxRigidBodyGeneratedValues( const PxRigidBody* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, CMassLocalPose, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, Mass, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, InvMass, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MassSpaceInertiaTensor, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MassSpaceInvInertiaTensor, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, LinearDamping, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, AngularDamping, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MaxLinearVelocity, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MaxAngularVelocity, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, RigidBodyFlags, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MinCCDAdvanceCoefficient, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MaxDepenetrationVelocity, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, MaxContactImpulse, PxRigidBodyGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidBody, ContactSlopCoefficient, PxRigidBodyGeneratedValues) struct PxRigidBodyGeneratedInfo : PxRigidActorGeneratedInfo { static const char* getClassName() { return "PxRigidBody"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_CMassLocalPose, PxRigidBody, const PxTransform &, PxTransform > CMassLocalPose; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_Mass, PxRigidBody, PxReal, PxReal > Mass; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_InvMass, PxRigidBody, PxReal > InvMass; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MassSpaceInertiaTensor, PxRigidBody, const PxVec3 &, PxVec3 > MassSpaceInertiaTensor; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MassSpaceInvInertiaTensor, PxRigidBody, PxVec3 > MassSpaceInvInertiaTensor; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_LinearDamping, PxRigidBody, PxReal, PxReal > LinearDamping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_AngularDamping, PxRigidBody, PxReal, PxReal > AngularDamping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxLinearVelocity, PxRigidBody, PxReal, PxReal > MaxLinearVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxAngularVelocity, PxRigidBody, PxReal, PxReal > MaxAngularVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_RigidBodyFlags, PxRigidBody, PxRigidBodyFlags, PxRigidBodyFlags > RigidBodyFlags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MinCCDAdvanceCoefficient, PxRigidBody, PxReal, PxReal > MinCCDAdvanceCoefficient; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxDepenetrationVelocity, PxRigidBody, PxReal, PxReal > MaxDepenetrationVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxContactImpulse, PxRigidBody, PxReal, PxReal > MaxContactImpulse; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_ContactSlopCoefficient, PxRigidBody, PxReal, PxReal > ContactSlopCoefficient; PX_PHYSX_CORE_API PxRigidBodyGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxRigidBody*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRigidActorGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRigidActorGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRigidActorGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 14; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidActorGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( CMassLocalPose, inStartIndex + 0 );; inOperator( Mass, inStartIndex + 1 );; inOperator( InvMass, inStartIndex + 2 );; inOperator( MassSpaceInertiaTensor, inStartIndex + 3 );; inOperator( MassSpaceInvInertiaTensor, inStartIndex + 4 );; inOperator( LinearDamping, inStartIndex + 5 );; inOperator( AngularDamping, inStartIndex + 6 );; inOperator( MaxLinearVelocity, inStartIndex + 7 );; inOperator( MaxAngularVelocity, inStartIndex + 8 );; inOperator( RigidBodyFlags, inStartIndex + 9 );; inOperator( MinCCDAdvanceCoefficient, inStartIndex + 10 );; inOperator( MaxDepenetrationVelocity, inStartIndex + 11 );; inOperator( MaxContactImpulse, inStartIndex + 12 );; inOperator( ContactSlopCoefficient, inStartIndex + 13 );; return 14 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxRigidBody> { PxRigidBodyGeneratedInfo Info; const PxRigidBodyGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxRigidDynamicLockFlag__EnumConversion[] = { { "eLOCK_LINEAR_X", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_X ) }, { "eLOCK_LINEAR_Y", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y ) }, { "eLOCK_LINEAR_Z", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z ) }, { "eLOCK_ANGULAR_X", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X ) }, { "eLOCK_ANGULAR_Y", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y ) }, { "eLOCK_ANGULAR_Z", static_cast<PxU32>( physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxRigidDynamicLockFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxRigidDynamicLockFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxRigidDynamic; struct PxRigidDynamicGeneratedValues : PxRigidBodyGeneratedValues { _Bool IsSleeping; PxReal SleepThreshold; PxReal StabilizationThreshold; PxRigidDynamicLockFlags RigidDynamicLockFlags; PxVec3 LinearVelocity; PxVec3 AngularVelocity; PxReal WakeCounter; PxU32 SolverIterationCounts[2]; PxReal ContactReportThreshold; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxRigidDynamicGeneratedValues( const PxRigidDynamic* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, IsSleeping, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, SleepThreshold, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, StabilizationThreshold, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, RigidDynamicLockFlags, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, LinearVelocity, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, AngularVelocity, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, WakeCounter, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, SolverIterationCounts, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, ContactReportThreshold, PxRigidDynamicGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidDynamic, ConcreteTypeName, PxRigidDynamicGeneratedValues) struct PxRigidDynamicGeneratedInfo : PxRigidBodyGeneratedInfo { static const char* getClassName() { return "PxRigidDynamic"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_IsSleeping, PxRigidDynamic, _Bool > IsSleeping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_SleepThreshold, PxRigidDynamic, PxReal, PxReal > SleepThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_StabilizationThreshold, PxRigidDynamic, PxReal, PxReal > StabilizationThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_RigidDynamicLockFlags, PxRigidDynamic, PxRigidDynamicLockFlags, PxRigidDynamicLockFlags > RigidDynamicLockFlags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_LinearVelocity, PxRigidDynamic, const PxVec3 &, PxVec3 > LinearVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_AngularVelocity, PxRigidDynamic, const PxVec3 &, PxVec3 > AngularVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_WakeCounter, PxRigidDynamic, PxReal, PxReal > WakeCounter; PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_SolverIterationCounts, PxRigidDynamic, PxU32 > SolverIterationCounts; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_ContactReportThreshold, PxRigidDynamic, PxReal, PxReal > ContactReportThreshold; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_ConcreteTypeName, PxRigidDynamic, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxRigidDynamicGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxRigidDynamic*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRigidBodyGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRigidBodyGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRigidBodyGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 10; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidBodyGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( IsSleeping, inStartIndex + 0 );; inOperator( SleepThreshold, inStartIndex + 1 );; inOperator( StabilizationThreshold, inStartIndex + 2 );; inOperator( RigidDynamicLockFlags, inStartIndex + 3 );; inOperator( LinearVelocity, inStartIndex + 4 );; inOperator( AngularVelocity, inStartIndex + 5 );; inOperator( WakeCounter, inStartIndex + 6 );; inOperator( SolverIterationCounts, inStartIndex + 7 );; inOperator( ContactReportThreshold, inStartIndex + 8 );; inOperator( ConcreteTypeName, inStartIndex + 9 );; return 10 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxRigidDynamic> { PxRigidDynamicGeneratedInfo Info; const PxRigidDynamicGeneratedInfo* getInfo() { return &Info; } }; class PxRigidStatic; struct PxRigidStaticGeneratedValues : PxRigidActorGeneratedValues { const char * ConcreteTypeName; PX_PHYSX_CORE_API PxRigidStaticGeneratedValues( const PxRigidStatic* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxRigidStatic, ConcreteTypeName, PxRigidStaticGeneratedValues) struct PxRigidStaticGeneratedInfo : PxRigidActorGeneratedInfo { static const char* getClassName() { return "PxRigidStatic"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidStatic_ConcreteTypeName, PxRigidStatic, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxRigidStaticGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxRigidStatic*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRigidActorGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRigidActorGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRigidActorGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidActorGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( ConcreteTypeName, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxRigidStatic> { PxRigidStaticGeneratedInfo Info; const PxRigidStaticGeneratedInfo* getInfo() { return &Info; } }; class PxArticulationLink; struct PxArticulationLinkGeneratedValues : PxRigidBodyGeneratedValues { PxArticulationJointReducedCoordinate * InboundJoint; PxU32 InboundJointDof; PxU32 LinkIndex; PxReal CfmScale; PxVec3 LinearVelocity; PxVec3 AngularVelocity; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxArticulationLinkGeneratedValues( const PxArticulationLink* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, InboundJoint, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, InboundJointDof, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, LinkIndex, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, CfmScale, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, LinearVelocity, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, AngularVelocity, PxArticulationLinkGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLink, ConcreteTypeName, PxArticulationLinkGeneratedValues) struct PxArticulationLinkGeneratedInfo : PxRigidBodyGeneratedInfo { static const char* getClassName() { return "PxArticulationLink"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_InboundJoint, PxArticulationLink, PxArticulationJointReducedCoordinate * > InboundJoint; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_InboundJointDof, PxArticulationLink, PxU32 > InboundJointDof; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_LinkIndex, PxArticulationLink, PxU32 > LinkIndex; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_Children, PxArticulationLink, PxArticulationLink * > Children; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_CfmScale, PxArticulationLink, const PxReal, PxReal > CfmScale; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_LinearVelocity, PxArticulationLink, PxVec3 > LinearVelocity; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_AngularVelocity, PxArticulationLink, PxVec3 > AngularVelocity; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_ConcreteTypeName, PxArticulationLink, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxArticulationLinkGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxArticulationLink*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRigidBodyGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRigidBodyGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRigidBodyGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 8; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidBodyGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( InboundJoint, inStartIndex + 0 );; inOperator( InboundJointDof, inStartIndex + 1 );; inOperator( LinkIndex, inStartIndex + 2 );; inOperator( Children, inStartIndex + 3 );; inOperator( CfmScale, inStartIndex + 4 );; inOperator( LinearVelocity, inStartIndex + 5 );; inOperator( AngularVelocity, inStartIndex + 6 );; inOperator( ConcreteTypeName, inStartIndex + 7 );; return 8 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxArticulationLink> { PxArticulationLinkGeneratedInfo Info; const PxArticulationLinkGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxArticulationJointType__EnumConversion[] = { { "eFIX", static_cast<PxU32>( physx::PxArticulationJointType::eFIX ) }, { "ePRISMATIC", static_cast<PxU32>( physx::PxArticulationJointType::ePRISMATIC ) }, { "eREVOLUTE", static_cast<PxU32>( physx::PxArticulationJointType::eREVOLUTE ) }, { "eREVOLUTE_UNWRAPPED", static_cast<PxU32>( physx::PxArticulationJointType::eREVOLUTE_UNWRAPPED ) }, { "eSPHERICAL", static_cast<PxU32>( physx::PxArticulationJointType::eSPHERICAL ) }, { "eUNDEFINED", static_cast<PxU32>( physx::PxArticulationJointType::eUNDEFINED ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationJointType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationJointType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxArticulationAxis__EnumConversion[] = { { "eTWIST", static_cast<PxU32>( physx::PxArticulationAxis::eTWIST ) }, { "eSWING1", static_cast<PxU32>( physx::PxArticulationAxis::eSWING1 ) }, { "eSWING2", static_cast<PxU32>( physx::PxArticulationAxis::eSWING2 ) }, { "eX", static_cast<PxU32>( physx::PxArticulationAxis::eX ) }, { "eY", static_cast<PxU32>( physx::PxArticulationAxis::eY ) }, { "eZ", static_cast<PxU32>( physx::PxArticulationAxis::eZ ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationAxis::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationAxis__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxArticulationMotion__EnumConversion[] = { { "eLOCKED", static_cast<PxU32>( physx::PxArticulationMotion::eLOCKED ) }, { "eLIMITED", static_cast<PxU32>( physx::PxArticulationMotion::eLIMITED ) }, { "eFREE", static_cast<PxU32>( physx::PxArticulationMotion::eFREE ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationMotion::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationMotion__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxArticulationJointReducedCoordinate; struct PxArticulationJointReducedCoordinateGeneratedValues { PxTransform ParentPose; PxTransform ChildPose; PxArticulationJointType::Enum JointType; PxArticulationMotion::Enum Motion[physx::PxArticulationAxis::eCOUNT]; PxArticulationLimit LimitParams[physx::PxArticulationAxis::eCOUNT]; PxArticulationDrive DriveParams[physx::PxArticulationAxis::eCOUNT]; PxReal Armature[physx::PxArticulationAxis::eCOUNT]; PxReal FrictionCoefficient; PxReal MaxJointVelocity; PxReal JointPosition[physx::PxArticulationAxis::eCOUNT]; PxReal JointVelocity[physx::PxArticulationAxis::eCOUNT]; const char * ConcreteTypeName; void * UserData; PX_PHYSX_CORE_API PxArticulationJointReducedCoordinateGeneratedValues( const PxArticulationJointReducedCoordinate* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, ParentPose, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, ChildPose, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, JointType, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, Motion, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, LimitParams, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, DriveParams, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, Armature, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, FrictionCoefficient, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, MaxJointVelocity, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, JointPosition, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, JointVelocity, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, ConcreteTypeName, PxArticulationJointReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationJointReducedCoordinate, UserData, PxArticulationJointReducedCoordinateGeneratedValues) struct PxArticulationJointReducedCoordinateGeneratedInfo { static const char* getClassName() { return "PxArticulationJointReducedCoordinate"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_ParentPose, PxArticulationJointReducedCoordinate, const PxTransform &, PxTransform > ParentPose; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_ChildPose, PxArticulationJointReducedCoordinate, const PxTransform &, PxTransform > ChildPose; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_JointType, PxArticulationJointReducedCoordinate, PxArticulationJointType::Enum, PxArticulationJointType::Enum > JointType; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_Motion, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxArticulationMotion::Enum > Motion; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_LimitParams, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxArticulationLimit > LimitParams; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_DriveParams, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxArticulationDrive > DriveParams; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_Armature, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxReal > Armature; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_FrictionCoefficient, PxArticulationJointReducedCoordinate, const PxReal, PxReal > FrictionCoefficient; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_MaxJointVelocity, PxArticulationJointReducedCoordinate, const PxReal, PxReal > MaxJointVelocity; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_JointPosition, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxReal > JointPosition; PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_JointVelocity, PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxReal > JointVelocity; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_ConcreteTypeName, PxArticulationJointReducedCoordinate, const char * > ConcreteTypeName; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_UserData, PxArticulationJointReducedCoordinate, void *, void * > UserData; PX_PHYSX_CORE_API PxArticulationJointReducedCoordinateGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxArticulationJointReducedCoordinate*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 13; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( ParentPose, inStartIndex + 0 );; inOperator( ChildPose, inStartIndex + 1 );; inOperator( JointType, inStartIndex + 2 );; inOperator( Motion, inStartIndex + 3 );; inOperator( LimitParams, inStartIndex + 4 );; inOperator( DriveParams, inStartIndex + 5 );; inOperator( Armature, inStartIndex + 6 );; inOperator( FrictionCoefficient, inStartIndex + 7 );; inOperator( MaxJointVelocity, inStartIndex + 8 );; inOperator( JointPosition, inStartIndex + 9 );; inOperator( JointVelocity, inStartIndex + 10 );; inOperator( ConcreteTypeName, inStartIndex + 11 );; inOperator( UserData, inStartIndex + 12 );; return 13 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxArticulationJointReducedCoordinate> { PxArticulationJointReducedCoordinateGeneratedInfo Info; const PxArticulationJointReducedCoordinateGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxArticulationFlag__EnumConversion[] = { { "eFIX_BASE", static_cast<PxU32>( physx::PxArticulationFlag::eFIX_BASE ) }, { "eDRIVE_LIMITS_ARE_FORCES", static_cast<PxU32>( physx::PxArticulationFlag::eDRIVE_LIMITS_ARE_FORCES ) }, { "eDISABLE_SELF_COLLISION", static_cast<PxU32>( physx::PxArticulationFlag::eDISABLE_SELF_COLLISION ) }, { "eCOMPUTE_JOINT_FORCES", static_cast<PxU32>( physx::PxArticulationFlag::eCOMPUTE_JOINT_FORCES ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxArticulationCacheFlag__EnumConversion[] = { { "eVELOCITY", static_cast<PxU32>( physx::PxArticulationCacheFlag::eVELOCITY ) }, { "eACCELERATION", static_cast<PxU32>( physx::PxArticulationCacheFlag::eACCELERATION ) }, { "ePOSITION", static_cast<PxU32>( physx::PxArticulationCacheFlag::ePOSITION ) }, { "eFORCE", static_cast<PxU32>( physx::PxArticulationCacheFlag::eFORCE ) }, { "eLINK_VELOCITY", static_cast<PxU32>( physx::PxArticulationCacheFlag::eLINK_VELOCITY ) }, { "eLINK_ACCELERATION", static_cast<PxU32>( physx::PxArticulationCacheFlag::eLINK_ACCELERATION ) }, { "eROOT_TRANSFORM", static_cast<PxU32>( physx::PxArticulationCacheFlag::eROOT_TRANSFORM ) }, { "eROOT_VELOCITIES", static_cast<PxU32>( physx::PxArticulationCacheFlag::eROOT_VELOCITIES ) }, { "eSENSOR_FORCES", static_cast<PxU32>( physx::PxArticulationCacheFlag::eSENSOR_FORCES ) }, { "eJOINT_SOLVER_FORCES", static_cast<PxU32>( physx::PxArticulationCacheFlag::eJOINT_SOLVER_FORCES ) }, { "eLINK_INCOMING_JOINT_FORCE", static_cast<PxU32>( physx::PxArticulationCacheFlag::eLINK_INCOMING_JOINT_FORCE ) }, { "eJOINT_TARGET_POSITIONS", static_cast<PxU32>( physx::PxArticulationCacheFlag::eJOINT_TARGET_POSITIONS ) }, { "eJOINT_TARGET_VELOCITIES", static_cast<PxU32>( physx::PxArticulationCacheFlag::eJOINT_TARGET_VELOCITIES ) }, { "eALL", static_cast<PxU32>( physx::PxArticulationCacheFlag::eALL ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationCacheFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationCacheFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxArticulationReducedCoordinate; struct PxArticulationReducedCoordinateGeneratedValues { PxScene * Scene; PxU32 SolverIterationCounts[2]; _Bool IsSleeping; PxReal SleepThreshold; PxReal StabilizationThreshold; PxReal WakeCounter; PxReal MaxCOMLinearVelocity; PxReal MaxCOMAngularVelocity; const char * Name; PxAggregate * Aggregate; PxArticulationFlags ArticulationFlags; PxTransform RootGlobalPose; PxVec3 RootLinearVelocity; PxVec3 RootAngularVelocity; void * UserData; PX_PHYSX_CORE_API PxArticulationReducedCoordinateGeneratedValues( const PxArticulationReducedCoordinate* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, Scene, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, SolverIterationCounts, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, IsSleeping, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, SleepThreshold, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, StabilizationThreshold, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, WakeCounter, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, MaxCOMLinearVelocity, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, MaxCOMAngularVelocity, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, Name, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, Aggregate, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, ArticulationFlags, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, RootGlobalPose, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, RootLinearVelocity, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, RootAngularVelocity, PxArticulationReducedCoordinateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationReducedCoordinate, UserData, PxArticulationReducedCoordinateGeneratedValues) struct PxArticulationReducedCoordinateGeneratedInfo { static const char* getClassName() { return "PxArticulationReducedCoordinate"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_Scene, PxArticulationReducedCoordinate, PxScene * > Scene; PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_SolverIterationCounts, PxArticulationReducedCoordinate, PxU32 > SolverIterationCounts; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_IsSleeping, PxArticulationReducedCoordinate, _Bool > IsSleeping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_SleepThreshold, PxArticulationReducedCoordinate, PxReal, PxReal > SleepThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_StabilizationThreshold, PxArticulationReducedCoordinate, PxReal, PxReal > StabilizationThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_WakeCounter, PxArticulationReducedCoordinate, PxReal, PxReal > WakeCounter; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_MaxCOMLinearVelocity, PxArticulationReducedCoordinate, const PxReal, PxReal > MaxCOMLinearVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_MaxCOMAngularVelocity, PxArticulationReducedCoordinate, const PxReal, PxReal > MaxCOMAngularVelocity; PxArticulationLinkCollectionProp Links; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_Name, PxArticulationReducedCoordinate, const char *, const char * > Name; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_Aggregate, PxArticulationReducedCoordinate, PxAggregate * > Aggregate; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_ArticulationFlags, PxArticulationReducedCoordinate, PxArticulationFlags, PxArticulationFlags > ArticulationFlags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_RootGlobalPose, PxArticulationReducedCoordinate, const PxTransform &, PxTransform > RootGlobalPose; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_RootLinearVelocity, PxArticulationReducedCoordinate, const PxVec3 &, PxVec3 > RootLinearVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_RootAngularVelocity, PxArticulationReducedCoordinate, const PxVec3 &, PxVec3 > RootAngularVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_UserData, PxArticulationReducedCoordinate, void *, void * > UserData; PX_PHYSX_CORE_API PxArticulationReducedCoordinateGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxArticulationReducedCoordinate*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 16; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scene, inStartIndex + 0 );; inOperator( SolverIterationCounts, inStartIndex + 1 );; inOperator( IsSleeping, inStartIndex + 2 );; inOperator( SleepThreshold, inStartIndex + 3 );; inOperator( StabilizationThreshold, inStartIndex + 4 );; inOperator( WakeCounter, inStartIndex + 5 );; inOperator( MaxCOMLinearVelocity, inStartIndex + 6 );; inOperator( MaxCOMAngularVelocity, inStartIndex + 7 );; inOperator( Links, inStartIndex + 8 );; inOperator( Name, inStartIndex + 9 );; inOperator( Aggregate, inStartIndex + 10 );; inOperator( ArticulationFlags, inStartIndex + 11 );; inOperator( RootGlobalPose, inStartIndex + 12 );; inOperator( RootLinearVelocity, inStartIndex + 13 );; inOperator( RootAngularVelocity, inStartIndex + 14 );; inOperator( UserData, inStartIndex + 15 );; return 16 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxArticulationReducedCoordinate> { PxArticulationReducedCoordinateGeneratedInfo Info; const PxArticulationReducedCoordinateGeneratedInfo* getInfo() { return &Info; } }; class PxAggregate; struct PxAggregateGeneratedValues { PxU32 MaxNbActors; PxU32 MaxNbShapes; _Bool SelfCollision; const char * ConcreteTypeName; void * UserData; PX_PHYSX_CORE_API PxAggregateGeneratedValues( const PxAggregate* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxAggregate, MaxNbActors, PxAggregateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxAggregate, MaxNbShapes, PxAggregateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxAggregate, SelfCollision, PxAggregateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxAggregate, ConcreteTypeName, PxAggregateGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxAggregate, UserData, PxAggregateGeneratedValues) struct PxAggregateGeneratedInfo { static const char* getClassName() { return "PxAggregate"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_MaxNbActors, PxAggregate, PxU32 > MaxNbActors; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_MaxNbShapes, PxAggregate, PxU32 > MaxNbShapes; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_Actors, PxAggregate, PxActor * > Actors; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_SelfCollision, PxAggregate, _Bool > SelfCollision; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_ConcreteTypeName, PxAggregate, const char * > ConcreteTypeName; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_UserData, PxAggregate, void *, void * > UserData; PX_PHYSX_CORE_API PxAggregateGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxAggregate*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 6; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( MaxNbActors, inStartIndex + 0 );; inOperator( MaxNbShapes, inStartIndex + 1 );; inOperator( Actors, inStartIndex + 2 );; inOperator( SelfCollision, inStartIndex + 3 );; inOperator( ConcreteTypeName, inStartIndex + 4 );; inOperator( UserData, inStartIndex + 5 );; return 6 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxAggregate> { PxAggregateGeneratedInfo Info; const PxAggregateGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxConstraintFlag__EnumConversion[] = { { "eBROKEN", static_cast<PxU32>( physx::PxConstraintFlag::eBROKEN ) }, { "eCOLLISION_ENABLED", static_cast<PxU32>( physx::PxConstraintFlag::eCOLLISION_ENABLED ) }, { "eVISUALIZATION", static_cast<PxU32>( physx::PxConstraintFlag::eVISUALIZATION ) }, { "eDRIVE_LIMITS_ARE_FORCES", static_cast<PxU32>( physx::PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES ) }, { "eIMPROVED_SLERP", static_cast<PxU32>( physx::PxConstraintFlag::eIMPROVED_SLERP ) }, { "eDISABLE_PREPROCESSING", static_cast<PxU32>( physx::PxConstraintFlag::eDISABLE_PREPROCESSING ) }, { "eENABLE_EXTENDED_LIMITS", static_cast<PxU32>( physx::PxConstraintFlag::eENABLE_EXTENDED_LIMITS ) }, { "eGPU_COMPATIBLE", static_cast<PxU32>( physx::PxConstraintFlag::eGPU_COMPATIBLE ) }, { "eALWAYS_UPDATE", static_cast<PxU32>( physx::PxConstraintFlag::eALWAYS_UPDATE ) }, { "eDISABLE_CONSTRAINT", static_cast<PxU32>( physx::PxConstraintFlag::eDISABLE_CONSTRAINT ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxConstraintFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxConstraintFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxConstraint; struct PxConstraintGeneratedValues { PxScene * Scene; PxRigidActor * Actors[2]; PxConstraintFlags Flags; _Bool IsValid; PxReal BreakForce[2]; PxReal MinResponseThreshold; const char * ConcreteTypeName; void * UserData; PX_PHYSX_CORE_API PxConstraintGeneratedValues( const PxConstraint* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, Scene, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, Actors, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, Flags, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, IsValid, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, BreakForce, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, MinResponseThreshold, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, ConcreteTypeName, PxConstraintGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConstraint, UserData, PxConstraintGeneratedValues) struct PxConstraintGeneratedInfo { static const char* getClassName() { return "PxConstraint"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Scene, PxConstraint, PxScene * > Scene; PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Actors, PxConstraint, PxRigidActor * > Actors; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Flags, PxConstraint, PxConstraintFlags, PxConstraintFlags > Flags; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_IsValid, PxConstraint, _Bool > IsValid; PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_BreakForce, PxConstraint, PxReal > BreakForce; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_MinResponseThreshold, PxConstraint, PxReal, PxReal > MinResponseThreshold; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_ConcreteTypeName, PxConstraint, const char * > ConcreteTypeName; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_UserData, PxConstraint, void *, void * > UserData; PX_PHYSX_CORE_API PxConstraintGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxConstraint*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 8; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scene, inStartIndex + 0 );; inOperator( Actors, inStartIndex + 1 );; inOperator( Flags, inStartIndex + 2 );; inOperator( IsValid, inStartIndex + 3 );; inOperator( BreakForce, inStartIndex + 4 );; inOperator( MinResponseThreshold, inStartIndex + 5 );; inOperator( ConcreteTypeName, inStartIndex + 6 );; inOperator( UserData, inStartIndex + 7 );; return 8 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxConstraint> { PxConstraintGeneratedInfo Info; const PxConstraintGeneratedInfo* getInfo() { return &Info; } }; class PxShape; struct PxShapeGeneratedValues : PxRefCountedGeneratedValues { PxTransform LocalPose; PxFilterData SimulationFilterData; PxFilterData QueryFilterData; PxReal ContactOffset; PxReal RestOffset; PxReal DensityForFluid; PxReal TorsionalPatchRadius; PxReal MinTorsionalPatchRadius; PxU32 InternalShapeIndex; PxShapeFlags Flags; _Bool IsExclusive; const char * Name; const char * ConcreteTypeName; void * UserData; PxGeometryHolder Geom; PX_PHYSX_CORE_API PxShapeGeneratedValues( const PxShape* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, LocalPose, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, SimulationFilterData, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, QueryFilterData, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, ContactOffset, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, RestOffset, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, DensityForFluid, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, TorsionalPatchRadius, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, MinTorsionalPatchRadius, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, InternalShapeIndex, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, Flags, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, IsExclusive, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, Name, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, ConcreteTypeName, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, UserData, PxShapeGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxShape, Geom, PxShapeGeneratedValues) struct PxShapeGeneratedInfo : PxRefCountedGeneratedInfo { static const char* getClassName() { return "PxShape"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_LocalPose, PxShape, const PxTransform &, PxTransform > LocalPose; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_SimulationFilterData, PxShape, const PxFilterData &, PxFilterData > SimulationFilterData; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_QueryFilterData, PxShape, const PxFilterData &, PxFilterData > QueryFilterData; PxShapeMaterialsProperty Materials; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_ContactOffset, PxShape, PxReal, PxReal > ContactOffset; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_RestOffset, PxShape, PxReal, PxReal > RestOffset; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_DensityForFluid, PxShape, PxReal, PxReal > DensityForFluid; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_TorsionalPatchRadius, PxShape, PxReal, PxReal > TorsionalPatchRadius; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_MinTorsionalPatchRadius, PxShape, PxReal, PxReal > MinTorsionalPatchRadius; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_InternalShapeIndex, PxShape, PxU32 > InternalShapeIndex; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_Flags, PxShape, PxShapeFlags, PxShapeFlags > Flags; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_IsExclusive, PxShape, _Bool > IsExclusive; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_Name, PxShape, const char *, const char * > Name; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_ConcreteTypeName, PxShape, const char * > ConcreteTypeName; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_UserData, PxShape, void *, void * > UserData; PxShapeGeomProperty Geom; PX_PHYSX_CORE_API PxShapeGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxShape*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxRefCountedGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxRefCountedGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxRefCountedGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 16; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRefCountedGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( LocalPose, inStartIndex + 0 );; inOperator( SimulationFilterData, inStartIndex + 1 );; inOperator( QueryFilterData, inStartIndex + 2 );; inOperator( Materials, inStartIndex + 3 );; inOperator( ContactOffset, inStartIndex + 4 );; inOperator( RestOffset, inStartIndex + 5 );; inOperator( DensityForFluid, inStartIndex + 6 );; inOperator( TorsionalPatchRadius, inStartIndex + 7 );; inOperator( MinTorsionalPatchRadius, inStartIndex + 8 );; inOperator( InternalShapeIndex, inStartIndex + 9 );; inOperator( Flags, inStartIndex + 10 );; inOperator( IsExclusive, inStartIndex + 11 );; inOperator( Name, inStartIndex + 12 );; inOperator( ConcreteTypeName, inStartIndex + 13 );; inOperator( UserData, inStartIndex + 14 );; inOperator( Geom, inStartIndex + 15 );; return 16 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxShape> { PxShapeGeneratedInfo Info; const PxShapeGeneratedInfo* getInfo() { return &Info; } }; class PxPruningStructure; struct PxPruningStructureGeneratedValues { const void * StaticMergeData; const void * DynamicMergeData; const char * ConcreteTypeName; PX_PHYSX_CORE_API PxPruningStructureGeneratedValues( const PxPruningStructure* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPruningStructure, StaticMergeData, PxPruningStructureGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPruningStructure, DynamicMergeData, PxPruningStructureGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxPruningStructure, ConcreteTypeName, PxPruningStructureGeneratedValues) struct PxPruningStructureGeneratedInfo { static const char* getClassName() { return "PxPruningStructure"; } PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_RigidActors, PxPruningStructure, PxRigidActor * > RigidActors; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_StaticMergeData, PxPruningStructure, const void * > StaticMergeData; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_DynamicMergeData, PxPruningStructure, const void * > DynamicMergeData; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_ConcreteTypeName, PxPruningStructure, const char * > ConcreteTypeName; PX_PHYSX_CORE_API PxPruningStructureGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxPruningStructure*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 4; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( RigidActors, inStartIndex + 0 );; inOperator( StaticMergeData, inStartIndex + 1 );; inOperator( DynamicMergeData, inStartIndex + 2 );; inOperator( ConcreteTypeName, inStartIndex + 3 );; return 4 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxPruningStructure> { PxPruningStructureGeneratedInfo Info; const PxPruningStructureGeneratedInfo* getInfo() { return &Info; } }; class PxTolerancesScale; struct PxTolerancesScaleGeneratedValues { _Bool IsValid; PxReal Length; PxReal Speed; PX_PHYSX_CORE_API PxTolerancesScaleGeneratedValues( const PxTolerancesScale* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTolerancesScale, IsValid, PxTolerancesScaleGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTolerancesScale, Length, PxTolerancesScaleGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTolerancesScale, Speed, PxTolerancesScaleGeneratedValues) struct PxTolerancesScaleGeneratedInfo { static const char* getClassName() { return "PxTolerancesScale"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_IsValid, PxTolerancesScale, _Bool > IsValid; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_Length, PxTolerancesScale, PxReal, PxReal > Length; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_Speed, PxTolerancesScale, PxReal, PxReal > Speed; PX_PHYSX_CORE_API PxTolerancesScaleGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxTolerancesScale*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( IsValid, inStartIndex + 0 );; inOperator( Length, inStartIndex + 1 );; inOperator( Speed, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxTolerancesScale> { PxTolerancesScaleGeneratedInfo Info; const PxTolerancesScaleGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxGeometryType__EnumConversion[] = { { "eSPHERE", static_cast<PxU32>( physx::PxGeometryType::eSPHERE ) }, { "ePLANE", static_cast<PxU32>( physx::PxGeometryType::ePLANE ) }, { "eCAPSULE", static_cast<PxU32>( physx::PxGeometryType::eCAPSULE ) }, { "eBOX", static_cast<PxU32>( physx::PxGeometryType::eBOX ) }, { "eCONVEXMESH", static_cast<PxU32>( physx::PxGeometryType::eCONVEXMESH ) }, { "ePARTICLESYSTEM", static_cast<PxU32>( physx::PxGeometryType::ePARTICLESYSTEM ) }, { "eTETRAHEDRONMESH", static_cast<PxU32>( physx::PxGeometryType::eTETRAHEDRONMESH ) }, { "eTRIANGLEMESH", static_cast<PxU32>( physx::PxGeometryType::eTRIANGLEMESH ) }, { "eHEIGHTFIELD", static_cast<PxU32>( physx::PxGeometryType::eHEIGHTFIELD ) }, { "eHAIRSYSTEM", static_cast<PxU32>( physx::PxGeometryType::eHAIRSYSTEM ) }, { "eCUSTOM", static_cast<PxU32>( physx::PxGeometryType::eCUSTOM ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxGeometryType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxGeometryType__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxGeometry; struct PxGeometryGeneratedValues { PX_PHYSX_CORE_API PxGeometryGeneratedValues( const PxGeometry* inSource ); }; struct PxGeometryGeneratedInfo { static const char* getClassName() { return "PxGeometry"; } PX_PHYSX_CORE_API PxGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 0; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return 0 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxGeometry> { PxGeometryGeneratedInfo Info; const PxGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxBoxGeometry; struct PxBoxGeometryGeneratedValues : PxGeometryGeneratedValues { PxVec3 HalfExtents; PX_PHYSX_CORE_API PxBoxGeometryGeneratedValues( const PxBoxGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBoxGeometry, HalfExtents, PxBoxGeometryGeneratedValues) struct PxBoxGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxBoxGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBoxGeometry_HalfExtents, PxBoxGeometry, PxVec3, PxVec3 > HalfExtents; PX_PHYSX_CORE_API PxBoxGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxBoxGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( HalfExtents, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxBoxGeometry> { PxBoxGeometryGeneratedInfo Info; const PxBoxGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxCapsuleGeometry; struct PxCapsuleGeometryGeneratedValues : PxGeometryGeneratedValues { PxReal Radius; PxReal HalfHeight; PX_PHYSX_CORE_API PxCapsuleGeometryGeneratedValues( const PxCapsuleGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxCapsuleGeometry, Radius, PxCapsuleGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxCapsuleGeometry, HalfHeight, PxCapsuleGeometryGeneratedValues) struct PxCapsuleGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxCapsuleGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxCapsuleGeometry_Radius, PxCapsuleGeometry, PxReal, PxReal > Radius; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxCapsuleGeometry_HalfHeight, PxCapsuleGeometry, PxReal, PxReal > HalfHeight; PX_PHYSX_CORE_API PxCapsuleGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxCapsuleGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 2; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Radius, inStartIndex + 0 );; inOperator( HalfHeight, inStartIndex + 1 );; return 2 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxCapsuleGeometry> { PxCapsuleGeometryGeneratedInfo Info; const PxCapsuleGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxMeshScale; struct PxMeshScaleGeneratedValues { PxVec3 Scale; PxQuat Rotation; PX_PHYSX_CORE_API PxMeshScaleGeneratedValues( const PxMeshScale* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMeshScale, Scale, PxMeshScaleGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxMeshScale, Rotation, PxMeshScaleGeneratedValues) struct PxMeshScaleGeneratedInfo { static const char* getClassName() { return "PxMeshScale"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMeshScale_Scale, PxMeshScale, PxVec3, PxVec3 > Scale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMeshScale_Rotation, PxMeshScale, PxQuat, PxQuat > Rotation; PX_PHYSX_CORE_API PxMeshScaleGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxMeshScale*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 2; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scale, inStartIndex + 0 );; inOperator( Rotation, inStartIndex + 1 );; return 2 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxMeshScale> { PxMeshScaleGeneratedInfo Info; const PxMeshScaleGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxConvexMeshGeometryFlag__EnumConversion[] = { { "eTIGHT_BOUNDS", static_cast<PxU32>( physx::PxConvexMeshGeometryFlag::eTIGHT_BOUNDS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxConvexMeshGeometryFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxConvexMeshGeometryFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxConvexMeshGeometry; struct PxConvexMeshGeometryGeneratedValues : PxGeometryGeneratedValues { PxMeshScale Scale; PxConvexMesh * ConvexMesh; PxConvexMeshGeometryFlags MeshFlags; PX_PHYSX_CORE_API PxConvexMeshGeometryGeneratedValues( const PxConvexMeshGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConvexMeshGeometry, Scale, PxConvexMeshGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConvexMeshGeometry, ConvexMesh, PxConvexMeshGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxConvexMeshGeometry, MeshFlags, PxConvexMeshGeometryGeneratedValues) struct PxConvexMeshGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxConvexMeshGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_Scale, PxConvexMeshGeometry, PxMeshScale, PxMeshScale > Scale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_ConvexMesh, PxConvexMeshGeometry, PxConvexMesh *, PxConvexMesh * > ConvexMesh; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_MeshFlags, PxConvexMeshGeometry, PxConvexMeshGeometryFlags, PxConvexMeshGeometryFlags > MeshFlags; PX_PHYSX_CORE_API PxConvexMeshGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxConvexMeshGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scale, inStartIndex + 0 );; inOperator( ConvexMesh, inStartIndex + 1 );; inOperator( MeshFlags, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxConvexMeshGeometry> { PxConvexMeshGeometryGeneratedInfo Info; const PxConvexMeshGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxSphereGeometry; struct PxSphereGeometryGeneratedValues : PxGeometryGeneratedValues { PxReal Radius; PX_PHYSX_CORE_API PxSphereGeometryGeneratedValues( const PxSphereGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSphereGeometry, Radius, PxSphereGeometryGeneratedValues) struct PxSphereGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxSphereGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSphereGeometry_Radius, PxSphereGeometry, PxReal, PxReal > Radius; PX_PHYSX_CORE_API PxSphereGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSphereGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Radius, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSphereGeometry> { PxSphereGeometryGeneratedInfo Info; const PxSphereGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxPlaneGeometry; struct PxPlaneGeometryGeneratedValues : PxGeometryGeneratedValues { PX_PHYSX_CORE_API PxPlaneGeometryGeneratedValues( const PxPlaneGeometry* inSource ); }; struct PxPlaneGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxPlaneGeometry"; } PX_PHYSX_CORE_API PxPlaneGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxPlaneGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 0; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return 0 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxPlaneGeometry> { PxPlaneGeometryGeneratedInfo Info; const PxPlaneGeometryGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxMeshGeometryFlag__EnumConversion[] = { { "eTIGHT_BOUNDS", static_cast<PxU32>( physx::PxMeshGeometryFlag::eTIGHT_BOUNDS ) }, { "eDOUBLE_SIDED", static_cast<PxU32>( physx::PxMeshGeometryFlag::eDOUBLE_SIDED ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxMeshGeometryFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxMeshGeometryFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxTriangleMeshGeometry; struct PxTriangleMeshGeometryGeneratedValues : PxGeometryGeneratedValues { PxMeshScale Scale; PxMeshGeometryFlags MeshFlags; PxTriangleMesh * TriangleMesh; PX_PHYSX_CORE_API PxTriangleMeshGeometryGeneratedValues( const PxTriangleMeshGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTriangleMeshGeometry, Scale, PxTriangleMeshGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTriangleMeshGeometry, MeshFlags, PxTriangleMeshGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTriangleMeshGeometry, TriangleMesh, PxTriangleMeshGeometryGeneratedValues) struct PxTriangleMeshGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxTriangleMeshGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_Scale, PxTriangleMeshGeometry, PxMeshScale, PxMeshScale > Scale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_MeshFlags, PxTriangleMeshGeometry, PxMeshGeometryFlags, PxMeshGeometryFlags > MeshFlags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_TriangleMesh, PxTriangleMeshGeometry, PxTriangleMesh *, PxTriangleMesh * > TriangleMesh; PX_PHYSX_CORE_API PxTriangleMeshGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxTriangleMeshGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Scale, inStartIndex + 0 );; inOperator( MeshFlags, inStartIndex + 1 );; inOperator( TriangleMesh, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxTriangleMeshGeometry> { PxTriangleMeshGeometryGeneratedInfo Info; const PxTriangleMeshGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxHeightFieldGeometry; struct PxHeightFieldGeometryGeneratedValues : PxGeometryGeneratedValues { PxHeightField * HeightField; PxReal HeightScale; PxReal RowScale; PxReal ColumnScale; PxMeshGeometryFlags HeightFieldFlags; PX_PHYSX_CORE_API PxHeightFieldGeometryGeneratedValues( const PxHeightFieldGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldGeometry, HeightField, PxHeightFieldGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldGeometry, HeightScale, PxHeightFieldGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldGeometry, RowScale, PxHeightFieldGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldGeometry, ColumnScale, PxHeightFieldGeometryGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldGeometry, HeightFieldFlags, PxHeightFieldGeometryGeneratedValues) struct PxHeightFieldGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxHeightFieldGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightField, PxHeightFieldGeometry, PxHeightField *, PxHeightField * > HeightField; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightScale, PxHeightFieldGeometry, PxReal, PxReal > HeightScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_RowScale, PxHeightFieldGeometry, PxReal, PxReal > RowScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_ColumnScale, PxHeightFieldGeometry, PxReal, PxReal > ColumnScale; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightFieldFlags, PxHeightFieldGeometry, PxMeshGeometryFlags, PxMeshGeometryFlags > HeightFieldFlags; PX_PHYSX_CORE_API PxHeightFieldGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxHeightFieldGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 5; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( HeightField, inStartIndex + 0 );; inOperator( HeightScale, inStartIndex + 1 );; inOperator( RowScale, inStartIndex + 2 );; inOperator( ColumnScale, inStartIndex + 3 );; inOperator( HeightFieldFlags, inStartIndex + 4 );; return 5 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxHeightFieldGeometry> { PxHeightFieldGeometryGeneratedInfo Info; const PxHeightFieldGeometryGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxSceneQueryUpdateMode__EnumConversion[] = { { "eBUILD_ENABLED_COMMIT_ENABLED", static_cast<PxU32>( physx::PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_ENABLED ) }, { "eBUILD_ENABLED_COMMIT_DISABLED", static_cast<PxU32>( physx::PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_DISABLED ) }, { "eBUILD_DISABLED_COMMIT_DISABLED", static_cast<PxU32>( physx::PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxSceneQueryUpdateMode::Enum > { PxEnumTraits() : NameConversion( g_physx__PxSceneQueryUpdateMode__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxHitFlag__EnumConversion[] = { { "ePOSITION", static_cast<PxU32>( physx::PxHitFlag::ePOSITION ) }, { "eNORMAL", static_cast<PxU32>( physx::PxHitFlag::eNORMAL ) }, { "eUV", static_cast<PxU32>( physx::PxHitFlag::eUV ) }, { "eASSUME_NO_INITIAL_OVERLAP", static_cast<PxU32>( physx::PxHitFlag::eASSUME_NO_INITIAL_OVERLAP ) }, { "eANY_HIT", static_cast<PxU32>( physx::PxHitFlag::eANY_HIT ) }, { "eMESH_MULTIPLE", static_cast<PxU32>( physx::PxHitFlag::eMESH_MULTIPLE ) }, { "eMESH_ANY", static_cast<PxU32>( physx::PxHitFlag::eMESH_ANY ) }, { "eMESH_BOTH_SIDES", static_cast<PxU32>( physx::PxHitFlag::eMESH_BOTH_SIDES ) }, { "ePRECISE_SWEEP", static_cast<PxU32>( physx::PxHitFlag::ePRECISE_SWEEP ) }, { "eMTD", static_cast<PxU32>( physx::PxHitFlag::eMTD ) }, { "eFACE_INDEX", static_cast<PxU32>( physx::PxHitFlag::eFACE_INDEX ) }, { "eDEFAULT", static_cast<PxU32>( physx::PxHitFlag::eDEFAULT ) }, { "eMODIFIABLE_FLAGS", static_cast<PxU32>( physx::PxHitFlag::eMODIFIABLE_FLAGS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxHitFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxHitFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxGeometryQueryFlag__EnumConversion[] = { { "eSIMD_GUARD", static_cast<PxU32>( physx::PxGeometryQueryFlag::eSIMD_GUARD ) }, { "eDEFAULT", static_cast<PxU32>( physx::PxGeometryQueryFlag::eDEFAULT ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxGeometryQueryFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxGeometryQueryFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxSceneQuerySystemBase; struct PxSceneQuerySystemBaseGeneratedValues { PxU32 DynamicTreeRebuildRateHint; PxSceneQueryUpdateMode::Enum UpdateMode; PxU32 StaticTimestamp; PX_PHYSX_CORE_API PxSceneQuerySystemBaseGeneratedValues( const PxSceneQuerySystemBase* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQuerySystemBase, DynamicTreeRebuildRateHint, PxSceneQuerySystemBaseGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQuerySystemBase, UpdateMode, PxSceneQuerySystemBaseGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQuerySystemBase, StaticTimestamp, PxSceneQuerySystemBaseGeneratedValues) struct PxSceneQuerySystemBaseGeneratedInfo { static const char* getClassName() { return "PxSceneQuerySystemBase"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQuerySystemBase_DynamicTreeRebuildRateHint, PxSceneQuerySystemBase, PxU32, PxU32 > DynamicTreeRebuildRateHint; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQuerySystemBase_UpdateMode, PxSceneQuerySystemBase, PxSceneQueryUpdateMode::Enum, PxSceneQueryUpdateMode::Enum > UpdateMode; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQuerySystemBase_StaticTimestamp, PxSceneQuerySystemBase, PxU32 > StaticTimestamp; PX_PHYSX_CORE_API PxSceneQuerySystemBaseGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSceneQuerySystemBase*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 3; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( DynamicTreeRebuildRateHint, inStartIndex + 0 );; inOperator( UpdateMode, inStartIndex + 1 );; inOperator( StaticTimestamp, inStartIndex + 2 );; return 3 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSceneQuerySystemBase> { PxSceneQuerySystemBaseGeneratedInfo Info; const PxSceneQuerySystemBaseGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxPruningStructureType__EnumConversion[] = { { "eNONE", static_cast<PxU32>( physx::PxPruningStructureType::eNONE ) }, { "eDYNAMIC_AABB_TREE", static_cast<PxU32>( physx::PxPruningStructureType::eDYNAMIC_AABB_TREE ) }, { "eSTATIC_AABB_TREE", static_cast<PxU32>( physx::PxPruningStructureType::eSTATIC_AABB_TREE ) }, { "eLAST", static_cast<PxU32>( physx::PxPruningStructureType::eLAST ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxPruningStructureType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxPruningStructureType__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxSceneSQSystem; struct PxSceneSQSystemGeneratedValues : PxSceneQuerySystemBaseGeneratedValues { PxSceneQueryUpdateMode::Enum SceneQueryUpdateMode; PxU32 SceneQueryStaticTimestamp; PxPruningStructureType::Enum StaticStructure; PxPruningStructureType::Enum DynamicStructure; PX_PHYSX_CORE_API PxSceneSQSystemGeneratedValues( const PxSceneSQSystem* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneSQSystem, SceneQueryUpdateMode, PxSceneSQSystemGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneSQSystem, SceneQueryStaticTimestamp, PxSceneSQSystemGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneSQSystem, StaticStructure, PxSceneSQSystemGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneSQSystem, DynamicStructure, PxSceneSQSystemGeneratedValues) struct PxSceneSQSystemGeneratedInfo : PxSceneQuerySystemBaseGeneratedInfo { static const char* getClassName() { return "PxSceneSQSystem"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneSQSystem_SceneQueryUpdateMode, PxSceneSQSystem, PxSceneQueryUpdateMode::Enum, PxSceneQueryUpdateMode::Enum > SceneQueryUpdateMode; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneSQSystem_SceneQueryStaticTimestamp, PxSceneSQSystem, PxU32 > SceneQueryStaticTimestamp; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneSQSystem_StaticStructure, PxSceneSQSystem, PxPruningStructureType::Enum > StaticStructure; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneSQSystem_DynamicStructure, PxSceneSQSystem, PxPruningStructureType::Enum > DynamicStructure; PX_PHYSX_CORE_API PxSceneSQSystemGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSceneSQSystem*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxSceneQuerySystemBaseGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxSceneQuerySystemBaseGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxSceneQuerySystemBaseGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 4; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxSceneQuerySystemBaseGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( SceneQueryUpdateMode, inStartIndex + 0 );; inOperator( SceneQueryStaticTimestamp, inStartIndex + 1 );; inOperator( StaticStructure, inStartIndex + 2 );; inOperator( DynamicStructure, inStartIndex + 3 );; return 4 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSceneSQSystem> { PxSceneSQSystemGeneratedInfo Info; const PxSceneSQSystemGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxSceneFlag__EnumConversion[] = { { "eENABLE_ACTIVE_ACTORS", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_ACTIVE_ACTORS ) }, { "eENABLE_CCD", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_CCD ) }, { "eDISABLE_CCD_RESWEEP", static_cast<PxU32>( physx::PxSceneFlag::eDISABLE_CCD_RESWEEP ) }, { "eENABLE_PCM", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_PCM ) }, { "eDISABLE_CONTACT_REPORT_BUFFER_RESIZE", static_cast<PxU32>( physx::PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE ) }, { "eDISABLE_CONTACT_CACHE", static_cast<PxU32>( physx::PxSceneFlag::eDISABLE_CONTACT_CACHE ) }, { "eREQUIRE_RW_LOCK", static_cast<PxU32>( physx::PxSceneFlag::eREQUIRE_RW_LOCK ) }, { "eENABLE_STABILIZATION", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_STABILIZATION ) }, { "eENABLE_AVERAGE_POINT", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_AVERAGE_POINT ) }, { "eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS", static_cast<PxU32>( physx::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS ) }, { "eENABLE_GPU_DYNAMICS", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_GPU_DYNAMICS ) }, { "eENABLE_ENHANCED_DETERMINISM", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_ENHANCED_DETERMINISM ) }, { "eENABLE_FRICTION_EVERY_ITERATION", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_FRICTION_EVERY_ITERATION ) }, { "eENABLE_DIRECT_GPU_API", static_cast<PxU32>( physx::PxSceneFlag::eENABLE_DIRECT_GPU_API ) }, { "eMUTABLE_FLAGS", static_cast<PxU32>( physx::PxSceneFlag::eMUTABLE_FLAGS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxSceneFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxSceneFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxActorTypeFlag__EnumConversion[] = { { "eRIGID_STATIC", static_cast<PxU32>( physx::PxActorTypeFlag::eRIGID_STATIC ) }, { "eRIGID_DYNAMIC", static_cast<PxU32>( physx::PxActorTypeFlag::eRIGID_DYNAMIC ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxActorTypeFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxActorTypeFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxParticleSolverType__EnumConversion[] = { { "ePBD", static_cast<PxU32>( physx::PxParticleSolverType::ePBD ) }, { "eFLIP", static_cast<PxU32>( physx::PxParticleSolverType::eFLIP ) }, { "eMPM", static_cast<PxU32>( physx::PxParticleSolverType::eMPM ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxParticleSolverType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxParticleSolverType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxPairFilteringMode__EnumConversion[] = { { "eKEEP", static_cast<PxU32>( physx::PxPairFilteringMode::eKEEP ) }, { "eSUPPRESS", static_cast<PxU32>( physx::PxPairFilteringMode::eSUPPRESS ) }, { "eKILL", static_cast<PxU32>( physx::PxPairFilteringMode::eKILL ) }, { "eDEFAULT", static_cast<PxU32>( physx::PxPairFilteringMode::eDEFAULT ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxPairFilteringMode::Enum > { PxEnumTraits() : NameConversion( g_physx__PxPairFilteringMode__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxFrictionType__EnumConversion[] = { { "ePATCH", static_cast<PxU32>( physx::PxFrictionType::ePATCH ) }, { "eONE_DIRECTIONAL", static_cast<PxU32>( physx::PxFrictionType::eONE_DIRECTIONAL ) }, { "eTWO_DIRECTIONAL", static_cast<PxU32>( physx::PxFrictionType::eTWO_DIRECTIONAL ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxFrictionType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxFrictionType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxSolverType__EnumConversion[] = { { "ePGS", static_cast<PxU32>( physx::PxSolverType::ePGS ) }, { "eTGS", static_cast<PxU32>( physx::PxSolverType::eTGS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxSolverType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxSolverType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxVisualizationParameter__EnumConversion[] = { { "eSCALE", static_cast<PxU32>( physx::PxVisualizationParameter::eSCALE ) }, { "eWORLD_AXES", static_cast<PxU32>( physx::PxVisualizationParameter::eWORLD_AXES ) }, { "eBODY_AXES", static_cast<PxU32>( physx::PxVisualizationParameter::eBODY_AXES ) }, { "eBODY_MASS_AXES", static_cast<PxU32>( physx::PxVisualizationParameter::eBODY_MASS_AXES ) }, { "eBODY_LIN_VELOCITY", static_cast<PxU32>( physx::PxVisualizationParameter::eBODY_LIN_VELOCITY ) }, { "eBODY_ANG_VELOCITY", static_cast<PxU32>( physx::PxVisualizationParameter::eBODY_ANG_VELOCITY ) }, { "eCONTACT_POINT", static_cast<PxU32>( physx::PxVisualizationParameter::eCONTACT_POINT ) }, { "eCONTACT_NORMAL", static_cast<PxU32>( physx::PxVisualizationParameter::eCONTACT_NORMAL ) }, { "eCONTACT_ERROR", static_cast<PxU32>( physx::PxVisualizationParameter::eCONTACT_ERROR ) }, { "eCONTACT_FORCE", static_cast<PxU32>( physx::PxVisualizationParameter::eCONTACT_FORCE ) }, { "eACTOR_AXES", static_cast<PxU32>( physx::PxVisualizationParameter::eACTOR_AXES ) }, { "eCOLLISION_AABBS", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_AABBS ) }, { "eCOLLISION_SHAPES", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_SHAPES ) }, { "eCOLLISION_AXES", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_AXES ) }, { "eCOLLISION_COMPOUNDS", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_COMPOUNDS ) }, { "eCOLLISION_FNORMALS", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_FNORMALS ) }, { "eCOLLISION_EDGES", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_EDGES ) }, { "eCOLLISION_STATIC", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_STATIC ) }, { "eCOLLISION_DYNAMIC", static_cast<PxU32>( physx::PxVisualizationParameter::eCOLLISION_DYNAMIC ) }, { "eJOINT_LOCAL_FRAMES", static_cast<PxU32>( physx::PxVisualizationParameter::eJOINT_LOCAL_FRAMES ) }, { "eJOINT_LIMITS", static_cast<PxU32>( physx::PxVisualizationParameter::eJOINT_LIMITS ) }, { "eCULL_BOX", static_cast<PxU32>( physx::PxVisualizationParameter::eCULL_BOX ) }, { "eMBP_REGIONS", static_cast<PxU32>( physx::PxVisualizationParameter::eMBP_REGIONS ) }, { "eSIMULATION_MESH", static_cast<PxU32>( physx::PxVisualizationParameter::eSIMULATION_MESH ) }, { "eSDF", static_cast<PxU32>( physx::PxVisualizationParameter::eSDF ) }, { "eNUM_VALUES", static_cast<PxU32>( physx::PxVisualizationParameter::eNUM_VALUES ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxVisualizationParameter::Enum > { PxEnumTraits() : NameConversion( g_physx__PxVisualizationParameter__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxBroadPhaseType__EnumConversion[] = { { "eSAP", static_cast<PxU32>( physx::PxBroadPhaseType::eSAP ) }, { "eMBP", static_cast<PxU32>( physx::PxBroadPhaseType::eMBP ) }, { "eABP", static_cast<PxU32>( physx::PxBroadPhaseType::eABP ) }, { "ePABP", static_cast<PxU32>( physx::PxBroadPhaseType::ePABP ) }, { "eGPU", static_cast<PxU32>( physx::PxBroadPhaseType::eGPU ) }, { "eLAST", static_cast<PxU32>( physx::PxBroadPhaseType::eLAST ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxBroadPhaseType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxBroadPhaseType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxArticulationGpuDataType__EnumConversion[] = { { "eJOINT_POSITION", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_POSITION ) }, { "eJOINT_VELOCITY", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_VELOCITY ) }, { "eJOINT_ACCELERATION", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_ACCELERATION ) }, { "eJOINT_FORCE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_FORCE ) }, { "eJOINT_SOLVER_FORCE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_SOLVER_FORCE ) }, { "eJOINT_TARGET_VELOCITY", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_TARGET_VELOCITY ) }, { "eJOINT_TARGET_POSITION", static_cast<PxU32>( physx::PxArticulationGpuDataType::eJOINT_TARGET_POSITION ) }, { "eSENSOR_FORCE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eSENSOR_FORCE ) }, { "eROOT_TRANSFORM", static_cast<PxU32>( physx::PxArticulationGpuDataType::eROOT_TRANSFORM ) }, { "eROOT_VELOCITY", static_cast<PxU32>( physx::PxArticulationGpuDataType::eROOT_VELOCITY ) }, { "eLINK_TRANSFORM", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_TRANSFORM ) }, { "eLINK_VELOCITY", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_VELOCITY ) }, { "eLINK_ACCELERATION", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_ACCELERATION ) }, { "eLINK_INCOMING_JOINT_FORCE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_INCOMING_JOINT_FORCE ) }, { "eLINK_FORCE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_FORCE ) }, { "eLINK_TORQUE", static_cast<PxU32>( physx::PxArticulationGpuDataType::eLINK_TORQUE ) }, { "eFIXED_TENDON", static_cast<PxU32>( physx::PxArticulationGpuDataType::eFIXED_TENDON ) }, { "eFIXED_TENDON_JOINT", static_cast<PxU32>( physx::PxArticulationGpuDataType::eFIXED_TENDON_JOINT ) }, { "eSPATIAL_TENDON", static_cast<PxU32>( physx::PxArticulationGpuDataType::eSPATIAL_TENDON ) }, { "eSPATIAL_TENDON_ATTACHMENT", static_cast<PxU32>( physx::PxArticulationGpuDataType::eSPATIAL_TENDON_ATTACHMENT ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationGpuDataType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationGpuDataType__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxSoftBodyGpuDataFlag__EnumConversion[] = { { "eTET_INDICES", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eTET_INDICES ) }, { "eTET_REST_POSES", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eTET_REST_POSES ) }, { "eTET_ROTATIONS", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eTET_ROTATIONS ) }, { "eTET_POSITION_INV_MASS", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eTET_POSITION_INV_MASS ) }, { "eSIM_TET_INDICES", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eSIM_TET_INDICES ) }, { "eSIM_TET_ROTATIONS", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eSIM_TET_ROTATIONS ) }, { "eSIM_VELOCITY_INV_MASS", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eSIM_VELOCITY_INV_MASS ) }, { "eSIM_POSITION_INV_MASS", static_cast<PxU32>( physx::PxSoftBodyGpuDataFlag::eSIM_POSITION_INV_MASS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxSoftBodyGpuDataFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxSoftBodyGpuDataFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxActorCacheFlag__EnumConversion[] = { { "eACTOR_DATA", static_cast<PxU32>( physx::PxActorCacheFlag::eACTOR_DATA ) }, { "eFORCE", static_cast<PxU32>( physx::PxActorCacheFlag::eFORCE ) }, { "eTORQUE", static_cast<PxU32>( physx::PxActorCacheFlag::eTORQUE ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxActorCacheFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxActorCacheFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxScene; struct PxSceneGeneratedValues : PxSceneSQSystemGeneratedValues { PxSceneFlags Flags; PxSceneLimits Limits; PxU32 Timestamp; const char * Name; PxCpuDispatcher * CpuDispatcher; PxCudaContextManager * CudaContextManager; PxSimulationEventCallback * SimulationEventCallback; PxContactModifyCallback * ContactModifyCallback; PxCCDContactModifyCallback * CCDContactModifyCallback; PxBroadPhaseCallback * BroadPhaseCallback; PxU32 FilterShaderDataSize; PxSimulationFilterShader FilterShader; PxSimulationFilterCallback * FilterCallback; PxPairFilteringMode::Enum KinematicKinematicFilteringMode; PxPairFilteringMode::Enum StaticKinematicFilteringMode; PxVec3 Gravity; PxReal BounceThresholdVelocity; PxU32 CCDMaxPasses; PxReal CCDMaxSeparation; PxReal CCDThreshold; PxReal MaxBiasCoefficient; PxReal FrictionOffsetThreshold; PxReal FrictionCorrelationDistance; PxFrictionType::Enum FrictionType; PxSolverType::Enum SolverType; PxBounds3 VisualizationCullingBox; PxBroadPhaseType::Enum BroadPhaseType; PxTaskManager * TaskManager; PxU32 MaxNbContactDataBlocksUsed; PxU32 ContactReportStreamBufferSize; PxU32 SolverBatchSize; PxU32 SolverArticulationBatchSize; PxReal WakeCounterResetValue; PxgDynamicsMemoryConfig GpuDynamicsConfig; void * UserData; PxSimulationStatistics SimulationStatistics; PX_PHYSX_CORE_API PxSceneGeneratedValues( const PxScene* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, Flags, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, Limits, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, Timestamp, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, Name, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CpuDispatcher, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CudaContextManager, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, SimulationEventCallback, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, ContactModifyCallback, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CCDContactModifyCallback, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, BroadPhaseCallback, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FilterShaderDataSize, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FilterShader, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FilterCallback, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, KinematicKinematicFilteringMode, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, StaticKinematicFilteringMode, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, Gravity, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, BounceThresholdVelocity, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CCDMaxPasses, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CCDMaxSeparation, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, CCDThreshold, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, MaxBiasCoefficient, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FrictionOffsetThreshold, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FrictionCorrelationDistance, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, FrictionType, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, SolverType, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, VisualizationCullingBox, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, BroadPhaseType, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, TaskManager, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, MaxNbContactDataBlocksUsed, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, ContactReportStreamBufferSize, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, SolverBatchSize, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, SolverArticulationBatchSize, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, WakeCounterResetValue, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, GpuDynamicsConfig, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, UserData, PxSceneGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxScene, SimulationStatistics, PxSceneGeneratedValues) struct PxSceneGeneratedInfo : PxSceneSQSystemGeneratedInfo { static const char* getClassName() { return "PxScene"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Flags, PxScene, PxSceneFlags > Flags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Limits, PxScene, const PxSceneLimits &, PxSceneLimits > Limits; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Timestamp, PxScene, PxU32 > Timestamp; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Name, PxScene, const char *, const char * > Name; PxReadOnlyFilteredCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Actors, PxScene, PxActor *, PxActorTypeFlags > Actors; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SoftBodies, PxScene, PxSoftBody * > SoftBodies; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Articulations, PxScene, PxArticulationReducedCoordinate * > Articulations; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Constraints, PxScene, PxConstraint * > Constraints; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Aggregates, PxScene, PxAggregate * > Aggregates; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CpuDispatcher, PxScene, PxCpuDispatcher * > CpuDispatcher; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CudaContextManager, PxScene, PxCudaContextManager * > CudaContextManager; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SimulationEventCallback, PxScene, PxSimulationEventCallback *, PxSimulationEventCallback * > SimulationEventCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_ContactModifyCallback, PxScene, PxContactModifyCallback *, PxContactModifyCallback * > ContactModifyCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDContactModifyCallback, PxScene, PxCCDContactModifyCallback *, PxCCDContactModifyCallback * > CCDContactModifyCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseCallback, PxScene, PxBroadPhaseCallback *, PxBroadPhaseCallback * > BroadPhaseCallback; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterShaderDataSize, PxScene, PxU32 > FilterShaderDataSize; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterShader, PxScene, PxSimulationFilterShader > FilterShader; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterCallback, PxScene, PxSimulationFilterCallback * > FilterCallback; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_KinematicKinematicFilteringMode, PxScene, PxPairFilteringMode::Enum > KinematicKinematicFilteringMode; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_StaticKinematicFilteringMode, PxScene, PxPairFilteringMode::Enum > StaticKinematicFilteringMode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Gravity, PxScene, const PxVec3 &, PxVec3 > Gravity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BounceThresholdVelocity, PxScene, const PxReal, PxReal > BounceThresholdVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDMaxPasses, PxScene, PxU32, PxU32 > CCDMaxPasses; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDMaxSeparation, PxScene, const PxReal, PxReal > CCDMaxSeparation; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDThreshold, PxScene, const PxReal, PxReal > CCDThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_MaxBiasCoefficient, PxScene, const PxReal, PxReal > MaxBiasCoefficient; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FrictionOffsetThreshold, PxScene, const PxReal, PxReal > FrictionOffsetThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FrictionCorrelationDistance, PxScene, const PxReal, PxReal > FrictionCorrelationDistance; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FrictionType, PxScene, PxFrictionType::Enum > FrictionType; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SolverType, PxScene, PxSolverType::Enum > SolverType; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_VisualizationCullingBox, PxScene, const PxBounds3 &, PxBounds3 > VisualizationCullingBox; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseType, PxScene, PxBroadPhaseType::Enum > BroadPhaseType; PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseRegions, PxScene, PxBroadPhaseRegionInfo > BroadPhaseRegions; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_TaskManager, PxScene, PxTaskManager * > TaskManager; PxWriteOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_NbContactDataBlocks, PxScene, PxU32 > NbContactDataBlocks; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_MaxNbContactDataBlocksUsed, PxScene, PxU32 > MaxNbContactDataBlocksUsed; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_ContactReportStreamBufferSize, PxScene, PxU32 > ContactReportStreamBufferSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SolverBatchSize, PxScene, PxU32, PxU32 > SolverBatchSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SolverArticulationBatchSize, PxScene, PxU32, PxU32 > SolverArticulationBatchSize; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_WakeCounterResetValue, PxScene, PxReal > WakeCounterResetValue; PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_GpuDynamicsConfig, PxScene, PxgDynamicsMemoryConfig > GpuDynamicsConfig; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_UserData, PxScene, void *, void * > UserData; SimulationStatisticsProperty SimulationStatistics; PX_PHYSX_CORE_API PxSceneGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxScene*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxSceneSQSystemGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxSceneSQSystemGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxSceneSQSystemGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 43; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxSceneSQSystemGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Flags, inStartIndex + 0 );; inOperator( Limits, inStartIndex + 1 );; inOperator( Timestamp, inStartIndex + 2 );; inOperator( Name, inStartIndex + 3 );; inOperator( Actors, inStartIndex + 4 );; inOperator( SoftBodies, inStartIndex + 5 );; inOperator( Articulations, inStartIndex + 6 );; inOperator( Constraints, inStartIndex + 7 );; inOperator( Aggregates, inStartIndex + 8 );; inOperator( CpuDispatcher, inStartIndex + 9 );; inOperator( CudaContextManager, inStartIndex + 10 );; inOperator( SimulationEventCallback, inStartIndex + 11 );; inOperator( ContactModifyCallback, inStartIndex + 12 );; inOperator( CCDContactModifyCallback, inStartIndex + 13 );; inOperator( BroadPhaseCallback, inStartIndex + 14 );; inOperator( FilterShaderDataSize, inStartIndex + 15 );; inOperator( FilterShader, inStartIndex + 16 );; inOperator( FilterCallback, inStartIndex + 17 );; inOperator( KinematicKinematicFilteringMode, inStartIndex + 18 );; inOperator( StaticKinematicFilteringMode, inStartIndex + 19 );; inOperator( Gravity, inStartIndex + 20 );; inOperator( BounceThresholdVelocity, inStartIndex + 21 );; inOperator( CCDMaxPasses, inStartIndex + 22 );; inOperator( CCDMaxSeparation, inStartIndex + 23 );; inOperator( CCDThreshold, inStartIndex + 24 );; inOperator( MaxBiasCoefficient, inStartIndex + 25 );; inOperator( FrictionOffsetThreshold, inStartIndex + 26 );; inOperator( FrictionCorrelationDistance, inStartIndex + 27 );; inOperator( FrictionType, inStartIndex + 28 );; inOperator( SolverType, inStartIndex + 29 );; inOperator( VisualizationCullingBox, inStartIndex + 30 );; inOperator( BroadPhaseType, inStartIndex + 31 );; inOperator( BroadPhaseRegions, inStartIndex + 32 );; inOperator( TaskManager, inStartIndex + 33 );; inOperator( NbContactDataBlocks, inStartIndex + 34 );; inOperator( MaxNbContactDataBlocksUsed, inStartIndex + 35 );; inOperator( ContactReportStreamBufferSize, inStartIndex + 36 );; inOperator( SolverBatchSize, inStartIndex + 37 );; inOperator( SolverArticulationBatchSize, inStartIndex + 38 );; inOperator( WakeCounterResetValue, inStartIndex + 39 );; inOperator( GpuDynamicsConfig, inStartIndex + 40 );; inOperator( UserData, inStartIndex + 41 );; inOperator( SimulationStatistics, inStartIndex + 42 );; return 43 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxScene> { PxSceneGeneratedInfo Info; const PxSceneGeneratedInfo* getInfo() { return &Info; } }; class PxTetrahedronMeshGeometry; struct PxTetrahedronMeshGeometryGeneratedValues : PxGeometryGeneratedValues { PxTetrahedronMesh * TetrahedronMesh; PX_PHYSX_CORE_API PxTetrahedronMeshGeometryGeneratedValues( const PxTetrahedronMeshGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxTetrahedronMeshGeometry, TetrahedronMesh, PxTetrahedronMeshGeometryGeneratedValues) struct PxTetrahedronMeshGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxTetrahedronMeshGeometry"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTetrahedronMeshGeometry_TetrahedronMesh, PxTetrahedronMeshGeometry, PxTetrahedronMesh *, PxTetrahedronMesh * > TetrahedronMesh; PX_PHYSX_CORE_API PxTetrahedronMeshGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxTetrahedronMeshGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( TetrahedronMesh, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxTetrahedronMeshGeometry> { PxTetrahedronMeshGeometryGeneratedInfo Info; const PxTetrahedronMeshGeometryGeneratedInfo* getInfo() { return &Info; } }; class PxCustomGeometry; struct PxCustomGeometryGeneratedValues : PxGeometryGeneratedValues { PxU32 CustomType; PX_PHYSX_CORE_API PxCustomGeometryGeneratedValues( const PxCustomGeometry* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxCustomGeometry, CustomType, PxCustomGeometryGeneratedValues) struct PxCustomGeometryGeneratedInfo : PxGeometryGeneratedInfo { static const char* getClassName() { return "PxCustomGeometry"; } PxCustomGeometryCustomTypeProperty CustomType; PX_PHYSX_CORE_API PxCustomGeometryGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxCustomGeometry*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxGeometryGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 1; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( CustomType, inStartIndex + 0 );; return 1 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxCustomGeometry> { PxCustomGeometryGeneratedInfo Info; const PxCustomGeometryGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxHeightFieldFormat__EnumConversion[] = { { "eS16_TM", static_cast<PxU32>( physx::PxHeightFieldFormat::eS16_TM ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxHeightFieldFormat::Enum > { PxEnumTraits() : NameConversion( g_physx__PxHeightFieldFormat__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxHeightFieldFlag__EnumConversion[] = { { "eNO_BOUNDARY_EDGES", static_cast<PxU32>( physx::PxHeightFieldFlag::eNO_BOUNDARY_EDGES ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxHeightFieldFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxHeightFieldFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxHeightFieldDesc; struct PxHeightFieldDescGeneratedValues { PxU32 NbRows; PxU32 NbColumns; PxHeightFieldFormat::Enum Format; PxStridedData Samples; PxReal ConvexEdgeThreshold; PxHeightFieldFlags Flags; PX_PHYSX_CORE_API PxHeightFieldDescGeneratedValues( const PxHeightFieldDesc* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, NbRows, PxHeightFieldDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, NbColumns, PxHeightFieldDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, Format, PxHeightFieldDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, Samples, PxHeightFieldDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, ConvexEdgeThreshold, PxHeightFieldDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxHeightFieldDesc, Flags, PxHeightFieldDescGeneratedValues) struct PxHeightFieldDescGeneratedInfo { static const char* getClassName() { return "PxHeightFieldDesc"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_NbRows, PxHeightFieldDesc, PxU32, PxU32 > NbRows; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_NbColumns, PxHeightFieldDesc, PxU32, PxU32 > NbColumns; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Format, PxHeightFieldDesc, PxHeightFieldFormat::Enum, PxHeightFieldFormat::Enum > Format; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Samples, PxHeightFieldDesc, PxStridedData, PxStridedData > Samples; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_ConvexEdgeThreshold, PxHeightFieldDesc, PxReal, PxReal > ConvexEdgeThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Flags, PxHeightFieldDesc, PxHeightFieldFlags, PxHeightFieldFlags > Flags; PX_PHYSX_CORE_API PxHeightFieldDescGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxHeightFieldDesc*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 6; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( NbRows, inStartIndex + 0 );; inOperator( NbColumns, inStartIndex + 1 );; inOperator( Format, inStartIndex + 2 );; inOperator( Samples, inStartIndex + 3 );; inOperator( ConvexEdgeThreshold, inStartIndex + 4 );; inOperator( Flags, inStartIndex + 5 );; return 6 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxHeightFieldDesc> { PxHeightFieldDescGeneratedInfo Info; const PxHeightFieldDescGeneratedInfo* getInfo() { return &Info; } }; struct PxArticulationLimit; struct PxArticulationLimitGeneratedValues { PxReal Low; PxReal High; PX_PHYSX_CORE_API PxArticulationLimitGeneratedValues( const PxArticulationLimit* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLimit, Low, PxArticulationLimitGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationLimit, High, PxArticulationLimitGeneratedValues) struct PxArticulationLimitGeneratedInfo { static const char* getClassName() { return "PxArticulationLimit"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLimit_Low, PxArticulationLimit, PxReal, PxReal > Low; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLimit_High, PxArticulationLimit, PxReal, PxReal > High; PX_PHYSX_CORE_API PxArticulationLimitGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxArticulationLimit*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 2; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Low, inStartIndex + 0 );; inOperator( High, inStartIndex + 1 );; return 2 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxArticulationLimit> { PxArticulationLimitGeneratedInfo Info; const PxArticulationLimitGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxArticulationDriveType__EnumConversion[] = { { "eFORCE", static_cast<PxU32>( physx::PxArticulationDriveType::eFORCE ) }, { "eACCELERATION", static_cast<PxU32>( physx::PxArticulationDriveType::eACCELERATION ) }, { "eTARGET", static_cast<PxU32>( physx::PxArticulationDriveType::eTARGET ) }, { "eVELOCITY", static_cast<PxU32>( physx::PxArticulationDriveType::eVELOCITY ) }, { "eNONE", static_cast<PxU32>( physx::PxArticulationDriveType::eNONE ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxArticulationDriveType::Enum > { PxEnumTraits() : NameConversion( g_physx__PxArticulationDriveType__EnumConversion ) {} const PxU32ToName* NameConversion; }; struct PxArticulationDrive; struct PxArticulationDriveGeneratedValues { PxReal Stiffness; PxReal Damping; PxReal MaxForce; PxArticulationDriveType::Enum DriveType; PX_PHYSX_CORE_API PxArticulationDriveGeneratedValues( const PxArticulationDrive* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationDrive, Stiffness, PxArticulationDriveGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationDrive, Damping, PxArticulationDriveGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationDrive, MaxForce, PxArticulationDriveGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxArticulationDrive, DriveType, PxArticulationDriveGeneratedValues) struct PxArticulationDriveGeneratedInfo { static const char* getClassName() { return "PxArticulationDrive"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationDrive_Stiffness, PxArticulationDrive, PxReal, PxReal > Stiffness; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationDrive_Damping, PxArticulationDrive, PxReal, PxReal > Damping; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationDrive_MaxForce, PxArticulationDrive, PxReal, PxReal > MaxForce; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationDrive_DriveType, PxArticulationDrive, PxArticulationDriveType::Enum, PxArticulationDriveType::Enum > DriveType; PX_PHYSX_CORE_API PxArticulationDriveGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxArticulationDrive*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 4; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( Stiffness, inStartIndex + 0 );; inOperator( Damping, inStartIndex + 1 );; inOperator( MaxForce, inStartIndex + 2 );; inOperator( DriveType, inStartIndex + 3 );; return 4 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxArticulationDrive> { PxArticulationDriveGeneratedInfo Info; const PxArticulationDriveGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxDynamicTreeSecondaryPruner__EnumConversion[] = { { "eNONE", static_cast<PxU32>( physx::PxDynamicTreeSecondaryPruner::eNONE ) }, { "eBUCKET", static_cast<PxU32>( physx::PxDynamicTreeSecondaryPruner::eBUCKET ) }, { "eINCREMENTAL", static_cast<PxU32>( physx::PxDynamicTreeSecondaryPruner::eINCREMENTAL ) }, { "eBVH", static_cast<PxU32>( physx::PxDynamicTreeSecondaryPruner::eBVH ) }, { "eLAST", static_cast<PxU32>( physx::PxDynamicTreeSecondaryPruner::eLAST ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxDynamicTreeSecondaryPruner::Enum > { PxEnumTraits() : NameConversion( g_physx__PxDynamicTreeSecondaryPruner__EnumConversion ) {} const PxU32ToName* NameConversion; }; static PxU32ToName g_physx__PxBVHBuildStrategy__EnumConversion[] = { { "eFAST", static_cast<PxU32>( physx::PxBVHBuildStrategy::eFAST ) }, { "eDEFAULT", static_cast<PxU32>( physx::PxBVHBuildStrategy::eDEFAULT ) }, { "eSAH", static_cast<PxU32>( physx::PxBVHBuildStrategy::eSAH ) }, { "eLAST", static_cast<PxU32>( physx::PxBVHBuildStrategy::eLAST ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxBVHBuildStrategy::Enum > { PxEnumTraits() : NameConversion( g_physx__PxBVHBuildStrategy__EnumConversion ) {} const PxU32ToName* NameConversion; }; class PxSceneQueryDesc; struct PxSceneQueryDescGeneratedValues { _Bool IsValid; PxPruningStructureType::Enum StaticStructure; PxPruningStructureType::Enum DynamicStructure; PxU32 DynamicTreeRebuildRateHint; PxDynamicTreeSecondaryPruner::Enum DynamicTreeSecondaryPruner; PxBVHBuildStrategy::Enum StaticBVHBuildStrategy; PxBVHBuildStrategy::Enum DynamicBVHBuildStrategy; PxU32 StaticNbObjectsPerNode; PxU32 DynamicNbObjectsPerNode; PxSceneQueryUpdateMode::Enum SceneQueryUpdateMode; PX_PHYSX_CORE_API PxSceneQueryDescGeneratedValues( const PxSceneQueryDesc* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, IsValid, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, StaticStructure, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, DynamicStructure, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, DynamicTreeRebuildRateHint, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, DynamicTreeSecondaryPruner, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, StaticBVHBuildStrategy, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, DynamicBVHBuildStrategy, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, StaticNbObjectsPerNode, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, DynamicNbObjectsPerNode, PxSceneQueryDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneQueryDesc, SceneQueryUpdateMode, PxSceneQueryDescGeneratedValues) struct PxSceneQueryDescGeneratedInfo { static const char* getClassName() { return "PxSceneQueryDesc"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_IsValid, PxSceneQueryDesc, _Bool > IsValid; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_StaticStructure, PxSceneQueryDesc, PxPruningStructureType::Enum, PxPruningStructureType::Enum > StaticStructure; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_DynamicStructure, PxSceneQueryDesc, PxPruningStructureType::Enum, PxPruningStructureType::Enum > DynamicStructure; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_DynamicTreeRebuildRateHint, PxSceneQueryDesc, PxU32, PxU32 > DynamicTreeRebuildRateHint; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_DynamicTreeSecondaryPruner, PxSceneQueryDesc, PxDynamicTreeSecondaryPruner::Enum, PxDynamicTreeSecondaryPruner::Enum > DynamicTreeSecondaryPruner; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_StaticBVHBuildStrategy, PxSceneQueryDesc, PxBVHBuildStrategy::Enum, PxBVHBuildStrategy::Enum > StaticBVHBuildStrategy; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_DynamicBVHBuildStrategy, PxSceneQueryDesc, PxBVHBuildStrategy::Enum, PxBVHBuildStrategy::Enum > DynamicBVHBuildStrategy; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_StaticNbObjectsPerNode, PxSceneQueryDesc, PxU32, PxU32 > StaticNbObjectsPerNode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_DynamicNbObjectsPerNode, PxSceneQueryDesc, PxU32, PxU32 > DynamicNbObjectsPerNode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneQueryDesc_SceneQueryUpdateMode, PxSceneQueryDesc, PxSceneQueryUpdateMode::Enum, PxSceneQueryUpdateMode::Enum > SceneQueryUpdateMode; PX_PHYSX_CORE_API PxSceneQueryDescGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSceneQueryDesc*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 10; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( IsValid, inStartIndex + 0 );; inOperator( StaticStructure, inStartIndex + 1 );; inOperator( DynamicStructure, inStartIndex + 2 );; inOperator( DynamicTreeRebuildRateHint, inStartIndex + 3 );; inOperator( DynamicTreeSecondaryPruner, inStartIndex + 4 );; inOperator( StaticBVHBuildStrategy, inStartIndex + 5 );; inOperator( DynamicBVHBuildStrategy, inStartIndex + 6 );; inOperator( StaticNbObjectsPerNode, inStartIndex + 7 );; inOperator( DynamicNbObjectsPerNode, inStartIndex + 8 );; inOperator( SceneQueryUpdateMode, inStartIndex + 9 );; return 10 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSceneQueryDesc> { PxSceneQueryDescGeneratedInfo Info; const PxSceneQueryDescGeneratedInfo* getInfo() { return &Info; } }; class PxSceneDesc; struct PxSceneDescGeneratedValues : PxSceneQueryDescGeneratedValues { PxVec3 Gravity; PxSimulationEventCallback * SimulationEventCallback; PxContactModifyCallback * ContactModifyCallback; PxCCDContactModifyCallback * CcdContactModifyCallback; const void * FilterShaderData; PxU32 FilterShaderDataSize; PxSimulationFilterShader FilterShader; PxSimulationFilterCallback * FilterCallback; PxPairFilteringMode::Enum KineKineFilteringMode; PxPairFilteringMode::Enum StaticKineFilteringMode; PxBroadPhaseType::Enum BroadPhaseType; PxBroadPhaseCallback * BroadPhaseCallback; PxSceneLimits Limits; PxFrictionType::Enum FrictionType; PxSolverType::Enum SolverType; PxReal BounceThresholdVelocity; PxReal FrictionOffsetThreshold; PxReal FrictionCorrelationDistance; PxSceneFlags Flags; PxCpuDispatcher * CpuDispatcher; PxCudaContextManager * CudaContextManager; void * UserData; PxU32 SolverBatchSize; PxU32 SolverArticulationBatchSize; PxU32 NbContactDataBlocks; PxU32 MaxNbContactDataBlocks; PxReal MaxBiasCoefficient; PxU32 ContactReportStreamBufferSize; PxU32 CcdMaxPasses; PxReal CcdThreshold; PxReal CcdMaxSeparation; PxReal WakeCounterResetValue; PxBounds3 SanityBounds; PxgDynamicsMemoryConfig GpuDynamicsConfig; PxU32 GpuMaxNumPartitions; PxU32 GpuMaxNumStaticPartitions; PxU32 GpuComputeVersion; PxU32 ContactPairSlabSize; PX_PHYSX_CORE_API PxSceneDescGeneratedValues( const PxSceneDesc* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, Gravity, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, SimulationEventCallback, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, ContactModifyCallback, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CcdContactModifyCallback, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FilterShaderData, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FilterShaderDataSize, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FilterShader, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FilterCallback, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, KineKineFilteringMode, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, StaticKineFilteringMode, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, BroadPhaseType, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, BroadPhaseCallback, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, Limits, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FrictionType, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, SolverType, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, BounceThresholdVelocity, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FrictionOffsetThreshold, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, FrictionCorrelationDistance, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, Flags, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CpuDispatcher, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CudaContextManager, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, UserData, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, SolverBatchSize, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, SolverArticulationBatchSize, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, NbContactDataBlocks, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, MaxNbContactDataBlocks, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, MaxBiasCoefficient, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, ContactReportStreamBufferSize, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CcdMaxPasses, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CcdThreshold, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, CcdMaxSeparation, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, WakeCounterResetValue, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, SanityBounds, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, GpuDynamicsConfig, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, GpuMaxNumPartitions, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, GpuMaxNumStaticPartitions, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, GpuComputeVersion, PxSceneDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneDesc, ContactPairSlabSize, PxSceneDescGeneratedValues) struct PxSceneDescGeneratedInfo : PxSceneQueryDescGeneratedInfo { static const char* getClassName() { return "PxSceneDesc"; } PxWriteOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ToDefault, PxSceneDesc, const PxTolerancesScale & > ToDefault; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Gravity, PxSceneDesc, PxVec3, PxVec3 > Gravity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SimulationEventCallback, PxSceneDesc, PxSimulationEventCallback *, PxSimulationEventCallback * > SimulationEventCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ContactModifyCallback, PxSceneDesc, PxContactModifyCallback *, PxContactModifyCallback * > ContactModifyCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdContactModifyCallback, PxSceneDesc, PxCCDContactModifyCallback *, PxCCDContactModifyCallback * > CcdContactModifyCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShaderData, PxSceneDesc, const void *, const void * > FilterShaderData; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShaderDataSize, PxSceneDesc, PxU32, PxU32 > FilterShaderDataSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShader, PxSceneDesc, PxSimulationFilterShader, PxSimulationFilterShader > FilterShader; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterCallback, PxSceneDesc, PxSimulationFilterCallback *, PxSimulationFilterCallback * > FilterCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_KineKineFilteringMode, PxSceneDesc, PxPairFilteringMode::Enum, PxPairFilteringMode::Enum > KineKineFilteringMode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_StaticKineFilteringMode, PxSceneDesc, PxPairFilteringMode::Enum, PxPairFilteringMode::Enum > StaticKineFilteringMode; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BroadPhaseType, PxSceneDesc, PxBroadPhaseType::Enum, PxBroadPhaseType::Enum > BroadPhaseType; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BroadPhaseCallback, PxSceneDesc, PxBroadPhaseCallback *, PxBroadPhaseCallback * > BroadPhaseCallback; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Limits, PxSceneDesc, PxSceneLimits, PxSceneLimits > Limits; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FrictionType, PxSceneDesc, PxFrictionType::Enum, PxFrictionType::Enum > FrictionType; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverType, PxSceneDesc, PxSolverType::Enum, PxSolverType::Enum > SolverType; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BounceThresholdVelocity, PxSceneDesc, PxReal, PxReal > BounceThresholdVelocity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FrictionOffsetThreshold, PxSceneDesc, PxReal, PxReal > FrictionOffsetThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FrictionCorrelationDistance, PxSceneDesc, PxReal, PxReal > FrictionCorrelationDistance; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Flags, PxSceneDesc, PxSceneFlags, PxSceneFlags > Flags; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CpuDispatcher, PxSceneDesc, PxCpuDispatcher *, PxCpuDispatcher * > CpuDispatcher; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CudaContextManager, PxSceneDesc, PxCudaContextManager *, PxCudaContextManager * > CudaContextManager; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_UserData, PxSceneDesc, void *, void * > UserData; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverBatchSize, PxSceneDesc, PxU32, PxU32 > SolverBatchSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverArticulationBatchSize, PxSceneDesc, PxU32, PxU32 > SolverArticulationBatchSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_NbContactDataBlocks, PxSceneDesc, PxU32, PxU32 > NbContactDataBlocks; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_MaxNbContactDataBlocks, PxSceneDesc, PxU32, PxU32 > MaxNbContactDataBlocks; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_MaxBiasCoefficient, PxSceneDesc, PxReal, PxReal > MaxBiasCoefficient; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ContactReportStreamBufferSize, PxSceneDesc, PxU32, PxU32 > ContactReportStreamBufferSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdMaxPasses, PxSceneDesc, PxU32, PxU32 > CcdMaxPasses; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdThreshold, PxSceneDesc, PxReal, PxReal > CcdThreshold; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdMaxSeparation, PxSceneDesc, PxReal, PxReal > CcdMaxSeparation; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_WakeCounterResetValue, PxSceneDesc, PxReal, PxReal > WakeCounterResetValue; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SanityBounds, PxSceneDesc, PxBounds3, PxBounds3 > SanityBounds; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuDynamicsConfig, PxSceneDesc, PxgDynamicsMemoryConfig, PxgDynamicsMemoryConfig > GpuDynamicsConfig; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuMaxNumPartitions, PxSceneDesc, PxU32, PxU32 > GpuMaxNumPartitions; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuMaxNumStaticPartitions, PxSceneDesc, PxU32, PxU32 > GpuMaxNumStaticPartitions; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuComputeVersion, PxSceneDesc, PxU32, PxU32 > GpuComputeVersion; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ContactPairSlabSize, PxSceneDesc, PxU32, PxU32 > ContactPairSlabSize; PX_PHYSX_CORE_API PxSceneDescGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSceneDesc*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); inOperator( *static_cast<PxSceneQueryDescGeneratedInfo*>( this ) ); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inStartIndex = PxSceneQueryDescGeneratedInfo::visitBaseProperties( inOperator, inStartIndex ); inStartIndex = PxSceneQueryDescGeneratedInfo::visitInstanceProperties( inOperator, inStartIndex ); return inStartIndex; } static PxU32 instancePropertyCount() { return 39; } static PxU32 totalPropertyCount() { return instancePropertyCount() + PxSceneQueryDescGeneratedInfo::totalPropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( ToDefault, inStartIndex + 0 );; inOperator( Gravity, inStartIndex + 1 );; inOperator( SimulationEventCallback, inStartIndex + 2 );; inOperator( ContactModifyCallback, inStartIndex + 3 );; inOperator( CcdContactModifyCallback, inStartIndex + 4 );; inOperator( FilterShaderData, inStartIndex + 5 );; inOperator( FilterShaderDataSize, inStartIndex + 6 );; inOperator( FilterShader, inStartIndex + 7 );; inOperator( FilterCallback, inStartIndex + 8 );; inOperator( KineKineFilteringMode, inStartIndex + 9 );; inOperator( StaticKineFilteringMode, inStartIndex + 10 );; inOperator( BroadPhaseType, inStartIndex + 11 );; inOperator( BroadPhaseCallback, inStartIndex + 12 );; inOperator( Limits, inStartIndex + 13 );; inOperator( FrictionType, inStartIndex + 14 );; inOperator( SolverType, inStartIndex + 15 );; inOperator( BounceThresholdVelocity, inStartIndex + 16 );; inOperator( FrictionOffsetThreshold, inStartIndex + 17 );; inOperator( FrictionCorrelationDistance, inStartIndex + 18 );; inOperator( Flags, inStartIndex + 19 );; inOperator( CpuDispatcher, inStartIndex + 20 );; inOperator( CudaContextManager, inStartIndex + 21 );; inOperator( UserData, inStartIndex + 22 );; inOperator( SolverBatchSize, inStartIndex + 23 );; inOperator( SolverArticulationBatchSize, inStartIndex + 24 );; inOperator( NbContactDataBlocks, inStartIndex + 25 );; inOperator( MaxNbContactDataBlocks, inStartIndex + 26 );; inOperator( MaxBiasCoefficient, inStartIndex + 27 );; inOperator( ContactReportStreamBufferSize, inStartIndex + 28 );; inOperator( CcdMaxPasses, inStartIndex + 29 );; inOperator( CcdThreshold, inStartIndex + 30 );; inOperator( CcdMaxSeparation, inStartIndex + 31 );; inOperator( WakeCounterResetValue, inStartIndex + 32 );; inOperator( SanityBounds, inStartIndex + 33 );; inOperator( GpuDynamicsConfig, inStartIndex + 34 );; inOperator( GpuMaxNumPartitions, inStartIndex + 35 );; inOperator( GpuMaxNumStaticPartitions, inStartIndex + 36 );; inOperator( GpuComputeVersion, inStartIndex + 37 );; inOperator( ContactPairSlabSize, inStartIndex + 38 );; return 39 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSceneDesc> { PxSceneDescGeneratedInfo Info; const PxSceneDescGeneratedInfo* getInfo() { return &Info; } }; class PxBroadPhaseDesc; struct PxBroadPhaseDescGeneratedValues { _Bool IsValid; PxBroadPhaseType::Enum MType; PxU64 MContextID; PxCudaContextManager * MContextManager; PxU32 MFoundLostPairsCapacity; _Bool MDiscardStaticVsKinematic; _Bool MDiscardKinematicVsKinematic; PX_PHYSX_CORE_API PxBroadPhaseDescGeneratedValues( const PxBroadPhaseDesc* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, IsValid, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MType, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MContextID, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MContextManager, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MFoundLostPairsCapacity, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MDiscardStaticVsKinematic, PxBroadPhaseDescGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxBroadPhaseDesc, MDiscardKinematicVsKinematic, PxBroadPhaseDescGeneratedValues) struct PxBroadPhaseDescGeneratedInfo { static const char* getClassName() { return "PxBroadPhaseDesc"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_IsValid, PxBroadPhaseDesc, _Bool > IsValid; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MType, PxBroadPhaseDesc, PxBroadPhaseType::Enum, PxBroadPhaseType::Enum > MType; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MContextID, PxBroadPhaseDesc, PxU64, PxU64 > MContextID; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MContextManager, PxBroadPhaseDesc, PxCudaContextManager *, PxCudaContextManager * > MContextManager; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MFoundLostPairsCapacity, PxBroadPhaseDesc, PxU32, PxU32 > MFoundLostPairsCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MDiscardStaticVsKinematic, PxBroadPhaseDesc, _Bool, _Bool > MDiscardStaticVsKinematic; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBroadPhaseDesc_MDiscardKinematicVsKinematic, PxBroadPhaseDesc, _Bool, _Bool > MDiscardKinematicVsKinematic; PX_PHYSX_CORE_API PxBroadPhaseDescGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxBroadPhaseDesc*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 7; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( IsValid, inStartIndex + 0 );; inOperator( MType, inStartIndex + 1 );; inOperator( MContextID, inStartIndex + 2 );; inOperator( MContextManager, inStartIndex + 3 );; inOperator( MFoundLostPairsCapacity, inStartIndex + 4 );; inOperator( MDiscardStaticVsKinematic, inStartIndex + 5 );; inOperator( MDiscardKinematicVsKinematic, inStartIndex + 6 );; return 7 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxBroadPhaseDesc> { PxBroadPhaseDescGeneratedInfo Info; const PxBroadPhaseDescGeneratedInfo* getInfo() { return &Info; } }; class PxSceneLimits; struct PxSceneLimitsGeneratedValues { PxU32 MaxNbActors; PxU32 MaxNbBodies; PxU32 MaxNbStaticShapes; PxU32 MaxNbDynamicShapes; PxU32 MaxNbAggregates; PxU32 MaxNbConstraints; PxU32 MaxNbRegions; PxU32 MaxNbBroadPhaseOverlaps; PX_PHYSX_CORE_API PxSceneLimitsGeneratedValues( const PxSceneLimits* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbActors, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbBodies, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbStaticShapes, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbDynamicShapes, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbAggregates, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbConstraints, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbRegions, PxSceneLimitsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSceneLimits, MaxNbBroadPhaseOverlaps, PxSceneLimitsGeneratedValues) struct PxSceneLimitsGeneratedInfo { static const char* getClassName() { return "PxSceneLimits"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbActors, PxSceneLimits, PxU32, PxU32 > MaxNbActors; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbBodies, PxSceneLimits, PxU32, PxU32 > MaxNbBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbStaticShapes, PxSceneLimits, PxU32, PxU32 > MaxNbStaticShapes; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbDynamicShapes, PxSceneLimits, PxU32, PxU32 > MaxNbDynamicShapes; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbAggregates, PxSceneLimits, PxU32, PxU32 > MaxNbAggregates; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbConstraints, PxSceneLimits, PxU32, PxU32 > MaxNbConstraints; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbRegions, PxSceneLimits, PxU32, PxU32 > MaxNbRegions; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbBroadPhaseOverlaps, PxSceneLimits, PxU32, PxU32 > MaxNbBroadPhaseOverlaps; PX_PHYSX_CORE_API PxSceneLimitsGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSceneLimits*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 8; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( MaxNbActors, inStartIndex + 0 );; inOperator( MaxNbBodies, inStartIndex + 1 );; inOperator( MaxNbStaticShapes, inStartIndex + 2 );; inOperator( MaxNbDynamicShapes, inStartIndex + 3 );; inOperator( MaxNbAggregates, inStartIndex + 4 );; inOperator( MaxNbConstraints, inStartIndex + 5 );; inOperator( MaxNbRegions, inStartIndex + 6 );; inOperator( MaxNbBroadPhaseOverlaps, inStartIndex + 7 );; return 8 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSceneLimits> { PxSceneLimitsGeneratedInfo Info; const PxSceneLimitsGeneratedInfo* getInfo() { return &Info; } }; struct PxgDynamicsMemoryConfig; struct PxgDynamicsMemoryConfigGeneratedValues { _Bool IsValid; PxU32 TempBufferCapacity; PxU32 MaxRigidContactCount; PxU32 MaxRigidPatchCount; PxU32 HeapCapacity; PxU32 FoundLostPairsCapacity; PxU32 FoundLostAggregatePairsCapacity; PxU32 TotalAggregatePairsCapacity; PxU32 MaxSoftBodyContacts; PxU32 MaxFemClothContacts; PxU32 MaxParticleContacts; PxU32 CollisionStackSize; PxU32 MaxHairContacts; PX_PHYSX_CORE_API PxgDynamicsMemoryConfigGeneratedValues( const PxgDynamicsMemoryConfig* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, IsValid, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, TempBufferCapacity, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxRigidContactCount, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxRigidPatchCount, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, HeapCapacity, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, FoundLostPairsCapacity, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, FoundLostAggregatePairsCapacity, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, TotalAggregatePairsCapacity, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxSoftBodyContacts, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxFemClothContacts, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxParticleContacts, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, CollisionStackSize, PxgDynamicsMemoryConfigGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxgDynamicsMemoryConfig, MaxHairContacts, PxgDynamicsMemoryConfigGeneratedValues) struct PxgDynamicsMemoryConfigGeneratedInfo { static const char* getClassName() { return "PxgDynamicsMemoryConfig"; } PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_IsValid, PxgDynamicsMemoryConfig, _Bool > IsValid; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_TempBufferCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32 > TempBufferCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxRigidContactCount, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxRigidContactCount; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxRigidPatchCount, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxRigidPatchCount; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_HeapCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32 > HeapCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_FoundLostPairsCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32 > FoundLostPairsCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_FoundLostAggregatePairsCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32 > FoundLostAggregatePairsCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_TotalAggregatePairsCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32 > TotalAggregatePairsCapacity; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxSoftBodyContacts, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxSoftBodyContacts; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxFemClothContacts, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxFemClothContacts; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxParticleContacts, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxParticleContacts; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_CollisionStackSize, PxgDynamicsMemoryConfig, PxU32, PxU32 > CollisionStackSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_MaxHairContacts, PxgDynamicsMemoryConfig, PxU32, PxU32 > MaxHairContacts; PX_PHYSX_CORE_API PxgDynamicsMemoryConfigGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxgDynamicsMemoryConfig*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 13; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( IsValid, inStartIndex + 0 );; inOperator( TempBufferCapacity, inStartIndex + 1 );; inOperator( MaxRigidContactCount, inStartIndex + 2 );; inOperator( MaxRigidPatchCount, inStartIndex + 3 );; inOperator( HeapCapacity, inStartIndex + 4 );; inOperator( FoundLostPairsCapacity, inStartIndex + 5 );; inOperator( FoundLostAggregatePairsCapacity, inStartIndex + 6 );; inOperator( TotalAggregatePairsCapacity, inStartIndex + 7 );; inOperator( MaxSoftBodyContacts, inStartIndex + 8 );; inOperator( MaxFemClothContacts, inStartIndex + 9 );; inOperator( MaxParticleContacts, inStartIndex + 10 );; inOperator( CollisionStackSize, inStartIndex + 11 );; inOperator( MaxHairContacts, inStartIndex + 12 );; return 13 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxgDynamicsMemoryConfig> { PxgDynamicsMemoryConfigGeneratedInfo Info; const PxgDynamicsMemoryConfigGeneratedInfo* getInfo() { return &Info; } }; static PxU32ToName g_physx__PxSimulationStatistics__RbPairStatsTypeConversion[] = { { "eDISCRETE_CONTACT_PAIRS", static_cast<PxU32>( physx::PxSimulationStatistics::eDISCRETE_CONTACT_PAIRS ) }, { "eCCD_PAIRS", static_cast<PxU32>( physx::PxSimulationStatistics::eCCD_PAIRS ) }, { "eMODIFIED_CONTACT_PAIRS", static_cast<PxU32>( physx::PxSimulationStatistics::eMODIFIED_CONTACT_PAIRS ) }, { "eTRIGGER_PAIRS", static_cast<PxU32>( physx::PxSimulationStatistics::eTRIGGER_PAIRS ) }, { NULL, 0 } }; template<> struct PxEnumTraits< physx::PxSimulationStatistics::RbPairStatsType > { PxEnumTraits() : NameConversion( g_physx__PxSimulationStatistics__RbPairStatsTypeConversion ) {} const PxU32ToName* NameConversion; }; class PxSimulationStatistics; struct PxSimulationStatisticsGeneratedValues { PxU32 NbActiveConstraints; PxU32 NbActiveDynamicBodies; PxU32 NbActiveKinematicBodies; PxU32 NbStaticBodies; PxU32 NbDynamicBodies; PxU32 NbKinematicBodies; PxU32 NbAggregates; PxU32 NbArticulations; PxU32 NbAxisSolverConstraints; PxU32 CompressedContactSize; PxU32 RequiredContactConstraintMemory; PxU32 PeakConstraintMemory; PxU32 NbDiscreteContactPairsTotal; PxU32 NbDiscreteContactPairsWithCacheHits; PxU32 NbDiscreteContactPairsWithContacts; PxU32 NbNewPairs; PxU32 NbLostPairs; PxU32 NbNewTouches; PxU32 NbLostTouches; PxU32 NbPartitions; PxU64 GpuMemParticles; PxU64 GpuMemSoftBodies; PxU64 GpuMemFEMCloths; PxU64 GpuMemHairSystems; PxU64 GpuMemHeap; PxU64 GpuMemHeapBroadPhase; PxU64 GpuMemHeapNarrowPhase; PxU64 GpuMemHeapSolver; PxU64 GpuMemHeapArticulation; PxU64 GpuMemHeapSimulation; PxU64 GpuMemHeapSimulationArticulation; PxU64 GpuMemHeapSimulationParticles; PxU64 GpuMemHeapSimulationSoftBody; PxU64 GpuMemHeapSimulationFEMCloth; PxU64 GpuMemHeapSimulationHairSystem; PxU64 GpuMemHeapParticles; PxU64 GpuMemHeapSoftBodies; PxU64 GpuMemHeapFEMCloths; PxU64 GpuMemHeapHairSystems; PxU64 GpuMemHeapOther; PxU32 NbBroadPhaseAdds; PxU32 NbBroadPhaseRemoves; PxU32 NbDiscreteContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT]; PxU32 NbModifiedContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT]; PxU32 NbCCDPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT]; PxU32 NbTriggerPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT]; PxU32 NbShapes[PxGeometryType::eGEOMETRY_COUNT]; PX_PHYSX_CORE_API PxSimulationStatisticsGeneratedValues( const PxSimulationStatistics* inSource ); }; DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbActiveConstraints, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbActiveDynamicBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbActiveKinematicBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbStaticBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbDynamicBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbKinematicBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbAggregates, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbArticulations, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbAxisSolverConstraints, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, CompressedContactSize, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, RequiredContactConstraintMemory, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, PeakConstraintMemory, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbDiscreteContactPairsTotal, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbDiscreteContactPairsWithCacheHits, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbDiscreteContactPairsWithContacts, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbNewPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbLostPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbNewTouches, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbLostTouches, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbPartitions, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemParticles, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemSoftBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemFEMCloths, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHairSystems, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeap, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapBroadPhase, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapNarrowPhase, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSolver, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapArticulation, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulation, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulationArticulation, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulationParticles, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulationSoftBody, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulationFEMCloth, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSimulationHairSystem, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapParticles, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapSoftBodies, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapFEMCloths, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapHairSystems, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, GpuMemHeapOther, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbBroadPhaseAdds, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbBroadPhaseRemoves, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbDiscreteContactPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbModifiedContactPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbCCDPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbTriggerPairs, PxSimulationStatisticsGeneratedValues) DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( PxSimulationStatistics, NbShapes, PxSimulationStatisticsGeneratedValues) struct PxSimulationStatisticsGeneratedInfo { static const char* getClassName() { return "PxSimulationStatistics"; } PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveConstraints, PxSimulationStatistics, PxU32, PxU32 > NbActiveConstraints; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveDynamicBodies, PxSimulationStatistics, PxU32, PxU32 > NbActiveDynamicBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveKinematicBodies, PxSimulationStatistics, PxU32, PxU32 > NbActiveKinematicBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbStaticBodies, PxSimulationStatistics, PxU32, PxU32 > NbStaticBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDynamicBodies, PxSimulationStatistics, PxU32, PxU32 > NbDynamicBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbKinematicBodies, PxSimulationStatistics, PxU32, PxU32 > NbKinematicBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbAggregates, PxSimulationStatistics, PxU32, PxU32 > NbAggregates; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbArticulations, PxSimulationStatistics, PxU32, PxU32 > NbArticulations; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbAxisSolverConstraints, PxSimulationStatistics, PxU32, PxU32 > NbAxisSolverConstraints; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_CompressedContactSize, PxSimulationStatistics, PxU32, PxU32 > CompressedContactSize; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_RequiredContactConstraintMemory, PxSimulationStatistics, PxU32, PxU32 > RequiredContactConstraintMemory; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_PeakConstraintMemory, PxSimulationStatistics, PxU32, PxU32 > PeakConstraintMemory; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsTotal, PxSimulationStatistics, PxU32, PxU32 > NbDiscreteContactPairsTotal; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsWithCacheHits, PxSimulationStatistics, PxU32, PxU32 > NbDiscreteContactPairsWithCacheHits; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsWithContacts, PxSimulationStatistics, PxU32, PxU32 > NbDiscreteContactPairsWithContacts; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbNewPairs, PxSimulationStatistics, PxU32, PxU32 > NbNewPairs; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbLostPairs, PxSimulationStatistics, PxU32, PxU32 > NbLostPairs; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbNewTouches, PxSimulationStatistics, PxU32, PxU32 > NbNewTouches; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbLostTouches, PxSimulationStatistics, PxU32, PxU32 > NbLostTouches; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbPartitions, PxSimulationStatistics, PxU32, PxU32 > NbPartitions; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemParticles, PxSimulationStatistics, PxU64, PxU64 > GpuMemParticles; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemSoftBodies, PxSimulationStatistics, PxU64, PxU64 > GpuMemSoftBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemFEMCloths, PxSimulationStatistics, PxU64, PxU64 > GpuMemFEMCloths; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHairSystems, PxSimulationStatistics, PxU64, PxU64 > GpuMemHairSystems; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeap, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeap; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapBroadPhase, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapBroadPhase; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapNarrowPhase, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapNarrowPhase; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSolver, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSolver; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapArticulation, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapArticulation; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulation, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulation; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulationArticulation, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulationArticulation; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulationParticles, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulationParticles; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulationSoftBody, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulationSoftBody; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulationFEMCloth, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulationFEMCloth; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSimulationHairSystem, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSimulationHairSystem; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapParticles, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapParticles; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapSoftBodies, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapSoftBodies; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapFEMCloths, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapFEMCloths; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapHairSystems, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapHairSystems; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_GpuMemHeapOther, PxSimulationStatistics, PxU64, PxU64 > GpuMemHeapOther; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbBroadPhaseAdds, PxSimulationStatistics, PxU32, PxU32 > NbBroadPhaseAdds; PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbBroadPhaseRemoves, PxSimulationStatistics, PxU32, PxU32 > NbBroadPhaseRemoves; NbDiscreteContactPairsProperty NbDiscreteContactPairs; NbModifiedContactPairsProperty NbModifiedContactPairs; NbCCDPairsProperty NbCCDPairs; NbTriggerPairsProperty NbTriggerPairs; NbShapesProperty NbShapes; PX_PHYSX_CORE_API PxSimulationStatisticsGeneratedInfo(); template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator inOperator ) const { return inOperator( reinterpret_cast<PxSimulationStatistics*>(NULL) ); } template<typename TOperator> void visitBases( TOperator inOperator ) { PX_UNUSED(inOperator); } template<typename TOperator> PxU32 visitBaseProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); return inStartIndex; } static PxU32 instancePropertyCount() { return 47; } static PxU32 totalPropertyCount() { return instancePropertyCount(); } template<typename TOperator> PxU32 visitInstanceProperties( TOperator inOperator, PxU32 inStartIndex = 0 ) const { PX_UNUSED(inOperator); PX_UNUSED(inStartIndex); inOperator( NbActiveConstraints, inStartIndex + 0 );; inOperator( NbActiveDynamicBodies, inStartIndex + 1 );; inOperator( NbActiveKinematicBodies, inStartIndex + 2 );; inOperator( NbStaticBodies, inStartIndex + 3 );; inOperator( NbDynamicBodies, inStartIndex + 4 );; inOperator( NbKinematicBodies, inStartIndex + 5 );; inOperator( NbAggregates, inStartIndex + 6 );; inOperator( NbArticulations, inStartIndex + 7 );; inOperator( NbAxisSolverConstraints, inStartIndex + 8 );; inOperator( CompressedContactSize, inStartIndex + 9 );; inOperator( RequiredContactConstraintMemory, inStartIndex + 10 );; inOperator( PeakConstraintMemory, inStartIndex + 11 );; inOperator( NbDiscreteContactPairsTotal, inStartIndex + 12 );; inOperator( NbDiscreteContactPairsWithCacheHits, inStartIndex + 13 );; inOperator( NbDiscreteContactPairsWithContacts, inStartIndex + 14 );; inOperator( NbNewPairs, inStartIndex + 15 );; inOperator( NbLostPairs, inStartIndex + 16 );; inOperator( NbNewTouches, inStartIndex + 17 );; inOperator( NbLostTouches, inStartIndex + 18 );; inOperator( NbPartitions, inStartIndex + 19 );; inOperator( GpuMemParticles, inStartIndex + 20 );; inOperator( GpuMemSoftBodies, inStartIndex + 21 );; inOperator( GpuMemFEMCloths, inStartIndex + 22 );; inOperator( GpuMemHairSystems, inStartIndex + 23 );; inOperator( GpuMemHeap, inStartIndex + 24 );; inOperator( GpuMemHeapBroadPhase, inStartIndex + 25 );; inOperator( GpuMemHeapNarrowPhase, inStartIndex + 26 );; inOperator( GpuMemHeapSolver, inStartIndex + 27 );; inOperator( GpuMemHeapArticulation, inStartIndex + 28 );; inOperator( GpuMemHeapSimulation, inStartIndex + 29 );; inOperator( GpuMemHeapSimulationArticulation, inStartIndex + 30 );; inOperator( GpuMemHeapSimulationParticles, inStartIndex + 31 );; inOperator( GpuMemHeapSimulationSoftBody, inStartIndex + 32 );; inOperator( GpuMemHeapSimulationFEMCloth, inStartIndex + 33 );; inOperator( GpuMemHeapSimulationHairSystem, inStartIndex + 34 );; inOperator( GpuMemHeapParticles, inStartIndex + 35 );; inOperator( GpuMemHeapSoftBodies, inStartIndex + 36 );; inOperator( GpuMemHeapFEMCloths, inStartIndex + 37 );; inOperator( GpuMemHeapHairSystems, inStartIndex + 38 );; inOperator( GpuMemHeapOther, inStartIndex + 39 );; inOperator( NbBroadPhaseAdds, inStartIndex + 40 );; inOperator( NbBroadPhaseRemoves, inStartIndex + 41 );; inOperator( NbDiscreteContactPairs, inStartIndex + 42 );; inOperator( NbModifiedContactPairs, inStartIndex + 43 );; inOperator( NbCCDPairs, inStartIndex + 44 );; inOperator( NbTriggerPairs, inStartIndex + 45 );; inOperator( NbShapes, inStartIndex + 46 );; return 47 + inStartIndex; } }; template<> struct PxClassInfoTraits<PxSimulationStatistics> { PxSimulationStatisticsGeneratedInfo Info; const PxSimulationStatisticsGeneratedInfo* getInfo() { return &Info; } }; #undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON #undef PX_PROPERTY_INFO_NAME
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/RepXMetaDataPropertyVisitor.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_REPX_META_DATA_PROPERTY_VISITOR_H #define PX_REPX_META_DATA_PROPERTY_VISITOR_H #include "PvdMetaDataPropertyVisitor.h" namespace physx { template<PxU32 TKey, typename TObjectType,typename TSetPropType, typename TPropertyType> struct PxRepXPropertyAccessor : public Vd::ValueStructOffsetRecord { typedef PxPropertyInfo<TKey,TObjectType,TSetPropType,TPropertyType> TPropertyInfoType; typedef TPropertyType prop_type; const TPropertyInfoType mProperty; PxRepXPropertyAccessor( const TPropertyInfoType& inProp ) : mProperty( inProp ) { } prop_type get( const TObjectType* inObj ) const { return mProperty.get( inObj ); } void set( TObjectType* inObj, prop_type val ) const { return mProperty.set( inObj, val ); } private: PxRepXPropertyAccessor& operator=(const PxRepXPropertyAccessor&); }; template<typename TSetPropType, typename TPropertyType> struct PxRepXPropertyAccessor<PxPropertyInfoName::PxRigidDynamic_WakeCounter, PxRigidDynamic, TSetPropType, TPropertyType> : public Vd::ValueStructOffsetRecord { typedef PxPropertyInfo<PxPropertyInfoName::PxRigidDynamic_WakeCounter,PxRigidDynamic,TSetPropType,TPropertyType> TPropertyInfoType; typedef TPropertyType prop_type; const TPropertyInfoType mProperty; PxRepXPropertyAccessor( const TPropertyInfoType& inProp ) : mProperty( inProp ) { } prop_type get( const PxRigidDynamic* inObj ) const { return mProperty.get( inObj ); } void set( PxRigidDynamic* inObj, prop_type val ) const { PX_UNUSED(val); PxRigidBodyFlags flags = inObj->getRigidBodyFlags(); if( !(flags & PxRigidBodyFlag::eKINEMATIC) ) return mProperty.set( inObj, val ); } private: PxRepXPropertyAccessor& operator=(const PxRepXPropertyAccessor&); }; typedef PxReadOnlyPropertyInfo<PxPropertyInfoName::PxArticulationLink_InboundJoint, PxArticulationLink, PxArticulationJointReducedCoordinate *> TIncomingJointPropType; //RepX cares about fewer property types than PVD does, //but I want to reuse the accessor architecture as it //greatly simplifies clients dealing with complex datatypes template<typename TOperatorType> struct RepXPropertyFilter { RepXPropertyFilter<TOperatorType> &operator=(const RepXPropertyFilter<TOperatorType> &); Vd::PvdPropertyFilter<TOperatorType> mFilter; RepXPropertyFilter( TOperatorType op ) : mFilter( op ) {} RepXPropertyFilter( const RepXPropertyFilter<TOperatorType>& other ) : mFilter( other.mFilter ) {} template<PxU32 TKey, typename TObjType, typename TPropertyType> void operator()( const PxReadOnlyPropertyInfo<TKey,TObjType,TPropertyType>&, PxU32 ) {} //repx ignores read only and write only properties template<PxU32 TKey, typename TObjType, typename TPropertyType> void operator()( const PxWriteOnlyPropertyInfo<TKey,TObjType,TPropertyType>&, PxU32 ) {} template<PxU32 TKey, typename TObjType, typename TCollectionType> void operator()( const PxReadOnlyCollectionPropertyInfo<TKey, TObjType, TCollectionType>&, PxU32 ) {} template<PxU32 TKey, typename TObjType, typename TCollectionType, typename TFilterType> void operator()( const PxReadOnlyFilteredCollectionPropertyInfo<TKey, TObjType, TCollectionType, TFilterType >&, PxU32 ) {} //forward these properties verbatim. template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> void operator()( const PxIndexedPropertyInfo<TKey, TObjType, TIndexType, TPropertyType >& inProp, PxU32 idx ) { mFilter( inProp, idx ); } template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> void operator()( const PxFixedSizeLookupTablePropertyInfo<TKey, TObjType, TIndexType,TPropertyType >& inProp, PxU32 idx ) { mFilter( inProp, idx ); } template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> void operator()( const PxExtendedIndexedPropertyInfo<TKey, TObjType, TIndexType, TPropertyType >& inProp, PxU32 idx) { mFilter( inProp, idx); } template<PxU32 TKey, typename TObjType, typename TIndexType, typename TIndex2Type, typename TPropertyType> void operator()( const PxDualIndexedPropertyInfo<TKey, TObjType, TIndexType, TIndex2Type, TPropertyType >& inProp, PxU32 idx ) { mFilter( inProp, idx ); } template<PxU32 TKey, typename TObjType, typename TIndexType, typename TIndex2Type, typename TPropertyType> void operator()( const PxExtendedDualIndexedPropertyInfo<TKey, TObjType, TIndexType, TIndex2Type, TPropertyType >& inProp, PxU32 idx ) { mFilter( inProp, idx ); } template<PxU32 TKey, typename TObjType, typename TPropertyType> void operator()( const PxRangePropertyInfo<TKey, TObjType, TPropertyType>& inProp, PxU32 idx ) { mFilter( inProp, idx ); } template<PxU32 TKey, typename TObjType, typename TPropertyType> void operator()( const PxBufferCollectionPropertyInfo<TKey, TObjType, TPropertyType>& inProp, PxU32 count ) { mFilter( inProp, count ); } template<PxU32 TKey, typename TObjType, typename TSetPropType, typename TPropertyType> void operator()( const PxPropertyInfo<TKey,TObjType,TSetPropType,TPropertyType>& prop, PxU32 ) { PxRepXPropertyAccessor< TKey, TObjType, TSetPropType, TPropertyType > theAccessor( prop ); mFilter.mOperator.pushName( prop.mName ); mFilter.template handleAccessor<TKey>( theAccessor ); mFilter.mOperator.popName(); } void operator()(const PxRigidActorGlobalPosePropertyInfo& inProp, PxU32) { mFilter.mOperator.pushName(inProp.mName); mFilter.mOperator.handleRigidActorGlobalPose(inProp); mFilter.mOperator.popName(); } void operator()( const PxRigidActorShapeCollection& inProp, PxU32 ) { mFilter.mOperator.pushName( "Shapes" ); mFilter.mOperator.handleShapes( inProp ); mFilter.mOperator.popName(); } void operator()( const PxArticulationLinkCollectionProp& inProp, PxU32 ) { mFilter.mOperator.pushName( "Links" ); mFilter.mOperator.handleArticulationLinks( inProp ); mFilter.mOperator.popName(); } void operator()( const PxShapeMaterialsProperty& inProp, PxU32 ) { mFilter.mOperator.pushName( "Materials" ); mFilter.mOperator.handleShapeMaterials( inProp ); mFilter.mOperator.popName(); } void operator()( const TIncomingJointPropType& inProp, PxU32 ) { mFilter.mOperator.handleIncomingJoint( inProp ); } void operator()( const PxShapeGeomProperty& inProp, PxU32 ) { mFilter.mOperator.handleGeomProperty( inProp ); } #define DEFINE_REPX_PROPERTY_NOP(datatype) \ template<PxU32 TKey, typename TObjType, typename TSetPropType> \ void operator()( const PxPropertyInfo<TKey,TObjType,TSetPropType,datatype>&, PxU32 ){} DEFINE_REPX_PROPERTY_NOP( const void* ) DEFINE_REPX_PROPERTY_NOP( void* ) DEFINE_REPX_PROPERTY_NOP( PxSimulationFilterCallback * ) DEFINE_REPX_PROPERTY_NOP( physx::PxTaskManager * ) DEFINE_REPX_PROPERTY_NOP( PxSimulationFilterShader * ) DEFINE_REPX_PROPERTY_NOP( PxSimulationFilterShader) DEFINE_REPX_PROPERTY_NOP( PxContactModifyCallback * ) DEFINE_REPX_PROPERTY_NOP( PxCCDContactModifyCallback * ) DEFINE_REPX_PROPERTY_NOP( PxSimulationEventCallback * ) DEFINE_REPX_PROPERTY_NOP( physx::PxCudaContextManager* ) DEFINE_REPX_PROPERTY_NOP( physx::PxCpuDispatcher * ) DEFINE_REPX_PROPERTY_NOP( PxRigidActor ) DEFINE_REPX_PROPERTY_NOP( const PxRigidActor ) DEFINE_REPX_PROPERTY_NOP( PxRigidActor& ) DEFINE_REPX_PROPERTY_NOP( const PxRigidActor& ) DEFINE_REPX_PROPERTY_NOP( PxScene* ) DEFINE_REPX_PROPERTY_NOP( PxAggregate * ) DEFINE_REPX_PROPERTY_NOP( PxArticulationReducedCoordinate& ) DEFINE_REPX_PROPERTY_NOP( const PxArticulationLink * ) DEFINE_REPX_PROPERTY_NOP( const PxRigidDynamic * ) DEFINE_REPX_PROPERTY_NOP( const PxRigidStatic * ) DEFINE_REPX_PROPERTY_NOP( PxStridedData ) //These are handled in a custom fasion. }; } #endif
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PxMetaDataObjects.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_METADATAOBJECTS_H #define PX_METADATAOBJECTS_H #include "foundation/PxMemory.h" #include "foundation/PxPhysicsVersion.h" // include the base headers instead of the PxPhysicsAPI.h //Geometry Library #include "geometry/PxBoxGeometry.h" #include "geometry/PxCapsuleGeometry.h" #include "geometry/PxConvexMesh.h" #include "geometry/PxConvexMeshGeometry.h" #include "geometry/PxGeometry.h" #include "geometry/PxGeometryHelpers.h" #include "geometry/PxGeometryQuery.h" #include "geometry/PxHeightField.h" #include "geometry/PxHeightFieldDesc.h" #include "geometry/PxHeightFieldFlag.h" #include "geometry/PxHeightFieldGeometry.h" #include "geometry/PxHeightFieldSample.h" #include "geometry/PxMeshQuery.h" #include "geometry/PxMeshScale.h" #include "geometry/PxPlaneGeometry.h" #include "geometry/PxSimpleTriangleMesh.h" #include "geometry/PxSphereGeometry.h" #include "geometry/PxTriangle.h" #include "geometry/PxTriangleMesh.h" #include "geometry/PxTriangleMeshGeometry.h" #include "geometry/PxTetrahedron.h" #include "geometry/PxTetrahedronMesh.h" #include "geometry/PxTetrahedronMeshGeometry.h" // PhysX Core SDK #include "PxActor.h" #include "PxAggregate.h" #include "PxArticulationReducedCoordinate.h" #include "PxArticulationJointReducedCoordinate.h" #include "PxArticulationLink.h" #include "PxClient.h" #include "PxConstraint.h" #include "PxConstraintDesc.h" #include "PxContact.h" #include "PxContactModifyCallback.h" #include "PxDeletionListener.h" #include "PxFiltering.h" #include "PxForceMode.h" #include "PxLockedData.h" #include "PxMaterial.h" #include "PxFEMSoftBodyMaterial.h" #include "PxFEMClothMaterial.h" #include "PxPBDMaterial.h" #include "PxFLIPMaterial.h" #include "PxMPMMaterial.h" #include "PxPhysics.h" #include "PxPhysXConfig.h" #include "PxQueryFiltering.h" #include "PxQueryReport.h" #include "PxRigidActor.h" #include "PxRigidBody.h" #include "PxRigidDynamic.h" #include "PxRigidStatic.h" #include "PxScene.h" #include "PxSceneDesc.h" #include "PxSceneLock.h" #include "PxShape.h" #include "PxSimulationEventCallback.h" #include "PxSimulationStatistics.h" #include "PxVisualizationParameter.h" #include "PxPruningStructure.h" #if PX_LINUX && PX_CLANG #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wreserved-identifier" #endif /** \addtogroup physics @{ */ namespace physx { class PxArticulationLink; class PxArticulationJointReducedCoordinate; struct PxPropertyInfoName { enum Enum { Unnamed = 0, #include "PxAutoGeneratedMetaDataObjectNames.h" LastPxPropertyInfoName }; }; struct PxU32ToName { const char* mName; PxU32 mValue; }; struct PxPropertyInfoBase { const char* mName; PxU32 mKey; PxPropertyInfoBase( const char* n, PxU32 inKey ) : mName( n ) , mKey( inKey ) { } }; template<PxU32 TKey> struct PxPropertyInfoParameterizedBase : public PxPropertyInfoBase { PxPropertyInfoParameterizedBase( const char* inName ) : PxPropertyInfoBase( inName, TKey ) {} }; template<PxU32 TKey, typename TObjType, typename TPropertyType> struct PxReadOnlyPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef TPropertyType (*TGetterType)( const TObjType* ); TGetterType mGetter; PxReadOnlyPropertyInfo( const char* inName, TGetterType inGetter ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mGetter( inGetter ) {} TPropertyType get( const TObjType* inObj ) const { return mGetter( inObj ); } }; template<PxU32 TKey, typename TObjType, typename TPropertyType> struct PxWriteOnlyPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef void(*TSetterType)( TObjType*, TPropertyType inArg ); TSetterType mSetter; PxWriteOnlyPropertyInfo( const char* inName, TSetterType inSetter ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mSetter( inSetter ) {} void set( TObjType* inObj, TPropertyType inArg ) const { mSetter( inObj, inArg ); } }; //Define the property types on the auto-generated objects. template<PxU32 TKey, typename TObjType, typename TSetPropType, typename TGetPropType> struct PxPropertyInfo : public PxReadOnlyPropertyInfo<TKey, TObjType, TGetPropType> { typedef typename PxReadOnlyPropertyInfo<TKey, TObjType, TGetPropType>::TGetterType TGetterType; typedef void(*TSetterType)( TObjType*, TSetPropType inArg ); TSetterType mSetter; PxPropertyInfo( const char* inName, TSetterType inSetter, TGetterType inGetter ) : PxReadOnlyPropertyInfo<TKey, TObjType, TGetPropType>( inName, inGetter ) , mSetter( inSetter ) {} void set( TObjType* inObj, TSetPropType inArg ) const { mSetter( inObj, inArg ); } }; template<PxU32 TKey, typename TObjType, typename TPropertyType> struct PxRangePropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef void (*TSetterType)( TObjType*,TPropertyType,TPropertyType); typedef void (*TGetterType)( const TObjType*,TPropertyType&,TPropertyType&); const char* mArg0Name; const char* mArg1Name; TSetterType mSetter; TGetterType mGetter; PxRangePropertyInfo( const char* name, const char* arg0Name, const char* arg1Name , TSetterType setter, TGetterType getter ) : PxPropertyInfoParameterizedBase<TKey>( name ) , mArg0Name( arg0Name ) , mArg1Name( arg1Name ) , mSetter( setter ) , mGetter( getter ) { } void set( TObjType* inObj, TPropertyType arg0, TPropertyType arg1 ) const { mSetter( inObj, arg0, arg1 ); } void get( const TObjType* inObj, TPropertyType& arg0, TPropertyType& arg1 ) const { mGetter( inObj, arg0, arg1 ); } }; template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> struct PxIndexedPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef void (*TSetterType)( TObjType*, TIndexType, TPropertyType ); typedef TPropertyType (*TGetterType)( const TObjType* inObj, TIndexType ); TSetterType mSetter; TGetterType mGetter; PxIndexedPropertyInfo( const char* name, TSetterType setter, TGetterType getter ) : PxPropertyInfoParameterizedBase<TKey>( name ) , mSetter( setter ) , mGetter( getter ) { } void set( TObjType* inObj, TIndexType inIndex, TPropertyType arg ) const { mSetter( inObj, inIndex, arg ); } TPropertyType get( const TObjType* inObj, TIndexType inIndex ) const { return mGetter( inObj, inIndex ); } }; template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> struct PxExtendedIndexedPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef PxU32 (*TNbObjectsMember)( const TObjType* ); typedef void (*TSetterType)( TObjType*, TIndexType, TPropertyType ); typedef TPropertyType (*TGetterType)( const TObjType* inObj, TIndexType ); TSetterType mSetter; TGetterType mGetter; PxU32 mCount; TNbObjectsMember mNbObjectsMember; PxExtendedIndexedPropertyInfo( const char* name, TGetterType getter, TNbObjectsMember inNb, TSetterType setter) : PxPropertyInfoParameterizedBase<TKey>( name ) , mSetter( setter ) , mGetter( getter ) , mNbObjectsMember( inNb ) { } PxU32 size( const TObjType* inObj ) const { return mNbObjectsMember( inObj ); } void set( TObjType* inObj, TIndexType inIndex, TPropertyType arg ) const { mSetter( inObj, inIndex, arg ); } TPropertyType get( const TObjType* inObj, TIndexType inIndex ) const { return mGetter( inObj, inIndex ); } }; template<PxU32 TKey, typename TObjType, typename TIndex1Type, typename TIndex2Type, typename TPropertyType> struct PxDualIndexedPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef void (*TSetterType)( TObjType*, TIndex1Type, TIndex2Type, TPropertyType ); typedef TPropertyType (*TGetterType)( const TObjType* inObj, TIndex1Type, TIndex2Type ); TSetterType mSetter; TGetterType mGetter; PxDualIndexedPropertyInfo( const char* name, TSetterType setter, TGetterType getter ) : PxPropertyInfoParameterizedBase<TKey>( name ) , mSetter( setter ) , mGetter( getter ) { } void set( TObjType* inObj, TIndex1Type inIdx1, TIndex2Type inIdx2, TPropertyType arg ) const { mSetter( inObj, inIdx1, inIdx2, arg ); } TPropertyType get( const TObjType* inObj, TIndex1Type inIdx1, TIndex2Type inIdx2 ) const { return mGetter( inObj, inIdx1, inIdx2 ); } }; template<PxU32 TKey, typename TObjType, typename TIndex1Type, typename TIndex2Type, typename TPropertyType> struct PxExtendedDualIndexedPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef void (*TSetterType)( TObjType*, TIndex1Type, TIndex2Type, TPropertyType ); typedef TPropertyType (*TGetterType)( const TObjType* inObj, TIndex1Type, TIndex2Type ); TSetterType mSetter; TGetterType mGetter; PxU32 mId0Count; PxU32 mId1Count; PxExtendedDualIndexedPropertyInfo( const char* name, TSetterType setter, TGetterType getter, PxU32 id0Count, PxU32 id1Count ) : PxPropertyInfoParameterizedBase<TKey>( name ) , mSetter( setter ) , mGetter( getter ) , mId0Count( id0Count ) , mId1Count( id1Count ) { } void set( TObjType* inObj, TIndex1Type inIdx1, TIndex2Type inIdx2, TPropertyType arg ) const { mSetter( inObj, inIdx1, inIdx2, arg ); } TPropertyType get( const TObjType* inObj, TIndex1Type inIdx1, TIndex2Type inIdx2 ) const { return mGetter( inObj, inIdx1, inIdx2 ); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType> struct PxBufferCollectionPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef PxU32 (*TNbObjectsMember)( const TObjType* ); typedef PxU32 (*TGetObjectsMember)( const TObjType*, TCollectionType*, PxU32 ); typedef void (*TSetObjectsMember)( TObjType*, TCollectionType*, PxU32 ); TGetObjectsMember mGetObjectsMember; TNbObjectsMember mNbObjectsMember; TSetObjectsMember mSetObjectsMember; PxBufferCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb, TSetObjectsMember inSet ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mGetObjectsMember( inGetter ) , mNbObjectsMember( inNb ) , mSetObjectsMember( inSet ) { } PxU32 size( const TObjType* inObj ) const { return mNbObjectsMember( inObj ); } PxU32 get( const TObjType* inObj, TCollectionType* inBuffer, PxU32 inNumItems ) const { return mGetObjectsMember( inObj, inBuffer, inNumItems ); } void set( TObjType* inObj, TCollectionType* inBuffer, PxU32 inNumItems ) const { mSetObjectsMember( inObj, inBuffer, inNumItems); } }; template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropertyType> struct PxFixedSizeLookupTablePropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef PxU32 (*TNbObjectsMember)( const TObjType* ); typedef PxReal (*TGetXMember)( const TObjType*, PxU32 ); typedef PxReal (*TGetYMember)( const TObjType*, PxU32 ); typedef void (*TAddPairMember)( TObjType*, PxReal, PxReal ); typedef void (*TClearMember)( TObjType* ); TGetXMember mGetXMember; TGetYMember mGetYMember; TNbObjectsMember mNbObjectsMember; TAddPairMember mAddPairMember; TClearMember mClearMember; PxFixedSizeLookupTablePropertyInfo( const char* inName, TGetXMember inGetterX, TGetYMember inGetterY, TNbObjectsMember inNb, TAddPairMember inAddPair, TClearMember inClear ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mGetXMember( inGetterX ) , mGetYMember( inGetterY ) , mNbObjectsMember( inNb ) , mAddPairMember( inAddPair ) , mClearMember( inClear ) { } PxU32 size( const TObjType* inObj ) const { return mNbObjectsMember( inObj ); } PxReal getX( const TObjType* inObj, const PxU32 index ) const { return mGetXMember( inObj, index ); } PxReal getY( const TObjType* inObj, const PxU32 index ) const { return mGetYMember( inObj, index ); } void addPair( TObjType* inObj, const PxReal x, const PxReal y ) { mAddPairMember( inObj, x, y ); } void clear( TObjType* inObj ) { mClearMember( inObj ); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType> struct PxReadOnlyCollectionPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef PxU32 (*TNbObjectsMember)( const TObjType* ); typedef PxU32 (*TGetObjectsMember)( const TObjType*, TCollectionType*, PxU32 ); TGetObjectsMember mGetObjectsMember; TNbObjectsMember mNbObjectsMember; PxReadOnlyCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mGetObjectsMember( inGetter ) , mNbObjectsMember( inNb ) { } PxU32 size( const TObjType* inObj ) const { return mNbObjectsMember( inObj ); } PxU32 get( const TObjType* inObj, TCollectionType* inBuffer, PxU32 inBufSize ) const { return mGetObjectsMember( inObj, inBuffer, inBufSize); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType, typename TFilterType> struct PxReadOnlyFilteredCollectionPropertyInfo : public PxPropertyInfoParameterizedBase<TKey> { typedef PxU32 (*TNbObjectsMember)( const TObjType*, TFilterType ); typedef PxU32 (*TGetObjectsMember)( const TObjType*, TFilterType, TCollectionType*, PxU32 ); TGetObjectsMember mGetObjectsMember; TNbObjectsMember mNbObjectsMember; PxReadOnlyFilteredCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb ) : PxPropertyInfoParameterizedBase<TKey>( inName ) , mGetObjectsMember( inGetter ) , mNbObjectsMember( inNb ) { } PxU32 size( const TObjType* inObj, TFilterType inFilter ) const { return mNbObjectsMember( inObj, inFilter ); } PxU32 get( const TObjType* inObj, TFilterType inFilter, TCollectionType* inBuffer, PxU32 inBufSize ) const { return mGetObjectsMember( inObj, inFilter, inBuffer, inBufSize); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType, typename TCreateArg> struct PxFactoryCollectionPropertyInfo : public PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType > { typedef typename PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >::TGetObjectsMember TGetObjectsMember; typedef typename PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >::TNbObjectsMember TNbObjectsMember; typedef TCollectionType (*TCreateMember)( TObjType*, TCreateArg ); TCreateMember mCreateMember; PxFactoryCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb, TCreateMember inMember ) : PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >( inName, inGetter, inNb ) , mCreateMember( inMember ) { } TCollectionType create( TObjType* inObj, TCreateArg inArg ) const { return mCreateMember( inObj, inArg ); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType> struct PxCollectionPropertyInfo : public PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType > { typedef typename PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >::TGetObjectsMember TGetObjectsMember; typedef typename PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >::TNbObjectsMember TNbObjectsMember; typedef void (*TAddMember)(TObjType*, TCollectionType&); typedef void (*TRemoveMember)(TObjType*, TCollectionType&); TAddMember mAddMember; TRemoveMember mRemoveMember; PxCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb, TAddMember inMember, TRemoveMember inRemoveMember ) : PxReadOnlyCollectionPropertyInfo< TKey, TObjType, TCollectionType >( inName, inGetter, inNb ) , mAddMember( inMember ) , mRemoveMember( inRemoveMember ) { } void add( TObjType* inObj, TCollectionType& inArg ) const { mAddMember(inObj, inArg ); } void remove( TObjType* inObj, TCollectionType& inArg ) const { mRemoveMember( inObj, inArg ); } }; template<PxU32 TKey, typename TObjType, typename TCollectionType, typename TFilterType> struct PxFilteredCollectionPropertyInfo : public PxReadOnlyFilteredCollectionPropertyInfo<TKey, TObjType, TCollectionType, TFilterType> { typedef typename PxReadOnlyFilteredCollectionPropertyInfo< TKey, TObjType, TCollectionType, TFilterType >::TGetObjectsMember TGetObjectsMember; typedef typename PxReadOnlyFilteredCollectionPropertyInfo< TKey, TObjType, TCollectionType, TFilterType >::TNbObjectsMember TNbObjectsMember; typedef void (*TAddMember)(TObjType*, TCollectionType&); typedef void (*TRemoveMember)(TObjType*, TCollectionType&); TAddMember mAddMember; TRemoveMember mRemoveMember; PxFilteredCollectionPropertyInfo( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb, TAddMember inMember, TRemoveMember inRemoveMember ) : PxReadOnlyFilteredCollectionPropertyInfo<TKey, TObjType, TCollectionType, TFilterType>( inName, inGetter, inNb ) , mAddMember( inMember ) , mRemoveMember( inRemoveMember ) { } void add( TObjType* inObj, TCollectionType& inArg ) const { mAddMember(inObj, inArg ); } void remove( TObjType* inObj, TCollectionType& inArg ) const { mRemoveMember( inObj, inArg ); } }; //create a default info class for when we can't match //the type correctly. struct PxUnknownClassInfo { static const char* getClassName() { return "__unknown_class"; } template<typename TReturnType, typename TOperator> TReturnType visitType( TOperator ) { return TReturnType(); } template<typename TOperator> void visitBases( TOperator ) { } template<typename TOperator> PxU32 visitBaseProperties( TOperator, PxU32 inStartIndex = 0 ) const { return inStartIndex; } template<typename TOperator> PxU32 visitInstanceProperties( TOperator, PxU32 inStartIndex = 0 ) const { return inStartIndex; } }; template<typename TDataType> struct PxClassInfoTraits { PxUnknownClassInfo Info; static bool getInfo() { return false;} }; //move the bool typedef to the global namespace. typedef bool _Bool; template<PxU32 TPropertyName> struct PxPropertyToValueStructMemberMap { bool Offset; }; #define DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP( type, prop, valueStruct ) \ template<> struct PxPropertyToValueStructMemberMap< PxPropertyInfoName::type##_##prop > \ { \ PxU32 Offset; \ PxPropertyToValueStructMemberMap< PxPropertyInfoName::type##_##prop >() : Offset( PX_OFFSET_OF_RT( valueStruct, prop ) ) {} \ template<typename TOperator> void visitProp( TOperator inOperator, valueStruct& inStruct ) { inOperator( inStruct.prop ); } \ }; struct PxShapeGeomPropertyHelper { PX_PHYSX_CORE_API PxGeometryType::Enum getGeometryType(const PxShape* inShape) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxBoxGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxSphereGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxCapsuleGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxPlaneGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxConvexMeshGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxTetrahedronMeshGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxParticleSystemGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxTriangleMeshGeometry& geometry) const; PX_PHYSX_CORE_API bool getGeometry(const PxShape* inShape, PxHeightFieldGeometry& geometry) const; }; struct PxShapeGeomProperty : public PxWriteOnlyPropertyInfo< PxPropertyInfoName::PxShape_Geom, PxShape, const PxGeometry & > , public PxShapeGeomPropertyHelper { static void setPxShape_Geom( PxShape* inObj, const PxGeometry& inArg){ inObj->setGeometry( inArg ); } static PxGeometryHolder getPxShape_Geom( const PxShape* inObj ) { return PxGeometryHolder(inObj->getGeometry()); } typedef PxWriteOnlyPropertyInfo< PxPropertyInfoName::PxShape_Geom, PxShape, const PxGeometry & >::TSetterType TSetterType; typedef PxGeometryHolder (*TGetterType)( const PxShape* inObj ); PxShapeGeomProperty( const char* inName="Geometry", TSetterType inSetter=setPxShape_Geom, TGetterType=getPxShape_Geom ) : PxWriteOnlyPropertyInfo< PxPropertyInfoName::PxShape_Geom, PxShape, const PxGeometry & >( inName, inSetter ) { } }; struct PxShapeMaterialsPropertyHelper { PX_PHYSX_CORE_API void setMaterials(PxShape* inShape, PxMaterial*const* materials, PxU16 materialCount) const; }; struct PxShapeMaterialsProperty : public PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxShape_Materials, PxShape, PxMaterial*> , public PxShapeMaterialsPropertyHelper { typedef PxReadOnlyCollectionPropertyInfo< PxPropertyInfoName::PxShape_Materials, PxShape, PxMaterial* >::TGetObjectsMember TGetObjectsMember; typedef PxReadOnlyCollectionPropertyInfo< PxPropertyInfoName::PxShape_Materials, PxShape, PxMaterial* >::TNbObjectsMember TNbObjectsMember; PxShapeMaterialsProperty( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb ) : PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxShape_Materials, PxShape, PxMaterial*>( inName, inGetter, inNb ) { } }; typedef PxPropertyInfo<PxPropertyInfoName::PxRigidActor_GlobalPose, PxRigidActor, const PxTransform &, PxTransform > PxRigidActorGlobalPosePropertyInfo; struct PxRigidActorShapeCollectionHelper { PX_PHYSX_CORE_API PxShape* createShape(PxRigidActor* inActor, const PxGeometry& geometry, PxMaterial& material, PxShapeFlags shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE) const; PX_PHYSX_CORE_API PxShape* createShape(PxRigidActor* inActor, const PxGeometry& geometry, PxMaterial *const* materials, PxU16 materialCount, PxShapeFlags shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE) const; }; struct PxRigidActorShapeCollection : public PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxRigidActor_Shapes, PxRigidActor, PxShape*> , public PxRigidActorShapeCollectionHelper { typedef PxReadOnlyCollectionPropertyInfo< PxPropertyInfoName::PxRigidActor_Shapes, PxRigidActor, PxShape* >::TGetObjectsMember TGetObjectsMember; typedef PxReadOnlyCollectionPropertyInfo< PxPropertyInfoName::PxRigidActor_Shapes, PxRigidActor, PxShape* >::TNbObjectsMember TNbObjectsMember; PxRigidActorShapeCollection( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb ) : PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxRigidActor_Shapes, PxRigidActor, PxShape*>( inName, inGetter, inNb ) { } }; struct PxArticulationReducedCoordinateLinkCollectionPropHelper { PX_PHYSX_CORE_API PxArticulationLink* createLink(PxArticulationReducedCoordinate* inArticulation, PxArticulationLink* parent, const PxTransform& pose) const; }; struct PxArticulationLinkCollectionProp : public PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxArticulationReducedCoordinate_Links, PxArticulationReducedCoordinate, PxArticulationLink*> , public PxArticulationReducedCoordinateLinkCollectionPropHelper { PxArticulationLinkCollectionProp( const char* inName, TGetObjectsMember inGetter, TNbObjectsMember inNb ) : PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxArticulationReducedCoordinate_Links, PxArticulationReducedCoordinate, PxArticulationLink*>( inName, inGetter, inNb ) { } }; template<typename TDataType> struct PxEnumTraits { PxEnumTraits() : NameConversion( false ) {} bool NameConversion; }; struct NbShapesProperty : public PxIndexedPropertyInfo<PxPropertyInfoName::PxSimulationStatistics_NbShapes, PxSimulationStatistics, PxGeometryType::Enum, PxU32> { PX_PHYSX_CORE_API NbShapesProperty(); }; struct NbDiscreteContactPairsProperty : public PxDualIndexedPropertyInfo<PxPropertyInfoName::PxSimulationStatistics_NbDiscreteContactPairs , PxSimulationStatistics , PxGeometryType::Enum , PxGeometryType::Enum , PxU32> { PX_PHYSX_CORE_API NbDiscreteContactPairsProperty(); }; struct NbModifiedContactPairsProperty : public PxDualIndexedPropertyInfo<PxPropertyInfoName::PxSimulationStatistics_NbModifiedContactPairs , PxSimulationStatistics , PxGeometryType::Enum , PxGeometryType::Enum , PxU32> { PX_PHYSX_CORE_API NbModifiedContactPairsProperty(); }; struct NbCCDPairsProperty : public PxDualIndexedPropertyInfo<PxPropertyInfoName::PxSimulationStatistics_NbCCDPairs , PxSimulationStatistics , PxGeometryType::Enum , PxGeometryType::Enum , PxU32> { PX_PHYSX_CORE_API NbCCDPairsProperty(); }; struct NbTriggerPairsProperty : public PxDualIndexedPropertyInfo<PxPropertyInfoName::PxSimulationStatistics_NbTriggerPairs , PxSimulationStatistics , PxGeometryType::Enum , PxGeometryType::Enum , PxU32> { PX_PHYSX_CORE_API NbTriggerPairsProperty(); }; struct SimulationStatisticsProperty : public PxReadOnlyPropertyInfo<PxPropertyInfoName::PxScene_SimulationStatistics, PxScene, PxSimulationStatistics> { PX_PHYSX_CORE_API SimulationStatisticsProperty(); }; struct PxCustomGeometryCustomTypeProperty : public PxReadOnlyPropertyInfo<PxPropertyInfoName::PxCustomGeometry_CustomType, PxCustomGeometry, PxU32> { PX_PHYSX_CORE_API PxCustomGeometryCustomTypeProperty(); }; struct PxMetaDataPlane { PxVec3 normal; PxReal distance; PxMetaDataPlane( PxVec3 n = PxVec3( 0, 0, 0 ), PxReal d = 0 ) : normal( n ) , distance( d ) { } }; #include "PxAutoGeneratedMetaDataObjects.h" #undef DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP static PxU32ToName g_physx__PxQueryFlag__EnumConversion[] = { { "eSTATIC", static_cast<PxU32>( PxQueryFlag::eSTATIC ) }, { "eDYNAMIC", static_cast<PxU32>( PxQueryFlag::eDYNAMIC ) }, { "ePREFILTER", static_cast<PxU32>( PxQueryFlag::ePREFILTER ) }, { "ePOSTFILTER", static_cast<PxU32>( PxQueryFlag::ePOSTFILTER ) }, { NULL, 0 } }; template<> struct PxEnumTraits<PxQueryFlag::Enum > { PxEnumTraits() : NameConversion( g_physx__PxQueryFlag__EnumConversion ) {} const PxU32ToName* NameConversion; }; template<typename TObjType, typename TOperator> inline PxU32 visitAllProperties( TOperator inOperator ) { PxU32 thePropCount = PxClassInfoTraits<TObjType>().Info.visitBaseProperties( inOperator ); return PxClassInfoTraits<TObjType>().Info.visitInstanceProperties( inOperator, thePropCount ); } template<typename TObjType, typename TOperator> inline void visitInstanceProperties( TOperator inOperator ) { PxClassInfoTraits<TObjType>().Info.visitInstanceProperties( inOperator, 0 ); } } #if PX_LINUX && PX_CLANG #pragma clang diagnostic pop #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PxMetaDataCompare.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_METADATACOMPARE_H #define PX_METADATACOMPARE_H #include "PxMetaDataObjects.h" #include "foundation/PxInlineArray.h" //Implement a basic equality comparison system based on the meta data system. //if you implement a particular areequal specialized to exactly your type //before including this file it will be called in preference to the completely //generic one shown here. //If you don't care about the failure prop name you are welcome to pass in 'null', template<typename TBaseObjType> bool areEqual( const TBaseObjType& lhs, const TBaseObjType& rhs, const char** outFailurePropName ); //We don't have the ability right now to handle these types. inline bool areEqual( const PxAggregate&, const PxAggregate& ) { return true; } inline bool areEqual( const PxSimulationFilterShader&, const PxSimulationFilterShader& ) { return true; } inline bool areEqual( const PxSimulationFilterCallback&, const PxSimulationFilterCallback& ) { return true; } inline bool areEqual( const PxConvexMesh&, const PxConvexMesh& ) { return true; } inline bool areEqual( const PxTriangleMesh&, const PxTriangleMesh& ) { return true; } inline bool areEqual( const PxTetrahedronMesh&, const PxTetrahedronMesh&) { return true; } inline bool areEqual( const PxParticleSystemGeometry&, const PxParticleSystemGeometry&) { return true; } inline bool areEqual( const PxBVH33TriangleMesh&, const PxBVH33TriangleMesh& ) { return true; } inline bool areEqual( const PxBVH34TriangleMesh&, const PxBVH34TriangleMesh& ) { return true; } inline bool areEqual( const PxHeightField&, const PxHeightField& ) { return true; } inline bool areEqual( const void* inLhs, const void* inRhs ) { return inLhs == inRhs; } inline bool areEqual( void* inLhs, void* inRhs ) { return inLhs == inRhs; } //Operators are copied, so this object needs to point //to the important data rather than reference or own it. template<typename TBaseObjType> struct EqualityOp { bool* mVal; const TBaseObjType* mLhs; const TBaseObjType* mRhs; const char** mFailurePropName; EqualityOp( bool& inVal, const TBaseObjType& inLhs, const TBaseObjType& inRhs, const char*& inFailurePropName ) : mVal( &inVal ) , mLhs( &inLhs ) , mRhs( &inRhs ) , mFailurePropName( &inFailurePropName ) { } bool hasFailed() { return *mVal == false; } //Ensure failure propagates the result a ways. void update( bool inResult, const char* inName ) { *mVal = *mVal && inResult; if ( hasFailed() ) *mFailurePropName = inName; } //ignore any properties pointering back to the scene. template<PxU32 TKey, typename TObjType> void operator()( const PxReadOnlyPropertyInfo<TKey, TObjType, PxScene*> & inProp, PxU32 ) {} template<PxU32 TKey, typename TObjType> void operator()( const PxReadOnlyPropertyInfo<TKey, TObjType, const PxScene*> & inProp, PxU32 ) {} //ignore any properties pointering back to the impl. template<PxU32 TKey, typename TObjType> void operator()(const PxReadOnlyPropertyInfo<TKey, TObjType, void*> & inProp, PxU32) {} template<PxU32 TKey, typename TObjType> void operator()(const PxReadOnlyPropertyInfo<TKey, TObjType, const void*> & inProp, PxU32) {} //ignore all of these properties because they just point back to the 'this' object and cause //a stack overflow. //Children is unnecessary and articulation points back to the source. void operator()( const PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxArticulationLink_Children, PxArticulationLink, PxArticulationLink* >& inProp, PxU32 ) {} void operator()( const PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxRigidActor_Constraints, PxRigidActor, PxConstraint* >& inProp, PxU32 ){} void operator()( const PxReadOnlyCollectionPropertyInfo<PxPropertyInfoName::PxAggregate_Actors, PxAggregate, PxActor* >& inProp, PxU32 ) {} template<PxU32 TKey, typename TObjType, typename TGetPropType> void operator()( const PxBufferCollectionPropertyInfo<TKey, TObjType, TGetPropType> & inProp, PxU32 ) { } template<PxU32 TKey, typename TObjType, typename TGetPropType> void operator()( const PxReadOnlyPropertyInfo<TKey, TObjType, TGetPropType> & inProp, PxU32 ) { if ( hasFailed() ) return; TGetPropType lhs( inProp.get( mLhs ) ); TGetPropType rhs( inProp.get( mRhs ) ); update( areEqual( lhs, rhs, NULL ), inProp.mName ); } template<PxU32 TKey, typename TObjType, typename TPropType> void operator()( const PxRangePropertyInfo<TKey, TObjType, TPropType> & inProp, PxU32 ) { if ( hasFailed() ) return; TPropType lhsl, lhsr, rhsl, rhsr; inProp.get( mLhs, lhsl, lhsr ); inProp.get( mRhs, rhsl, rhsr ); update( areEqual( lhsl, rhsl, NULL ), inProp.mName ); update( areEqual( lhsr, rhsr, NULL ), inProp.mName ); } //Indexed properties where we don't know the range of index types are ignored template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropType> void compareIndex( const PxIndexedPropertyInfo<TKey, TObjType, TIndexType, TPropType> &, bool ) {} template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropType> void compareIndex( const PxIndexedPropertyInfo<TKey, TObjType, TIndexType, TPropType> &inProp, const PxU32ToName* inNames ) { for ( const PxU32ToName* theName = inNames; theName->mName != NULL && !hasFailed(); ++theName ) { TIndexType theIndex( static_cast<TIndexType>( theName->mValue ) ); update( areEqual( inProp.get( mLhs, theIndex ), inProp.get( mRhs, theIndex ), NULL ), inProp.mName ); } } template<PxU32 TKey, typename TObjType, typename TIndexType, typename TPropType> void operator()( const PxIndexedPropertyInfo<TKey, TObjType, TIndexType, TPropType> & inProp, PxU32 ) { if ( hasFailed() ) return; compareIndex( inProp, PxEnumTraits<TIndexType>().NameConversion ); } template<PxU32 TKey, typename TObjType, typename TCollectionType> void operator()( const PxReadOnlyCollectionPropertyInfo<TKey, TObjType, TCollectionType> & inProp, PxU32 ) { if ( hasFailed() ) return; physx::PxInlineArray<TCollectionType, 20> lhsArray; physx::PxInlineArray<TCollectionType, 20> rhsArray; PxU32 size = inProp.size( mLhs ); if ( size != inProp.size( mRhs ) ) update( false, inProp.mName ); else { lhsArray.resize( size ); rhsArray.resize( size ); inProp.get( mLhs, lhsArray.begin(), size ); inProp.get( mRhs, rhsArray.begin(), size ); for ( PxU32 idx =0; idx < size && !hasFailed(); ++idx ) update( areEqual( lhsArray[idx], rhsArray[idx], NULL ), inProp.mName ); } } //Filtered collections where we can't know the range of filter values are ignored. template<PxU32 TKey, typename TObjType, typename TFilterType, typename TCollectionType> void compare( const PxReadOnlyFilteredCollectionPropertyInfo< TKey, TObjType, TFilterType, TCollectionType >&, bool ) {} template<PxU32 TKey, typename TObjType, typename TFilterType, typename TCollectionType> void compare( const PxReadOnlyFilteredCollectionPropertyInfo< TKey, TObjType, TFilterType, TCollectionType >& inProp, const PxU32ToName* inNames ) { //Exaustively compare all items. physx::PxInlineArray<TCollectionType*, 20> lhsArray; physx::PxInlineArray<TCollectionType*, 20> rhsArray; for ( const PxU32ToName* theName = inNames; theName->mName != NULL && !hasFailed(); ++theName ) { TFilterType theFilter( static_cast<TFilterType>( theName->mValue ) ); PxU32 size = inProp.size( mLhs, theFilter ); if ( size != inProp.size( mRhs, theFilter ) ) update( false, inProp.mName ); else { lhsArray.resize( size ); rhsArray.resize( size ); inProp.get( mLhs, theFilter, lhsArray.begin(), size ); inProp.get( mRhs, theFilter, rhsArray.begin(), size ); for ( PxU32 idx =0; idx < size && !hasFailed(); ++idx ) update( areEqual( lhsArray[idx], rhsArray[idx], NULL ), inProp.mName ); } } } template<PxU32 TKey, typename TObjType, typename TFilterType, typename TCollectionType> void operator()( const PxReadOnlyFilteredCollectionPropertyInfo< TKey, TObjType, TFilterType, TCollectionType >& inProp, PxU32 ) { if ( hasFailed() ) return; compare( inProp, PxEnumTraits<TFilterType>().NameConversion ); } template<typename TGeometryType, typename TPropertyType> void compareGeometry( const TPropertyType& inProp ) { TGeometryType lhs; TGeometryType rhs; bool lsuc = inProp.getGeometry( mLhs, lhs ); bool rsuc = inProp.getGeometry( mRhs, rhs ); if ( !( lsuc && rsuc ) ) update( false, inProp.mName ); else update( areEqual( lhs, rhs, NULL ), inProp.mName ); } void operator()( const PxShapeGeomProperty& inProp, PxU32 ) { if ( hasFailed() ) return; PxGeometryType::Enum lhsType( inProp.getGeometryType( mLhs ) ); PxGeometryType::Enum rhsType( inProp.getGeometryType( mRhs ) ); if ( lhsType != rhsType ) update( false, inProp.mName ); else { switch( lhsType ) { case PxGeometryType::eSPHERE: compareGeometry<PxSphereGeometry>(inProp); break; case PxGeometryType::ePLANE: compareGeometry<PxPlaneGeometry>(inProp); break; case PxGeometryType::eCAPSULE: compareGeometry<PxCapsuleGeometry>(inProp); break; case PxGeometryType::eBOX: compareGeometry<PxBoxGeometry>(inProp); break; case PxGeometryType::eCONVEXMESH: compareGeometry<PxConvexMeshGeometry>(inProp); break; case PxGeometryType::eTETRAHEDRONMESH: compareGeometry<PxTetrahedronMeshGeometry>(inProp); break; case PxGeometryType::ePARTICLESYSTEM: compareGeometry<PxParticleSystemGeometry>(inProp); break; case PxGeometryType::eTRIANGLEMESH: compareGeometry<PxTriangleMeshGeometry>(inProp); break; case PxGeometryType::eHEIGHTFIELD: compareGeometry<PxHeightFieldGeometry>(inProp); break; default: PX_ASSERT( false ); break; } } } }; inline bool areEqual( const char* lhs, const char* rhs, const char**, const PxUnknownClassInfo& ) { if ( lhs && rhs ) return Pxstrcmp( lhs, rhs ) == 0; if ( lhs || rhs ) return false; return true; } inline bool areEqual( PxReal inLhs, PxReal inRhs ) { return PxAbs( inLhs - inRhs ) < 1e-5f; } inline bool areEqual( PxVec3& lhs, PxVec3& rhs ) { return areEqual( lhs.x, rhs.x ) && areEqual( lhs.y, rhs.y ) && areEqual( lhs.z, rhs.z ); } inline bool areEqual( const PxVec3& lhs, const PxVec3& rhs ) { return areEqual( lhs.x, rhs.x ) && areEqual( lhs.y, rhs.y ) && areEqual( lhs.z, rhs.z ); } inline bool areEqual( const PxVec4& lhs, const PxVec4& rhs ) { return areEqual( lhs.x, rhs.x ) && areEqual( lhs.y, rhs.y ) && areEqual( lhs.z, rhs.z ) && areEqual( lhs.w, rhs.w ); } inline bool areEqual( const PxQuat& lhs, const PxQuat& rhs ) { return areEqual( lhs.x, rhs.x ) && areEqual( lhs.y, rhs.y ) && areEqual( lhs.z, rhs.z ) && areEqual( lhs.w, rhs.w ); } inline bool areEqual( const PxTransform& lhs, const PxTransform& rhs ) { return areEqual(lhs.p, rhs.p) && areEqual(lhs.q, rhs.q); } inline bool areEqual( const PxBounds3& inLhs, const PxBounds3& inRhs ) { return areEqual(inLhs.minimum,inRhs.minimum) && areEqual(inLhs.maximum,inRhs.maximum); } inline bool areEqual( const PxMetaDataPlane& lhs, const PxMetaDataPlane& rhs ) { return areEqual( lhs.normal.x, rhs.normal.x ) && areEqual( lhs.normal.y, rhs.normal.y ) && areEqual( lhs.normal.z, rhs.normal.z ) && areEqual( lhs.distance, rhs.distance ); } template<typename TBaseObjType> inline bool areEqual( const TBaseObjType& lhs, const TBaseObjType& rhs ) { return lhs == rhs; } //If we don't know the class type, we must result in == operator template<typename TBaseObjType> inline bool areEqual( const TBaseObjType& lhs, const TBaseObjType& rhs, const char**, const PxUnknownClassInfo& ) { return areEqual( lhs, rhs ); } //If we don't know the class type, we must result in == operator template<typename TBaseObjType, typename TTraitsType> inline bool areEqual( const TBaseObjType& lhs, const TBaseObjType& rhs, const char** outFailurePropName, const TTraitsType& ) { const char* theFailureName = NULL; bool result = true; static int i = 0; ++i; visitAllProperties<TBaseObjType>( EqualityOp<TBaseObjType>( result, lhs, rhs, theFailureName ) ); if ( outFailurePropName != NULL && theFailureName ) *outFailurePropName = theFailureName; return result; } template<typename TBaseObjType> inline bool areEqualPointerCheck( const TBaseObjType& lhs, const TBaseObjType& rhs, const char** outFailurePropName, int ) { return areEqual( lhs, rhs, outFailurePropName, PxClassInfoTraits<TBaseObjType>().Info ); } inline bool areEqualPointerCheck( const void* lhs, const void* rhs, const char**, bool ) { return lhs == rhs; } inline bool areEqualPointerCheck( const char* lhs, const char* rhs, const char** outFailurePropName, bool ) { bool bRet = true; if ( lhs && rhs ) bRet = Pxstrcmp( lhs, rhs ) == 0; else if ( lhs || rhs ) bRet = false; return bRet; } inline bool areEqualPointerCheck( void* lhs, void* rhs, const char**, bool ) { return lhs == rhs; } template<typename TBaseObjType> inline bool areEqualPointerCheck( const TBaseObjType& lhs, const TBaseObjType& rhs, const char** outFailurePropName, bool ) { if ( lhs && rhs ) return areEqual( *lhs, *rhs, outFailurePropName ); if ( lhs || rhs ) return false; return true; } template < typename Tp > struct is_pointer { static const int val = 0; }; template < typename Tp > struct is_pointer<Tp*> { static const bool val = true; }; template<typename TBaseObjType> inline bool areEqual( const TBaseObjType& lhs, const TBaseObjType& rhs, const char** outFailurePropName ) { return areEqualPointerCheck( lhs, rhs, outFailurePropName, is_pointer<TBaseObjType>::val ); } #endif
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PvdMetaDataDefineProperties.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PVD_META_DATA_DEFINE_PROPERTIES_H #define PVD_META_DATA_DEFINE_PROPERTIES_H #if PX_SUPPORT_PVD #include "common/PxCoreUtilityTypes.h" #include "PvdMetaDataPropertyVisitor.h" #include "PxPvdDataStreamHelpers.h" #include "PxPvdDataStream.h" namespace physx { namespace Vd { using namespace physx::pvdsdk; template<typename TPropType> struct PropertyDefinitionOp { void defineProperty( PvdPropertyDefinitionHelper& mHelper, NamespacedName mClassKey ) { mHelper.createProperty( mClassKey, "", getPvdNamespacedNameForType<TPropType>(), PropertyType::Scalar ); } }; template<> struct PropertyDefinitionOp<const char*> { void defineProperty( PvdPropertyDefinitionHelper& mHelper, NamespacedName mClassKey ) { mHelper.createProperty( mClassKey, "", getPvdNamespacedNameForType<StringHandle>(), PropertyType::Scalar ); } }; #define DEFINE_PROPERTY_DEFINITION_OP_NOP( type ) \ template<> struct PropertyDefinitionOp<type> { void defineProperty( PvdPropertyDefinitionHelper&, NamespacedName ){} }; //NOP out these two types. DEFINE_PROPERTY_DEFINITION_OP_NOP( PxStridedData ) DEFINE_PROPERTY_DEFINITION_OP_NOP( PxBoundedData ) #define DEFINE_PROPERTY_DEFINITION_OBJECT_REF( type ) \ template<> struct PropertyDefinitionOp<type> { \ void defineProperty( PvdPropertyDefinitionHelper& mHelper, NamespacedName mClassKey) \ { \ mHelper.createProperty( mClassKey, "", getPvdNamespacedNameForType<ObjectRef>(), PropertyType::Scalar ); \ } \ }; DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxTetrahedronMesh* ) DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxTriangleMesh* ) DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxBVH33TriangleMesh* ) DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxBVH34TriangleMesh* ) DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxConvexMesh* ) DEFINE_PROPERTY_DEFINITION_OBJECT_REF( PxHeightField* ) struct PvdClassInfoDefine { PvdPropertyDefinitionHelper& mHelper; NamespacedName mClassKey; PvdClassInfoDefine( PvdPropertyDefinitionHelper& info, NamespacedName inClassName ) : mHelper( info ) , mClassKey( inClassName ) { } PvdClassInfoDefine( const PvdClassInfoDefine& other ) : mHelper( other.mHelper ) , mClassKey( other.mClassKey ) { } void defineProperty( NamespacedName inDtype, const char* semantic = "", PropertyType::Enum inPType = PropertyType::Scalar ) { mHelper.createProperty( mClassKey, semantic, inDtype, inPType ); } void pushName( const char* inName ) { mHelper.pushName( inName ); } void pushBracketedName( const char* inName) { mHelper.pushBracketedName( inName ); } void popName() { mHelper.popName(); } inline void defineNameValueDefs( const PxU32ToName* theConversions ) { while( theConversions->mName != NULL ) { mHelper.addNamedValue( theConversions->mName, theConversions->mValue ); ++theConversions; } } template<typename TAccessorType> void simpleProperty( PxU32, TAccessorType& /*inProp */) { typedef typename TAccessorType::prop_type TPropertyType; PropertyDefinitionOp<TPropertyType>().defineProperty( mHelper, mClassKey ); } template<typename TAccessorType, typename TInfoType> void extendedIndexedProperty( PxU32* key, const TAccessorType& inProp, TInfoType& ) { simpleProperty(*key, inProp); } template<typename TDataType> static NamespacedName getNameForEnumType() { size_t s = sizeof( TDataType ); switch(s) { case 1: return getPvdNamespacedNameForType<PxU8>(); case 2: return getPvdNamespacedNameForType<PxU16>(); case 4: return getPvdNamespacedNameForType<PxU32>(); default: return getPvdNamespacedNameForType<PxU64>(); } } template<typename TAccessorType> void enumProperty( PxU32 /*key*/, TAccessorType& /*inProp*/, const PxU32ToName* inConversions ) { typedef typename TAccessorType::prop_type TPropType; defineNameValueDefs( inConversions ); defineProperty( getNameForEnumType<TPropType>(), "Enumeration Value" ); } template<typename TAccessorType> void flagsProperty( PxU32 /*key*/, const TAccessorType& /*inAccessor*/, const PxU32ToName* inConversions ) { typedef typename TAccessorType::prop_type TPropType; defineNameValueDefs( inConversions ); defineProperty( getNameForEnumType<TPropType>(), "Bitflag" ); } template<typename TAccessorType, typename TInfoType> void complexProperty( PxU32* key, const TAccessorType& inAccessor, TInfoType& inInfo ) { PxU32 theOffset = inAccessor.mOffset; inInfo.visitBaseProperties( makePvdPropertyFilter( *this, key, &theOffset ) ); inInfo.visitInstanceProperties( makePvdPropertyFilter( *this, key, &theOffset ) ); } template<typename TAccessorType, typename TInfoType> void bufferCollectionProperty( PxU32* key, const TAccessorType& inAccessor, TInfoType& inInfo ) { complexProperty(key, inAccessor, inInfo); } template<PxU32 TKey, typename TObjectType, typename TPropertyType, PxU32 TEnableFlag> void handleBuffer( const PxBufferPropertyInfo<TKey, TObjectType, const PxArray< TPropertyType >&, TEnableFlag>& inProp ) { mHelper.pushName( inProp.mName ); defineProperty( getPvdNamespacedNameForType<TPropertyType>(), "", PropertyType::Array ); mHelper.popName(); } template<PxU32 TKey, typename TObjectType, typename TCollectionType> void handleCollection( const PxReadOnlyCollectionPropertyInfo<TKey, TObjectType, TCollectionType>& inProp ) { mHelper.pushName( inProp.mName ); defineProperty( getPvdNamespacedNameForType<TCollectionType>(), "", PropertyType::Array ); mHelper.popName(); } template<PxU32 TKey, typename TObjectType, typename TEnumType> void handleCollection( const PxReadOnlyCollectionPropertyInfo<TKey, TObjectType, TEnumType>& inProp, const PxU32ToName* inConversions ) { mHelper.pushName( inProp.mName ); defineNameValueDefs( inConversions ); defineProperty( getNameForEnumType<TEnumType>(), "Enumeration Value", PropertyType::Array ); mHelper.popName(); } private: PvdClassInfoDefine& operator=(const PvdClassInfoDefine&); }; template<typename TPropType> struct SimplePropertyValueStructOp { void addPropertyMessageArg( PvdPropertyDefinitionHelper& mHelper, PxU32 inOffset ) { mHelper.addPropertyMessageArg<TPropType>( inOffset ); } }; #define DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_OP_NOP( type ) \ template<> struct SimplePropertyValueStructOp<type> { void addPropertyMessageArg( PvdPropertyDefinitionHelper&, PxU32 ){}}; DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_OP_NOP( PxStridedData ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_OP_NOP( PxBoundedData ) #define DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( type ) \ template<> struct SimplePropertyValueStructOp<type> { \ void addPropertyMessageArg( PvdPropertyDefinitionHelper& mHelper, PxU32 inOffset ) \ { \ mHelper.addPropertyMessageArg<VoidPtr>( inOffset ); \ } \ }; DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxTetrahedronMesh* ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxTriangleMesh* ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxBVH33TriangleMesh* ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxBVH34TriangleMesh* ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxConvexMesh* ) DEFINE_SIMPLE_PROPERTY_VALUE_STRUCT_VOIDPTR_OP( PxHeightField* ) struct PvdClassInfoValueStructDefine { private: PvdClassInfoValueStructDefine& operator=(const PvdClassInfoValueStructDefine&); public: PvdPropertyDefinitionHelper& mHelper; PvdClassInfoValueStructDefine( PvdPropertyDefinitionHelper& info ) : mHelper( info ) { } PvdClassInfoValueStructDefine( const PvdClassInfoValueStructDefine& other ) : mHelper( other.mHelper ) { } void defineValueStructOffset( const ValueStructOffsetRecord& inProp, PxU32 inPropSize ) { if( inProp.mHasValidOffset ) { switch( inPropSize ) { case 8: mHelper.addPropertyMessageArg<PxU64>( inProp.mOffset ); break; case 4: mHelper.addPropertyMessageArg<PxU32>( inProp.mOffset ); break; case 2: mHelper.addPropertyMessageArg<PxU16>( inProp.mOffset ); break; default: PX_ASSERT(1 == inPropSize); mHelper.addPropertyMessageArg<PxU8>( inProp.mOffset ); break; } } } void pushName( const char* inName ) { mHelper.pushName( inName ); } void pushBracketedName( const char* inName) { mHelper.pushBracketedName( inName ); } void popName() { mHelper.popName(); } template<typename TAccessorType, typename TInfoType> void bufferCollectionProperty( PxU32* /*key*/, const TAccessorType& /*inAccessor*/, TInfoType& /*inInfo*/ ) { //complexProperty(key, inAccessor, inInfo); } template<typename TAccessorType> void simpleProperty( PxU32 /*key*/, TAccessorType& inProp ) { typedef typename TAccessorType::prop_type TPropertyType; if ( inProp.mHasValidOffset ) { SimplePropertyValueStructOp<TPropertyType>().addPropertyMessageArg( mHelper, inProp.mOffset ); } } template<typename TAccessorType> void enumProperty( PxU32 /*key*/, TAccessorType& inAccessor, const PxU32ToName* /*inConversions */) { typedef typename TAccessorType::prop_type TPropType; defineValueStructOffset( inAccessor, sizeof( TPropType ) ); } template<typename TAccessorType> void flagsProperty( PxU32 /*key*/, const TAccessorType& inAccessor, const PxU32ToName* /*inConversions */) { typedef typename TAccessorType::prop_type TPropType; defineValueStructOffset( inAccessor, sizeof( TPropType ) ); } template<typename TAccessorType, typename TInfoType> void complexProperty( PxU32* key, const TAccessorType& inAccessor, TInfoType& inInfo ) { PxU32 theOffset = inAccessor.mOffset; inInfo.visitBaseProperties( makePvdPropertyFilter( *this, key, &theOffset ) ); inInfo.visitInstanceProperties( makePvdPropertyFilter( *this, key, &theOffset ) ); } template<PxU32 TKey, typename TObjectType, typename TCollectionType> void handleCollection( const PxReadOnlyCollectionPropertyInfo<TKey, TObjectType, TCollectionType>& /*prop*/ ) { } template<PxU32 TKey, typename TObjectType, typename TEnumType> void handleCollection( const PxReadOnlyCollectionPropertyInfo<TKey, TObjectType, TEnumType>& /*prop*/, const PxU32ToName* /*inConversions */) { } template<PxU32 TKey, typename TObjectType, typename TInfoType> void handleCollection( const PxBufferCollectionPropertyInfo<TKey, TObjectType, TInfoType>& /*prop*/, const TInfoType& /*inInfo */) { } }; } } #endif #endif
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PxMetaDataCppPrefix.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_META_DATA_CPP_PREFIX_H #define PX_META_DATA_CPP_PREFIX_H //Header that is only included by the clang-generated cpp files. //Used to change compilation settings where necessary for only those files. #endif
NVIDIA-Omniverse/PhysX/physx/source/physxmetadata/core/include/PvdMetaDataExtensions.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_META_DATA_EXTENSIONS_H #define PX_META_DATA_EXTENSIONS_H #include "PxMetaDataObjects.h" #if PX_SUPPORT_PVD #include "PxPvdObjectModelBaseTypes.h" namespace physx { namespace pvdsdk { template<> PX_INLINE NamespacedName getPvdNamespacedNameForType<physx::PxMetaDataPlane>() { return getPvdNamespacedNameForType<PxVec4>(); } template<> PX_INLINE NamespacedName getPvdNamespacedNameForType<physx::PxRigidActor*>() { return getPvdNamespacedNameForType<VoidPtr>(); } }} #endif namespace physx { namespace Vd { //Additional properties that exist only in pvd land. struct PxPvdOnlyProperties { enum Enum { FirstProp = PxPropertyInfoName::LastPxPropertyInfoName, PxScene_Frame, PxScene_Contacts, PxScene_SimulateElapsedTime, #define DEFINE_ENUM_RANGE( stem, count ) \ stem##Begin, \ stem##End = stem##Begin + count //I can't easily add up the number of required property entries, but it is large due to the below //geometry count squared properties. Thus I punt and allocate way more than I need right now. DEFINE_ENUM_RANGE( PxScene_SimulationStatistics, 1000 ), DEFINE_ENUM_RANGE( PxSceneDesc_Limits, PxPropertyInfoName::PxSceneLimits_PropertiesStop - PxPropertyInfoName::PxSceneLimits_PropertiesStart ), DEFINE_ENUM_RANGE( PxSimulationStatistics_NumShapes, PxGeometryType::eGEOMETRY_COUNT ), DEFINE_ENUM_RANGE( PxSimulationStatistics_NumDiscreteContactPairs, PxGeometryType::eGEOMETRY_COUNT * PxGeometryType::eGEOMETRY_COUNT ), DEFINE_ENUM_RANGE( PxSimulationStatistics_NumModifiedContactPairs, PxGeometryType::eGEOMETRY_COUNT * PxGeometryType::eGEOMETRY_COUNT ), DEFINE_ENUM_RANGE( PxSimulationStatistics_NumSweptIntegrationPairs, PxGeometryType::eGEOMETRY_COUNT * PxGeometryType::eGEOMETRY_COUNT ), DEFINE_ENUM_RANGE( PxSimulationStatistics_NumTriggerPairs, PxGeometryType::eGEOMETRY_COUNT * PxGeometryType::eGEOMETRY_COUNT ), DEFINE_ENUM_RANGE( PxRigidDynamic_SolverIterationCounts, 2 ), DEFINE_ENUM_RANGE( PxArticulation_SolverIterationCounts, 2 ), DEFINE_ENUM_RANGE( PxArticulationJoint_SwingLimit, 2 ), DEFINE_ENUM_RANGE( PxArticulationJoint_TwistLimit, 2 ), DEFINE_ENUM_RANGE( PxConvexMeshGeometry_Scale, PxPropertyInfoName::PxMeshScale_PropertiesStop - PxPropertyInfoName::PxMeshScale_PropertiesStart ), DEFINE_ENUM_RANGE( PxTriangleMeshGeometry_Scale, PxPropertyInfoName::PxMeshScale_PropertiesStop - PxPropertyInfoName::PxMeshScale_PropertiesStart ), LastPxPvdOnlyProperty }; }; template<PxU32 TKey, typename TObjectType, typename TPropertyType, PxU32 TEnableFlag> struct PxBufferPropertyInfo : PxReadOnlyPropertyInfo< TKey, TObjectType, TPropertyType > { typedef PxReadOnlyPropertyInfo< TKey, TObjectType, TPropertyType > TBaseType; typedef typename TBaseType::TGetterType TGetterType; PxBufferPropertyInfo( const char* inName, TGetterType inGetter ) : TBaseType( inName, inGetter ) { } bool isEnabled( PxU32 inFlags ) const { return (inFlags & TEnableFlag) > 0; } }; #define DECLARE_BUFFER_PROPERTY( objectType, baseType, propType, propName, fieldName, flagName ) \ typedef PxBufferPropertyInfo< PxPvdOnlyProperties::baseType##_##propName, objectType, propType, flagName > T##objectType##propName##Base; \ inline propType get##propName( const objectType* inData ) { return inData->fieldName; } \ struct baseType##propName##Property : T##objectType##propName##Base \ { \ baseType##propName##Property() : T##objectType##propName##Base( #propName, get##propName ){} \ }; template<PxU32 PropertyKey, typename TEnumType > struct IndexerToNameMap { PxEnumTraits<TEnumType> Converter; }; struct ValueStructOffsetRecord { mutable bool mHasValidOffset; mutable PxU32 mOffset; ValueStructOffsetRecord() : mHasValidOffset( false ), mOffset( 0 ) {} void setupValueStructOffset( PxU32 inValue ) const { mHasValidOffset = true; mOffset = inValue; } }; template<PxU32 TKey, typename TObjectType, typename TPropertyType> struct PxPvdReadOnlyPropertyAccessor : public ValueStructOffsetRecord { typedef PxReadOnlyPropertyInfo<TKey,TObjectType,TPropertyType> TPropertyInfoType; typedef TPropertyType prop_type; const TPropertyInfoType mProperty; PxPvdReadOnlyPropertyAccessor( const TPropertyInfoType& inProp ) : mProperty( inProp ) { } prop_type get( const TObjectType* inObj ) const { return mProperty.get( inObj ); } private: PxPvdReadOnlyPropertyAccessor& operator=(const PxPvdReadOnlyPropertyAccessor&); }; template<PxU32 TKey, typename TObjectType, typename TPropertyType> struct PxBufferCollectionPropertyAccessor : public ValueStructOffsetRecord { typedef PxBufferCollectionPropertyInfo< TKey, TObjectType, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; const TPropertyInfoType& mProperty; const char* mName; PxBufferCollectionPropertyAccessor( const TPropertyInfoType& inProp, const char* inName ) : mProperty( inProp ) , mName( inName ) { } const char* name() const { return mName; } PxU32 size( const TObjectType* inObj ) const { return mProperty.size( inObj ); } PxU32 get( const TObjectType* inObj, prop_type* buffer, PxU32 inNumItems) const { return mProperty.get( inObj, buffer, inNumItems); } void set( TObjectType* inObj, prop_type* inBuffer, PxU32 inNumItems ) const { mProperty.set( inObj, inBuffer, inNumItems ); } }; template<PxU32 TKey, typename TObjectType, typename TIndexType, typename TPropertyType> struct PxPvdIndexedPropertyAccessor : public ValueStructOffsetRecord { typedef PxIndexedPropertyInfo< TKey, TObjectType, TIndexType, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; TIndexType mIndex; const TPropertyInfoType& mProperty; PxPvdIndexedPropertyAccessor( const TPropertyInfoType& inProp, PxU32 inIndex ) : mIndex( static_cast<TIndexType>( inIndex ) ) , mProperty( inProp ) { } prop_type get( const TObjectType* inObj ) const { return mProperty.get( inObj, mIndex ); } void set( TObjectType* inObj, prop_type val ) const { mProperty.set( inObj, mIndex, val ); } void operator = (PxPvdIndexedPropertyAccessor&) {} }; template<PxU32 TKey, typename TObjectType, typename TIndexType, typename TPropertyType> struct PxPvdExtendedIndexedPropertyAccessor : public ValueStructOffsetRecord { typedef PxExtendedIndexedPropertyInfo< TKey, TObjectType, TIndexType, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; TIndexType mIndex; const TPropertyInfoType& mProperty; PxPvdExtendedIndexedPropertyAccessor( const TPropertyInfoType& inProp, PxU32 inIndex ) : mIndex( static_cast<TIndexType>( inIndex ) ) , mProperty( inProp ) { } PxU32 size( const TObjectType* inObj ) const { return mProperty.size( inObj ); } prop_type get( const TObjectType* inObj, TIndexType index ) const { return mProperty.get( inObj, index ); } void set( TObjectType* inObj, TIndexType index, prop_type val ) const { mProperty.set( inObj, index, val ); } void operator = (PxPvdExtendedIndexedPropertyAccessor&) {} }; template<PxU32 TKey, typename TObjectType, typename TIndexType, typename TPropertyType> struct PxPvdFixedSizeLookupTablePropertyAccessor : public ValueStructOffsetRecord { typedef PxFixedSizeLookupTablePropertyInfo< TKey, TObjectType, TIndexType, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; TIndexType mIndex; const TPropertyInfoType& mProperty; PxPvdFixedSizeLookupTablePropertyAccessor( const TPropertyInfoType& inProp, const PxU32 inIndex3 ) : mIndex( static_cast<TIndexType>( inIndex3 ) ) , mProperty( inProp ) { } PxU32 size( const TObjectType* inObj ) const { return mProperty.size( inObj ); } prop_type getX( const TObjectType* inObj, const TIndexType index ) const { return mProperty.getX( inObj, index ); } prop_type getY( const TObjectType* inObj, const TIndexType index ) const { return mProperty.getY( inObj, index ); } void addPair( TObjectType* inObj, const PxReal x, const PxReal y ) { const_cast<TPropertyInfoType&>(mProperty).addPair( inObj, x, y ); } void clear( TObjectType* inObj ) { const_cast<TPropertyInfoType&>(mProperty).clear( inObj ); } void operator = (PxPvdFixedSizeLookupTablePropertyAccessor&) {} }; template<PxU32 TKey, typename TObjectType, typename TIdx0Type, typename TIdx1Type, typename TPropertyType> struct PxPvdDualIndexedPropertyAccessor : public ValueStructOffsetRecord { typedef PxDualIndexedPropertyInfo< TKey, TObjectType, TIdx0Type, TIdx1Type, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; TIdx0Type mIdx0; TIdx1Type mIdx1; const TPropertyInfoType& mProperty; PxPvdDualIndexedPropertyAccessor( const TPropertyInfoType& inProp, PxU32 idx0, PxU32 idx1 ) : mIdx0( static_cast<TIdx0Type>( idx0 ) ) , mIdx1( static_cast<TIdx1Type>( idx1 ) ) , mProperty( inProp ) { } prop_type get( const TObjectType* inObj ) const { return mProperty.get( inObj, mIdx0, mIdx1 ); } void set( TObjectType* inObj, prop_type val ) const { mProperty.set( inObj, mIdx0, mIdx1, val ); } private: PxPvdDualIndexedPropertyAccessor& operator = (const PxPvdDualIndexedPropertyAccessor&); }; template<PxU32 TKey, typename TObjectType, typename TIdx0Type, typename TIdx1Type, typename TPropertyType> struct PxPvdExtendedDualIndexedPropertyAccessor : public ValueStructOffsetRecord { typedef PxExtendedDualIndexedPropertyInfo< TKey, TObjectType, TIdx0Type, TIdx1Type, TPropertyType > TPropertyInfoType; typedef TPropertyType prop_type; TIdx0Type mIdx0; TIdx1Type mIdx1; const TPropertyInfoType& mProperty; PxPvdExtendedDualIndexedPropertyAccessor( const TPropertyInfoType& inProp, PxU32 idx0, PxU32 idx1 ) : mIdx0( static_cast<TIdx0Type>( idx0 ) ) , mIdx1( static_cast<TIdx1Type>( idx1 ) ) , mProperty( inProp ) { } prop_type get( const TObjectType* inObj ) const { return mProperty.get( inObj, mIdx0, mIdx1 ); } void set( TObjectType* inObj, prop_type val ) const { mProperty.set( inObj, mIdx0, mIdx1, val ); } private: PxPvdExtendedDualIndexedPropertyAccessor& operator = (const PxPvdExtendedDualIndexedPropertyAccessor&); }; template<PxU32 TKey, typename TObjType, typename TPropertyType> struct PxPvdRangePropertyAccessor : public ValueStructOffsetRecord { typedef PxRangePropertyInfo<TKey, TObjType, TPropertyType> TPropertyInfoType; typedef TPropertyType prop_type; bool mFirstValue; const TPropertyInfoType& mProperty; PxPvdRangePropertyAccessor( const TPropertyInfoType& inProp, bool inFirstValue ) : mFirstValue( inFirstValue ) , mProperty( inProp ) { } prop_type get( const TObjType* inObj ) const { prop_type first,second; mProperty.get( inObj, first, second ); return mFirstValue ? first : second; } void set( TObjType* inObj, prop_type val ) const { prop_type first,second; mProperty.get( inObj, first, second ); if ( mFirstValue ) mProperty.set( inObj, val, second ); else mProperty.set( inObj, first, val ); } void operator = (PxPvdRangePropertyAccessor&) {} }; template<typename TDataType> struct IsFlagsType { bool FlagData; }; template<typename TEnumType, typename TStorageType> struct IsFlagsType<PxFlags<TEnumType, TStorageType> > { const PxU32ToName* FlagData; IsFlagsType<PxFlags<TEnumType, TStorageType> > () : FlagData( PxEnumTraits<TEnumType>().NameConversion ) {} }; template<typename TDataType> struct PvdClassForType { bool Unknown; }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvd.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdImpl.h" namespace physx { namespace pvdsdk { ForwardingAllocator gForwardingAllocator; PxAllocatorCallback* gPvdAllocatorCallback = &gForwardingAllocator; } // namespace pvdsdk PxPvd* PxCreatePvd(PxFoundation& foundation) { pvdsdk::gPvdAllocatorCallback = &foundation.getAllocatorCallback(); pvdsdk::PvdImpl::initialize(); return pvdsdk::PvdImpl::getInstance(); } } // namespace physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectModelMetaData.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #include "PxPvdObjectModelInternalTypes.h" #include "PxPvdObjectModelMetaData.h" #include "PxPvdInternalByteStreams.h" #include "PxPvdMarshalling.h" using namespace physx; using namespace pvdsdk; namespace { struct PropDescImpl : public PropertyDescription, public PxUserAllocated { PxArray<NamedValue> mValueNames; PropDescImpl(const PropertyDescription& inBase, StringTable& table) : PropertyDescription(inBase), mValueNames("NamedValue") { mName = table.registerStr(mName); } PropDescImpl() : mValueNames("NamedValue") { } template <typename TSerializer> void serialize(TSerializer& serializer) { serializer.streamify(mOwnerClassName); serializer.streamify(mOwnerClassId); serializer.streamify(mSemantic); serializer.streamify(mDatatype); serializer.streamify(mDatatypeName); serializer.streamify(mPropertyType); serializer.streamify(mPropertyId); serializer.streamify(m32BitOffset); serializer.streamify(m64BitOffset); serializer.streamify(mValueNames); serializer.streamify(mName); } }; struct ClassDescImpl : public ClassDescription, public PxUserAllocated { PxArray<PropDescImpl*> mPropImps; PxArray<PtrOffset> m32OffsetArray; PxArray<PtrOffset> m64OffsetArray; ClassDescImpl(const ClassDescription& inBase) : ClassDescription(inBase) , mPropImps("PropDescImpl*") , m32OffsetArray("ClassDescImpl::m32OffsetArray") , m64OffsetArray("ClassDescImpl::m64OffsetArray") { PVD_FOREACH(idx, get32BitSizeInfo().mPtrOffsets.size()) m32OffsetArray.pushBack(get32BitSizeInfo().mPtrOffsets[idx]); PVD_FOREACH(idx, get64BitSizeInfo().mPtrOffsets.size()) m64OffsetArray.pushBack(get64BitSizeInfo().mPtrOffsets[idx]); } ClassDescImpl() : mPropImps("PropDescImpl*") , m32OffsetArray("ClassDescImpl::m32OffsetArray") , m64OffsetArray("ClassDescImpl::m64OffsetArray") { } PropDescImpl* findProperty(String name) { PVD_FOREACH(idx, mPropImps.size()) { if(safeStrEq(mPropImps[idx]->mName, name)) return mPropImps[idx]; } return NULL; } void addProperty(PropDescImpl* prop) { mPropImps.pushBack(prop); } void addPtrOffset(PtrOffsetType::Enum type, uint32_t offset32, uint32_t offset64) { m32OffsetArray.pushBack(PtrOffset(type, offset32)); m64OffsetArray.pushBack(PtrOffset(type, offset64)); get32BitSizeInfo().mPtrOffsets = DataRef<PtrOffset>(m32OffsetArray.begin(), m32OffsetArray.end()); get64BitSizeInfo().mPtrOffsets = DataRef<PtrOffset>(m64OffsetArray.begin(), m64OffsetArray.end()); } template <typename TSerializer> void serialize(TSerializer& serializer) { serializer.streamify(mName); serializer.streamify(mClassId); serializer.streamify(mBaseClass); serializer.streamify(mPackedUniformWidth); serializer.streamify(mPackedClassType); serializer.streamify(mLocked); serializer.streamify(mRequiresDestruction); serializer.streamify(get32BitSize()); serializer.streamify(get32BitSizeInfo().mDataByteSize); serializer.streamify(get32BitSizeInfo().mAlignment); serializer.streamify(get64BitSize()); serializer.streamify(get64BitSizeInfo().mDataByteSize); serializer.streamify(get64BitSizeInfo().mAlignment); serializer.streamifyLinks(mPropImps); serializer.streamify(m32OffsetArray); serializer.streamify(m64OffsetArray); get32BitSizeInfo().mPtrOffsets = DataRef<PtrOffset>(m32OffsetArray.begin(), m32OffsetArray.end()); get64BitSizeInfo().mPtrOffsets = DataRef<PtrOffset>(m64OffsetArray.begin(), m64OffsetArray.end()); } }; class StringTableImpl : public StringTable, public PxUserAllocated { PxHashMap<const char*, char*> mStrings; uint32_t mNextStrHandle; PxHashMap<uint32_t, char*> mHandleToStr; PxHashMap<const char*, uint32_t> mStrToHandle; public: StringTableImpl() : mStrings("StringTableImpl::mStrings") , mNextStrHandle(1) , mHandleToStr("StringTableImpl::mHandleToStr") , mStrToHandle("StringTableImpl::mStrToHandle") { } uint32_t nextHandleValue() { return mNextStrHandle++; } virtual ~StringTableImpl() { for(PxHashMap<const char*, char*>::Iterator iter = mStrings.getIterator(); !iter.done(); ++iter) PX_FREE(iter->second); mStrings.clear(); } virtual uint32_t getNbStrs() { return mStrings.size(); } virtual uint32_t getStrs(const char** outStrs, uint32_t bufLen, uint32_t startIdx = 0) { startIdx = PxMin(getNbStrs(), startIdx); uint32_t numStrs(PxMin(getNbStrs() - startIdx, bufLen)); PxHashMap<const char*, char*>::Iterator iter(mStrings.getIterator()); for(uint32_t idx = 0; idx < startIdx; ++idx, ++iter) ; for(uint32_t idx = 0; idx < numStrs && !iter.done(); ++idx, ++iter) outStrs[idx] = iter->second; return numStrs; } void addStringHandle(char* str, uint32_t hdl) { mHandleToStr.insert(hdl, str); mStrToHandle.insert(str, hdl); } uint32_t addStringHandle(char* str) { uint32_t theNewHandle = nextHandleValue(); addStringHandle(str, theNewHandle); return theNewHandle; } const char* doRegisterStr(const char* str, bool& outAdded) { PX_ASSERT(isMeaningful(str)); const PxHashMap<const char*, char*>::Entry* entry(mStrings.find(str)); if(entry == NULL) { outAdded = true; char* retval(copyStr(str)); mStrings.insert(retval, retval); return retval; } return entry->second; } virtual const char* registerStr(const char* str, bool& outAdded) { outAdded = false; if(isMeaningful(str) == false) return ""; const char* retval = doRegisterStr(str, outAdded); if(outAdded) addStringHandle(const_cast<char*>(retval)); return retval; } NamespacedName registerName(const NamespacedName& nm) { return NamespacedName(registerStr(nm.mNamespace), registerStr(nm.mName)); } const char* registerStr(const char* str) { bool ignored; return registerStr(str, ignored); } virtual StringHandle strToHandle(const char* str) { if(isMeaningful(str) == false) return 0; const PxHashMap<const char*, uint32_t>::Entry* entry(mStrToHandle.find(str)); if(entry) return entry->second; bool added = false; const char* registeredStr = doRegisterStr(str, added); uint32_t theNewHandle = addStringHandle(const_cast<char*>(registeredStr)); PX_ASSERT(mStrToHandle.find(str)); PX_ASSERT(added); return theNewHandle; } virtual const char* handleToStr(uint32_t hdl) { if(hdl == 0) return ""; const PxHashMap<uint32_t, char*>::Entry* entry(mHandleToStr.find(hdl)); if(entry) return entry->second; // unregistered handle... return ""; } void write(PvdOutputStream& stream) { uint32_t numStrs = static_cast<uint32_t>(mHandleToStr.size()); stream << numStrs; stream << mNextStrHandle; for(PxHashMap<uint32_t, char*>::Iterator iter = mHandleToStr.getIterator(); !iter.done(); ++iter) { stream << iter->first; uint32_t len = static_cast<uint32_t>(strlen(iter->second) + 1); stream << len; stream.write(reinterpret_cast<uint8_t*>(iter->second), len); } } template <typename TReader> void read(TReader& stream) { mHandleToStr.clear(); mStrToHandle.clear(); uint32_t numStrs; stream >> numStrs; stream >> mNextStrHandle; PxArray<uint8_t> readBuffer("StringTable::read::readBuffer"); uint32_t bufSize = 0; for(uint32_t idx = 0; idx < numStrs; ++idx) { uint32_t handleValue; uint32_t bufLen; stream >> handleValue; stream >> bufLen; if(bufSize < bufLen) readBuffer.resize(bufLen); bufSize = PxMax(bufSize, bufLen); stream.read(readBuffer.begin(), bufLen); bool ignored; const char* newStr = doRegisterStr(reinterpret_cast<const char*>(readBuffer.begin()), ignored); addStringHandle(const_cast<char*>(newStr), handleValue); } } virtual void release() { PVD_DELETE(this); } private: StringTableImpl& operator=(const StringTableImpl&); }; struct NamespacedNameHasher { uint32_t operator()(const NamespacedName& nm) { return PxHash<const char*>()(nm.mNamespace) ^ PxHash<const char*>()(nm.mName); } bool equal(const NamespacedName& lhs, const NamespacedName& rhs) { return safeStrEq(lhs.mNamespace, rhs.mNamespace) && safeStrEq(lhs.mName, rhs.mName); } }; struct ClassPropertyName { NamespacedName mName; String mPropName; ClassPropertyName(const NamespacedName& name = NamespacedName(), String propName = "") : mName(name), mPropName(propName) { } }; struct ClassPropertyNameHasher { uint32_t operator()(const ClassPropertyName& nm) { return NamespacedNameHasher()(nm.mName) ^ PxHash<const char*>()(nm.mPropName); } bool equal(const ClassPropertyName& lhs, const ClassPropertyName& rhs) { return NamespacedNameHasher().equal(lhs.mName, rhs.mName) && safeStrEq(lhs.mPropName, rhs.mPropName); } }; struct PropertyMessageEntryImpl : public PropertyMessageEntry { PropertyMessageEntryImpl(const PropertyMessageEntry& data) : PropertyMessageEntry(data) { } PropertyMessageEntryImpl() { } template <typename TSerializerType> void serialize(TSerializerType& serializer) { serializer.streamify(mDatatypeName); serializer.streamify(mDatatypeId); serializer.streamify(mMessageOffset); serializer.streamify(mByteSize); serializer.streamify(mDestByteSize); serializer.streamify(mProperty); } }; struct PropertyMessageDescriptionImpl : public PropertyMessageDescription, public PxUserAllocated { PxArray<PropertyMessageEntryImpl> mEntryImpls; PxArray<PropertyMessageEntry> mEntries; PxArray<uint32_t> mStringOffsetArray; PropertyMessageDescriptionImpl(const PropertyMessageDescription& data) : PropertyMessageDescription(data) , mEntryImpls("PropertyMessageDescriptionImpl::mEntryImpls") , mEntries("PropertyMessageDescriptionImpl::mEntries") , mStringOffsetArray("PropertyMessageDescriptionImpl::mStringOffsets") { } PropertyMessageDescriptionImpl() : mEntryImpls("PropertyMessageDescriptionImpl::mEntryImpls") , mEntries("PropertyMessageDescriptionImpl::mEntries") , mStringOffsetArray("PropertyMessageDescriptionImpl::mStringOffsets") { } ~PropertyMessageDescriptionImpl() { } void addEntry(const PropertyMessageEntryImpl& entry) { mEntryImpls.pushBack(entry); mEntries.pushBack(entry); mProperties = DataRef<PropertyMessageEntry>(mEntries.begin(), mEntries.end()); } template <typename TSerializerType> void serialize(TSerializerType& serializer) { serializer.streamify(mClassName); serializer.streamify(mClassId); // No other class has this id, it is DB-unique serializer.streamify(mMessageName); serializer.streamify(mMessageId); serializer.streamify(mMessageByteSize); serializer.streamify(mEntryImpls); serializer.streamify(mStringOffsetArray); if(mEntries.size() != mEntryImpls.size()) { mEntries.clear(); uint32_t numEntries = static_cast<uint32_t>(mEntryImpls.size()); for(uint32_t idx = 0; idx < numEntries; ++idx) mEntries.pushBack(mEntryImpls[idx]); } mProperties = DataRef<PropertyMessageEntry>(mEntries.begin(), mEntries.end()); mStringOffsets = DataRef<uint32_t>(mStringOffsetArray.begin(), mStringOffsetArray.end()); } private: PropertyMessageDescriptionImpl& operator=(const PropertyMessageDescriptionImpl&); }; struct PvdObjectModelMetaDataImpl : public PvdObjectModelMetaData, public PxUserAllocated { typedef PxHashMap<NamespacedName, ClassDescImpl*, NamespacedNameHasher> TNameToClassMap; typedef PxHashMap<ClassPropertyName, PropDescImpl*, ClassPropertyNameHasher> TNameToPropMap; typedef PxHashMap<NamespacedName, PropertyMessageDescriptionImpl*, NamespacedNameHasher> TNameToPropertyMessageMap; TNameToClassMap mNameToClasses; TNameToPropMap mNameToProperties; PxArray<ClassDescImpl*> mClasses; PxArray<PropDescImpl*> mProperties; StringTableImpl* mStringTable; TNameToPropertyMessageMap mPropertyMessageMap; PxArray<PropertyMessageDescriptionImpl*> mPropertyMessages; int32_t mNextClassId; uint32_t mRefCount; PvdObjectModelMetaDataImpl() : mNameToClasses("NamespacedName->ClassDescImpl*") , mNameToProperties("ClassPropertyName->PropDescImpl*") , mClasses("ClassDescImpl*") , mProperties("PropDescImpl*") , mStringTable(PVD_NEW(StringTableImpl)()) , mPropertyMessageMap("PropertyMessageMap") , mPropertyMessages("PvdObjectModelMetaDataImpl::mPropertyMessages") , mNextClassId(1) , mRefCount(0) { } private: PvdObjectModelMetaDataImpl& operator=(const PvdObjectModelMetaDataImpl&); public: int32_t nextClassId() { return mNextClassId++; } void initialize() { // Create the default classes. { ClassDescImpl& aryData = getOrCreateClassImpl(getPvdNamespacedNameForType<ArrayData>(), DataTypeToPvdTypeMap<ArrayData>::BaseTypeEnum); aryData.get32BitSize() = sizeof(ArrayData); aryData.get32BitSizeInfo().mAlignment = sizeof(void*); aryData.get64BitSize() = sizeof(ArrayData); aryData.get64BitSizeInfo().mAlignment = sizeof(void*); aryData.mLocked = true; } #define CREATE_BASIC_PVD_CLASS(type) \ { \ ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<type>(), getPvdTypeForType<type>()); \ cls.get32BitSize() = sizeof(type); \ cls.get32BitSizeInfo().mAlignment = sizeof(type); \ cls.get64BitSize() = sizeof(type); \ cls.get64BitSizeInfo().mAlignment = sizeof(type); \ cls.mLocked = true; \ cls.mPackedUniformWidth = sizeof(type); \ cls.mPackedClassType = getPvdTypeForType<type>(); \ } CREATE_BASIC_PVD_CLASS(int8_t) CREATE_BASIC_PVD_CLASS(uint8_t) CREATE_BASIC_PVD_CLASS(bool) CREATE_BASIC_PVD_CLASS(int16_t) CREATE_BASIC_PVD_CLASS(uint16_t) CREATE_BASIC_PVD_CLASS(int32_t) CREATE_BASIC_PVD_CLASS(uint32_t) // CREATE_BASIC_PVD_CLASS(uint32_t) CREATE_BASIC_PVD_CLASS(int64_t) CREATE_BASIC_PVD_CLASS(uint64_t) CREATE_BASIC_PVD_CLASS(float) CREATE_BASIC_PVD_CLASS(double) #undef CREATE_BASIC_PVD_CLASS #define CREATE_PTR_TYPE_PVD_CLASS(type, ptrType) \ { \ ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<type>(), getPvdTypeForType<type>()); \ cls.get32BitSize() = 4; \ cls.get32BitSizeInfo().mAlignment = 4; \ cls.get64BitSize() = 8; \ cls.get64BitSizeInfo().mAlignment = 8; \ cls.mLocked = true; \ cls.addPtrOffset(PtrOffsetType::ptrType, 0, 0); \ } CREATE_PTR_TYPE_PVD_CLASS(String, StringOffset) CREATE_PTR_TYPE_PVD_CLASS(VoidPtr, VoidPtrOffset) CREATE_PTR_TYPE_PVD_CLASS(StringHandle, StringOffset) CREATE_PTR_TYPE_PVD_CLASS(ObjectRef, VoidPtrOffset) #undef CREATE_64BIT_ADJUST_PVD_CLASS int32_t fltClassType = getPvdTypeForType<float>(); int32_t u32ClassType = getPvdTypeForType<uint32_t>(); int32_t v3ClassType = getPvdTypeForType<PxVec3>(); int32_t v4ClassType = getPvdTypeForType<PxVec4>(); int32_t qtClassType = getPvdTypeForType<PxQuat>(); { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PvdColor>(), getPvdTypeForType<PvdColor>()); createProperty(cls.mClassId, "r", "", getPvdTypeForType<uint8_t>(), PropertyType::Scalar); createProperty(cls.mClassId, "g", "", getPvdTypeForType<uint8_t>(), PropertyType::Scalar); createProperty(cls.mClassId, "b", "", getPvdTypeForType<uint8_t>(), PropertyType::Scalar); createProperty(cls.mClassId, "a", "", getPvdTypeForType<uint8_t>(), PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 1); PX_ASSERT(cls.get32BitSize() == 4); PX_ASSERT(cls.get64BitSizeInfo().mAlignment == 1); PX_ASSERT(cls.get64BitSize() == 4); PX_ASSERT(cls.mPackedUniformWidth == 1); PX_ASSERT(cls.mPackedClassType == getPvdTypeForType<uint8_t>()); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxVec2>(), getPvdTypeForType<PxVec2>()); createProperty(cls.mClassId, "x", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "y", "", fltClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 8); PX_ASSERT(cls.get64BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get64BitSize() == 8); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxVec3>(), getPvdTypeForType<PxVec3>()); createProperty(cls.mClassId, "x", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "y", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "z", "", fltClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 12); PX_ASSERT(cls.get64BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get64BitSize() == 12); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxVec4>(), getPvdTypeForType<PxVec4>()); createProperty(cls.mClassId, "x", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "y", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "z", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "w", "", fltClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 16); PX_ASSERT(cls.get64BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get64BitSize() == 16); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxQuat>(), getPvdTypeForType<PxQuat>()); createProperty(cls.mClassId, "x", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "y", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "z", "", fltClassType, PropertyType::Scalar); createProperty(cls.mClassId, "w", "", fltClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 16); PX_ASSERT(cls.get64BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get64BitSize() == 16); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxBounds3>(), getPvdTypeForType<PxBounds3>()); createProperty(cls.mClassId, "minimum", "", v3ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "maximum", "", v3ClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 24); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxTransform>(), getPvdTypeForType<PxTransform>()); createProperty(cls.mClassId, "q", "", qtClassType, PropertyType::Scalar); createProperty(cls.mClassId, "p", "", v3ClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 28); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxMat33>(), getPvdTypeForType<PxMat33>()); createProperty(cls.mClassId, "column0", "", v3ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "column1", "", v3ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "column2", "", v3ClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 36); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<PxMat44>(), getPvdTypeForType<PxMat44>()); createProperty(cls.mClassId, "column0", "", v4ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "column1", "", v4ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "column2", "", v4ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "column3", "", v4ClassType, PropertyType::Scalar); PX_ASSERT(cls.get32BitSizeInfo().mAlignment == 4); PX_ASSERT(cls.get32BitSize() == 64); PX_ASSERT(cls.mPackedUniformWidth == 4); PX_ASSERT(cls.mPackedClassType == fltClassType); cls.mLocked = true; } { ClassDescImpl& cls = getOrCreateClassImpl(getPvdNamespacedNameForType<U32Array4>(), getPvdTypeForType<U32Array4>()); createProperty(cls.mClassId, "d0", "", u32ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "d1", "", u32ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "d2", "", u32ClassType, PropertyType::Scalar); createProperty(cls.mClassId, "d3", "", u32ClassType, PropertyType::Scalar); cls.mLocked = true; } } virtual ~PvdObjectModelMetaDataImpl() { mStringTable->release(); PVD_FOREACH(idx, mClasses.size()) { if(mClasses[idx] != NULL) PVD_DELETE(mClasses[idx]); } mClasses.clear(); PVD_FOREACH(idx, mProperties.size()) PVD_DELETE(mProperties[idx]); mProperties.clear(); PVD_FOREACH(idx, mPropertyMessages.size()) PVD_DELETE(mPropertyMessages[idx]); mPropertyMessages.clear(); } ClassDescImpl& getOrCreateClassImpl(const NamespacedName& nm, int32_t idx) { ClassDescImpl* impl(getClassImpl(idx)); if(impl) return *impl; NamespacedName safeName(mStringTable->registerStr(nm.mNamespace), mStringTable->registerStr(nm.mName)); while(idx >= int32_t(mClasses.size())) mClasses.pushBack(NULL); mClasses[uint32_t(idx)] = PVD_NEW(ClassDescImpl)(ClassDescription(safeName, idx)); mNameToClasses.insert(nm, mClasses[uint32_t(idx)]); mNextClassId = PxMax(mNextClassId, idx + 1); return *mClasses[uint32_t(idx)]; } ClassDescImpl& getOrCreateClassImpl(const NamespacedName& nm) { ClassDescImpl* retval = findClassImpl(nm); if(retval) return *retval; return getOrCreateClassImpl(nm, nextClassId()); } virtual ClassDescription getOrCreateClass(const NamespacedName& nm) { return getOrCreateClassImpl(nm); } // get or create parent, lock parent. deriveFrom getOrCreatechild. virtual bool deriveClass(const NamespacedName& parent, const NamespacedName& child) { ClassDescImpl& p(getOrCreateClassImpl(parent)); ClassDescImpl& c(getOrCreateClassImpl(child)); if(c.mBaseClass >= 0) { PX_ASSERT(c.mBaseClass == p.mClassId); return false; } p.mLocked = true; c.mBaseClass = p.mClassId; c.get32BitSizeInfo() = p.get32BitSizeInfo(); c.get64BitSizeInfo() = p.get64BitSizeInfo(); c.mPackedClassType = p.mPackedClassType; c.mPackedUniformWidth = p.mPackedUniformWidth; c.mRequiresDestruction = p.mRequiresDestruction; c.m32OffsetArray = p.m32OffsetArray; c.m64OffsetArray = p.m64OffsetArray; // Add all the parent propertes to this class in the global name map. for(ClassDescImpl* parent0 = &p; parent0 != NULL; parent0 = getClassImpl(parent0->mBaseClass)) { PVD_FOREACH(idx, parent0->mPropImps.size()) mNameToProperties.insert(ClassPropertyName(c.mName, parent0->mPropImps[idx]->mName), parent0->mPropImps[idx]); if(parent0->mBaseClass < 0) break; } return true; } ClassDescImpl* findClassImpl(const NamespacedName& nm) const { const TNameToClassMap::Entry* entry(mNameToClasses.find(nm)); if(entry) return entry->second; return NULL; } virtual Option<ClassDescription> findClass(const NamespacedName& nm) const { ClassDescImpl* retval = findClassImpl(nm); if(retval) return *retval; return Option<ClassDescription>(); } ClassDescImpl* getClassImpl(int32_t classId) const { if(classId < 0) return NULL; uint32_t idx = uint32_t(classId); if(idx < mClasses.size()) return mClasses[idx]; return NULL; } virtual Option<ClassDescription> getClass(int32_t classId) const { ClassDescImpl* impl(getClassImpl(classId)); if(impl) return *impl; return None(); } virtual ClassDescription* getClassPtr(int32_t classId) const { return getClassImpl(classId); } virtual Option<ClassDescription> getParentClass(int32_t classId) const { ClassDescImpl* impl(getClassImpl(classId)); if(impl == NULL) return None(); return getClass(impl->mBaseClass); } virtual void lockClass(int32_t classId) { ClassDescImpl* impl(getClassImpl(classId)); PX_ASSERT(impl); if(impl) impl->mLocked = true; } virtual uint32_t getNbClasses() const { uint32_t total = 0; PVD_FOREACH(idx, mClasses.size()) if(mClasses[idx])++ total; return total; } virtual uint32_t getClasses(ClassDescription* outClasses, uint32_t requestCount, uint32_t startIndex = 0) const { uint32_t classCount(getNbClasses()); startIndex = PxMin(classCount, startIndex); uint32_t retAmount = PxMin(requestCount, classCount - startIndex); uint32_t idx = 0; while(startIndex) { if(mClasses[idx] != NULL) --startIndex; ++idx; } uint32_t inserted = 0; uint32_t classesSize = static_cast<uint32_t>(mClasses.size()); while(inserted < retAmount && idx < classesSize) { if(mClasses[idx] != NULL) { outClasses[inserted] = *mClasses[idx]; ++inserted; } ++idx; } return inserted; } uint32_t updateByteSizeAndGetPropertyAlignment(ClassDescriptionSizeInfo& dest, const ClassDescriptionSizeInfo& src) { uint32_t alignment = src.mAlignment; dest.mAlignment = PxMax(dest.mAlignment, alignment); uint32_t offset = align(dest.mDataByteSize, alignment); dest.mDataByteSize = offset + src.mByteSize; dest.mByteSize = align(dest.mDataByteSize, dest.mAlignment); return offset; } void transferPtrOffsets(ClassDescriptionSizeInfo& destInfo, PxArray<PtrOffset>& destArray, const PxArray<PtrOffset>& src, uint32_t offset) { PVD_FOREACH(idx, src.size()) destArray.pushBack(PtrOffset(src[idx].mOffsetType, src[idx].mOffset + offset)); destInfo.mPtrOffsets = DataRef<PtrOffset>(destArray.begin(), destArray.end()); } virtual Option<PropertyDescription> createProperty(int32_t classId, String name, String semantic, int32_t datatype, PropertyType::Enum propertyType) { ClassDescImpl* cls(getClassImpl(classId)); PX_ASSERT(cls); if(!cls) return None(); if(cls->mLocked) { PX_ASSERT(false); return None(); } PropDescImpl* impl(cls->findProperty(name)); // duplicate property definition if(impl) { PX_ASSERT(false); return None(); } if(datatype == getPvdTypeForType<String>()) { PX_ASSERT(false); return None(); } // The datatype for this property has not been declared. ClassDescImpl* propDType(getClassImpl(datatype)); PX_ASSERT(propDType); if(!propDType) return None(); NamespacedName propClsName(propDType->mName); int32_t propPackedWidth = propDType->mPackedUniformWidth; int32_t propPackedType = propDType->mPackedClassType; // The implications of properties being complex types aren't major //*until* you start trying to undue a property event that set values // of those complex types. Then things just get too complex. if(propDType->mRequiresDestruction) { PX_ASSERT(false); return None(); } bool requiresDestruction = propDType->mRequiresDestruction || cls->mRequiresDestruction; if(propertyType == PropertyType::Array) { int32_t tempId = DataTypeToPvdTypeMap<ArrayData>::BaseTypeEnum; propDType = getClassImpl(tempId); PX_ASSERT(propDType); if(!propDType) return None(); requiresDestruction = true; } uint32_t offset32 = updateByteSizeAndGetPropertyAlignment(cls->get32BitSizeInfo(), propDType->get32BitSizeInfo()); uint32_t offset64 = updateByteSizeAndGetPropertyAlignment(cls->get64BitSizeInfo(), propDType->get64BitSizeInfo()); transferPtrOffsets(cls->get32BitSizeInfo(), cls->m32OffsetArray, propDType->m32OffsetArray, offset32); transferPtrOffsets(cls->get64BitSizeInfo(), cls->m64OffsetArray, propDType->m64OffsetArray, offset64); propDType->mLocked = true; // Can't add members to the property type. cls->mRequiresDestruction = requiresDestruction; int32_t propId = int32_t(mProperties.size()); PropertyDescription newDesc(cls->mName, cls->mClassId, name, semantic, datatype, propClsName, propertyType, propId, offset32, offset64); mProperties.pushBack(PVD_NEW(PropDescImpl)(newDesc, *mStringTable)); mNameToProperties.insert(ClassPropertyName(cls->mName, mProperties.back()->mName), mProperties.back()); cls->addProperty(mProperties.back()); bool firstProp = cls->mPropImps.size() == 1; if(firstProp) { cls->mPackedUniformWidth = propPackedWidth; cls->mPackedClassType = propPackedType; } else { bool packed = (propPackedWidth > 0) && (cls->get32BitSizeInfo().mDataByteSize % propPackedWidth) == 0; if(cls->mPackedClassType >= 0) // maybe uncheck packed class type { if(propPackedType < 0 || cls->mPackedClassType != propPackedType // Object refs require conversion from stream to db id || datatype == getPvdTypeForType<ObjectRef>() // Strings also require conversion from stream to db id. || datatype == getPvdTypeForType<StringHandle>() || packed == false) cls->mPackedClassType = -1; } if(cls->mPackedUniformWidth >= 0) // maybe uncheck packed class width { if(propPackedWidth < 0 || cls->mPackedUniformWidth != propPackedWidth // object refs, because they require special treatment during parsing, // cannot be packed || datatype == getPvdTypeForType<ObjectRef>() // Likewise, string handles are special because the data needs to be sent *after* // the || datatype == getPvdTypeForType<StringHandle>() || packed == false) cls->mPackedUniformWidth = -1; // invalid packed width. } } return *mProperties.back(); } PropDescImpl* findPropImpl(const NamespacedName& clsName, String prop) const { const TNameToPropMap::Entry* entry = mNameToProperties.find(ClassPropertyName(clsName, prop)); if(entry) return entry->second; return NULL; } virtual Option<PropertyDescription> findProperty(const NamespacedName& cls, String propName) const { PropDescImpl* prop(findPropImpl(cls, propName)); if(prop) return *prop; return None(); } virtual Option<PropertyDescription> findProperty(int32_t clsId, String propName) const { ClassDescImpl* cls(getClassImpl(clsId)); PX_ASSERT(cls); if(!cls) return None(); PropDescImpl* prop(findPropImpl(cls->mName, propName)); if(prop) return *prop; return None(); } PropDescImpl* getPropertyImpl(int32_t propId) const { PX_ASSERT(propId >= 0); if(propId < 0) return NULL; uint32_t val = uint32_t(propId); if(val >= mProperties.size()) { PX_ASSERT(false); return NULL; } return mProperties[val]; } virtual Option<PropertyDescription> getProperty(int32_t propId) const { PropDescImpl* impl(getPropertyImpl(propId)); if(impl) return *impl; return None(); } virtual void setNamedPropertyValues(DataRef<NamedValue> values, int32_t propId) { PropDescImpl* impl(getPropertyImpl(propId)); if(impl) { impl->mValueNames.resize(values.size()); PVD_FOREACH(idx, values.size()) impl->mValueNames[idx] = values[idx]; } } virtual DataRef<NamedValue> getNamedPropertyValues(int32_t propId) const { PropDescImpl* impl(getPropertyImpl(propId)); if(impl) { return toDataRef(impl->mValueNames); } return DataRef<NamedValue>(); } virtual uint32_t getNbProperties(int32_t classId) const { uint32_t retval = 0; for(ClassDescImpl* impl(getClassImpl(classId)); impl; impl = getClassImpl(impl->mBaseClass)) { retval += impl->mPropImps.size(); if(impl->mBaseClass < 0) break; } return retval; } // Properties need to be returned in base class order, so this requires a recursive function. uint32_t getPropertiesImpl(int32_t classId, PropertyDescription*& outBuffer, uint32_t& numItems, uint32_t& startIdx) const { ClassDescImpl* impl = getClassImpl(classId); if(impl) { uint32_t retval = 0; if(impl->mBaseClass >= 0) retval = getPropertiesImpl(impl->mBaseClass, outBuffer, numItems, startIdx); uint32_t localStart = PxMin(impl->mPropImps.size(), startIdx); uint32_t localNumItems = PxMin(numItems, impl->mPropImps.size() - localStart); PVD_FOREACH(idx, localNumItems) { outBuffer[idx] = *impl->mPropImps[localStart + idx]; } startIdx -= localStart; numItems -= localNumItems; outBuffer += localNumItems; return retval + localNumItems; } return 0; } virtual uint32_t getProperties(int32_t classId, PropertyDescription* outBuffer, uint32_t numItems, uint32_t startIdx) const { return getPropertiesImpl(classId, outBuffer, numItems, startIdx); } virtual MarshalQueryResult checkMarshalling(int32_t srcClsId, int32_t dstClsId) const { Option<ClassDescription> propTypeOpt(getClass(dstClsId)); if(propTypeOpt.hasValue() == false) { PX_ASSERT(false); return MarshalQueryResult(); } const ClassDescription& propType(propTypeOpt); Option<ClassDescription> incomingTypeOpt(getClass(srcClsId)); if(incomingTypeOpt.hasValue() == false) { PX_ASSERT(false); return MarshalQueryResult(); } const ClassDescription& incomingType(incomingTypeOpt); // Can only marshal simple things at this point in time. bool needsMarshalling = false; bool canMarshal = false; TSingleMarshaller single = NULL; TBlockMarshaller block = NULL; if(incomingType.mClassId != propType.mClassId) { // Check that marshalling is even possible. if((incomingType.mPackedUniformWidth >= 0 && propType.mPackedUniformWidth >= 0) == false) { PX_ASSERT(false); return MarshalQueryResult(); } int32_t srcType = incomingType.mPackedClassType; int32_t dstType = propType.mPackedClassType; int32_t srcWidth = incomingType.mPackedUniformWidth; int32_t dstWidth = propType.mPackedUniformWidth; canMarshal = getMarshalOperators(single, block, srcType, dstType); if(srcWidth == dstWidth) needsMarshalling = canMarshal; // If the types are the same width, we assume we can convert between some // of them seamlessly (uint16_t, int16_t) else { needsMarshalling = true; // If we can't marshall and we have to then we can't set the property value. // This indicates that the src and dest are different properties and we don't // know how to convert between them. if(!canMarshal) { PX_ASSERT(false); return MarshalQueryResult(); } } } return MarshalQueryResult(srcClsId, dstClsId, canMarshal, needsMarshalling, block); } PropertyMessageDescriptionImpl* findPropertyMessageImpl(const NamespacedName& messageName) const { const TNameToPropertyMessageMap::Entry* entry = mPropertyMessageMap.find(messageName); if(entry) return entry->second; return NULL; } PropertyMessageDescriptionImpl* getPropertyMessageImpl(int32_t msg) const { int32_t msgCount = int32_t(mPropertyMessages.size()); if(msg >= 0 && msg < msgCount) return mPropertyMessages[uint32_t(msg)]; return NULL; } virtual Option<PropertyMessageDescription> createPropertyMessage(const NamespacedName& clsName, const NamespacedName& messageName, DataRef<PropertyMessageArg> entries, uint32_t messageSize) { PropertyMessageDescriptionImpl* existing(findPropertyMessageImpl(messageName)); if(existing) { PX_ASSERT(false); return None(); } ClassDescImpl* cls = findClassImpl(clsName); PX_ASSERT(cls); if(!cls) return None(); int32_t msgId = int32_t(mPropertyMessages.size()); PropertyMessageDescriptionImpl* newMessage = PVD_NEW(PropertyMessageDescriptionImpl)( PropertyMessageDescription(mStringTable->registerName(clsName), cls->mClassId, mStringTable->registerName(messageName), msgId, messageSize)); uint32_t calculatedSize = 0; PVD_FOREACH(idx, entries.size()) { PropertyMessageArg entry(entries[idx]); ClassDescImpl* dtypeCls = findClassImpl(entry.mDatatypeName); if(dtypeCls == NULL) { PX_ASSERT(false); goto DestroyNewMessage; } ClassDescriptionSizeInfo dtypeInfo(dtypeCls->get32BitSizeInfo()); uint32_t incomingSize = dtypeInfo.mByteSize; if(entry.mByteSize < incomingSize) { PX_ASSERT(false); goto DestroyNewMessage; } calculatedSize = PxMax(calculatedSize, entry.mMessageOffset + entry.mByteSize); if(calculatedSize > messageSize) { PX_ASSERT(false); goto DestroyNewMessage; } Option<PropertyDescription> propName(findProperty(cls->mClassId, entry.mPropertyName)); if(propName.hasValue() == false) { PX_ASSERT(false); goto DestroyNewMessage; } Option<ClassDescription> propCls(getClass(propName.getValue().mDatatype)); if(propCls.hasValue() == false) { PX_ASSERT(false); goto DestroyNewMessage; } PropertyMessageEntryImpl newEntry(PropertyMessageEntry( propName, dtypeCls->mName, dtypeCls->mClassId, entry.mMessageOffset, incomingSize, dtypeInfo.mByteSize)); newMessage->addEntry(newEntry); if(newEntry.mDatatypeId == getPvdTypeForType<String>()) newMessage->mStringOffsetArray.pushBack(entry.mMessageOffset); // property messages cannot be marshalled at this time. if(newEntry.mDatatypeId != getPvdTypeForType<String>() && newEntry.mDatatypeId != getPvdTypeForType<VoidPtr>()) { MarshalQueryResult marshalInfo = checkMarshalling(newEntry.mDatatypeId, newEntry.mProperty.mDatatype); if(marshalInfo.needsMarshalling) { PX_ASSERT(false); goto DestroyNewMessage; } } } if(newMessage) { newMessage->mStringOffsets = DataRef<uint32_t>(newMessage->mStringOffsetArray.begin(), newMessage->mStringOffsetArray.end()); mPropertyMessages.pushBack(newMessage); mPropertyMessageMap.insert(messageName, newMessage); return *newMessage; } DestroyNewMessage: if(newMessage) PVD_DELETE(newMessage); return None(); } virtual Option<PropertyMessageDescription> findPropertyMessage(const NamespacedName& msgName) const { PropertyMessageDescriptionImpl* desc(findPropertyMessageImpl(msgName)); if(desc) return *desc; return None(); } virtual Option<PropertyMessageDescription> getPropertyMessage(int32_t msgId) const { PropertyMessageDescriptionImpl* desc(getPropertyMessageImpl(msgId)); if(desc) return *desc; return None(); } virtual uint32_t getNbPropertyMessages() const { return mPropertyMessages.size(); } virtual uint32_t getPropertyMessages(PropertyMessageDescription* msgBuf, uint32_t bufLen, uint32_t startIdx = 0) const { startIdx = PxMin(startIdx, getNbPropertyMessages()); bufLen = PxMin(bufLen, getNbPropertyMessages() - startIdx); PVD_FOREACH(idx, bufLen) msgBuf[idx] = *mPropertyMessages[idx + startIdx]; return bufLen; } struct MetaDataWriter { const PvdObjectModelMetaDataImpl& mMetaData; PvdOutputStream& mStream; MetaDataWriter(const PvdObjectModelMetaDataImpl& meta, PvdOutputStream& stream) : mMetaData(meta), mStream(stream) { } void streamify(NamespacedName& type) { mStream << mMetaData.mStringTable->strToHandle(type.mNamespace); mStream << mMetaData.mStringTable->strToHandle(type.mName); } void streamify(String& type) { mStream << mMetaData.mStringTable->strToHandle(type); } void streamify(int32_t& type) { mStream << type; } void streamify(uint32_t& type) { mStream << type; } void streamify(uint8_t type) { mStream << type; } void streamify(bool type) { streamify( uint8_t(type)); } void streamify(PropertyType::Enum type) { uint32_t val = static_cast<uint32_t>(type); mStream << val; } void streamify(NamedValue& type) { streamify(type.mValue); streamify(type.mName); } void streamifyLinks(PropDescImpl* prop) { streamify(prop->mPropertyId); } void streamify(PropertyDescription& prop) { streamify(prop.mPropertyId); } void streamify(PropertyMessageEntryImpl& prop) { prop.serialize(*this); } void streamify(PtrOffset& off) { uint32_t type = off.mOffsetType; mStream << type; mStream << off.mOffset; } template <typename TDataType> void streamify(TDataType* type) { int32_t existMarker = type ? 1 : 0; mStream << existMarker; if(type) type->serialize(*this); } template <typename TArrayType> void streamify(const PxArray<TArrayType>& type) { mStream << static_cast<uint32_t>(type.size()); PVD_FOREACH(idx, type.size()) streamify(const_cast<TArrayType&>(type[idx])); } template <typename TArrayType> void streamifyLinks(const PxArray<TArrayType>& type) { mStream << static_cast<uint32_t>(type.size()); PVD_FOREACH(idx, type.size()) streamifyLinks(const_cast<TArrayType&>(type[idx])); } private: MetaDataWriter& operator=(const MetaDataWriter&); }; template <typename TStreamType> struct MetaDataReader { PvdObjectModelMetaDataImpl& mMetaData; TStreamType& mStream; MetaDataReader(PvdObjectModelMetaDataImpl& meta, TStreamType& stream) : mMetaData(meta), mStream(stream) { } void streamify(NamespacedName& type) { streamify(type.mNamespace); streamify(type.mName); } void streamify(String& type) { uint32_t handle; mStream >> handle; type = mMetaData.mStringTable->handleToStr(handle); } void streamify(int32_t& type) { mStream >> type; } void streamify(uint32_t& type) { mStream >> type; } void streamify(bool& type) { uint8_t data; mStream >> data; type = data ? true : false; } void streamify(PropertyType::Enum& type) { uint32_t val; mStream >> val; type = static_cast<PropertyType::Enum>(val); } void streamify(NamedValue& type) { streamify(type.mValue); streamify(type.mName); } void streamify(PropertyMessageEntryImpl& type) { type.serialize(*this); } void streamify(PtrOffset& off) { uint32_t type; mStream >> type; mStream >> off.mOffset; off.mOffsetType = static_cast<PtrOffsetType::Enum>(type); } void streamifyLinks(PropDescImpl*& prop) { int32_t propId; streamify(propId); prop = mMetaData.getPropertyImpl(propId); } void streamify(PropertyDescription& prop) { streamify(prop.mPropertyId); prop = mMetaData.getProperty(prop.mPropertyId); } template <typename TDataType> void streamify(TDataType*& type) { uint32_t existMarker; mStream >> existMarker; if(existMarker) { TDataType* newType = PVD_NEW(TDataType)(); newType->serialize(*this); type = newType; } else type = NULL; } template <typename TArrayType> void streamify(PxArray<TArrayType>& type) { uint32_t typeSize; mStream >> typeSize; type.resize(typeSize); PVD_FOREACH(idx, type.size()) streamify(type[idx]); } template <typename TArrayType> void streamifyLinks(PxArray<TArrayType>& type) { uint32_t typeSize; mStream >> typeSize; type.resize(typeSize); PVD_FOREACH(idx, type.size()) streamifyLinks(type[idx]); } private: MetaDataReader& operator=(const MetaDataReader&); }; virtual void write(PvdOutputStream& stream) const { stream << getCurrentPvdObjectModelVersion(); stream << mNextClassId; mStringTable->write(stream); MetaDataWriter writer(*this, stream); writer.streamify(mProperties); writer.streamify(mClasses); writer.streamify(mPropertyMessages); } template <typename TReaderType> void read(TReaderType& stream) { uint32_t version; stream >> version; stream >> mNextClassId; mStringTable->read(stream); MetaDataReader<TReaderType> reader(*this, stream); reader.streamify(mProperties); reader.streamify(mClasses); reader.streamify(mPropertyMessages); mNameToClasses.clear(); mNameToProperties.clear(); mPropertyMessageMap.clear(); PVD_FOREACH(i, mClasses.size()) { ClassDescImpl* cls(mClasses[i]); if(cls == NULL) continue; mNameToClasses.insert(cls->mName, mClasses[i]); uint32_t propCount = getNbProperties(cls->mClassId); PropertyDescription descs[16]; uint32_t offset = 0; for(uint32_t idx = 0; idx < propCount; idx = offset) { uint32_t numProps = getProperties(cls->mClassId, descs, 16, offset); offset += numProps; for(uint32_t propIdx = 0; propIdx < numProps; ++propIdx) { PropDescImpl* prop = getPropertyImpl(descs[propIdx].mPropertyId); if(prop) mNameToProperties.insert(ClassPropertyName(cls->mName, prop->mName), prop); } } } PVD_FOREACH(idx, mPropertyMessages.size()) mPropertyMessageMap.insert(mPropertyMessages[idx]->mMessageName, mPropertyMessages[idx]); } virtual StringTable& getStringTable() const { return *mStringTable; } virtual void addRef() { ++mRefCount; } virtual void release() { if(mRefCount) --mRefCount; if(!mRefCount) PVD_DELETE(this); } }; } uint32_t PvdObjectModelMetaData::getCurrentPvdObjectModelVersion() { return 1; } PvdObjectModelMetaData& PvdObjectModelMetaData::create() { PvdObjectModelMetaDataImpl& retval(*PVD_NEW(PvdObjectModelMetaDataImpl)()); retval.initialize(); return retval; } PvdObjectModelMetaData& PvdObjectModelMetaData::create(PvdInputStream& stream) { PvdObjectModelMetaDataImpl& retval(*PVD_NEW(PvdObjectModelMetaDataImpl)()); retval.read(stream); return retval; } StringTable& StringTable::create() { return *PVD_NEW(StringTableImpl)(); }
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileContextProviderImpl.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_CONTEXT_PROVIDER_IMPL_H #define PX_PROFILE_CONTEXT_PROVIDER_IMPL_H #include "PxProfileContextProvider.h" #include "foundation/PxThread.h" namespace physx { namespace profile { struct PxDefaultContextProvider { PxProfileEventExecutionContext getExecutionContext() { PxThread::Id theId( PxThread::getId() ); return PxProfileEventExecutionContext( static_cast<uint32_t>( theId ), static_cast<uint8_t>( PxThreadPriority::eNORMAL ), 0 ); } uint32_t getThreadId() { return static_cast<uint32_t>( PxThread::getId() ); } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventImpl.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #include "PxProfileEventBuffer.h" #include "PxProfileZoneImpl.h" #include "PxProfileZoneManagerImpl.h" #include "PxProfileMemoryEventBuffer.h" #include "foundation/PxUserAllocated.h" namespace physx { namespace profile { struct PxProfileNameProviderForward { PxProfileNames mNames; PxProfileNameProviderForward( PxProfileNames inNames ) : mNames( inNames ) { } PxProfileNames getProfileNames() const { return mNames; } }; PxProfileZone& PxProfileZone::createProfileZone( PxAllocatorCallback* inAllocator, const char* inSDKName, PxProfileNames inNames, uint32_t inEventBufferByteSize ) { typedef ZoneImpl<PxProfileNameProviderForward> TSDKType; return *PX_PROFILE_NEW( inAllocator, TSDKType ) ( inAllocator, inSDKName, inEventBufferByteSize, PxProfileNameProviderForward( inNames ) ); } PxProfileZoneManager& PxProfileZoneManager::createProfileZoneManager(PxAllocatorCallback* inAllocator ) { return *PX_PROFILE_NEW( inAllocator, ZoneManagerImpl ) ( inAllocator ); } PxProfileMemoryEventBuffer& PxProfileMemoryEventBuffer::createMemoryEventBuffer( PxAllocatorCallback& inAllocator, uint32_t inBufferSize ) { return *PX_PROFILE_NEW( &inAllocator, PxProfileMemoryEventBufferImpl )( inAllocator, inBufferSize ); } } }
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventNames.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_NAMES_H #define PX_PROFILE_EVENT_NAMES_H #include "PxProfileEventId.h" namespace physx { namespace profile { /** \brief Mapping from event id to name. */ struct PxProfileEventName { const char* name; PxProfileEventId eventId; /** \brief Default constructor. \param inName Profile event name. \param inId Profile event id. */ PxProfileEventName( const char* inName, PxProfileEventId inId ) : name( inName ), eventId( inId ) {} }; /** \brief Aggregator of event id -> name mappings */ struct PxProfileNames { /** \brief Default constructor that doesn't point to any names. \param inEventCount Number of provided events. \param inSubsystems Event names array. */ PxProfileNames( uint32_t inEventCount = 0, const PxProfileEventName* inSubsystems = NULL ) : eventCount( inEventCount ) , events( inSubsystems ) { } uint32_t eventCount; const PxProfileEventName* events; }; /** \brief Provides a mapping from event ID -> name. */ class PxProfileNameProvider { public: /** \brief Returns profile event names. \return Profile event names. */ virtual PxProfileNames getProfileNames() const = 0; protected: virtual ~PxProfileNameProvider(){} PxProfileNameProvider& operator=(const PxProfileNameProvider&) { return *this; } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdUserRenderTypes.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON #ifndef DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA #define DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA DECLARE_PVD_IMMEDIATE_RENDER_TYPE #endif DECLARE_PVD_IMMEDIATE_RENDER_TYPE(SetInstanceId) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Points) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Lines) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Triangles) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(JointFrames) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(LinearLimit) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(AngularLimit) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(LimitCone) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(DoubleCone) DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Text) DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA(Debug) #undef DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA #undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileDataParsing.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_DATA_PARSING_H #define PX_PROFILE_DATA_PARSING_H #include "foundation/Px.h" namespace physx { namespace profile { //Converts datatypes without using type punning. struct BlockParserDataConverter { union { uint8_t mU8[8]; uint16_t mU16[4]; uint32_t mU32[2]; uint64_t mU64[1]; int8_t mI8[8]; int16_t mI16[4]; int32_t mI32[2]; int64_t mI64[1]; float mF32[2]; double mF64[1]; }; template<typename TDataType> inline TDataType convert() { PX_ASSERT( false ); return TDataType(); } template<typename TDataType> inline void convert( const TDataType& ) {} }; template<> inline uint8_t BlockParserDataConverter::convert<uint8_t>() { return mU8[0]; } template<> inline uint16_t BlockParserDataConverter::convert<uint16_t>() { return mU16[0]; } template<> inline uint32_t BlockParserDataConverter::convert<uint32_t>() { return mU32[0]; } template<> inline uint64_t BlockParserDataConverter::convert<uint64_t>() { return mU64[0]; } template<> inline int8_t BlockParserDataConverter::convert<int8_t>() { return mI8[0]; } template<> inline int16_t BlockParserDataConverter::convert<int16_t>() { return mI16[0]; } template<> inline int32_t BlockParserDataConverter::convert<int32_t>() { return mI32[0]; } template<> inline int64_t BlockParserDataConverter::convert<int64_t>() { return mI64[0]; } template<> inline float BlockParserDataConverter::convert<float>() { return mF32[0]; } template<> inline double BlockParserDataConverter::convert<double>() { return mF64[0]; } template<> inline void BlockParserDataConverter::convert<uint8_t>( const uint8_t& inData ) { mU8[0] = inData; } template<> inline void BlockParserDataConverter::convert<uint16_t>( const uint16_t& inData ) { mU16[0] = inData; } template<> inline void BlockParserDataConverter::convert<uint32_t>( const uint32_t& inData ) { mU32[0] = inData; } template<> inline void BlockParserDataConverter::convert<uint64_t>( const uint64_t& inData ) { mU64[0] = inData; } template<> inline void BlockParserDataConverter::convert<int8_t>( const int8_t& inData ) { mI8[0] = inData; } template<> inline void BlockParserDataConverter::convert<int16_t>( const int16_t& inData ) { mI16[0] = inData; } template<> inline void BlockParserDataConverter::convert<int32_t>( const int32_t& inData ) { mI32[0] = inData; } template<> inline void BlockParserDataConverter::convert<int64_t>( const int64_t& inData ) { mI64[0] = inData; } template<> inline void BlockParserDataConverter::convert<float>( const float& inData ) { mF32[0] = inData; } template<> inline void BlockParserDataConverter::convert<double>( const double& inData ) { mF64[0] = inData; } //Handles various details around parsing blocks of uint8_t data. struct BlockParseFunctions { template<uint8_t ByteCount> static inline void swapBytes( uint8_t* inData ) { for ( uint32_t idx = 0; idx < ByteCount/2; ++idx ) { uint32_t endIdx = ByteCount-idx-1; uint8_t theTemp = inData[idx]; inData[idx] = inData[endIdx]; inData[endIdx] = theTemp; } } static inline bool checkLength( const uint8_t* inStart, const uint8_t* inStop, uint32_t inLength ) { return static_cast<uint32_t>(inStop - inStart) >= inLength; } //warning work-around template<typename T> static inline T val(T v) {return v;} template<bool DoSwapBytes, typename TDataType> static inline bool parse( const uint8_t*& inStart, const uint8_t* inStop, TDataType& outData ) { if ( checkLength( inStart, inStop, sizeof( TDataType ) ) ) { BlockParserDataConverter theConverter; for ( uint32_t idx =0; idx < sizeof( TDataType ); ++idx ) theConverter.mU8[idx] = inStart[idx]; if ( val(DoSwapBytes)) swapBytes<sizeof(TDataType)>( theConverter.mU8 ); outData = theConverter.convert<TDataType>(); inStart += sizeof( TDataType ); return true; } return false; } template<bool DoSwapBytes, typename TDataType> static inline bool parseBlock( const uint8_t*& inStart, const uint8_t* inStop, TDataType* outData, uint32_t inNumItems ) { uint32_t desired = sizeof(TDataType)*inNumItems; if ( checkLength( inStart, inStop, desired ) ) { if ( val(DoSwapBytes) ) { for ( uint32_t item = 0; item < inNumItems; ++item ) { BlockParserDataConverter theConverter; for ( uint32_t idx =0; idx < sizeof( TDataType ); ++idx ) theConverter.mU8[idx] = inStart[idx]; swapBytes<sizeof(TDataType)>( theConverter.mU8 ); outData[item] = theConverter.convert<TDataType>(); inStart += sizeof(TDataType); } } else { uint8_t* target = reinterpret_cast<uint8_t*>(outData); memmove( target, inStart, desired ); inStart += desired; } return true; } return false; } //In-place byte swapping block template<bool DoSwapBytes, typename TDataType> static inline bool parseBlock( uint8_t*& inStart, const uint8_t* inStop, uint32_t inNumItems ) { uint32_t desired = sizeof(TDataType)*inNumItems; if ( checkLength( inStart, inStop, desired ) ) { if ( val(DoSwapBytes) ) { for ( uint32_t item = 0; item < inNumItems; ++item, inStart += sizeof( TDataType ) ) swapBytes<sizeof(TDataType)>( inStart ); //In-place swap. } else inStart += sizeof( TDataType ) * inNumItems; return true; } return false; } }; //Wraps the begin/end keeping track of them. template<bool DoSwapBytes> struct BlockParser { const uint8_t* mBegin; const uint8_t* mEnd; BlockParser( const uint8_t* inBegin=NULL, const uint8_t* inEnd=NULL ) : mBegin( inBegin ) , mEnd( inEnd ) { } inline bool hasMoreData() const { return mBegin != mEnd; } inline bool checkLength( uint32_t inLength ) { return BlockParseFunctions::checkLength( mBegin, mEnd, inLength ); } template<typename TDataType> inline bool read( TDataType& outDatatype ) { return BlockParseFunctions::parse<DoSwapBytes>( mBegin, mEnd, outDatatype ); } template<typename TDataType> inline bool readBlock( TDataType* outDataPtr, uint32_t inNumItems ) { return BlockParseFunctions::parseBlock<DoSwapBytes>( mBegin, mEnd, outDataPtr, inNumItems ); } template<typename TDataType> inline bool readBlock( uint32_t inNumItems ) { uint8_t* theTempPtr = const_cast<uint8_t*>(mBegin); bool retval = BlockParseFunctions::parseBlock<DoSwapBytes, TDataType>( theTempPtr, mEnd, inNumItems ); mBegin = theTempPtr; return retval; } uint32_t amountLeft() const { return static_cast<uint32_t>( mEnd - mBegin ); } }; //Reads the data without checking for error conditions template<typename TDataType, typename TBlockParserType> inline TDataType blockParserRead( TBlockParserType& inType ) { TDataType retval; inType.read( retval ); return retval; } }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventBuffer.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_EVENT_BUFFER_H #define PX_PROFILE_EVENT_BUFFER_H #include "PxProfileEvents.h" #include "PxProfileEventSerialization.h" #include "PxProfileDataBuffer.h" #include "PxProfileContextProvider.h" #include "foundation/PxTime.h" namespace physx { namespace profile { /** * An event buffer maintains an in-memory buffer of events. When this buffer is full * it sends to buffer to all handlers registered and resets the buffer. * * It is parameterized in four ways. The first is a context provider that provides * both thread id and context id. * * The second is the mutex (which may be null) and a scoped locking mechanism. Thus the buffer * may be used in a multithreaded context but clients of the buffer don't pay for this if they * don't intend to use it this way. * * Finally the buffer may use an event filtering mechanism. This mechanism needs one function, * namely isEventEnabled( uint8_t subsystem, uint8_t eventId ). * * All of these systems can be parameterized at compile time leading to an event buffer * that should be as fast as possible given the constraints. * * Buffers may be chained together as this buffer has a handleBufferFlush method that * will grab the mutex and add the data to this event buffer. * * Overall, lets look at the PhysX SDK an how all the pieces fit together. * The SDK should have a mutex-protected event buffer where actual devs or users of PhysX * can register handlers. This buffer has slow but correct implementations of the * context provider interface. * * The SDK object should also have a concrete event filter which was used in the * construction of the event buffer and which it exposes through opaque interfaces. * * The SDK should protect its event buffer and its event filter from multithreaded * access and thus this provides the safest and slowest way to log events and to * enable/disable events. * * Each scene should also have a concrete event filter. This filter is updated from * the SDK event filter (in a mutex protected way) every frame. Thus scenes can change * their event filtering on a frame-by-frame basis. It means that tasks running * under the scene don't need a mutex when accessing the filter. * * Furthermore the scene should have an event buffer that always sets the context id * on each event to the scene. This allows PVD and other systems to correlate events * to scenes. Scenes should provide access only to a relative event sending system * that looks up thread id upon each event but uses the scene id. * * The SDK's event buffer should be setup as an EventBufferClient for each scene's * event buffer. Thus the SDK should expose an EventBufferClient interface that * any client can use. * * For extremely *extremely* performance sensitive areas we should create a specialized * per-scene, per-thread event buffer that is set on the task for these occasions. This buffer * uses a trivial event context setup with the scene's context id and the thread id. It should * share the scene's concrete event filter and it should have absolutely no locking. It should * empty into the scene's event buffer which in some cases should empty into the SDK's event buffer * which when full will push events all the way out of the system. The task should *always* flush * the event buffer (if it has one) when it is finished; nothing else will work reliably. * * If the per-scene,per-thread event buffer is correctly parameterized and fully defined adding * a new event should be an inline operation requiring no mutex grabs in the common case. I don't * believe you can get faster event production than this; the events are as small as possible (all * relative events) and they are all produced inline resulting in one 4 byte header and one * 8 byte timestamp per event. Reducing the memory pressure in this way reduces the communication * overhead, the mutex grabs, basically everything that makes profiling expensive at the cost * of a per-scene,per-thread event buffer (which could easily be reduced to a per-thread event * buffer. */ template<typename TContextProvider, typename TMutex, typename TScopedLock, typename TEventFilter> class EventBuffer : public DataBuffer<TMutex, TScopedLock> { public: typedef DataBuffer<TMutex, TScopedLock> TBaseType; typedef TContextProvider TContextProviderType; typedef TEventFilter TEventFilterType; typedef typename TBaseType::TMutexType TMutexType; typedef typename TBaseType::TScopedLockType TScopedLockType; typedef typename TBaseType::TU8AllocatorType TU8AllocatorType; typedef typename TBaseType::TMemoryBufferType TMemoryBufferType; typedef typename TBaseType::TBufferClientArray TBufferClientArray; private: EventContextInformation mEventContextInformation; uint64_t mLastTimestamp; TContextProvider mContextProvider; TEventFilterType mEventFilter; public: EventBuffer(PxAllocatorCallback* inFoundation , uint32_t inBufferFullAmount , const TContextProvider& inProvider , TMutexType* inBufferMutex , const TEventFilterType& inEventFilter ) : TBaseType( inFoundation, inBufferFullAmount, inBufferMutex, "struct physx::profile::ProfileEvent" ) , mLastTimestamp( 0 ) , mContextProvider( inProvider ) , mEventFilter( inEventFilter ) { memset(&mEventContextInformation,0,sizeof(EventContextInformation)); } TContextProvider& getContextProvider() { return mContextProvider; } PX_FORCE_INLINE void startEvent(uint16_t inId, uint32_t threadId, uint64_t contextId, uint8_t cpuId, uint8_t threadPriority, uint64_t inTimestamp) { TScopedLockType lock(TBaseType::mBufferMutex); if ( mEventFilter.isEventEnabled( inId ) ) { StartEvent theEvent; theEvent.init( threadId, contextId, cpuId, threadPriority, inTimestamp ); doAddProfileEvent( inId, theEvent ); } } PX_FORCE_INLINE void startEvent(uint16_t inId, uint64_t contextId) { PxProfileEventExecutionContext ctx( mContextProvider.getExecutionContext() ); startEvent( inId, ctx.mThreadId, contextId, ctx.mCpuId, static_cast<uint8_t>(ctx.mThreadPriority), PxTime::getCurrentCounterValue() ); } PX_FORCE_INLINE void startEvent(uint16_t inId, uint64_t contextId, uint32_t threadId) { startEvent( inId, threadId, contextId, 0, 0, PxTime::getCurrentCounterValue() ); } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint32_t threadId, uint64_t contextId, uint8_t cpuId, uint8_t threadPriority, uint64_t inTimestamp) { TScopedLockType lock(TBaseType::mBufferMutex); if ( mEventFilter.isEventEnabled( inId ) ) { StopEvent theEvent; theEvent.init( threadId, contextId, cpuId, threadPriority, inTimestamp ); doAddProfileEvent( inId, theEvent ); } } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint64_t contextId) { PxProfileEventExecutionContext ctx( mContextProvider.getExecutionContext() ); stopEvent( inId, ctx.mThreadId, contextId, ctx.mCpuId, static_cast<uint8_t>(ctx.mThreadPriority), PxTime::getCurrentCounterValue() ); } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint64_t contextId, uint32_t threadId) { stopEvent( inId, threadId, contextId, 0, 0, PxTime::getCurrentCounterValue() ); } inline void eventValue( uint16_t inId, uint64_t contextId, int64_t inValue ) { eventValue( inId, mContextProvider.getThreadId(), contextId, inValue ); } inline void eventValue( uint16_t inId, uint32_t threadId, uint64_t contextId, int64_t inValue ) { TScopedLockType lock( TBaseType::mBufferMutex ); EventValue theEvent; theEvent.init( inValue, contextId, threadId ); EventHeader theHeader( static_cast<uint8_t>( getEventType<EventValue>() ), inId ); //set the header relative timestamp; EventValue& theType( theEvent ); theType.setupHeader( theHeader ); sendEvent( theHeader, theType ); } void flushProfileEvents() { TBaseType::flushEvents(); } void release() { PX_PROFILE_DELETE( TBaseType::mWrapper.mUserFoundation, this ); } protected: //Clears the cache meaning event compression //starts over again. //only called when the buffer mutex is held void clearCachedData() { mEventContextInformation.setToDefault(); mLastTimestamp = 0; } template<typename TProfileEventType> PX_FORCE_INLINE void doAddProfileEvent(uint16_t eventId, const TProfileEventType& inType) { TScopedLockType lock(TBaseType::mBufferMutex); if (mEventContextInformation == inType.mContextInformation) doAddEvent(static_cast<uint8_t>(inType.getRelativeEventType()), eventId, inType.getRelativeEvent()); else { mEventContextInformation = inType.mContextInformation; doAddEvent( static_cast<uint8_t>( getEventType<TProfileEventType>() ), eventId, inType ); } } template<typename TDataType> PX_FORCE_INLINE void doAddEvent(uint8_t inEventType, uint16_t eventId, const TDataType& inType) { EventHeader theHeader( inEventType, eventId ); //set the header relative timestamp; TDataType& theType( const_cast<TDataType&>( inType ) ); uint64_t currentTs = inType.getTimestamp(); theType.setupHeader(theHeader, mLastTimestamp); mLastTimestamp = currentTs; sendEvent( theHeader, theType ); } template<typename TDataType> PX_FORCE_INLINE void sendEvent( EventHeader& inHeader, TDataType& inType ) { uint32_t sizeToWrite = sizeof(inHeader) + inType.getEventSize(inHeader); PX_UNUSED(sizeToWrite); uint32_t writtenSize = inHeader.streamify( TBaseType::mSerializer ); writtenSize += inType.streamify(TBaseType::mSerializer, inHeader); PX_ASSERT(writtenSize == sizeToWrite); if ( TBaseType::mDataArray.size() >= TBaseType::mBufferFullAmount ) flushProfileEvents(); } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileScopedEvent.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_SCOPED_EVENT_H #define PX_PROFILE_SCOPED_EVENT_H #include "PxProfileEventId.h" #include "PxProfileCompileTimeEventFilter.h" namespace physx { namespace profile { /** \brief Template version of startEvent, called directly on provided profile buffer. \param inBuffer Profile event buffer. \param inId Profile event id. \param inContext Profile event context. */ template<bool TEnabled, typename TBufferType> inline void startEvent( TBufferType* inBuffer, const PxProfileEventId& inId, uint64_t inContext ) { if ( TEnabled && inBuffer ) inBuffer->startEvent( inId, inContext ); } /** \brief Template version of stopEvent, called directly on provided profile buffer. \param inBuffer Profile event buffer. \param inId Profile event id. \param inContext Profile event context. */ template<bool TEnabled, typename TBufferType> inline void stopEvent( TBufferType* inBuffer, const PxProfileEventId& inId, uint64_t inContext ) { if ( TEnabled && inBuffer ) inBuffer->stopEvent( inId, inContext ); } /** \brief Template version of startEvent, called directly on provided profile buffer. \param inEnabled If profile event is enabled. \param inBuffer Profile event buffer. \param inId Profile event id. \param inContext Profile event context. */ template<typename TBufferType> inline void startEvent( bool inEnabled, TBufferType* inBuffer, const PxProfileEventId& inId, uint64_t inContext ) { if ( inEnabled && inBuffer ) inBuffer->startEvent( inId, inContext ); } /** \brief Template version of stopEvent, called directly on provided profile buffer. \param inEnabled If profile event is enabled. \param inBuffer Profile event buffer. \param inId Profile event id. \param inContext Profile event context. */ template<typename TBufferType> inline void stopEvent( bool inEnabled, TBufferType* inBuffer, const PxProfileEventId& inId, uint64_t inContext ) { if ( inEnabled && inBuffer ) inBuffer->stopEvent( inId, inContext ); } /** \brief Template version of eventValue, called directly on provided profile buffer. \param inEnabled If profile event is enabled. \param inBuffer Profile event buffer. \param inId Profile event id. \param inContext Profile event context. \param inValue Event value. */ template<typename TBufferType> inline void eventValue( bool inEnabled, TBufferType* inBuffer, const PxProfileEventId& inId, uint64_t inContext, int64_t inValue ) { if ( inEnabled && inBuffer ) inBuffer->eventValue( inId, inContext, inValue ); } }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdImpl.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_IMPL_H #define PX_PVD_IMPL_H #include "foundation/PxProfiler.h" #include "foundation/PxAllocator.h" #include "PsPvd.h" #include "foundation/PxArray.h" #include "foundation/PxMutex.h" #include "PxPvdCommStreamTypes.h" #include "PxPvdFoundation.h" #include "PxPvdObjectModelMetaData.h" #include "PxPvdObjectRegistrar.h" namespace physx { namespace profile { class PxProfileZoneManager; } namespace pvdsdk { class PvdMemClient; class PvdProfileZoneClient; struct MetaDataProvider : public PvdOMMetaDataProvider, public PxUserAllocated { typedef PxMutex::ScopedLock TScopedLockType; typedef PxHashMap<const void*, int32_t> TInstTypeMap; PvdObjectModelMetaData& mMetaData; PxMutex mMutex; uint32_t mRefCount; TInstTypeMap mTypeMap; MetaDataProvider() : mMetaData(PvdObjectModelMetaData::create()), mRefCount(0), mTypeMap("MetaDataProvider::mTypeMap") { mMetaData.addRef(); } virtual ~MetaDataProvider() { mMetaData.release(); } virtual void addRef() { TScopedLockType locker(mMutex); ++mRefCount; } virtual void release() { { TScopedLockType locker(mMutex); if(mRefCount) --mRefCount; } if(!mRefCount) PVD_DELETE(this); } virtual PvdObjectModelMetaData& lock() { mMutex.lock(); return mMetaData; } virtual void unlock() { mMutex.unlock(); } virtual bool createInstance(const NamespacedName& clsName, const void* instance) { TScopedLockType locker(mMutex); Option<ClassDescription> cls(mMetaData.findClass(clsName)); if(cls.hasValue() == false) return false; int32_t instType = cls->mClassId; mTypeMap.insert(instance, instType); return true; } virtual bool isInstanceValid(const void* instance) { TScopedLockType locker(mMutex); ClassDescription classDesc; bool retval = mTypeMap.find(instance) != NULL; #if PX_DEBUG if(retval) classDesc = mMetaData.getClass(mTypeMap.find(instance)->second); #endif return retval; } virtual void destroyInstance(const void* instance) { { TScopedLockType locker(mMutex); mTypeMap.erase(instance); } } virtual int32_t getInstanceClassType(const void* instance) { TScopedLockType locker(mMutex); const TInstTypeMap::Entry* entry = mTypeMap.find(instance); if(entry) return entry->second; return -1; } private: MetaDataProvider& operator=(const MetaDataProvider&); MetaDataProvider(const MetaDataProvider&); }; ////////////////////////////////////////////////////////////////////////// /*! PvdImpl is the realization of PxPvd. It implements the interface methods and provides richer functionality for advanced users or internal clients (such as PhysX or APEX), including handler notification for clients. */ ////////////////////////////////////////////////////////////////////////// class PvdImpl : public PsPvd, public PxUserAllocated { PX_NOCOPY(PvdImpl) typedef PxMutex::ScopedLock TScopedLockType; typedef void (PvdImpl::*TAllocationHandler)(size_t size, const char* typeName, const char* filename, int line, void* allocatedMemory); typedef void (PvdImpl::*TDeallocationHandler)(void* allocatedMemory); public: PvdImpl(); virtual ~PvdImpl(); void release(); bool connect(PxPvdTransport& transport, PxPvdInstrumentationFlags flags); void disconnect(); bool isConnected(bool useCachedStatus = true); void flush(); PxPvdTransport* getTransport(); PxPvdInstrumentationFlags getInstrumentationFlags(); void addClient(PvdClient* client); void removeClient(PvdClient* client); PvdOMMetaDataProvider& getMetaDataProvider(); bool registerObject(const void* inItem); bool unRegisterObject(const void* inItem); //AllocationListener void onAllocation(size_t size, const char* typeName, const char* filename, int line, void* allocatedMemory); void onDeallocation(void* addr); uint64_t getNextStreamId(); static bool initialize(); static PvdImpl* getInstance(); // Profiling virtual void* zoneStart(const char* eventName, bool detached, uint64_t contextId); virtual void zoneEnd(void* profilerData, const char *eventName, bool detached, uint64_t contextId); private: void sendTransportInitialization(); PxPvdTransport* mPvdTransport; physx::PxArray<PvdClient*> mPvdClients; MetaDataProvider* mSharedMetaProvider; // shared between clients ObjectRegistrar mObjectRegistrar; PvdMemClient* mMemClient; PxPvdInstrumentationFlags mFlags; bool mIsConnected; bool mGPUProfilingWasConnected; bool mIsNVTXSupportEnabled; uint32_t mNVTXContext; uint64_t mNextStreamId; physx::profile::PxProfileZoneManager*mProfileZoneManager; PvdProfileZoneClient* mProfileClient; physx::profile::PxProfileZone* mProfileZone; static PvdImpl* sInstance; static uint32_t sRefCount; }; } // namespace pvdsdk } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventSender.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_SENDER_H #define PX_PROFILE_EVENT_SENDER_H #include "foundation/Px.h" namespace physx { namespace profile { /** \brief Tagging interface to indicate an object that is capable of flushing a profile event stream at a certain point. */ class PxProfileEventFlusher { protected: virtual ~PxProfileEventFlusher(){} public: /** \brief Flush profile events. Sends the profile event buffer to hooked clients. */ virtual void flushProfileEvents() = 0; }; /** \brief Sends the full events where the caller must provide the context and thread id. */ class PxProfileEventSender { protected: virtual ~PxProfileEventSender(){} public: /** \brief Use this as a thread id for events that start on one thread and end on another */ static const uint32_t CrossThreadId = 99999789; /** \brief Send a start profile event, optionally with a context. Events are sorted by thread and context in the client side. \param inId Profile event id. \param contextId Context id. */ virtual void startEvent( uint16_t inId, uint64_t contextId) = 0; /** \brief Send a stop profile event, optionally with a context. Events are sorted by thread and context in the client side. \param inId Profile event id. \param contextId Context id. */ virtual void stopEvent( uint16_t inId, uint64_t contextId) = 0; /** \brief Send a start profile event, optionally with a context. Events are sorted by thread and context in the client side. \param inId Profile event id. \param contextId Context id. \param threadId Thread id. */ virtual void startEvent( uint16_t inId, uint64_t contextId, uint32_t threadId) = 0; /** \brief Send a stop profile event, optionally with a context. Events are sorted by thread and context in the client side. \param inId Profile event id. \param contextId Context id. \param threadId Thread id. */ virtual void stopEvent( uint16_t inId, uint64_t contextId, uint32_t threadId ) = 0; virtual void atEvent(uint16_t inId, uint64_t contextId, uint32_t threadId, uint64_t start, uint64_t stop) = 0; /** \brief Set an specific events value. This is different than the profiling value for the event; it is a value recorded and kept around without a timestamp associated with it. This value is displayed when the event itself is processed. \param inId Profile event id. \param contextId Context id. \param inValue Value to set for the event. */ virtual void eventValue( uint16_t inId, uint64_t contextId, int64_t inValue ) = 0; }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileMemory.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_MEMORY_H #define PX_PROFILE_MEMORY_H #include "PxProfileEventBufferClientManager.h" #include "PxProfileEventSender.h" #include "foundation/PxBroadcast.h" namespace physx { namespace profile { /** \brief Record events so a late-connecting client knows about all outstanding allocations */ class PxProfileMemoryEventRecorder : public PxAllocationListener { protected: virtual ~PxProfileMemoryEventRecorder(){} public: /** \brief Set the allocation listener \param inListener Allocation listener. */ virtual void setListener(PxAllocationListener* inListener) = 0; /** \brief Release the instance. */ virtual void release() = 0; }; /** \brief Stores memory events into the memory buffer. */ class PxProfileMemoryEventBuffer : public PxAllocationListener //add a new event to the buffer , public PxProfileEventBufferClientManager //add clients to handle the serialized memory events , public PxProfileEventFlusher //flush the buffer { protected: virtual ~PxProfileMemoryEventBuffer(){} public: /** \brief Release the instance. */ virtual void release() = 0; /** \brief Create a non-mutex-protected event buffer. \param inAllocator Allocation callback. \param inBufferSize Internal buffer size. */ static PxProfileMemoryEventBuffer& createMemoryEventBuffer(PxAllocatorCallback& inAllocator, uint32_t inBufferSize = 0x1000); }; } } // namespace physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventId.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_ID_H #define PX_PROFILE_EVENT_ID_H #include "foundation/Px.h" namespace physx { namespace profile { /** \brief A event id structure. Optionally includes information about if the event was enabled at compile time. */ struct PxProfileEventId { uint16_t eventId; mutable bool compileTimeEnabled; /** \brief Profile event id constructor. \param inId Profile event id. \param inCompileTimeEnabled Compile time enabled. */ PxProfileEventId( uint16_t inId = 0, bool inCompileTimeEnabled = true ) : eventId( inId ) , compileTimeEnabled( inCompileTimeEnabled ) { } operator uint16_t () const { return eventId; } bool operator==( const PxProfileEventId& inOther ) const { return eventId == inOther.eventId; } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileMemoryEventBuffer.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_MEMORY_EVENT_BUFFER_H #define PX_PROFILE_MEMORY_EVENT_BUFFER_H #include "PxProfileDataBuffer.h" #include "PxProfileMemoryEvents.h" #include "PxProfileMemory.h" #include "PxProfileScopedMutexLock.h" #include "PxProfileAllocatorWrapper.h" #include "PxProfileEventMutex.h" #include "foundation/PxHash.h" #include "foundation/PxHashMap.h" #include "foundation/PxUserAllocated.h" namespace physx { namespace profile { template<typename TMutex, typename TScopedLock> class MemoryEventBuffer : public DataBuffer<TMutex, TScopedLock> { public: typedef DataBuffer<TMutex, TScopedLock> TBaseType; typedef typename TBaseType::TMutexType TMutexType; typedef typename TBaseType::TScopedLockType TScopedLockType; typedef typename TBaseType::TU8AllocatorType TU8AllocatorType; typedef typename TBaseType::TMemoryBufferType TMemoryBufferType; typedef typename TBaseType::TBufferClientArray TBufferClientArray; typedef PxHashMap<const char*, uint32_t, PxHash<const char*>, TU8AllocatorType> TCharPtrToHandleMap; protected: TCharPtrToHandleMap mStringTable; public: MemoryEventBuffer( PxAllocatorCallback& cback , uint32_t inBufferFullAmount , TMutexType* inBufferMutex ) : TBaseType( &cback, inBufferFullAmount, inBufferMutex, "struct physx::profile::MemoryEvent" ) , mStringTable( TU8AllocatorType( TBaseType::getWrapper(), "MemoryEventStringBuffer" ) ) { } uint32_t getHandle( const char* inData ) { if ( inData == NULL ) inData = ""; const typename TCharPtrToHandleMap::Entry* result( mStringTable.find( inData ) ); if ( result ) return result->second; uint32_t hdl = mStringTable.size() + 1; mStringTable.insert( inData, hdl ); StringTableEvent theEvent; theEvent.init( inData, hdl ); sendEvent( theEvent ); return hdl; } void onAllocation( size_t inSize, const char* inType, const char* inFile, uint32_t inLine, uint64_t addr ) { if ( addr == 0 ) return; uint32_t typeHdl( getHandle( inType ) ); uint32_t fileHdl( getHandle( inFile ) ); AllocationEvent theEvent; theEvent.init( inSize, typeHdl, fileHdl, inLine, addr ); sendEvent( theEvent ); } void onDeallocation( uint64_t addr ) { if ( addr == 0 ) return; DeallocationEvent theEvent; theEvent.init( addr ); sendEvent( theEvent ); } void flushProfileEvents() { TBaseType::flushEvents(); } protected: template<typename TDataType> void sendEvent( TDataType inType ) { MemoryEventHeader theHeader( getMemoryEventType<TDataType>() ); inType.setup( theHeader ); theHeader.streamify( TBaseType::mSerializer ); inType.streamify( TBaseType::mSerializer, theHeader ); if ( TBaseType::mDataArray.size() >= TBaseType::mBufferFullAmount ) flushProfileEvents(); } }; class PxProfileMemoryEventBufferImpl : public PxUserAllocated , public PxProfileMemoryEventBuffer { typedef MemoryEventBuffer<PxProfileEventMutex, NullLock> TMemoryBufferType; TMemoryBufferType mBuffer; public: PxProfileMemoryEventBufferImpl( PxAllocatorCallback& alloc, uint32_t inBufferFullAmount ) : mBuffer( alloc, inBufferFullAmount, NULL ) { } virtual void onAllocation( size_t size, const char* typeName, const char* filename, int line, void* allocatedMemory ) { mBuffer.onAllocation( size, typeName, filename, uint32_t(line), static_cast<uint64_t>(reinterpret_cast<size_t>(allocatedMemory)) ); } virtual void onDeallocation( void* allocatedMemory ) { mBuffer.onDeallocation(static_cast<uint64_t>(reinterpret_cast<size_t>(allocatedMemory)) ); } virtual void addClient( PxProfileEventBufferClient& inClient ) { mBuffer.addClient( inClient ); } virtual void removeClient( PxProfileEventBufferClient& inClient ) { mBuffer.removeClient( inClient ); } virtual bool hasClients() const { return mBuffer.hasClients(); } virtual void flushProfileEvents() { mBuffer.flushProfileEvents(); } virtual void release(){ PX_PROFILE_DELETE( mBuffer.getWrapper().getAllocator(), this ); } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdUserRenderer.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #include "PxPvdUserRenderImpl.h" #include "PxPvdInternalByteStreams.h" #include "PxPvdBits.h" #include <stdarg.h> using namespace physx; using namespace physx::pvdsdk; namespace { template <typename TStreamType> struct RenderWriter : public RenderSerializer { TStreamType& mStream; RenderWriter(TStreamType& stream) : mStream(stream) { } template <typename TDataType> void write(const TDataType* val, uint32_t count) { uint32_t numBytes = count * sizeof(TDataType); mStream.write(reinterpret_cast<const uint8_t*>(val), numBytes); } template <typename TDataType> void write(const TDataType& val) { write(&val, 1); } template <typename TDataType> void writeRef(DataRef<TDataType>& val) { uint32_t amount = val.size(); write(amount); if(amount) write(val.begin(), amount); } virtual void streamify(uint64_t& val) { write(val); } virtual void streamify(uint32_t& val) { write(val); } virtual void streamify(float& val) { write(val); } virtual void streamify(uint8_t& val) { write(val); } virtual void streamify(DataRef<uint8_t>& val) { writeRef(val); } virtual void streamify(PxDebugText& val) { write(val.color); write(val.position); write(val.size); uint32_t amount = static_cast<uint32_t>(strlen(val.string)) + 1; write(amount); if(amount) write(val.string, amount); } virtual void streamify(DataRef<PxDebugPoint>& val) { writeRef(val); } virtual void streamify(DataRef<PxDebugLine>& val) { writeRef(val); } virtual void streamify(DataRef<PxDebugTriangle>& val) { writeRef(val); } virtual uint32_t hasData() { return false; } virtual bool isGood() { return true; } private: RenderWriter& operator=(const RenderWriter&); }; struct UserRenderer : public PvdUserRenderer { ForwardingMemoryBuffer mBuffer; uint32_t mBufferCapacity; RendererEventClient* mClient; UserRenderer(uint32_t bufferFullAmount) : mBuffer("UserRenderBuffer"), mBufferCapacity(bufferFullAmount), mClient(NULL) { } virtual ~UserRenderer() { } virtual void release() { PVD_DELETE(this); } template <typename TEventType> void handleEvent(TEventType evt) { RenderWriter<ForwardingMemoryBuffer> _writer(mBuffer); RenderSerializer& writer(_writer); PvdUserRenderTypes::Enum evtType(getPvdRenderTypeFromType<TEventType>()); writer.streamify(evtType); evt.serialize(writer); if(mBuffer.size() >= mBufferCapacity) flushRenderEvents(); } virtual void setInstanceId(const void* iid) { handleEvent(SetInstanceIdRenderEvent(PVD_POINTER_TO_U64(iid))); } // Draw these points associated with this instance virtual void drawPoints(const PxDebugPoint* points, uint32_t count) { handleEvent(PointsRenderEvent(points, count)); } // Draw these lines associated with this instance virtual void drawLines(const PxDebugLine* lines, uint32_t count) { handleEvent(LinesRenderEvent(lines, count)); } // Draw these triangles associated with this instance virtual void drawTriangles(const PxDebugTriangle* triangles, uint32_t count) { handleEvent(TrianglesRenderEvent(triangles, count)); } virtual void drawText(const PxDebugText& text) { handleEvent(TextRenderEvent(text)); } virtual void drawRenderbuffer(const PxDebugPoint* pointData, uint32_t pointCount, const PxDebugLine* lineData, uint32_t lineCount, const PxDebugTriangle* triangleData, uint32_t triangleCount) { handleEvent(DebugRenderEvent(pointData, pointCount, lineData, lineCount, triangleData, triangleCount)); } // Constraint visualization routines virtual void visualizeJointFrames(const PxTransform& parent, const PxTransform& child) PX_OVERRIDE { handleEvent(JointFramesRenderEvent(parent, child)); } virtual void visualizeLinearLimit(const PxTransform& t0, const PxTransform& t1, float value) PX_OVERRIDE { handleEvent(LinearLimitRenderEvent(t0, t1, value, true)); } virtual void visualizeAngularLimit(const PxTransform& t0, float lower, float upper) PX_OVERRIDE { handleEvent(AngularLimitRenderEvent(t0, lower, upper, true)); } virtual void visualizeLimitCone(const PxTransform& t, float tanQSwingY, float tanQSwingZ) PX_OVERRIDE { handleEvent(LimitConeRenderEvent(t, tanQSwingY, tanQSwingZ, true)); } virtual void visualizeDoubleCone(const PxTransform& t, float angle) PX_OVERRIDE { handleEvent(DoubleConeRenderEvent(t, angle, true)); } // Clear the immedate buffer. virtual void flushRenderEvents() { if(mClient) mClient->handleBufferFlush(mBuffer.begin(), mBuffer.size()); mBuffer.clear(); } virtual void setClient(RendererEventClient* client) { mClient = client; } private: UserRenderer& operator=(const UserRenderer&); }; template <bool swapBytes> struct RenderReader : public RenderSerializer { MemPvdInputStream mStream; ForwardingMemoryBuffer& mBuffer; RenderReader(ForwardingMemoryBuffer& buf) : mBuffer(buf) { } void setData(DataRef<const uint8_t> data) { mStream.setup(const_cast<uint8_t*>(data.begin()), const_cast<uint8_t*>(data.end())); } virtual void streamify(uint32_t& val) { mStream >> val; } virtual void streamify(uint64_t& val) { mStream >> val; } virtual void streamify(float& val) { mStream >> val; } virtual void streamify(uint8_t& val) { mStream >> val; } template <typename TDataType> void readRef(DataRef<TDataType>& val) { uint32_t count; mStream >> count; uint32_t numBytes = sizeof(TDataType) * count; TDataType* dataPtr = reinterpret_cast<TDataType*>(mBuffer.growBuf(numBytes)); mStream.read(reinterpret_cast<uint8_t*>(dataPtr), numBytes); val = DataRef<TDataType>(dataPtr, count); } virtual void streamify(DataRef<PxDebugPoint>& val) { readRef(val); } virtual void streamify(DataRef<PxDebugLine>& val) { readRef(val); } virtual void streamify(DataRef<PxDebugTriangle>& val) { readRef(val); } virtual void streamify(PxDebugText& val) { mStream >> val.color; mStream >> val.position; mStream >> val.size; uint32_t len = 0; mStream >> len; uint8_t* dataPtr = mBuffer.growBuf(len); mStream.read(dataPtr, len); val.string = reinterpret_cast<const char*>(dataPtr); } virtual void streamify(DataRef<uint8_t>& val) { readRef(val); } virtual bool isGood() { return mStream.isGood(); } virtual uint32_t hasData() { return uint32_t(mStream.size() > 0); } private: RenderReader& operator=(const RenderReader&); }; template <> struct RenderReader<true> : public RenderSerializer { MemPvdInputStream mStream; ForwardingMemoryBuffer& mBuffer; RenderReader(ForwardingMemoryBuffer& buf) : mBuffer(buf) { } void setData(DataRef<const uint8_t> data) { mStream.setup(const_cast<uint8_t*>(data.begin()), const_cast<uint8_t*>(data.end())); } template <typename TDataType> void read(TDataType& val) { mStream >> val; swapBytes(val); } virtual void streamify(uint64_t& val) { read(val); } virtual void streamify(uint32_t& val) { read(val); } virtual void streamify(float& val) { read(val); } virtual void streamify(uint8_t& val) { read(val); } template <typename TDataType> void readRef(DataRef<TDataType>& val) { uint32_t count; mStream >> count; swapBytes(count); uint32_t numBytes = sizeof(TDataType) * count; TDataType* dataPtr = reinterpret_cast<TDataType*>(mBuffer.growBuf(numBytes)); PVD_FOREACH(idx, count) RenderSerializerMap<TDataType>().serialize(*this, dataPtr[idx]); val = DataRef<TDataType>(dataPtr, count); } virtual void streamify(DataRef<PxDebugPoint>& val) { readRef(val); } virtual void streamify(DataRef<PxDebugLine>& val) { readRef(val); } virtual void streamify(DataRef<PxDebugTriangle>& val) { readRef(val); } virtual void streamify(PxDebugText& val) { mStream >> val.color; mStream >> val.position; mStream >> val.size; uint32_t len = 0; mStream >> len; uint8_t* dataPtr = mBuffer.growBuf(len); mStream.read(dataPtr, len); val.string = reinterpret_cast<const char*>(dataPtr); } virtual void streamify(DataRef<uint8_t>& val) { readRef(val); } virtual bool isGood() { return mStream.isGood(); } virtual uint32_t hasData() { return uint32_t(mStream.size() > 0); } private: RenderReader& operator=(const RenderReader&); }; } PvdUserRenderer* PvdUserRenderer::create(uint32_t bufferSize) { return PVD_NEW(UserRenderer)(bufferSize); }
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdCommStreamEventSink.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_COMM_STREAM_EVENT_SINK_H #define PX_PVD_COMM_STREAM_EVENT_SINK_H #include "PxPvdObjectModelBaseTypes.h" #include "PxPvdCommStreamEvents.h" #include "PxPvdCommStreamTypes.h" namespace physx { namespace pvdsdk { class PvdCommStreamEventSink { public: template <typename TStreamType> static void writeStreamEvent(const EventSerializeable& evt, PvdCommStreamEventTypes::Enum evtType, TStreamType& stream) { EventStreamifier<TStreamType> streamifier_concrete(stream); PvdEventSerializer& streamifier(streamifier_concrete); streamifier.streamify(evtType); const_cast<EventSerializeable&>(evt).serialize(streamifier); } }; } // pvd } // physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdDefaultSocketTransport.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdDefaultSocketTransport.h" namespace physx { namespace pvdsdk { PvdDefaultSocketTransport::PvdDefaultSocketTransport(const char* host, int port, unsigned int timeoutInMilliseconds) : mHost(host), mPort(uint16_t(port)), mTimeout(timeoutInMilliseconds), mConnected(false), mWrittenData(0) { } PvdDefaultSocketTransport::~PvdDefaultSocketTransport() { } bool PvdDefaultSocketTransport::connect() { if(mConnected) return true; if(mSocket.connect(mHost, mPort, mTimeout)) { mSocket.setBlocking(true); mConnected = true; } return mConnected; } void PvdDefaultSocketTransport::disconnect() { mSocket.flush(); mSocket.disconnect(); mConnected = false; } bool PvdDefaultSocketTransport::isConnected() { return mSocket.isConnected(); } bool PvdDefaultSocketTransport::write(const uint8_t* inBytes, uint32_t inLength) { if(mConnected) { if(inLength == 0) return true; uint32_t amountWritten = 0; uint32_t totalWritten = 0; do { // Sockets don't have to write as much as requested, so we need // to wrap this call in a do/while loop. // If they don't write any bytes then we consider them disconnected. amountWritten = mSocket.write(inBytes, inLength); inLength -= amountWritten; inBytes += amountWritten; totalWritten += amountWritten; } while(inLength && amountWritten); if(amountWritten == 0) return false; mWrittenData += totalWritten; return true; } else return false; } PxPvdTransport& PvdDefaultSocketTransport::lock() { mMutex.lock(); return *this; } void PvdDefaultSocketTransport::unlock() { mMutex.unlock(); } void PvdDefaultSocketTransport::flush() { mSocket.flush(); } uint64_t PvdDefaultSocketTransport::getWrittenDataSize() { return mWrittenData; } void PvdDefaultSocketTransport::release() { PX_DELETE_THIS; } } // namespace pvdsdk PxPvdTransport* PxDefaultPvdSocketTransportCreate(const char* host, int port, unsigned int timeoutInMilliseconds) { return PX_NEW(pvdsdk::PvdDefaultSocketTransport)(host, port, timeoutInMilliseconds); } } // namespace physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdDefaultFileTransport.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdDefaultFileTransport.h" namespace physx { namespace pvdsdk { PvdDefaultFileTransport::PvdDefaultFileTransport(const char* name) : mConnected(false), mWrittenData(0), mLocked(false) { mFileBuffer = PX_NEW(PsFileBuffer)(name, PxFileBuf::OPEN_WRITE_ONLY); } PvdDefaultFileTransport::~PvdDefaultFileTransport() { } bool PvdDefaultFileTransport::connect() { PX_ASSERT(mFileBuffer); mConnected = mFileBuffer->isOpen(); return mConnected; } void PvdDefaultFileTransport::disconnect() { mConnected = false; } bool PvdDefaultFileTransport::isConnected() { return mConnected; } bool PvdDefaultFileTransport::write(const uint8_t* inBytes, uint32_t inLength) { PX_ASSERT(mLocked); PX_ASSERT(mFileBuffer); if (mConnected) { uint32_t len = mFileBuffer->write(inBytes, inLength); mWrittenData += len; return len == inLength; } else return false; } PxPvdTransport& PvdDefaultFileTransport::lock() { mMutex.lock(); PX_ASSERT(!mLocked); mLocked = true; return *this; } void PvdDefaultFileTransport::unlock() { PX_ASSERT(mLocked); mLocked = false; mMutex.unlock(); } void PvdDefaultFileTransport::flush() { } uint64_t PvdDefaultFileTransport::getWrittenDataSize() { return mWrittenData; } void PvdDefaultFileTransport::release() { if (mFileBuffer) { mFileBuffer->close(); delete mFileBuffer; } mFileBuffer = NULL; PX_DELETE_THIS; } class NullFileTransport : public physx::PxPvdTransport, public physx::PxUserAllocated { PX_NOCOPY(NullFileTransport) public: NullFileTransport(); virtual ~NullFileTransport(); virtual bool connect(); virtual void disconnect(); virtual bool isConnected(); virtual bool write(const uint8_t* inBytes, uint32_t inLength); virtual PxPvdTransport& lock(); virtual void unlock(); virtual void flush(); virtual uint64_t getWrittenDataSize(); virtual void release(); private: bool mConnected; uint64_t mWrittenData; physx::PxMutex mMutex; bool mLocked; // for debug, remove it when finished }; NullFileTransport::NullFileTransport() : mConnected(false), mWrittenData(0), mLocked(false) { } NullFileTransport::~NullFileTransport() { } bool NullFileTransport::connect() { mConnected = true; return true; } void NullFileTransport::disconnect() { mConnected = false; } bool NullFileTransport::isConnected() { return mConnected; } bool NullFileTransport::write(const uint8_t* /*inBytes*/, uint32_t inLength) { PX_ASSERT(mLocked); if(mConnected) { uint32_t len = inLength; mWrittenData += len; return len == inLength; } else return false; } PxPvdTransport& NullFileTransport::lock() { mMutex.lock(); PX_ASSERT(!mLocked); mLocked = true; return *this; } void NullFileTransport::unlock() { PX_ASSERT(mLocked); mLocked = false; mMutex.unlock(); } void NullFileTransport::flush() { } uint64_t NullFileTransport::getWrittenDataSize() { return mWrittenData; } void NullFileTransport::release() { PX_DELETE_THIS; } } // namespace pvdsdk PxPvdTransport* PxDefaultPvdFileTransportCreate(const char* name) { if(name) return PX_NEW(pvdsdk::PvdDefaultFileTransport)(name); else return PX_NEW(pvdsdk::NullFileTransport)(); } } // namespace physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEvents.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENTS_H #define PX_PROFILE_EVENTS_H #include "foundation/PxMath.h" #include "foundation/PxAssert.h" #include "PxProfileEventId.h" #define PX_PROFILE_UNION_1(a) physx::profile::TUnion<a, physx::profile::Empty> #define PX_PROFILE_UNION_2(a,b) physx::profile::TUnion<a, PX_PROFILE_UNION_1(b)> #define PX_PROFILE_UNION_3(a,b,c) physx::profile::TUnion<a, PX_PROFILE_UNION_2(b,c)> #define PX_PROFILE_UNION_4(a,b,c,d) physx::profile::TUnion<a, PX_PROFILE_UNION_3(b,c,d)> #define PX_PROFILE_UNION_5(a,b,c,d,e) physx::profile::TUnion<a, PX_PROFILE_UNION_4(b,c,d,e)> #define PX_PROFILE_UNION_6(a,b,c,d,e,f) physx::profile::TUnion<a, PX_PROFILE_UNION_5(b,c,d,e,f)> #define PX_PROFILE_UNION_7(a,b,c,d,e,f,g) physx::profile::TUnion<a, PX_PROFILE_UNION_6(b,c,d,e,f,g)> #define PX_PROFILE_UNION_8(a,b,c,d,e,f,g,h) physx::profile::TUnion<a, PX_PROFILE_UNION_7(b,c,d,e,f,g,h)> #define PX_PROFILE_UNION_9(a,b,c,d,e,f,g,h,i) physx::profile::TUnion<a, PX_PROFILE_UNION_8(b,c,d,e,f,g,h,i)> namespace physx { namespace profile { struct Empty {}; template <typename T> struct Type2Type {}; template <typename U, typename V> union TUnion { typedef U Head; typedef V Tail; Head head; Tail tail; template <typename TDataType> void init(const TDataType& inData) { toType(Type2Type<TDataType>()).init(inData); } template <typename TDataType> PX_FORCE_INLINE TDataType& toType(const Type2Type<TDataType>& outData) { return tail.toType(outData); } PX_FORCE_INLINE Head& toType(const Type2Type<Head>&) { return head; } template <typename TDataType> PX_FORCE_INLINE const TDataType& toType(const Type2Type<TDataType>& outData) const { return tail.toType(outData); } PX_FORCE_INLINE const Head& toType(const Type2Type<Head>&) const { return head; } }; struct EventTypes { enum Enum { Unknown = 0, StartEvent, StopEvent, RelativeStartEvent, //reuses context,id from the earlier event. RelativeStopEvent, //reuses context,id from the earlier event. EventValue, CUDAProfileBuffer //obsolete, placeholder to skip data from PhysX SDKs < 3.4 }; }; struct EventStreamCompressionFlags { enum Enum { U8 = 0, U16 = 1, U32 = 2, U64 = 3, CompressionMask = 3 }; }; #if PX_APPLE_FAMILY #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wimplicit-fallthrough" #endif //Find the smallest value that will represent the incoming value without loss. //We can enlarge the current compression value, but we can't make is smaller. //In this way, we can use this function to find the smallest compression setting //that will work for a set of values. inline EventStreamCompressionFlags::Enum findCompressionValue( uint64_t inValue, EventStreamCompressionFlags::Enum inCurrentCompressionValue = EventStreamCompressionFlags::U8 ) { PX_ASSERT_WITH_MESSAGE( (inCurrentCompressionValue >= EventStreamCompressionFlags::U8) && (inCurrentCompressionValue <= EventStreamCompressionFlags::U64), "Invalid inCurrentCompressionValue in profile::findCompressionValue"); //Fallthrough is intentional switch( inCurrentCompressionValue ) { case EventStreamCompressionFlags::U8: if ( inValue <= UINT8_MAX ) return EventStreamCompressionFlags::U8; case EventStreamCompressionFlags::U16: if ( inValue <= UINT16_MAX ) return EventStreamCompressionFlags::U16; case EventStreamCompressionFlags::U32: if ( inValue <= UINT32_MAX ) return EventStreamCompressionFlags::U32; case EventStreamCompressionFlags::U64: break; } return EventStreamCompressionFlags::U64; } //Find the smallest value that will represent the incoming value without loss. //We can enlarge the current compression value, but we can't make is smaller. //In this way, we can use this function to find the smallest compression setting //that will work for a set of values. inline EventStreamCompressionFlags::Enum findCompressionValue( uint32_t inValue, EventStreamCompressionFlags::Enum inCurrentCompressionValue = EventStreamCompressionFlags::U8 ) { PX_ASSERT_WITH_MESSAGE( (inCurrentCompressionValue >= EventStreamCompressionFlags::U8) && (inCurrentCompressionValue <= EventStreamCompressionFlags::U64), "Invalid inCurrentCompressionValue in profile::findCompressionValue"); //Fallthrough is intentional switch( inCurrentCompressionValue ) { case EventStreamCompressionFlags::U8: if ( inValue <= UINT8_MAX ) return EventStreamCompressionFlags::U8; case EventStreamCompressionFlags::U16: if ( inValue <= UINT16_MAX ) return EventStreamCompressionFlags::U16; case EventStreamCompressionFlags::U32: case EventStreamCompressionFlags::U64: break; } return EventStreamCompressionFlags::U32; } #if PX_APPLE_FAMILY #pragma clang diagnostic pop #endif //Event header is 32 bytes and precedes all events. struct EventHeader { uint8_t mEventType; //Used to parse the correct event out of the stream uint8_t mStreamOptions; //Timestamp compression, etc. uint16_t mEventId; //16 bit per-event-system event id EventHeader( uint8_t type = 0, uint16_t id = 0 ) : mEventType( type ) , mStreamOptions( uint8_t(-1) ) , mEventId( id ) { } EventHeader( EventTypes::Enum type, uint16_t id ) : mEventType( static_cast<uint8_t>( type ) ) , mStreamOptions( uint8_t(-1) ) , mEventId( id ) { } EventStreamCompressionFlags::Enum getTimestampCompressionFlags() const { return static_cast<EventStreamCompressionFlags::Enum> ( mStreamOptions & EventStreamCompressionFlags::CompressionMask ); } uint64_t compressTimestamp( uint64_t inLastTimestamp, uint64_t inCurrentTimestamp ) { mStreamOptions = EventStreamCompressionFlags::U64; uint64_t retval = inCurrentTimestamp; if ( inLastTimestamp ) { retval = inCurrentTimestamp - inLastTimestamp; EventStreamCompressionFlags::Enum compressionValue = findCompressionValue( retval ); mStreamOptions = static_cast<uint8_t>( compressionValue ); if ( compressionValue == EventStreamCompressionFlags::U64 ) retval = inCurrentTimestamp; //just send the timestamp as is. } return retval; } uint64_t uncompressTimestamp( uint64_t inLastTimestamp, uint64_t inCurrentTimestamp ) const { if ( getTimestampCompressionFlags() != EventStreamCompressionFlags::U64 ) return inLastTimestamp + inCurrentTimestamp; return inCurrentTimestamp; } void setContextIdCompressionFlags( uint64_t inContextId ) { uint8_t options = static_cast<uint8_t>( findCompressionValue( inContextId ) ); mStreamOptions = uint8_t(mStreamOptions | options << 2); } EventStreamCompressionFlags::Enum getContextIdCompressionFlags() const { return static_cast< EventStreamCompressionFlags::Enum >( ( mStreamOptions >> 2 ) & EventStreamCompressionFlags::CompressionMask ); } bool operator==( const EventHeader& inOther ) const { return mEventType == inOther.mEventType && mStreamOptions == inOther.mStreamOptions && mEventId == inOther.mEventId; } template<typename TStreamType> inline uint32_t streamify( TStreamType& inStream ) { uint32_t writtenSize = inStream.streamify( "EventType", mEventType ); writtenSize += inStream.streamify("StreamOptions", mStreamOptions); //Timestamp compression, etc. writtenSize += inStream.streamify("EventId", mEventId); //16 bit per-event-system event id return writtenSize; } }; //Declaration of type level getEventType function that maps enumeration event types to datatypes template<typename TDataType> inline EventTypes::Enum getEventType() { PX_ASSERT( false ); return EventTypes::Unknown; } //Relative profile event means this event is sharing the context and thread id //with the event before it. struct RelativeProfileEvent { uint64_t mTensOfNanoSeconds; //timestamp is in tensOfNanonseconds void init( uint64_t inTs ) { mTensOfNanoSeconds = inTs; } void init( const RelativeProfileEvent& inData ) { mTensOfNanoSeconds = inData.mTensOfNanoSeconds; } bool operator==( const RelativeProfileEvent& other ) const { return mTensOfNanoSeconds == other.mTensOfNanoSeconds; } template<typename TStreamType> uint32_t streamify( TStreamType& inStream, const EventHeader& inHeader ) { return inStream.streamify( "TensOfNanoSeconds", mTensOfNanoSeconds, inHeader.getTimestampCompressionFlags() ); } uint64_t getTimestamp() const { return mTensOfNanoSeconds; } void setTimestamp( uint64_t inTs ) { mTensOfNanoSeconds = inTs; } void setupHeader( EventHeader& inHeader, uint64_t inLastTimestamp ) { mTensOfNanoSeconds = inHeader.compressTimestamp( inLastTimestamp, mTensOfNanoSeconds ); } uint32_t getEventSize(const EventHeader& inHeader) { uint32_t size = 0; switch (inHeader.getTimestampCompressionFlags()) { case EventStreamCompressionFlags::U8: size = 1; break; case EventStreamCompressionFlags::U16: size = 2; break; case EventStreamCompressionFlags::U32: size = 4; break; case EventStreamCompressionFlags::U64: size = 8; break; } return size; } }; //Start version of the relative event. struct RelativeStartEvent : public RelativeProfileEvent { void init( uint64_t inTs = 0 ) { RelativeProfileEvent::init( inTs ); } void init( const RelativeStartEvent& inData ) { RelativeProfileEvent::init( inData ); } template<typename THandlerType> void handle( THandlerType* inHdlr, uint16_t eventId, uint32_t thread, uint64_t context, uint8_t inCpuId, uint8_t threadPriority ) const { inHdlr->onStartEvent( PxProfileEventId( eventId ), thread, context, inCpuId, threadPriority, mTensOfNanoSeconds ); } }; template<> inline EventTypes::Enum getEventType<RelativeStartEvent>() { return EventTypes::RelativeStartEvent; } //Stop version of relative event. struct RelativeStopEvent : public RelativeProfileEvent { void init( uint64_t inTs = 0 ) { RelativeProfileEvent::init( inTs ); } void init( const RelativeStopEvent& inData ) { RelativeProfileEvent::init( inData ); } template<typename THandlerType> void handle( THandlerType* inHdlr, uint16_t eventId, uint32_t thread, uint64_t context, uint8_t inCpuId, uint8_t threadPriority ) const { inHdlr->onStopEvent( PxProfileEventId( eventId ), thread, context, inCpuId, threadPriority, mTensOfNanoSeconds ); } }; template<> inline EventTypes::Enum getEventType<RelativeStopEvent>() { return EventTypes::RelativeStopEvent; } struct EventContextInformation { uint64_t mContextId; uint32_t mThreadId; //Thread this event was taken from uint8_t mThreadPriority; uint8_t mCpuId; void init( uint32_t inThreadId = UINT32_MAX , uint64_t inContextId = (uint64_t(-1)) , uint8_t inPriority = UINT8_MAX , uint8_t inCpuId = UINT8_MAX ) { mContextId = inContextId; mThreadId = inThreadId; mThreadPriority = inPriority; mCpuId = inCpuId; } void init( const EventContextInformation& inData ) { mContextId = inData.mContextId; mThreadId = inData.mThreadId; mThreadPriority = inData.mThreadPriority; mCpuId = inData.mCpuId; } template<typename TStreamType> uint32_t streamify( TStreamType& inStream, EventStreamCompressionFlags::Enum inContextIdFlags ) { uint32_t writtenSize = inStream.streamify( "ThreadId", mThreadId ); writtenSize += inStream.streamify("ContextId", mContextId, inContextIdFlags); writtenSize += inStream.streamify("ThreadPriority", mThreadPriority); writtenSize += inStream.streamify("CpuId", mCpuId); return writtenSize; } bool operator==( const EventContextInformation& other ) const { return mThreadId == other.mThreadId && mContextId == other.mContextId && mThreadPriority == other.mThreadPriority && mCpuId == other.mCpuId; } void setToDefault() { *this = EventContextInformation(); } }; //Profile event contains all the data required to tell the profile what is going //on. struct ProfileEvent { EventContextInformation mContextInformation; RelativeProfileEvent mTimeData; //timestamp in seconds. void init( uint32_t inThreadId, uint64_t inContextId, uint8_t inCpuId, uint8_t inPriority, uint64_t inTs ) { mContextInformation.init( inThreadId, inContextId, inPriority, inCpuId ); mTimeData.init( inTs ); } void init( const ProfileEvent& inData ) { mContextInformation.init( inData.mContextInformation ); mTimeData.init( inData.mTimeData ); } bool operator==( const ProfileEvent& other ) const { return mContextInformation == other.mContextInformation && mTimeData == other.mTimeData; } template<typename TStreamType> uint32_t streamify( TStreamType& inStream, const EventHeader& inHeader ) { uint32_t writtenSize = mContextInformation.streamify(inStream, inHeader.getContextIdCompressionFlags()); writtenSize += mTimeData.streamify(inStream, inHeader); return writtenSize; } uint32_t getEventSize(const EventHeader& inHeader) { uint32_t eventSize = 0; // time is stored depending on the conpress flag mTimeData.streamify(inStream, inHeader); switch (inHeader.getTimestampCompressionFlags()) { case EventStreamCompressionFlags::U8: eventSize++; break; case EventStreamCompressionFlags::U16: eventSize += 2; break; case EventStreamCompressionFlags::U32: eventSize += 4; break; case EventStreamCompressionFlags::U64: eventSize += 8; break; } // context information // mContextInformation.streamify( inStream, inHeader.getContextIdCompressionFlags() ); eventSize += 6; // uint32_t mThreadId; uint8_t mThreadPriority; uint8_t mCpuId; switch (inHeader.getContextIdCompressionFlags()) { case EventStreamCompressionFlags::U8: eventSize++; break; case EventStreamCompressionFlags::U16: eventSize += 2; break; case EventStreamCompressionFlags::U32: eventSize += 4; break; case EventStreamCompressionFlags::U64: eventSize += 8; break; } return eventSize; } uint64_t getTimestamp() const { return mTimeData.getTimestamp(); } void setTimestamp( uint64_t inTs ) { mTimeData.setTimestamp( inTs ); } void setupHeader( EventHeader& inHeader, uint64_t inLastTimestamp ) { mTimeData.setupHeader( inHeader, inLastTimestamp ); inHeader.setContextIdCompressionFlags( mContextInformation.mContextId ); } }; //profile start event starts the profile session. struct StartEvent : public ProfileEvent { void init( uint32_t inThreadId = 0, uint64_t inContextId = 0, uint8_t inCpuId = 0, uint8_t inPriority = 0, uint64_t inTensOfNanoSeconds = 0 ) { ProfileEvent::init( inThreadId, inContextId, inCpuId, inPriority, inTensOfNanoSeconds ); } void init( const StartEvent& inData ) { ProfileEvent::init( inData ); } RelativeStartEvent getRelativeEvent() const { RelativeStartEvent theEvent; theEvent.init( mTimeData.mTensOfNanoSeconds ); return theEvent; } EventTypes::Enum getRelativeEventType() const { return getEventType<RelativeStartEvent>(); } }; template<> inline EventTypes::Enum getEventType<StartEvent>() { return EventTypes::StartEvent; } //Profile stop event stops the profile session. struct StopEvent : public ProfileEvent { void init( uint32_t inThreadId = 0, uint64_t inContextId = 0, uint8_t inCpuId = 0, uint8_t inPriority = 0, uint64_t inTensOfNanoSeconds = 0 ) { ProfileEvent::init( inThreadId, inContextId, inCpuId, inPriority, inTensOfNanoSeconds ); } void init( const StopEvent& inData ) { ProfileEvent::init( inData ); } RelativeStopEvent getRelativeEvent() const { RelativeStopEvent theEvent; theEvent.init( mTimeData.mTensOfNanoSeconds ); return theEvent; } EventTypes::Enum getRelativeEventType() const { return getEventType<RelativeStopEvent>(); } }; template<> inline EventTypes::Enum getEventType<StopEvent>() { return EventTypes::StopEvent; } struct EventValue { uint64_t mValue; uint64_t mContextId; uint32_t mThreadId; void init( int64_t inValue = 0, uint64_t inContextId = 0, uint32_t inThreadId = 0 ) { mValue = static_cast<uint64_t>( inValue ); mContextId = inContextId; mThreadId = inThreadId; } void init( const EventValue& inData ) { mValue = inData.mValue; mContextId = inData.mContextId; mThreadId = inData.mThreadId; } int64_t getValue() const { return static_cast<int16_t>( mValue ); } void setupHeader( EventHeader& inHeader ) { mValue = inHeader.compressTimestamp( 0, mValue ); inHeader.setContextIdCompressionFlags( mContextId ); } template<typename TStreamType> uint32_t streamify( TStreamType& inStream, const EventHeader& inHeader ) { uint32_t writtenSize = inStream.streamify("Value", mValue, inHeader.getTimestampCompressionFlags()); writtenSize += inStream.streamify("ContextId", mContextId, inHeader.getContextIdCompressionFlags()); writtenSize += inStream.streamify("ThreadId", mThreadId); return writtenSize; } uint32_t getEventSize(const EventHeader& inHeader) { uint32_t eventSize = 0; // value switch (inHeader.getTimestampCompressionFlags()) { case EventStreamCompressionFlags::U8: eventSize++; break; case EventStreamCompressionFlags::U16: eventSize += 2; break; case EventStreamCompressionFlags::U32: eventSize += 4; break; case EventStreamCompressionFlags::U64: eventSize += 8; break; } // context information switch (inHeader.getContextIdCompressionFlags()) { case EventStreamCompressionFlags::U8: eventSize++; break; case EventStreamCompressionFlags::U16: eventSize += 2; break; case EventStreamCompressionFlags::U32: eventSize += 4; break; case EventStreamCompressionFlags::U64: eventSize += 8; break; } eventSize += 4; // uint32_t mThreadId; return eventSize; } bool operator==( const EventValue& other ) const { return mValue == other.mValue && mContextId == other.mContextId && mThreadId == other.mThreadId; } template<typename THandlerType> void handle( THandlerType* inHdlr, uint16_t eventId ) const { inHdlr->onEventValue( PxProfileEventId( eventId ), mThreadId, mContextId, getValue() ); } }; template<> inline EventTypes::Enum getEventType<EventValue>() { return EventTypes::EventValue; } //obsolete, placeholder to skip data from PhysX SDKs < 3.4 struct CUDAProfileBuffer { uint64_t mTimestamp; float mTimespan; const uint8_t* mCudaData; uint32_t mBufLen; uint32_t mVersion; template<typename TStreamType> uint32_t streamify( TStreamType& inStream, const EventHeader& ) { uint32_t writtenSize = inStream.streamify("Timestamp", mTimestamp); writtenSize += inStream.streamify("Timespan", mTimespan); writtenSize += inStream.streamify("CudaData", mCudaData, mBufLen); writtenSize += inStream.streamify("BufLen", mBufLen); writtenSize += inStream.streamify("Version", mVersion); return writtenSize; } bool operator==( const CUDAProfileBuffer& other ) const { return mTimestamp == other.mTimestamp && mTimespan == other.mTimespan && mBufLen == other.mBufLen && memcmp( mCudaData, other.mCudaData, mBufLen ) == 0 && mVersion == other.mVersion; } }; template<> inline EventTypes::Enum getEventType<CUDAProfileBuffer>() { return EventTypes::CUDAProfileBuffer; } //Provides a generic equal operation for event data objects. template <typename TEventData> struct EventDataEqualOperator { TEventData mData; EventDataEqualOperator( const TEventData& inD ) : mData( inD ) {} template<typename TDataType> bool operator()( const TDataType& inRhs ) const { return mData.toType( Type2Type<TDataType>() ) == inRhs; } bool operator()() const { return false; } }; /** * Generic event container that combines and even header with the generic event data type. * Provides unsafe and typesafe access to the event data. */ class Event { public: typedef PX_PROFILE_UNION_7(StartEvent, StopEvent, RelativeStartEvent, RelativeStopEvent, EventValue, CUDAProfileBuffer, uint8_t) EventData; private: EventHeader mHeader; EventData mData; public: Event() {} template <typename TDataType> Event( EventHeader inHeader, const TDataType& inData ) : mHeader( inHeader ) { mData.init<TDataType>(inData); } template<typename TDataType> Event( uint16_t eventId, const TDataType& inData ) : mHeader( getEventType<TDataType>(), eventId ) { mData.init<TDataType>(inData); } const EventHeader& getHeader() const { return mHeader; } const EventData& getData() const { return mData; } template<typename TDataType> const TDataType& getValue() const { PX_ASSERT( mHeader.mEventType == getEventType<TDataType>() ); return mData.toType<TDataType>(); } template<typename TDataType> TDataType& getValue() { PX_ASSERT( mHeader.mEventType == getEventType<TDataType>() ); return mData.toType<TDataType>(); } template<typename TRetVal, typename TOperator> inline TRetVal visit( TOperator inOp ) const; bool operator==( const Event& inOther ) const { if ( !(mHeader == inOther.mHeader ) ) return false; if ( mHeader.mEventType ) return inOther.visit<bool>( EventDataEqualOperator<EventData>( mData ) ); return true; } }; //Combining the above union type with an event type means that an object can get the exact //data out of the union. Using this function means that all callsites will be forced to //deal with the newer datatypes and that the switch statement only exists in once place. //Implements conversion from enum -> datatype template<typename TRetVal, typename TOperator> TRetVal visit( EventTypes::Enum inEventType, const Event::EventData& inData, TOperator inOperator ) { switch( inEventType ) { case EventTypes::StartEvent: return inOperator( inData.toType( Type2Type<StartEvent>() ) ); case EventTypes::StopEvent: return inOperator( inData.toType( Type2Type<StopEvent>() ) ); case EventTypes::RelativeStartEvent: return inOperator( inData.toType( Type2Type<RelativeStartEvent>() ) ); case EventTypes::RelativeStopEvent: return inOperator( inData.toType( Type2Type<RelativeStopEvent>() ) ); case EventTypes::EventValue: return inOperator( inData.toType( Type2Type<EventValue>() ) ); //obsolete, placeholder to skip data from PhysX SDKs < 3.4 case EventTypes::CUDAProfileBuffer: return inOperator( inData.toType( Type2Type<CUDAProfileBuffer>() ) ); case EventTypes::Unknown: break; } uint8_t type = static_cast<uint8_t>( inEventType ); return inOperator( type ); } template<typename TRetVal, typename TOperator> inline TRetVal Event::visit( TOperator inOp ) const { return physx::profile::visit<TRetVal>( static_cast<EventTypes::Enum>(mHeader.mEventType), mData, inOp ); } } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectModelInternalTypes.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_OBJECT_MODEL_INTERNAL_TYPES_H #define PX_PVD_OBJECT_MODEL_INTERNAL_TYPES_H #include "foundation/PxMemory.h" #include "PxPvdObjectModelBaseTypes.h" #include "foundation/PxArray.h" #include "PxPvdFoundation.h" namespace physx { namespace pvdsdk { struct PvdInternalType { enum Enum { None = 0, #define DECLARE_INTERNAL_PVD_TYPE(type) type, #include "PxPvdObjectModelInternalTypeDefs.h" Last #undef DECLARE_INTERNAL_PVD_TYPE }; }; PX_COMPILE_TIME_ASSERT(uint32_t(PvdInternalType::Last) <= uint32_t(PvdBaseType::InternalStop)); template <typename T> struct DataTypeToPvdTypeMap { bool compile_error; }; template <PvdInternalType::Enum> struct PvdTypeToDataTypeMap { bool compile_error; }; #define DECLARE_INTERNAL_PVD_TYPE(type) \ template <> \ struct DataTypeToPvdTypeMap<type> \ { \ enum Enum \ { \ BaseTypeEnum = PvdInternalType::type \ }; \ }; \ template <> \ struct PvdTypeToDataTypeMap<PvdInternalType::type> \ { \ typedef type TDataType; \ }; \ template <> \ struct PvdDataTypeToNamespacedNameMap<type> \ { \ NamespacedName Name; \ PvdDataTypeToNamespacedNameMap<type>() : Name("physx3_debugger_internal", #type) \ { \ } \ }; #include "PxPvdObjectModelInternalTypeDefs.h" #undef DECLARE_INTERNAL_PVD_TYPE template <typename TDataType, typename TAlloc> DataRef<TDataType> toDataRef(const PxArray<TDataType, TAlloc>& data) { return DataRef<TDataType>(data.begin(), data.end()); } static inline bool safeStrEq(const DataRef<String>& lhs, const DataRef<String>& rhs) { uint32_t count = lhs.size(); if(count != rhs.size()) return false; for(uint32_t idx = 0; idx < count; ++idx) if(!safeStrEq(lhs[idx], rhs[idx])) return false; return true; } static inline char* copyStr(const char* str) { str = nonNull(str); uint32_t len = static_cast<uint32_t>(strlen(str)); char* newData = reinterpret_cast<char*>(PX_ALLOC(len + 1, "string")); PxMemCopy(newData, str, len); newData[len] = 0; return newData; } // Used for predictable bit fields. template <typename TDataType, uint8_t TNumBits, uint8_t TOffset, typename TInputType> struct BitMaskSetter { // Create a mask that masks out the orginal value shift into place static TDataType createOffsetMask() { return createMask() << TOffset; } // Create a mask of TNumBits number of tis static TDataType createMask() { return static_cast<TDataType>((1 << TNumBits) - 1); } void setValue(TDataType& inCurrent, TInputType inData) { PX_ASSERT(inData < (1 << TNumBits)); // Create a mask to remove the current value. TDataType theMask = ~(createOffsetMask()); // Clear out current value. inCurrent = inCurrent & theMask; // Create the new value. TDataType theAddition = reinterpret_cast<TDataType>(inData << TOffset); // or it into the existing value. inCurrent = inCurrent | theAddition; } TInputType getValue(TDataType inCurrent) { return static_cast<TInputType>((inCurrent >> TOffset) & createMask()); } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventBufferAtomic.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_EVENT_BUFFER_ATOMIC_H #define PX_PROFILE_EVENT_BUFFER_ATOMIC_H #include "PxProfileEvents.h" #include "PxProfileEventSerialization.h" #include "PxProfileDataBuffer.h" #include "foundation/PxArray.h" #include "foundation/PxAtomic.h" #include "foundation/PxAllocator.h" #include "foundation/PxAlloca.h" #include "foundation/PxTime.h" namespace physx { namespace profile { static const uint32_t LOCAL_BUFFER_SIZE = 512; /** * An event buffer maintains an in-memory buffer of events. When this buffer is full * it sends to buffer to all handlers registered and resets the buffer. * * It is parameterized in four ways. The first is a context provider that provides * both thread id and context id. * * The second is the mutex (which may be null) and a scoped locking mechanism. Thus the buffer * may be used in a multithreaded context but clients of the buffer don't pay for this if they * don't intend to use it this way. * * Finally the buffer may use an event filtering mechanism. This mechanism needs one function, * namely isEventEnabled( uint8_t subsystem, uint8_t eventId ). * * All of these systems can be parameterized at compile time leading to an event buffer * that should be as fast as possible given the constraints. * * Buffers may be chained together as this buffer has a handleBufferFlush method that * will grab the mutex and add the data to this event buffer. * * Overall, lets look at the PhysX SDK an how all the pieces fit together. * The SDK should have a mutex-protected event buffer where actual devs or users of PhysX * can register handlers. This buffer has slow but correct implementations of the * context provider interface. * * The SDK object should also have a concrete event filter which was used in the * construction of the event buffer and which it exposes through opaque interfaces. * * The SDK should protect its event buffer and its event filter from multithreaded * access and thus this provides the safest and slowest way to log events and to * enable/disable events. * * Each scene should also have a concrete event filter. This filter is updated from * the SDK event filter (in a mutex protected way) every frame. Thus scenes can change * their event filtering on a frame-by-frame basis. It means that tasks running * under the scene don't need a mutex when accessing the filter. * * Furthermore the scene should have an event buffer that always sets the context id * on each event to the scene. This allows PVD and other systems to correlate events * to scenes. Scenes should provide access only to a relative event sending system * that looks up thread id upon each event but uses the scene id. * * The SDK's event buffer should be setup as an EventBufferClient for each scene's * event buffer. Thus the SDK should expose an EventBufferClient interface that * any client can use. * * For extremely *extremely* performance sensitive areas we should create a specialized * per-scene, per-thread event buffer that is set on the task for these occasions. This buffer * uses a trivial event context setup with the scene's context id and the thread id. It should * share the scene's concrete event filter and it should have absolutely no locking. It should * empty into the scene's event buffer which in some cases should empty into the SDK's event buffer * which when full will push events all the way out of the system. The task should *always* flush * the event buffer (if it has one) when it is finished; nothing else will work reliably. * * If the per-scene,per-thread event buffer is correctly parameterized and fully defined adding * a new event should be an inline operation requiring no mutex grabs in the common case. I don't * believe you can get faster event production than this; the events are as small as possible (all * relative events) and they are all produced inline resulting in one 4 byte header and one * 8 byte timestamp per event. Reducing the memory pressure in this way reduces the communication * overhead, the mutex grabs, basically everything that makes profiling expensive at the cost * of a per-scene,per-thread event buffer (which could easily be reduced to a per-thread event * buffer. */ template<typename TContextProvider, typename TMutex, typename TScopedLock, typename TEventFilter> class EventBufferAtomic : public DataBuffer < TMutex, TScopedLock > { public: typedef DataBuffer<TMutex, TScopedLock> TBaseType; typedef TContextProvider TContextProviderType; typedef TEventFilter TEventFilterType; typedef typename TBaseType::TMutexType TMutexType; typedef typename TBaseType::TScopedLockType TScopedLockType; typedef typename TBaseType::TU8AllocatorType TU8AllocatorType; typedef typename TBaseType::TMemoryBufferType TMemoryBufferType; typedef typename TBaseType::TBufferClientArray TBufferClientArray; private: TContextProvider mContextProvider; TEventFilterType mEventFilter; volatile int32_t mReserved; volatile int32_t mWritten; public: EventBufferAtomic(PxAllocatorCallback* inFoundation , uint32_t inBufferFullAmount , const TContextProvider& inProvider , TMutexType* inBufferMutex , const TEventFilterType& inEventFilter) : TBaseType(inFoundation, inBufferFullAmount, inBufferMutex, "struct physx::profile::ProfileEvent") , mContextProvider(inProvider) , mEventFilter(inEventFilter) , mReserved(0) , mWritten(0) { } TContextProvider& getContextProvider() { return mContextProvider; } PX_FORCE_INLINE void startEvent(uint16_t inId, uint32_t threadId, uint64_t contextId, uint8_t cpuId, uint8_t threadPriority, uint64_t inTimestamp) { if (mEventFilter.isEventEnabled(inId)) { StartEvent theEvent; theEvent.init(threadId, contextId, cpuId, threadPriority, inTimestamp); doAddProfileEvent(inId, theEvent); } } PX_FORCE_INLINE void startEvent(uint16_t inId, uint64_t contextId) { PxProfileEventExecutionContext ctx(mContextProvider.getExecutionContext()); startEvent(inId, ctx.mThreadId, contextId, ctx.mCpuId, static_cast<uint8_t>(ctx.mThreadPriority), PxTime::getCurrentCounterValue()); } PX_FORCE_INLINE void startEvent(uint16_t inId, uint64_t contextId, uint32_t threadId) { startEvent(inId, threadId, contextId, 0, 0, PxTime::getCurrentCounterValue()); } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint32_t threadId, uint64_t contextId, uint8_t cpuId, uint8_t threadPriority, uint64_t inTimestamp) { if (mEventFilter.isEventEnabled(inId)) { StopEvent theEvent; theEvent.init(threadId, contextId, cpuId, threadPriority, inTimestamp); doAddProfileEvent(inId, theEvent); } } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint64_t contextId) { PxProfileEventExecutionContext ctx(mContextProvider.getExecutionContext()); stopEvent(inId, ctx.mThreadId, contextId, ctx.mCpuId, static_cast<uint8_t>(ctx.mThreadPriority), PxTime::getCurrentCounterValue()); } PX_FORCE_INLINE void stopEvent(uint16_t inId, uint64_t contextId, uint32_t threadId) { stopEvent(inId, threadId, contextId, 0, 0, PxTime::getCurrentCounterValue()); } inline void eventValue(uint16_t inId, uint64_t contextId, int64_t inValue) { eventValue(inId, mContextProvider.getThreadId(), contextId, inValue); } inline void eventValue(uint16_t inId, uint32_t threadId, uint64_t contextId, int64_t inValue) { EventValue theEvent; theEvent.init(inValue, contextId, threadId); EventHeader theHeader(static_cast<uint8_t>(getEventType<EventValue>()), inId); //set the header relative timestamp; EventValue& theType(theEvent); theType.setupHeader(theHeader); int32_t sizeToWrite = int32_t(sizeof(theHeader) + theType.getEventSize(theHeader)); int32_t reserved = PxAtomicAdd(&mReserved, sizeToWrite); sendEvent(theHeader, theType, reserved, sizeToWrite); } void flushProfileEvents(int32_t reserved = -1) { TScopedLockType lock(TBaseType::mBufferMutex); // set the buffer full to lock additional writes int32_t reservedOld = PxAtomicExchange(&mReserved, int32_t(TBaseType::mBufferFullAmount + 1)); if (reserved == -1) reserved = reservedOld; // spin till we have written all the data while (reserved > mWritten) { } // check if we have written all data PX_ASSERT(reserved == mWritten); // set the correct size of the serialization data buffer TBaseType::mSerializer.mArray->setEnd(TBaseType::mSerializer.mArray->begin() + mWritten); // flush events TBaseType::flushEvents(); // write master timestamp and set reserved/written to start writing to buffer again mWritten = 0; mReserved = 0; } void release() { PX_PROFILE_DELETE(TBaseType::mWrapper.mUserFoundation, this); } protected: //Clears the cache meaning event compression //starts over again. //only called when the buffer mutex is held void clearCachedData() { } template<typename TProfileEventType> PX_FORCE_INLINE void doAddProfileEvent(uint16_t eventId, const TProfileEventType& inType) { doAddEvent(static_cast<uint8_t>(getEventType<TProfileEventType>()), eventId, inType); } template<typename TDataType> PX_FORCE_INLINE void doAddEvent(uint8_t inEventType, uint16_t eventId, const TDataType& inType) { EventHeader theHeader(inEventType, eventId); TDataType& theType(const_cast<TDataType&>(inType)); theType.setupHeader(theHeader, 0); const int32_t sizeToWrite = int32_t(sizeof(theHeader) + theType.getEventSize(theHeader)); int32_t reserved = PxAtomicAdd(&mReserved, sizeToWrite); sendEvent(theHeader, theType, reserved, sizeToWrite); } template<typename TDataType> PX_FORCE_INLINE void sendEvent(EventHeader& inHeader, TDataType& inType, int32_t reserved, int32_t sizeToWrite) { // if we don't fit to the buffer, we wait till it is flushed if (reserved - sizeToWrite >= int32_t(TBaseType::mBufferFullAmount)) { while (reserved - sizeToWrite >= int32_t(TBaseType::mBufferFullAmount)) { // I32 overflow if (mReserved < int32_t(TBaseType::mBufferFullAmount)) { reserved = PxAtomicAdd(&mReserved, sizeToWrite); } } } int32_t writeIndex = reserved - sizeToWrite; uint32_t writtenSize = 0; PX_ASSERT(writeIndex >= 0); PX_ALLOCA(tempBuffer, uint8_t, sizeToWrite); TempMemoryBuffer memoryBuffer(tempBuffer, sizeToWrite); EventSerializer<TempMemoryBuffer> eventSerializer(&memoryBuffer); writtenSize = inHeader.streamify(eventSerializer); writtenSize += inType.streamify(eventSerializer, inHeader); TBaseType::mSerializer.mArray->reserve(writeIndex + writtenSize); TBaseType::mSerializer.mArray->write(&tempBuffer[0], writtenSize, writeIndex); PX_ASSERT(writtenSize == uint32_t(sizeToWrite)); PxAtomicAdd(&mWritten, sizeToWrite); if (reserved >= int32_t(TBaseType::mBufferFullAmount)) { TScopedLockType lock(TBaseType::mBufferMutex); // we flush the buffer if its full and we did not flushed him in the meantime if(mReserved >= reserved) flushProfileEvents(reserved); } } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdMemClient.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_MEM_CLIENT_H #define PX_PVD_MEM_CLIENT_H #include "PxPvdClient.h" #include "foundation/PxHashMap.h" #include "foundation/PxMutex.h" #include "foundation/PxBroadcast.h" #include "PxProfileEventBufferClient.h" #include "PxProfileMemory.h" namespace physx { class PvdDataStream; namespace pvdsdk { class PvdImpl; class PvdMemClient : public PvdClient, public profile::PxProfileEventBufferClient, public PxUserAllocated { PX_NOCOPY(PvdMemClient) public: PvdMemClient(PvdImpl& pvd); virtual ~PvdMemClient(); bool isConnected() const; void onPvdConnected(); void onPvdDisconnected(); void flush(); PvdDataStream* getDataStream(); void sendMemEvents(); // memory event void onAllocation(size_t size, const char* typeName, const char* filename, int line, void* allocatedMemory); void onDeallocation(void* addr); private: PvdImpl& mSDKPvd; PvdDataStream* mPvdDataStream; bool mIsConnected; // mem profile PxMutex mMutex; // mem onallocation can called from different threads profile::PxProfileMemoryEventBuffer& mMemEventBuffer; void handleBufferFlush(const uint8_t* inData, uint32_t inLength); void handleClientRemoved(); }; } // namespace pvdsdk } // namespace physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectModelInternalTypeDefs.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON DECLARE_INTERNAL_PVD_TYPE(ArrayData) #undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdMemClient.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdImpl.h" #include "PxPvdMemClient.h" namespace physx { namespace pvdsdk { PvdMemClient::PvdMemClient(PvdImpl& pvd) : mSDKPvd(pvd) , mPvdDataStream(NULL) , mIsConnected(false) , mMemEventBuffer(profile::PxProfileMemoryEventBuffer::createMemoryEventBuffer(*gPvdAllocatorCallback)) { } PvdMemClient::~PvdMemClient() { mSDKPvd.removeClient(this); if(mMemEventBuffer.hasClients()) mPvdDataStream->destroyInstance(&mMemEventBuffer); mMemEventBuffer.release(); } PvdDataStream* PvdMemClient::getDataStream() { return mPvdDataStream; } bool PvdMemClient::isConnected() const { return mIsConnected; } void PvdMemClient::onPvdConnected() { if(mIsConnected) return; mIsConnected = true; mPvdDataStream = PvdDataStream::create(&mSDKPvd); mPvdDataStream->createInstance(&mMemEventBuffer); mMemEventBuffer.addClient(*this); } void PvdMemClient::onPvdDisconnected() { if(!mIsConnected) return; mIsConnected = false; flush(); mMemEventBuffer.removeClient(*this); mPvdDataStream->release(); mPvdDataStream = NULL; } void PvdMemClient::onAllocation(size_t inSize, const char* inType, const char* inFile, int inLine, void* inAddr) { mMutex.lock(); mMemEventBuffer.onAllocation(inSize, inType, inFile, inLine, inAddr); mMutex.unlock(); } void PvdMemClient::onDeallocation(void* inAddr) { mMutex.lock(); mMemEventBuffer.onDeallocation(inAddr); mMutex.unlock(); } void PvdMemClient::flush() { mMutex.lock(); mMemEventBuffer.flushProfileEvents(); mMutex.unlock(); } void PvdMemClient::handleBufferFlush(const uint8_t* inData, uint32_t inLength) { if(mPvdDataStream) mPvdDataStream->setPropertyValue(&mMemEventBuffer, "events", inData, inLength); } void PvdMemClient::handleClientRemoved() { } } // pvd } // physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdMarshalling.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_MARSHALLING_H #define PX_PVD_MARSHALLING_H #include "foundation/PxMathIntrinsics.h" #include "PxPvdObjectModelBaseTypes.h" #include "PxPvdBits.h" namespace physx { namespace pvdsdk { // Define marshalling template <typename TSmallerType, typename TLargerType> struct PvdMarshalling { bool canMarshal; PvdMarshalling() : canMarshal(false) { } }; template <typename smtype, typename lgtype> static inline void marshalSingleT(const uint8_t* srcData, uint8_t* destData) { smtype incoming; physx::intrinsics::memCopy(&incoming, srcData, sizeof(smtype)); lgtype outgoing = static_cast<lgtype>(incoming); physx::intrinsics::memCopy(destData, &outgoing, sizeof(lgtype)); } template <typename smtype, typename lgtype> static inline void marshalBlockT(const uint8_t* srcData, uint8_t* destData, uint32_t numBytes) { for(const uint8_t* item = srcData, *end = srcData + numBytes; item < end; item += sizeof(smtype), destData += sizeof(lgtype)) marshalSingleT<smtype, lgtype>(item, destData); } #define PVD_TYPE_MARSHALLER(smtype, lgtype) \ template <> \ struct PvdMarshalling<smtype, lgtype> \ { \ uint32_t canMarshal; \ static void marshalSingle(const uint8_t* srcData, uint8_t* destData) \ { \ marshalSingleT<smtype, lgtype>(srcData, destData); \ } \ static void marshalBlock(const uint8_t* srcData, uint8_t* destData, uint32_t numBytes) \ { \ marshalBlockT<smtype, lgtype>(srcData, destData, numBytes); \ } \ }; // define marshalling tables. PVD_TYPE_MARSHALLER(int8_t, int16_t) PVD_TYPE_MARSHALLER(int8_t, uint16_t) PVD_TYPE_MARSHALLER(int8_t, int32_t) PVD_TYPE_MARSHALLER(int8_t, uint32_t) PVD_TYPE_MARSHALLER(int8_t, int64_t) PVD_TYPE_MARSHALLER(int8_t, uint64_t) PVD_TYPE_MARSHALLER(int8_t, PvdF32) PVD_TYPE_MARSHALLER(int8_t, PvdF64) PVD_TYPE_MARSHALLER(uint8_t, int16_t) PVD_TYPE_MARSHALLER(uint8_t, uint16_t) PVD_TYPE_MARSHALLER(uint8_t, int32_t) PVD_TYPE_MARSHALLER(uint8_t, uint32_t) PVD_TYPE_MARSHALLER(uint8_t, int64_t) PVD_TYPE_MARSHALLER(uint8_t, uint64_t) PVD_TYPE_MARSHALLER(uint8_t, PvdF32) PVD_TYPE_MARSHALLER(uint8_t, PvdF64) PVD_TYPE_MARSHALLER(int16_t, int32_t) PVD_TYPE_MARSHALLER(int16_t, uint32_t) PVD_TYPE_MARSHALLER(int16_t, int64_t) PVD_TYPE_MARSHALLER(int16_t, uint64_t) PVD_TYPE_MARSHALLER(int16_t, PvdF32) PVD_TYPE_MARSHALLER(int16_t, PvdF64) PVD_TYPE_MARSHALLER(uint16_t, int32_t) PVD_TYPE_MARSHALLER(uint16_t, uint32_t) PVD_TYPE_MARSHALLER(uint16_t, int64_t) PVD_TYPE_MARSHALLER(uint16_t, uint64_t) PVD_TYPE_MARSHALLER(uint16_t, PvdF32) PVD_TYPE_MARSHALLER(uint16_t, PvdF64) PVD_TYPE_MARSHALLER(int32_t, int64_t) PVD_TYPE_MARSHALLER(int32_t, uint64_t) PVD_TYPE_MARSHALLER(int32_t, PvdF64) PVD_TYPE_MARSHALLER(int32_t, PvdF32) PVD_TYPE_MARSHALLER(uint32_t, int64_t) PVD_TYPE_MARSHALLER(uint32_t, uint64_t) PVD_TYPE_MARSHALLER(uint32_t, PvdF64) PVD_TYPE_MARSHALLER(uint32_t, PvdF32) PVD_TYPE_MARSHALLER(PvdF32, PvdF64) PVD_TYPE_MARSHALLER(PvdF32, uint32_t) PVD_TYPE_MARSHALLER(PvdF32, int32_t) PVD_TYPE_MARSHALLER(uint64_t, PvdF64) PVD_TYPE_MARSHALLER(int64_t, PvdF64) PVD_TYPE_MARSHALLER(PvdF64, uint64_t) PVD_TYPE_MARSHALLER(PvdF64, int64_t) template <typename TMarshaller> static inline bool getMarshalOperators(TSingleMarshaller&, TBlockMarshaller&, TMarshaller&, bool) { return false; } template <typename TMarshaller> static inline bool getMarshalOperators(TSingleMarshaller& single, TBlockMarshaller& block, TMarshaller&, uint32_t) { single = TMarshaller::marshalSingle; block = TMarshaller::marshalBlock; return true; } template <typename smtype, typename lgtype> static inline bool getMarshalOperators(TSingleMarshaller& single, TBlockMarshaller& block) { single = NULL; block = NULL; PvdMarshalling<smtype, lgtype> marshaller = PvdMarshalling<smtype, lgtype>(); return getMarshalOperators(single, block, marshaller, marshaller.canMarshal); } template <typename smtype> static inline bool getMarshalOperators(TSingleMarshaller& single, TBlockMarshaller& block, int32_t lgtypeId) { switch(lgtypeId) { case PvdBaseType::PvdI8: // int8_t: return getMarshalOperators<smtype, int8_t>(single, block); case PvdBaseType::PvdU8: // uint8_t: return getMarshalOperators<smtype, uint8_t>(single, block); case PvdBaseType::PvdI16: // int16_t: return getMarshalOperators<smtype, int16_t>(single, block); case PvdBaseType::PvdU16: // uint16_t: return getMarshalOperators<smtype, uint16_t>(single, block); case PvdBaseType::PvdI32: // int32_t: return getMarshalOperators<smtype, int32_t>(single, block); case PvdBaseType::PvdU32: // uint32_t: return getMarshalOperators<smtype, uint32_t>(single, block); case PvdBaseType::PvdI64: // int64_t: return getMarshalOperators<smtype, int64_t>(single, block); case PvdBaseType::PvdU64: // uint64_t: return getMarshalOperators<smtype, uint64_t>(single, block); case PvdBaseType::PvdF32: return getMarshalOperators<smtype, PvdF32>(single, block); case PvdBaseType::PvdF64: return getMarshalOperators<smtype, PvdF64>(single, block); } return false; } static inline bool getMarshalOperators(TSingleMarshaller& single, TBlockMarshaller& block, int32_t smtypeId, int32_t lgtypeId) { switch(smtypeId) { case PvdBaseType::PvdI8: // int8_t: return getMarshalOperators<int8_t>(single, block, lgtypeId); case PvdBaseType::PvdU8: // uint8_t: return getMarshalOperators<uint8_t>(single, block, lgtypeId); case PvdBaseType::PvdI16: // int16_t: return getMarshalOperators<int16_t>(single, block, lgtypeId); case PvdBaseType::PvdU16: // uint16_t: return getMarshalOperators<uint16_t>(single, block, lgtypeId); case PvdBaseType::PvdI32: // int32_t: return getMarshalOperators<int32_t>(single, block, lgtypeId); case PvdBaseType::PvdU32: // uint32_t: return getMarshalOperators<uint32_t>(single, block, lgtypeId); case PvdBaseType::PvdI64: // int64_t: return getMarshalOperators<int64_t>(single, block, lgtypeId); case PvdBaseType::PvdU64: // uint64_t: return getMarshalOperators<uint64_t>(single, block, lgtypeId); case PvdBaseType::PvdF32: return getMarshalOperators<PvdF32>(single, block, lgtypeId); case PvdBaseType::PvdF64: return getMarshalOperators<PvdF64>(single, block, lgtypeId); } return false; } } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventSerialization.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_EVENT_SERIALIZATION_H #define PX_PROFILE_EVENT_SERIALIZATION_H #include "PxProfileDataParsing.h" #include "PxProfileEvents.h" namespace physx { namespace profile { /** * Array type must be a pxu8 container. Templated so that this object can write * to different collections. */ template<typename TArrayType> struct EventSerializer { TArrayType* mArray; EventSerializer( TArrayType* inA ) : mArray( inA ) {} template<typename TDataType> uint32_t streamify( const char*, const TDataType& inType ) { return mArray->write( inType ); } uint32_t streamify( const char*, const char*& inType ) { PX_ASSERT( inType != NULL ); uint32_t len( static_cast<uint32_t>( strlen( inType ) ) ); ++len; //include the null terminator uint32_t writtenSize = 0; writtenSize = mArray->write(len); writtenSize += mArray->write(inType, len); return writtenSize; } uint32_t streamify( const char*, const uint8_t* inData, uint32_t len ) { uint32_t writtenSize = mArray->write(len); if ( len ) writtenSize += mArray->write(inData, len); return writtenSize; } uint32_t streamify( const char* nm, const uint64_t& inType, EventStreamCompressionFlags::Enum inFlags ) { uint32_t writtenSize = 0; switch( inFlags ) { case EventStreamCompressionFlags::U8: writtenSize = streamify(nm, static_cast<uint8_t>(inType)); break; case EventStreamCompressionFlags::U16: writtenSize = streamify(nm, static_cast<uint16_t>(inType)); break; case EventStreamCompressionFlags::U32: writtenSize = streamify(nm, static_cast<uint32_t>(inType)); break; case EventStreamCompressionFlags::U64: writtenSize = streamify(nm, inType); break; } return writtenSize; } uint32_t streamify( const char* nm, const uint32_t& inType, EventStreamCompressionFlags::Enum inFlags ) { uint32_t writtenSize = 0; switch( inFlags ) { case EventStreamCompressionFlags::U8: writtenSize = streamify(nm, static_cast<uint8_t>(inType)); break; case EventStreamCompressionFlags::U16: writtenSize = streamify(nm, static_cast<uint16_t>(inType)); break; case EventStreamCompressionFlags::U32: case EventStreamCompressionFlags::U64: writtenSize = streamify(nm, inType); break; } return writtenSize; } }; /** * The event deserializes takes a buffer implements the streamify functions * by setting the passed in data to the data in the buffer. */ template<bool TSwapBytes> struct EventDeserializer { const uint8_t* mData; uint32_t mLength; bool mFail; EventDeserializer( const uint8_t* inData, uint32_t inLength ) : mData( inData ) , mLength( inLength ) , mFail( false ) { if ( mData == NULL ) mLength = 0; } bool val() { return TSwapBytes; } uint32_t streamify( const char* , uint8_t& inType ) { uint8_t* theData = reinterpret_cast<uint8_t*>( &inType ); //type punned pointer... if ( mFail || sizeof( inType ) > mLength ) { PX_ASSERT( false ); mFail = true; } else { for( uint32_t idx = 0; idx < sizeof( uint8_t ); ++idx, ++mData, --mLength ) theData[idx] = *mData; } return 0; } //default streamify reads things natively as bytes. template<typename TDataType> uint32_t streamify( const char* , TDataType& inType ) { uint8_t* theData = reinterpret_cast<uint8_t*>( &inType ); //type punned pointer... if ( mFail || sizeof( inType ) > mLength ) { PX_ASSERT( false ); mFail = true; } else { for( uint32_t idx = 0; idx < sizeof( TDataType ); ++idx, ++mData, --mLength ) theData[idx] = *mData; bool temp = val(); if ( temp ) BlockParseFunctions::swapBytes<sizeof(TDataType)>( theData ); } return 0; } uint32_t streamify( const char*, const char*& inType ) { uint32_t theLen; streamify( "", theLen ); theLen = PxMin( theLen, mLength ); inType = reinterpret_cast<const char*>( mData ); mData += theLen; mLength -= theLen; return 0; } uint32_t streamify( const char*, const uint8_t*& inData, uint32_t& len ) { uint32_t theLen; streamify( "", theLen ); theLen = PxMin( theLen, mLength ); len = theLen; inData = reinterpret_cast<const uint8_t*>( mData ); mData += theLen; mLength -= theLen; return 0; } uint32_t streamify( const char* nm, uint64_t& inType, EventStreamCompressionFlags::Enum inFlags ) { switch( inFlags ) { case EventStreamCompressionFlags::U8: { uint8_t val=0; streamify( nm, val ); inType = val; } break; case EventStreamCompressionFlags::U16: { uint16_t val; streamify( nm, val ); inType = val; } break; case EventStreamCompressionFlags::U32: { uint32_t val; streamify( nm, val ); inType = val; } break; case EventStreamCompressionFlags::U64: streamify( nm, inType ); break; } return 0; } uint32_t streamify( const char* nm, uint32_t& inType, EventStreamCompressionFlags::Enum inFlags ) { switch( inFlags ) { case EventStreamCompressionFlags::U8: { uint8_t val=0; streamify( nm, val ); inType = val; } break; case EventStreamCompressionFlags::U16: { uint16_t val=0; streamify( nm, val ); inType = val; } break; case EventStreamCompressionFlags::U32: case EventStreamCompressionFlags::U64: streamify( nm, inType ); break; } return 0; } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdImpl.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdImpl.h" #include "PxPvdMemClient.h" #include "PxPvdProfileZoneClient.h" #include "PxPvdProfileZone.h" #if PX_SUPPORT_GPU_PHYSX #include "gpu/PxGpu.h" #endif #if PX_NVTX #include "nvToolsExt.h" #endif namespace { const char* gSdkName = "PhysXSDK"; } namespace physx { namespace pvdsdk { class CmEventNameProvider : public physx::profile::PxProfileNameProvider { public: physx::profile::PxProfileNames getProfileNames() const { physx::profile::PxProfileNames ret; ret.eventCount = 0; return ret; } }; CmEventNameProvider gProfileNameProvider; void initializeModelTypes(PvdDataStream& stream) { stream.createClass<profile::PxProfileZone>(); stream.createProperty<profile::PxProfileZone, uint8_t>( "events", PvdCommStreamEmbeddedTypes::getProfileEventStreamSemantic(), PropertyType::Array); stream.createClass<profile::PxProfileMemoryEventBuffer>(); stream.createProperty<profile::PxProfileMemoryEventBuffer, uint8_t>( "events", PvdCommStreamEmbeddedTypes::getMemoryEventStreamSemantic(), PropertyType::Array); stream.createClass<PvdUserRenderer>(); stream.createProperty<PvdUserRenderer, uint8_t>( "events", PvdCommStreamEmbeddedTypes::getRendererEventStreamSemantic(), PropertyType::Array); } PvdImpl* PvdImpl::sInstance = NULL; uint32_t PvdImpl::sRefCount = 0; PvdImpl::PvdImpl() : mPvdTransport(NULL) , mSharedMetaProvider(NULL) , mMemClient(NULL) , mIsConnected(false) , mGPUProfilingWasConnected(false) , mIsNVTXSupportEnabled(true) , mNVTXContext(0) , mNextStreamId(1) , mProfileClient(NULL) , mProfileZone(NULL) { mProfileZoneManager = &physx::profile::PxProfileZoneManager::createProfileZoneManager(PxGetBroadcastAllocator()); mProfileClient = PVD_NEW(PvdProfileZoneClient)(*this); } PvdImpl::~PvdImpl() { if((mFlags & PxPvdInstrumentationFlag::ePROFILE) ) { PxSetProfilerCallback(NULL); #if PX_SUPPORT_GPU_PHYSX if (mGPUProfilingWasConnected) { PxSetPhysXGpuProfilerCallback(NULL); } #endif } disconnect(); if ( mProfileZoneManager ) { mProfileZoneManager->release(); mProfileZoneManager = NULL; } PVD_DELETE(mProfileClient); mProfileClient = NULL; } bool PvdImpl::connect(PxPvdTransport& transport, PxPvdInstrumentationFlags flags) { if(mIsConnected) { PxGetFoundation().error(PxErrorCode::eINVALID_PARAMETER, PX_FL, "PxPvd::connect - recall connect! Should call disconnect before re-connect."); return false; } mFlags = flags; mPvdTransport = &transport; mIsConnected = mPvdTransport->connect(); if(mIsConnected) { mSharedMetaProvider = PVD_NEW(MetaDataProvider); sendTransportInitialization(); PvdDataStream* stream = PvdDataStream::create(this); initializeModelTypes(*stream); stream->release(); if(mFlags & PxPvdInstrumentationFlag::eMEMORY) { mMemClient = PVD_NEW(PvdMemClient)(*this); mPvdClients.pushBack(mMemClient); } if((mFlags & PxPvdInstrumentationFlag::ePROFILE) && mProfileZoneManager) { mPvdClients.pushBack(mProfileClient); mProfileZone = &physx::profile::PxProfileZone::createProfileZone(PxGetBroadcastAllocator(),gSdkName,gProfileNameProvider.getProfileNames()); } for(uint32_t i = 0; i < mPvdClients.size(); i++) mPvdClients[i]->onPvdConnected(); if (mProfileZone) { mProfileZoneManager->addProfileZoneHandler(*mProfileClient); mProfileZoneManager->addProfileZone( *mProfileZone ); } if ((mFlags & PxPvdInstrumentationFlag::ePROFILE)) { PxSetProfilerCallback(this); #if PX_SUPPORT_GPU_PHYSX PxSetPhysXGpuProfilerCallback(this); mGPUProfilingWasConnected = true; #endif } } return mIsConnected; } void PvdImpl::disconnect() { if(mProfileZone) { mProfileZoneManager->removeProfileZoneHandler(*mProfileClient); mProfileZoneManager->removeProfileZone( *mProfileZone ); mProfileZone->release(); mProfileZone=NULL; removeClient(mProfileClient); } if(mIsConnected) { for(uint32_t i = 0; i < mPvdClients.size(); i++) mPvdClients[i]->onPvdDisconnected(); if(mMemClient) { removeClient(mMemClient); PvdMemClient* tmp = mMemClient; //avoid tracking deallocation itsself mMemClient = NULL; PVD_DELETE(tmp); } mSharedMetaProvider->release(); mPvdTransport->disconnect(); mObjectRegistrar.clear(); mIsConnected = false; } } void PvdImpl::flush() { for(uint32_t i = 0; i < mPvdClients.size(); i++) mPvdClients[i]->flush(); if ( mProfileZone ) { mProfileZone->flushEventIdNameMap(); mProfileZone->flushProfileEvents(); } } bool PvdImpl::isConnected(bool useCachedStatus) { if(mPvdTransport) return useCachedStatus ? mIsConnected : mPvdTransport->isConnected(); else return false; } PxPvdTransport* PvdImpl::getTransport() { return mPvdTransport; } PxPvdInstrumentationFlags PvdImpl::getInstrumentationFlags() { return mFlags; } void PvdImpl::sendTransportInitialization() { StreamInitialization init; EventStreamifier<PxPvdTransport> stream(mPvdTransport->lock()); init.serialize(stream); mPvdTransport->unlock(); } void PvdImpl::addClient(PvdClient* client) { PX_ASSERT(client); for(uint32_t i = 0; i < mPvdClients.size(); i++) { if(client == mPvdClients[i]) return; } mPvdClients.pushBack(client); if(mIsConnected) { client->onPvdConnected(); } } void PvdImpl::removeClient(PvdClient* client) { for(uint32_t i = 0; i < mPvdClients.size(); i++) { if(client == mPvdClients[i]) { client->onPvdDisconnected(); mPvdClients.remove(i); } } } void PvdImpl::onAllocation(size_t inSize, const char* inType, const char* inFile, int inLine, void* inAddr) { if(mMemClient) mMemClient->onAllocation(inSize, inType, inFile, inLine, inAddr); } void PvdImpl::onDeallocation(void* inAddr) { if(mMemClient) mMemClient->onDeallocation(inAddr); } PvdOMMetaDataProvider& PvdImpl::getMetaDataProvider() { return *mSharedMetaProvider; } bool PvdImpl::registerObject(const void* inItem) { return mObjectRegistrar.addItem(inItem); } bool PvdImpl::unRegisterObject(const void* inItem) { return mObjectRegistrar.decItem(inItem); } uint64_t PvdImpl::getNextStreamId() { uint64_t retval = ++mNextStreamId; return retval; } bool PvdImpl::initialize() { if(0 == sRefCount) { sInstance = PVD_NEW(PvdImpl)(); } ++sRefCount; return !!sInstance; } void PvdImpl::release() { if(sRefCount > 0) { if(--sRefCount) return; PVD_DELETE(sInstance); sInstance = NULL; } } PvdImpl* PvdImpl::getInstance() { return sInstance; } /************************************************************************************************************************** Instrumented profiling events ***************************************************************************************************************************/ static const uint32_t CrossThreadId = 99999789; void* PvdImpl::zoneStart(const char* eventName, bool detached, uint64_t contextId) { if(mProfileZone) { const uint16_t id = mProfileZone->getEventIdForName(eventName); if(detached) mProfileZone->startEvent(id, contextId, CrossThreadId); else mProfileZone->startEvent(id, contextId); } #if PX_NVTX if(mIsNVTXSupportEnabled) { if(detached) { // TODO : Need to use the nvtxRangeStart API for cross thread events nvtxEventAttributes_t eventAttrib; memset(&eventAttrib, 0, sizeof(eventAttrib)); eventAttrib.version = NVTX_VERSION; eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; eventAttrib.colorType = NVTX_COLOR_ARGB; eventAttrib.color = 0xFF00FF00; eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = eventName; nvtxMarkEx(&eventAttrib); } else { nvtxRangePush(eventName); } } #endif return NULL; } void PvdImpl::zoneEnd(void* /*profilerData*/, const char* eventName, bool detached, uint64_t contextId) { if(mProfileZone) { const uint16_t id = mProfileZone->getEventIdForName(eventName); if(detached) mProfileZone->stopEvent(id, contextId, CrossThreadId); else mProfileZone->stopEvent(id, contextId); } #if PX_NVTX if(mIsNVTXSupportEnabled) { if(detached) { nvtxEventAttributes_t eventAttrib; memset(&eventAttrib, 0, sizeof(eventAttrib)); eventAttrib.version = NVTX_VERSION; eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; eventAttrib.colorType = NVTX_COLOR_ARGB; eventAttrib.color = 0xFFFF0000; eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = eventName; nvtxMarkEx(&eventAttrib); } else { nvtxRangePop(); } } #endif } } // pvd } // physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdDefaultFileTransport.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_DEFAULT_FILE_TRANSPORT_H #define PX_PVD_DEFAULT_FILE_TRANSPORT_H #include "pvd/PxPvdTransport.h" #include "foundation/PxUserAllocated.h" #include "PsFileBuffer.h" #include "foundation/PxMutex.h" namespace physx { namespace pvdsdk { class PvdDefaultFileTransport : public physx::PxPvdTransport, public physx::PxUserAllocated { PX_NOCOPY(PvdDefaultFileTransport) public: PvdDefaultFileTransport(const char* name); virtual ~PvdDefaultFileTransport(); virtual bool connect(); virtual void disconnect(); virtual bool isConnected(); virtual bool write(const uint8_t* inBytes, uint32_t inLength); virtual PxPvdTransport& lock(); virtual void unlock(); virtual void flush(); virtual uint64_t getWrittenDataSize(); virtual void release(); private: physx::PsFileBuffer* mFileBuffer; bool mConnected; uint64_t mWrittenData; physx::PxMutex mMutex; bool mLocked; // for debug, remove it when finished }; } // pvdsdk } // physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileContextProvider.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_CONTEXT_PROVIDER_H #define PX_PROFILE_CONTEXT_PROVIDER_H #include "foundation/Px.h" namespace physx { namespace profile { struct PxProfileEventExecutionContext { uint32_t mThreadId; uint8_t mCpuId; uint8_t mThreadPriority; PxProfileEventExecutionContext( uint32_t inThreadId = 0, uint8_t inThreadPriority = 2 /*eThreadPriorityNormal*/, uint8_t inCpuId = 0 ) : mThreadId( inThreadId ) , mCpuId( inCpuId ) , mThreadPriority( inThreadPriority ) { } bool operator==( const PxProfileEventExecutionContext& inOther ) const { return mThreadId == inOther.mThreadId && mCpuId == inOther.mCpuId && mThreadPriority == inOther.mThreadPriority; } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectModelMetaData.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_OBJECT_MODEL_METADATA_H #define PX_PVD_OBJECT_MODEL_METADATA_H #include "foundation/PxAssert.h" #include "PxPvdObjectModelBaseTypes.h" #include "PxPvdBits.h" namespace physx { namespace pvdsdk { class PvdInputStream; class PvdOutputStream; struct PropertyDescription { NamespacedName mOwnerClassName; int32_t mOwnerClassId; String mName; String mSemantic; // The datatype this property corresponds to. int32_t mDatatype; // The name of the datatype NamespacedName mDatatypeName; // Scalar or array. PropertyType::Enum mPropertyType; // No other property under any class has this id, it is DB-unique. int32_t mPropertyId; // Offset in bytes into the object's data section where this property starts. uint32_t m32BitOffset; // Offset in bytes into the object's data section where this property starts. uint32_t m64BitOffset; PropertyDescription(const NamespacedName& clsName, int32_t classId, String name, String semantic, int32_t datatype, const NamespacedName& datatypeName, PropertyType::Enum propType, int32_t propId, uint32_t offset32, uint32_t offset64) : mOwnerClassName(clsName) , mOwnerClassId(classId) , mName(name) , mSemantic(semantic) , mDatatype(datatype) , mDatatypeName(datatypeName) , mPropertyType(propType) , mPropertyId(propId) , m32BitOffset(offset32) , m64BitOffset(offset64) { } PropertyDescription() : mOwnerClassId(-1) , mName("") , mSemantic("") , mDatatype(-1) , mPropertyType(PropertyType::Unknown) , mPropertyId(-1) , m32BitOffset(0) , m64BitOffset(0) { } virtual ~PropertyDescription() { } }; struct PtrOffsetType { enum Enum { UnknownOffset, VoidPtrOffset, StringOffset }; }; struct PtrOffset { PtrOffsetType::Enum mOffsetType; uint32_t mOffset; PtrOffset(PtrOffsetType::Enum type, uint32_t offset) : mOffsetType(type), mOffset(offset) { } PtrOffset() : mOffsetType(PtrOffsetType::UnknownOffset), mOffset(0) { } }; inline uint32_t align(uint32_t offset, uint32_t alignment) { uint32_t startOffset = offset; uint32_t alignmentMask = ~(alignment - 1); offset = (offset + alignment - 1) & alignmentMask; PX_ASSERT(offset >= startOffset && (offset % alignment) == 0); (void)startOffset; return offset; } struct ClassDescriptionSizeInfo { // The size of the data section of this object, padded to alignment. uint32_t mByteSize; // The last data member goes to here. uint32_t mDataByteSize; // Alignment in bytes of the data section of this object. uint32_t mAlignment; // the offsets of string handles in the binary value of this class DataRef<PtrOffset> mPtrOffsets; ClassDescriptionSizeInfo() : mByteSize(0), mDataByteSize(0), mAlignment(0) { } }; struct ClassDescription { NamespacedName mName; // No other class has this id, it is DB-unique int32_t mClassId; // Only single derivation supported. int32_t mBaseClass; // If this class has properties that are of uniform type, then we note that. // This means that when deserialization an array of these objects we can just use // single function to endian convert the entire mess at once. int32_t mPackedUniformWidth; // If this class is composed uniformly of members of a given type // Or all of its properties are composed uniformly of members of // a give ntype, then this class's packed type is that type. // PxTransform's packed type would be float. int32_t mPackedClassType; // 0: 32Bit 1: 64Bit ClassDescriptionSizeInfo mSizeInfo[2]; // No further property additions allowed. bool mLocked; // True when this datatype has an array on it that needs to be // separately deleted. bool mRequiresDestruction; ClassDescription(NamespacedName name, int32_t id) : mName(name) , mClassId(id) , mBaseClass(-1) , mPackedUniformWidth(-1) , mPackedClassType(-1) , mLocked(false) , mRequiresDestruction(false) { } ClassDescription() : mClassId(-1), mBaseClass(-1), mPackedUniformWidth(-1), mPackedClassType(-1), mLocked(false), mRequiresDestruction(false) { } virtual ~ClassDescription() { } ClassDescriptionSizeInfo& get32BitSizeInfo() { return mSizeInfo[0]; } ClassDescriptionSizeInfo& get64BitSizeInfo() { return mSizeInfo[1]; } uint32_t& get32BitSize() { return get32BitSizeInfo().mByteSize; } uint32_t& get64BitSize() { return get64BitSizeInfo().mByteSize; } uint32_t get32BitSize() const { return mSizeInfo[0].mByteSize; } const ClassDescriptionSizeInfo& getNativeSizeInfo() const { return mSizeInfo[(sizeof(void*) >> 2) - 1]; } uint32_t getNativeSize() const { return getNativeSizeInfo().mByteSize; } }; struct MarshalQueryResult { int32_t srcType; int32_t dstType; // If canMarshal != needsMarshalling we have a problem. bool canMarshal; bool needsMarshalling; // Non null if marshalling is possible. TBlockMarshaller marshaller; MarshalQueryResult(int32_t _srcType = -1, int32_t _dstType = -1, bool _canMarshal = false, bool _needs = false, TBlockMarshaller _m = NULL) : srcType(_srcType), dstType(_dstType), canMarshal(_canMarshal), needsMarshalling(_needs), marshaller(_m) { } }; struct PropertyMessageEntry { PropertyDescription mProperty; NamespacedName mDatatypeName; // datatype of the data in the message. int32_t mDatatypeId; // where in the message this property starts. uint32_t mMessageOffset; // size of this entry object uint32_t mByteSize; // If the chain of properties doesn't have any array properties this indicates the uint32_t mDestByteSize; PropertyMessageEntry(PropertyDescription propName, NamespacedName dtypeName, int32_t dtype, uint32_t messageOff, uint32_t byteSize, uint32_t destByteSize) : mProperty(propName) , mDatatypeName(dtypeName) , mDatatypeId(dtype) , mMessageOffset(messageOff) , mByteSize(byteSize) , mDestByteSize(destByteSize) { } PropertyMessageEntry() : mDatatypeId(-1), mMessageOffset(0), mByteSize(0), mDestByteSize(0) { } }; // Create a struct that defines a subset of the properties on an object. struct PropertyMessageDescription { NamespacedName mClassName; // No other class has this id, it is DB-unique int32_t mClassId; NamespacedName mMessageName; int32_t mMessageId; DataRef<PropertyMessageEntry> mProperties; uint32_t mMessageByteSize; // Offsets into the property message where const char* items are. DataRef<uint32_t> mStringOffsets; PropertyMessageDescription(const NamespacedName& nm, int32_t clsId, const NamespacedName& msgName, int32_t msgId, uint32_t msgSize) : mClassName(nm), mClassId(clsId), mMessageName(msgName), mMessageId(msgId), mMessageByteSize(msgSize) { } PropertyMessageDescription() : mClassId(-1), mMessageId(-1), mMessageByteSize(0) { } virtual ~PropertyMessageDescription() { } }; class StringTable { protected: virtual ~StringTable() { } public: virtual uint32_t getNbStrs() = 0; virtual uint32_t getStrs(const char** outStrs, uint32_t bufLen, uint32_t startIdx = 0) = 0; virtual const char* registerStr(const char* str, bool& outAdded) = 0; const char* registerStr(const char* str) { bool ignored; return registerStr(str, ignored); } virtual StringHandle strToHandle(const char* str) = 0; virtual const char* handleToStr(uint32_t hdl) = 0; virtual void release() = 0; static StringTable& create(); }; struct None { }; template <typename T> class Option { T mValue; bool mHasValue; public: Option(const T& val) : mValue(val), mHasValue(true) { } Option(None nothing = None()) : mHasValue(false) { (void)nothing; } Option(const Option& other) : mValue(other.mValue), mHasValue(other.mHasValue) { } Option& operator=(const Option& other) { mValue = other.mValue; mHasValue = other.mHasValue; return *this; } bool hasValue() const { return mHasValue; } const T& getValue() const { PX_ASSERT(hasValue()); return mValue; } T& getValue() { PX_ASSERT(hasValue()); return mValue; } operator const T&() const { return getValue(); } operator T&() { return getValue(); } T* operator->() { return &getValue(); } const T* operator->() const { return &getValue(); } }; /** * Create new classes and add properties to some existing ones. * The default classes are created already, the simple types * along with the basic math types. * (uint8_t, int8_t, etc ) * (PxVec3, PxQuat, PxTransform, PxMat33, PxMat34, PxMat44) */ class PvdObjectModelMetaData { protected: virtual ~PvdObjectModelMetaData() { } public: virtual ClassDescription getOrCreateClass(const NamespacedName& nm) = 0; // get or create parent, lock parent. deriveFrom getOrCreatechild. virtual bool deriveClass(const NamespacedName& parent, const NamespacedName& child) = 0; virtual Option<ClassDescription> findClass(const NamespacedName& nm) const = 0; template <typename TDataType> Option<ClassDescription> findClass() { return findClass(getPvdNamespacedNameForType<TDataType>()); } virtual Option<ClassDescription> getClass(int32_t classId) const = 0; virtual ClassDescription* getClassPtr(int32_t classId) const = 0; virtual Option<ClassDescription> getParentClass(int32_t classId) const = 0; bool isDerivedFrom(int32_t classId, int32_t parentClass) const { if(classId == parentClass) return true; ClassDescription* p = getClassPtr(getClassPtr(classId)->mBaseClass); while(p != NULL) { if(p->mClassId == parentClass) return true; p = getClassPtr(p->mBaseClass); } return false; } virtual void lockClass(int32_t classId) = 0; virtual uint32_t getNbClasses() const = 0; virtual uint32_t getClasses(ClassDescription* outClasses, uint32_t requestCount, uint32_t startIndex = 0) const = 0; // Create a nested property. // This way you can have obj.p.x without explicity defining the class p. virtual Option<PropertyDescription> createProperty(int32_t classId, String name, String semantic, int32_t datatype, PropertyType::Enum propertyType = PropertyType::Scalar) = 0; Option<PropertyDescription> createProperty(NamespacedName clsId, String name, String semantic, NamespacedName dtype, PropertyType::Enum propertyType = PropertyType::Scalar) { return createProperty(findClass(clsId)->mClassId, name, semantic, findClass(dtype)->mClassId, propertyType); } Option<PropertyDescription> createProperty(NamespacedName clsId, String name, NamespacedName dtype, PropertyType::Enum propertyType = PropertyType::Scalar) { return createProperty(findClass(clsId)->mClassId, name, "", findClass(dtype)->mClassId, propertyType); } Option<PropertyDescription> createProperty(int32_t clsId, String name, int32_t dtype, PropertyType::Enum propertyType = PropertyType::Scalar) { return createProperty(clsId, name, "", dtype, propertyType); } template <typename TDataType> Option<PropertyDescription> createProperty(int32_t clsId, String name, String semantic = "", PropertyType::Enum propertyType = PropertyType::Scalar) { return createProperty(clsId, name, semantic, getPvdNamespacedNameForType<TDataType>(), propertyType); } virtual Option<PropertyDescription> findProperty(const NamespacedName& cls, String prop) const = 0; virtual Option<PropertyDescription> findProperty(int32_t clsId, String prop) const = 0; virtual Option<PropertyDescription> getProperty(int32_t propId) const = 0; virtual void setNamedPropertyValues(DataRef<NamedValue> values, int32_t propId) = 0; // for enumerations and flags. virtual DataRef<NamedValue> getNamedPropertyValues(int32_t propId) const = 0; virtual uint32_t getNbProperties(int32_t classId) const = 0; virtual uint32_t getProperties(int32_t classId, PropertyDescription* outBuffer, uint32_t bufCount, uint32_t startIdx = 0) const = 0; // Does one cls id differ marshalling to another and if so return the functions to do it. virtual MarshalQueryResult checkMarshalling(int32_t srcClsId, int32_t dstClsId) const = 0; // messages and classes are stored in separate maps, so a property message can have the same name as a class. virtual Option<PropertyMessageDescription> createPropertyMessage(const NamespacedName& cls, const NamespacedName& msgName, DataRef<PropertyMessageArg> entries, uint32_t messageSize) = 0; virtual Option<PropertyMessageDescription> findPropertyMessage(const NamespacedName& msgName) const = 0; virtual Option<PropertyMessageDescription> getPropertyMessage(int32_t msgId) const = 0; virtual uint32_t getNbPropertyMessages() const = 0; virtual uint32_t getPropertyMessages(PropertyMessageDescription* msgBuf, uint32_t bufLen, uint32_t startIdx = 0) const = 0; virtual StringTable& getStringTable() const = 0; virtual void write(PvdOutputStream& stream) const = 0; void save(PvdOutputStream& stream) const { write(stream); } virtual void addRef() = 0; virtual void release() = 0; static uint32_t getCurrentPvdObjectModelVersion(); static PvdObjectModelMetaData& create(); static PvdObjectModelMetaData& create(PvdInputStream& stream); }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdByteStreams.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_BYTE_STREAMS_H #define PX_PVD_BYTE_STREAMS_H #include "PxPvdObjectModelBaseTypes.h" namespace physx { namespace pvdsdk { static inline uint32_t strLen(const char* inStr) { uint32_t len = 0; if(inStr) { while(*inStr) { ++len; ++inStr; } } return len; } class PvdInputStream { protected: virtual ~PvdInputStream() { } public: // Return false if you can't write the number of bytes requested // But make an absolute best effort to read the data... virtual bool read(uint8_t* buffer, uint32_t& len) = 0; template <typename TDataType> bool read(TDataType* buffer, uint32_t numItems) { uint32_t expected = numItems; uint32_t amountToRead = numItems * sizeof(TDataType); read(reinterpret_cast<uint8_t*>(buffer), amountToRead); numItems = amountToRead / sizeof(TDataType); PX_ASSERT(numItems == expected); return expected == numItems; } template <typename TDataType> PvdInputStream& operator>>(TDataType& data) { uint32_t dataSize = static_cast<uint32_t>(sizeof(TDataType)); bool success = read(reinterpret_cast<uint8_t*>(&data), dataSize); // PX_ASSERT( success ); // PX_ASSERT( dataSize == sizeof( data ) ); (void)success; return *this; } }; class PvdOutputStream { protected: virtual ~PvdOutputStream() { } public: // Return false if you can't write the number of bytes requested // But make an absolute best effort to write the data... virtual bool write(const uint8_t* buffer, uint32_t len) = 0; virtual bool directCopy(PvdInputStream& inStream, uint32_t len) = 0; template <typename TDataType> bool write(const TDataType* buffer, uint32_t numItems) { return write(reinterpret_cast<const uint8_t*>(buffer), numItems * sizeof(TDataType)); } template <typename TDataType> PvdOutputStream& operator<<(const TDataType& data) { bool success = write(reinterpret_cast<const uint8_t*>(&data), sizeof(data)); PX_ASSERT(success); (void)success; return *this; } PvdOutputStream& operator<<(const char* inString) { if(inString && *inString) { uint32_t len(strLen(inString)); write(inString, len); } return *this; } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileZoneManagerImpl.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_ZONE_MANAGER_IMPL_H #define PX_PROFILE_ZONE_MANAGER_IMPL_H #include "PxProfileZoneManager.h" #include "PxProfileScopedMutexLock.h" #include "PxPvdProfileZone.h" #include "PxProfileAllocatorWrapper.h" #include "foundation/PxArray.h" #include "foundation/PxMutex.h" namespace physx { namespace profile { struct NullEventNameProvider : public PxProfileNameProvider { virtual PxProfileNames getProfileNames() const { return PxProfileNames( 0, 0 ); } }; class ZoneManagerImpl : public PxProfileZoneManager { typedef ScopedLockImpl<PxMutex> TScopedLockType; PxProfileAllocatorWrapper mWrapper; PxProfileArray<PxProfileZone*> mZones; PxProfileArray<PxProfileZoneHandler*> mHandlers; PxMutex mMutex; ZoneManagerImpl( const ZoneManagerImpl& inOther ); ZoneManagerImpl& operator=( const ZoneManagerImpl& inOther ); public: ZoneManagerImpl(PxAllocatorCallback* inFoundation) : mWrapper( inFoundation ) , mZones( mWrapper ) , mHandlers( mWrapper ) {} virtual ~ZoneManagerImpl() { //This assert would mean that a profile zone is outliving us. //This will cause a crash when the profile zone is released. PX_ASSERT( mZones.size() == 0 ); while( mZones.size() ) removeProfileZone( *mZones.back() ); } virtual void addProfileZone( PxProfileZone& inSDK ) { TScopedLockType lock( &mMutex ); if ( inSDK.getProfileZoneManager() != NULL ) { if ( inSDK.getProfileZoneManager() == this ) return; else //there must be two managers in the system somehow. { PX_ASSERT( false ); inSDK.getProfileZoneManager()->removeProfileZone( inSDK ); } } mZones.pushBack( &inSDK ); inSDK.setProfileZoneManager( this ); for ( uint32_t idx =0; idx < mHandlers.size(); ++idx ) mHandlers[idx]->onZoneAdded( inSDK ); } virtual void removeProfileZone( PxProfileZone& inSDK ) { TScopedLockType lock( &mMutex ); if ( inSDK.getProfileZoneManager() == NULL ) return; else if ( inSDK.getProfileZoneManager() != this ) { PX_ASSERT( false ); inSDK.getProfileZoneManager()->removeProfileZone( inSDK ); return; } inSDK.setProfileZoneManager( NULL ); for ( uint32_t idx = 0; idx < mZones.size(); ++idx ) { if ( mZones[idx] == &inSDK ) { for ( uint32_t handler =0; handler < mHandlers.size(); ++handler ) mHandlers[handler]->onZoneRemoved( inSDK ); mZones.replaceWithLast( idx ); } } } virtual void flushProfileEvents() { uint32_t sdkCount = mZones.size(); for ( uint32_t idx = 0; idx < sdkCount; ++idx ) mZones[idx]->flushProfileEvents(); } virtual void addProfileZoneHandler( PxProfileZoneHandler& inHandler ) { TScopedLockType lock( &mMutex ); mHandlers.pushBack( &inHandler ); for ( uint32_t idx = 0; idx < mZones.size(); ++idx ) inHandler.onZoneAdded( *mZones[idx] ); } virtual void removeProfileZoneHandler( PxProfileZoneHandler& inHandler ) { TScopedLockType lock( &mMutex ); for( uint32_t idx = 0; idx < mZones.size(); ++idx ) inHandler.onZoneRemoved( *mZones[idx] ); for( uint32_t idx = 0; idx < mHandlers.size(); ++idx ) { if ( mHandlers[idx] == &inHandler ) mHandlers.replaceWithLast( idx ); } } virtual PxProfileZone& createProfileZone( const char* inSDKName, PxProfileNameProvider* inProvider, uint32_t inEventBufferByteSize ) { NullEventNameProvider nullProvider; if ( inProvider == NULL ) inProvider = &nullProvider; return createProfileZone( inSDKName, inProvider->getProfileNames(), inEventBufferByteSize ); } virtual PxProfileZone& createProfileZone( const char* inSDKName, PxProfileNames inNames, uint32_t inEventBufferByteSize ) { PxProfileZone& retval( PxProfileZone::createProfileZone( &mWrapper.getAllocator(), inSDKName, inNames, inEventBufferByteSize ) ); addProfileZone( retval ); return retval; } virtual void release() { PX_PROFILE_DELETE( mWrapper.getAllocator(), this ); } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdCommStreamTypes.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_COMM_STREAM_TYPES_H #define PX_PVD_COMM_STREAM_TYPES_H #include "foundation/PxErrorCallback.h" #include "common/PxRenderBuffer.h" #include "pvd/PxPvdTransport.h" #include "PxPvdObjectModelBaseTypes.h" #include "PxPvdCommStreamEvents.h" #include "PxPvdDataStream.h" #include "foundation/PxMutex.h" namespace physx { namespace profile { class PxProfileZone; class PxProfileMemoryEventBuffer; } namespace pvdsdk { struct PvdErrorMessage; class PvdObjectModelMetaData; DEFINE_PVD_TYPE_NAME_MAP(profile::PxProfileZone, "_debugger_", "PxProfileZone") DEFINE_PVD_TYPE_NAME_MAP(profile::PxProfileMemoryEventBuffer, "_debugger_", "PxProfileMemoryEventBuffer") DEFINE_PVD_TYPE_NAME_MAP(PvdErrorMessage, "_debugger_", "PvdErrorMessage") // All event streams are on the 'events' property of objects of these types static inline NamespacedName getMemoryEventTotalsClassName() { return NamespacedName("_debugger", "MemoryEventTotals"); } class PvdOMMetaDataProvider { protected: virtual ~PvdOMMetaDataProvider() { } public: virtual void addRef() = 0; virtual void release() = 0; virtual PvdObjectModelMetaData& lock() = 0; virtual void unlock() = 0; virtual bool createInstance(const NamespacedName& clsName, const void* instance) = 0; virtual bool isInstanceValid(const void* instance) = 0; virtual void destroyInstance(const void* instance) = 0; virtual int32_t getInstanceClassType(const void* instance) = 0; }; class PvdCommStreamEmbeddedTypes { public: static const char* getProfileEventStreamSemantic() { return "profile event stream"; } static const char* getMemoryEventStreamSemantic() { return "memory event stream"; } static const char* getRendererEventStreamSemantic() { return "render event stream"; } }; class PvdCommStreamEventBufferClient; template <typename TStreamType> struct EventStreamifier : public PvdEventSerializer { TStreamType& mBuffer; EventStreamifier(TStreamType& buf) : mBuffer(buf) { } template <typename TDataType> void write(const TDataType& type) { mBuffer.write(reinterpret_cast<const uint8_t*>(&type), sizeof(TDataType)); } template <typename TDataType> void write(const TDataType* type, uint32_t count) { mBuffer.write(reinterpret_cast<const uint8_t*>(type), count * sizeof(TDataType)); } void writeRef(DataRef<const uint8_t> data) { uint32_t amount = static_cast<uint32_t>(data.size()); write(amount); write(data.begin(), amount); } void writeRef(DataRef<StringHandle> data) { uint32_t amount = static_cast<uint32_t>(data.size()); write(amount); write(data.begin(), amount); } template <typename TDataType> void writeRef(DataRef<TDataType> data) { uint32_t amount = static_cast<uint32_t>(data.size()); write(amount); for(uint32_t idx = 0; idx < amount; ++idx) { TDataType& dtype(const_cast<TDataType&>(data[idx])); dtype.serialize(*this); } } virtual void streamify(uint16_t& val) { write(val); } virtual void streamify(uint8_t& val) { write(val); } virtual void streamify(uint32_t& val) { write(val); } virtual void streamify(float& val) { write(val); } virtual void streamify(uint64_t& val) { write(val); } virtual void streamify(PxDebugText& val) { write(val.color); write(val.position); write(val.size); streamify(val.string); } virtual void streamify(String& val) { uint32_t len = 0; String temp = nonNull(val); if(*temp) len = static_cast<uint32_t>(strlen(temp) + 1); write(len); write(val, len); } virtual void streamify(DataRef<const uint8_t>& val) { writeRef(val); } virtual void streamify(DataRef<NameHandleValue>& val) { writeRef(val); } virtual void streamify(DataRef<StreamPropMessageArg>& val) { writeRef(val); } virtual void streamify(DataRef<StringHandle>& val) { writeRef(val); } private: EventStreamifier& operator=(const EventStreamifier&); }; struct MeasureStream { uint32_t mSize; MeasureStream() : mSize(0) { } template <typename TDataType> void write(const TDataType& val) { mSize += sizeof(val); } template <typename TDataType> void write(const TDataType*, uint32_t count) { mSize += sizeof(TDataType) * count; } }; struct DataStreamState { enum Enum { Open, SetPropertyValue, PropertyMessageGroup }; }; } // pvdsdk } // physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdDataStream.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #include "foundation/PxAssert.h" #include "PxPvdCommStreamEventSink.h" #include "PxPvdDataStreamHelpers.h" #include "PxPvdObjectModelInternalTypes.h" #include "PxPvdImpl.h" using namespace physx; using namespace physx::pvdsdk; namespace { struct ScopedMetaData { PvdOMMetaDataProvider& mProvider; PvdObjectModelMetaData& mMeta; ScopedMetaData(PvdOMMetaDataProvider& provider) : mProvider(provider), mMeta(provider.lock()) { } ~ScopedMetaData() { mProvider.unlock(); } PvdObjectModelMetaData* operator->() { return &mMeta; } private: ScopedMetaData& operator=(const ScopedMetaData&); }; struct PropertyDefinitionHelper : public PvdPropertyDefinitionHelper { PvdDataStream* mStream; PvdOMMetaDataProvider& mProvider; PxArray<char> mNameBuffer; PxArray<uint32_t> mNameStack; PxArray<NamedValue> mNamedValues; PxArray<PropertyMessageArg> mPropertyMessageArgs; PropertyDefinitionHelper(PvdOMMetaDataProvider& provider) : mStream(NULL) , mProvider(provider) , mNameBuffer("PropertyDefinitionHelper::mNameBuffer") , mNameStack("PropertyDefinitionHelper::mNameStack") , mNamedValues("PropertyDefinitionHelper::mNamedValues") , mPropertyMessageArgs("PropertyDefinitionHelper::mPropertyMessageArgs") { } void setStream(PvdDataStream* stream) { mStream = stream; } inline void appendStrToBuffer(const char* str) { if(str == NULL) return; size_t strLen = strlen(str); size_t endBufOffset = mNameBuffer.size(); size_t resizeLen = endBufOffset; // account for null if(mNameBuffer.empty()) resizeLen += 1; else endBufOffset -= 1; mNameBuffer.resize(static_cast<uint32_t>(resizeLen + strLen)); char* endPtr = mNameBuffer.begin() + endBufOffset; PxMemCopy(endPtr, str, static_cast<uint32_t>(strLen)); } virtual void pushName(const char* nm, const char* appender = ".") { size_t nameBufLen = mNameBuffer.size(); mNameStack.pushBack(static_cast<uint32_t>(nameBufLen)); if(mNameBuffer.empty() == false) appendStrToBuffer(appender); appendStrToBuffer(nm); mNameBuffer.back() = 0; } virtual void pushBracketedName(const char* inName, const char* leftBracket = "[", const char* rightBracket = "]") { size_t nameBufLen = mNameBuffer.size(); mNameStack.pushBack(static_cast<uint32_t>(nameBufLen)); appendStrToBuffer(leftBracket); appendStrToBuffer(inName); appendStrToBuffer(rightBracket); mNameBuffer.back() = 0; } virtual void popName() { if(mNameStack.empty()) return; mNameBuffer.resize(static_cast<uint32_t>(mNameStack.back())); mNameStack.popBack(); if(mNameBuffer.empty() == false) mNameBuffer.back() = 0; } virtual const char* getTopName() { if(mNameBuffer.size()) return mNameBuffer.begin(); return ""; } virtual void clearNameStack() { mNameBuffer.clear(); mNameStack.clear(); } virtual void addNamedValue(const char* name, uint32_t value) { mNamedValues.pushBack(NamedValue(name, value)); } virtual void clearNamedValues() { mNamedValues.clear(); } virtual DataRef<NamedValue> getNamedValues() { return DataRef<NamedValue>(mNamedValues.begin(), mNamedValues.size()); } virtual void createProperty(const NamespacedName& clsName, const char* inSemantic, const NamespacedName& dtypeName, PropertyType::Enum propType) { mStream->createProperty(clsName, getTopName(), inSemantic, dtypeName, propType, getNamedValues()); clearNamedValues(); } const char* registerStr(const char* str) { ScopedMetaData scopedProvider(mProvider); return scopedProvider->getStringTable().registerStr(str); } virtual void addPropertyMessageArg(const NamespacedName& inDatatype, uint32_t inOffset, uint32_t inSize) { mPropertyMessageArgs.pushBack(PropertyMessageArg(registerStr(getTopName()), inDatatype, inOffset, inSize)); } virtual void addPropertyMessage(const NamespacedName& clsName, const NamespacedName& msgName, uint32_t inStructSizeInBytes) { if(mPropertyMessageArgs.empty()) { PX_ASSERT(false); return; } mStream->createPropertyMessage( clsName, msgName, DataRef<PropertyMessageArg>(mPropertyMessageArgs.begin(), mPropertyMessageArgs.size()), inStructSizeInBytes); } virtual void clearPropertyMessageArgs() { mPropertyMessageArgs.clear(); } private: PropertyDefinitionHelper& operator=(const PropertyDefinitionHelper&); }; class PvdMemPool { // Link List PxArray<uint8_t*> mMemBuffer; uint32_t mLength; uint32_t mBufIndex; // 4k for one page static const int BUFFER_LENGTH = 4096; PX_NOCOPY(PvdMemPool) public: PvdMemPool(const char* bufDataName) : mMemBuffer(bufDataName), mLength(0), mBufIndex(0) { grow(); } ~PvdMemPool() { for(uint32_t i = 0; i < mMemBuffer.size(); i++) { PX_FREE(mMemBuffer[i]); } } void grow() { if(mBufIndex + 1 < mMemBuffer.size()) { mBufIndex++; } else { uint8_t* Buf = reinterpret_cast<uint8_t*>(PX_ALLOC(BUFFER_LENGTH, "PvdMemPool::mMemBuffer.buf")); mMemBuffer.pushBack(Buf); mBufIndex = mMemBuffer.size() - 1; } mLength = 0; } void* allocate(uint32_t length) { if(length > uint32_t(BUFFER_LENGTH)) return NULL; if(length + mLength > uint32_t(BUFFER_LENGTH)) grow(); void* mem = reinterpret_cast<void*>(&mMemBuffer[mBufIndex][mLength]); mLength += length; return mem; } void clear() { mLength = 0; mBufIndex = 0; } }; struct PvdOutStream : public PvdDataStream, public PxUserAllocated { PxHashMap<String, uint32_t> mStringHashMap; PvdOMMetaDataProvider& mMetaDataProvider; PxArray<uint8_t> mTempBuffer; PropertyDefinitionHelper mPropertyDefinitionHelper; DataStreamState::Enum mStreamState; ClassDescription mSPVClass; PropertyMessageDescription mMessageDesc; // Set property value and SetPropertyMessage calls require // us to write the data out to a separate buffer // when strings are involved. ForwardingMemoryBuffer mSPVBuffer; uint32_t mEventCount; uint32_t mPropertyMessageSize; bool mConnected; uint64_t mStreamId; PxArray<PvdCommand*> mPvdCommandArray; PvdMemPool mPvdCommandPool; PxPvdTransport& mTransport; PvdOutStream(PxPvdTransport& transport, PvdOMMetaDataProvider& provider, uint64_t streamId) : mStringHashMap("PvdOutStream::mStringHashMap") , mMetaDataProvider(provider) , mTempBuffer("PvdOutStream::mTempBuffer") , mPropertyDefinitionHelper(mMetaDataProvider) , mStreamState(DataStreamState::Open) , mSPVBuffer("PvdCommStreamBufferedEventSink::mSPVBuffer") , mEventCount(0) , mPropertyMessageSize(0) , mConnected(true) , mStreamId(streamId) , mPvdCommandArray("PvdCommStreamBufferedEventSink::mPvdCommandArray") , mPvdCommandPool("PvdCommStreamBufferedEventSink::mPvdCommandPool") , mTransport(transport) { mPropertyDefinitionHelper.setStream(this); } virtual ~PvdOutStream() { } virtual void release() { PVD_DELETE(this); } StringHandle toStream(String nm) { if(nm == NULL || *nm == 0) return 0; const PxHashMap<String, uint32_t>::Entry* entry(mStringHashMap.find(nm)); if(entry) return entry->second; ScopedMetaData meta(mMetaDataProvider); StringHandle hdl = meta->getStringTable().strToHandle(nm); nm = meta->getStringTable().handleToStr(hdl); handlePvdEvent(StringHandleEvent(nm, hdl)); mStringHashMap.insert(nm, hdl); return hdl; } StreamNamespacedName toStream(const NamespacedName& nm) { return StreamNamespacedName(toStream(nm.mNamespace), toStream(nm.mName)); } bool isClassExist(const NamespacedName& nm) { ScopedMetaData meta(mMetaDataProvider); return meta->findClass(nm).hasValue(); } bool createMetaClass(const NamespacedName& nm) { ScopedMetaData meta(mMetaDataProvider); meta->getOrCreateClass(nm); return true; } bool deriveMetaClass(const NamespacedName& parent, const NamespacedName& child) { ScopedMetaData meta(mMetaDataProvider); return meta->deriveClass(parent, child); } // You will notice that some functions are #pragma'd out throughout this file. // This is because they are only called from asserts which means they aren't // called in release. This causes warnings when building using snc which break // the build. #if PX_DEBUG bool propertyExists(const NamespacedName& nm, String pname) { ScopedMetaData meta(mMetaDataProvider); return meta->findProperty(nm, pname).hasValue(); } #endif PvdError boolToError(bool val) { if(val) return PvdErrorType::Success; return PvdErrorType::NetworkError; } // PvdMetaDataStream virtual PvdError createClass(const NamespacedName& nm) { PX_ASSERT(mStreamState == DataStreamState::Open); #if PX_DEBUG PX_ASSERT(isClassExist(nm) == false); #endif createMetaClass(nm); return boolToError(handlePvdEvent(CreateClass(toStream(nm)))); } virtual PvdError deriveClass(const NamespacedName& parent, const NamespacedName& child) { PX_ASSERT(mStreamState == DataStreamState::Open); #if PX_DEBUG PX_ASSERT(isClassExist(parent)); PX_ASSERT(isClassExist(child)); #endif deriveMetaClass(parent, child); return boolToError(handlePvdEvent(DeriveClass(toStream(parent), toStream(child)))); } template <typename TDataType> TDataType* allocTemp(uint32_t numItems) { uint32_t desiredBytes = numItems * sizeof(TDataType); if(desiredBytes > mTempBuffer.size()) mTempBuffer.resize(desiredBytes); TDataType* retval = reinterpret_cast<TDataType*>(mTempBuffer.begin()); if(numItems) { PVD_FOREACH(idx, numItems) new (retval + idx) TDataType(); } return retval; } #if PX_DEBUG // Property datatypes need to be uniform. // At this point, the data stream cannot handle properties that // A struct with a float member and a char member would work. // A struct with a float member and a long member would work (more efficiently). bool isValidPropertyDatatype(const NamespacedName& dtypeName) { ScopedMetaData meta(mMetaDataProvider); ClassDescription clsDesc(meta->findClass(dtypeName)); return clsDesc.mRequiresDestruction == false; } #endif NamespacedName createMetaProperty(const NamespacedName& clsName, String name, String semantic, const NamespacedName& dtypeName, PropertyType::Enum propertyType) { ScopedMetaData meta(mMetaDataProvider); int32_t dtypeType = meta->findClass(dtypeName)->mClassId; NamespacedName typeName = dtypeName; if(dtypeType == getPvdTypeForType<String>()) { dtypeType = getPvdTypeForType<StringHandle>(); typeName = getPvdNamespacedNameForType<StringHandle>(); } Option<PropertyDescription> propOpt = meta->createProperty(meta->findClass(clsName)->mClassId, name, semantic, dtypeType, propertyType); PX_ASSERT(propOpt.hasValue()); PX_UNUSED(propOpt); return typeName; } virtual PvdError createProperty(const NamespacedName& clsName, String name, String semantic, const NamespacedName& incomingDtypeName, PropertyType::Enum propertyType, DataRef<NamedValue> values) { PX_ASSERT(mStreamState == DataStreamState::Open); #if PX_DEBUG PX_ASSERT(isClassExist(clsName)); PX_ASSERT(propertyExists(clsName, name) == false); #endif NamespacedName dtypeName(incomingDtypeName); if(safeStrEq(dtypeName.mName, "VoidPtr")) dtypeName.mName = "ObjectRef"; #if PX_DEBUG PX_ASSERT(isClassExist(dtypeName)); PX_ASSERT(isValidPropertyDatatype(dtypeName)); #endif NamespacedName typeName = createMetaProperty(clsName, name, semantic, dtypeName, propertyType); // Can't have arrays of strings or arrays of string handles due to the difficulty // of quickly dealing with them on the network receiving side. if(propertyType == PropertyType::Array && safeStrEq(typeName.mName, "StringHandle")) { PX_ASSERT(false); return PvdErrorType::ArgumentError; } uint32_t numItems = values.size(); NameHandleValue* streamValues = allocTemp<NameHandleValue>(numItems); PVD_FOREACH(idx, numItems) streamValues[idx] = NameHandleValue(toStream(values[idx].mName), values[idx].mValue); CreateProperty evt(toStream(clsName), toStream(name), toStream(semantic), toStream(typeName), propertyType, DataRef<NameHandleValue>(streamValues, numItems)); return boolToError(handlePvdEvent(evt)); } bool createMetaPropertyMessage(const NamespacedName& cls, const NamespacedName& msgName, DataRef<PropertyMessageArg> entries, uint32_t messageSizeInBytes) { ScopedMetaData meta(mMetaDataProvider); return meta->createPropertyMessage(cls, msgName, entries, messageSizeInBytes).hasValue(); } #if PX_DEBUG bool messageExists(const NamespacedName& msgName) { ScopedMetaData meta(mMetaDataProvider); return meta->findPropertyMessage(msgName).hasValue(); } #endif virtual PvdError createPropertyMessage(const NamespacedName& cls, const NamespacedName& msgName, DataRef<PropertyMessageArg> entries, uint32_t messageSizeInBytes) { PX_ASSERT(mStreamState == DataStreamState::Open); #if PX_DEBUG PX_ASSERT(isClassExist(cls)); PX_ASSERT(messageExists(msgName) == false); #endif createMetaPropertyMessage(cls, msgName, entries, messageSizeInBytes); uint32_t numItems = entries.size(); StreamPropMessageArg* streamValues = allocTemp<StreamPropMessageArg>(numItems); PVD_FOREACH(idx, numItems) streamValues[idx] = StreamPropMessageArg(toStream(entries[idx].mPropertyName), toStream(entries[idx].mDatatypeName), entries[idx].mMessageOffset, entries[idx].mByteSize); CreatePropertyMessage evt(toStream(cls), toStream(msgName), DataRef<StreamPropMessageArg>(streamValues, numItems), messageSizeInBytes); return boolToError(handlePvdEvent(evt)); } uint64_t toStream(const void* instance) { return PVD_POINTER_TO_U64(instance); } virtual PvdError createInstance(const NamespacedName& cls, const void* instance) { PX_ASSERT(isInstanceValid(instance) == false); PX_ASSERT(mStreamState == DataStreamState::Open); bool success = mMetaDataProvider.createInstance(cls, instance); PX_ASSERT(success); (void)success; return boolToError(handlePvdEvent(CreateInstance(toStream(cls), toStream(instance)))); } virtual bool isInstanceValid(const void* instance) { return mMetaDataProvider.isInstanceValid(instance); } #if PX_DEBUG // If the property will fit or is already completely in memory bool checkPropertyType(const void* instance, String name, const NamespacedName& incomingType) { int32_t instType = mMetaDataProvider.getInstanceClassType(instance); ScopedMetaData meta(mMetaDataProvider); Option<PropertyDescription> prop = meta->findProperty(instType, name); if(prop.hasValue() == false) return false; int32_t propType = prop->mDatatype; int32_t incomingTypeId = meta->findClass(incomingType)->mClassId; if(incomingTypeId != getPvdTypeForType<VoidPtr>()) { MarshalQueryResult result = meta->checkMarshalling(incomingTypeId, propType); bool possible = result.needsMarshalling == false || result.canMarshal; return possible; } else { if(propType != getPvdTypeForType<ObjectRef>()) return false; } return true; } #endif DataRef<const uint8_t> bufferPropertyValue(ClassDescriptionSizeInfo info, DataRef<const uint8_t> data) { uint32_t realSize = info.mByteSize; uint32_t numItems = data.size() / realSize; if(info.mPtrOffsets.size() != 0) { mSPVBuffer.clear(); PVD_FOREACH(item, numItems) { const uint8_t* itemPtr = data.begin() + item * realSize; mSPVBuffer.write(itemPtr, realSize); PVD_FOREACH(stringIdx, info.mPtrOffsets.size()) { PtrOffset offset(info.mPtrOffsets[stringIdx]); if(offset.mOffsetType == PtrOffsetType::VoidPtrOffset) continue; const char* strPtr; physx::intrinsics::memCopy(&strPtr, itemPtr + offset.mOffset, sizeof(char*)); strPtr = nonNull(strPtr); uint32_t len = safeStrLen(strPtr) + 1; mSPVBuffer.write(strPtr, len); } } data = DataRef<const uint8_t>(mSPVBuffer.begin(), mSPVBuffer.size()); } return data; } virtual PvdError setPropertyValue(const void* instance, String name, DataRef<const uint8_t> data, const NamespacedName& incomingTypeName) { PX_ASSERT(isInstanceValid(instance)); #if PX_DEBUG PX_ASSERT(isClassExist(incomingTypeName)); #endif PX_ASSERT(mStreamState == DataStreamState::Open); ClassDescription clsDesc; { ScopedMetaData meta(mMetaDataProvider); clsDesc = meta->findClass(incomingTypeName); } uint32_t realSize = clsDesc.getNativeSize(); uint32_t numItems = data.size() / realSize; data = bufferPropertyValue(clsDesc.getNativeSizeInfo(), data); SetPropertyValue evt(toStream(instance), toStream(name), data, toStream(incomingTypeName), numItems); return boolToError(handlePvdEvent(evt)); } // Else if the property is very large (contact reports) you can send it in chunks. virtual PvdError beginSetPropertyValue(const void* instance, String name, const NamespacedName& incomingTypeName) { PX_ASSERT(isInstanceValid(instance)); #if PX_DEBUG PX_ASSERT(isClassExist(incomingTypeName)); PX_ASSERT(checkPropertyType(instance, name, incomingTypeName)); #endif PX_ASSERT(mStreamState == DataStreamState::Open); mStreamState = DataStreamState::SetPropertyValue; { ScopedMetaData meta(mMetaDataProvider); mSPVClass = meta->findClass(incomingTypeName); } BeginSetPropertyValue evt(toStream(instance), toStream(name), toStream(incomingTypeName)); return boolToError(handlePvdEvent(evt)); } virtual PvdError appendPropertyValueData(DataRef<const uint8_t> data) { uint32_t realSize = mSPVClass.getNativeSize(); uint32_t numItems = data.size() / realSize; data = bufferPropertyValue(mSPVClass.getNativeSizeInfo(), data); PX_ASSERT(mStreamState == DataStreamState::SetPropertyValue); return boolToError(handlePvdEvent(AppendPropertyValueData(data, numItems))); } virtual PvdError endSetPropertyValue() { PX_ASSERT(mStreamState == DataStreamState::SetPropertyValue); mStreamState = DataStreamState::Open; return boolToError(handlePvdEvent(EndSetPropertyValue())); } #if PX_DEBUG bool checkPropertyMessage(const void* instance, const NamespacedName& msgName) { int32_t clsId = mMetaDataProvider.getInstanceClassType(instance); ScopedMetaData meta(mMetaDataProvider); PropertyMessageDescription desc(meta->findPropertyMessage(msgName)); bool retval = meta->isDerivedFrom(clsId, desc.mClassId); return retval; } #endif DataRef<const uint8_t> bufferPropertyMessage(const PropertyMessageDescription& desc, DataRef<const uint8_t> data) { if(desc.mStringOffsets.size()) { mSPVBuffer.clear(); mSPVBuffer.write(data.begin(), data.size()); PVD_FOREACH(idx, desc.mStringOffsets.size()) { const char* strPtr; physx::intrinsics::memCopy(&strPtr, data.begin() + desc.mStringOffsets[idx], sizeof(char*)); strPtr = nonNull(strPtr); uint32_t len = safeStrLen(strPtr) + 1; mSPVBuffer.write(strPtr, len); } data = DataRef<const uint8_t>(mSPVBuffer.begin(), mSPVBuffer.end()); } return data; } virtual PvdError setPropertyMessage(const void* instance, const NamespacedName& msgName, DataRef<const uint8_t> data) { ScopedMetaData meta(mMetaDataProvider); PX_ASSERT(isInstanceValid(instance)); #if PX_DEBUG PX_ASSERT(messageExists(msgName)); PX_ASSERT(checkPropertyMessage(instance, msgName)); #endif PropertyMessageDescription desc(meta->findPropertyMessage(msgName)); if(data.size() < desc.mMessageByteSize) { PX_ASSERT(false); return PvdErrorType::ArgumentError; } data = bufferPropertyMessage(desc, data); PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent(SetPropertyMessage(toStream(instance), toStream(msgName), data))); } #if PX_DEBUG bool checkBeginPropertyMessageGroup(const NamespacedName& msgName) { ScopedMetaData meta(mMetaDataProvider); PropertyMessageDescription desc(meta->findPropertyMessage(msgName)); return desc.mStringOffsets.size() == 0; } #endif // If you need to send of lot of identical messages, this avoids a hashtable lookup per message. virtual PvdError beginPropertyMessageGroup(const NamespacedName& msgName) { #if PX_DEBUG PX_ASSERT(messageExists(msgName)); PX_ASSERT(checkBeginPropertyMessageGroup(msgName)); #endif PX_ASSERT(mStreamState == DataStreamState::Open); mStreamState = DataStreamState::PropertyMessageGroup; ScopedMetaData meta(mMetaDataProvider); mMessageDesc = meta->findPropertyMessage(msgName); return boolToError(handlePvdEvent(BeginPropertyMessageGroup(toStream(msgName)))); } virtual PvdError sendPropertyMessageFromGroup(const void* instance, DataRef<const uint8_t> data) { PX_ASSERT(mStreamState == DataStreamState::PropertyMessageGroup); PX_ASSERT(isInstanceValid(instance)); #if PX_DEBUG PX_ASSERT(checkPropertyMessage(instance, mMessageDesc.mMessageName)); #endif if(mMessageDesc.mMessageByteSize != data.size()) { PX_ASSERT(false); return PvdErrorType::ArgumentError; } if(data.size() < mMessageDesc.mMessageByteSize) return PvdErrorType::ArgumentError; data = bufferPropertyMessage(mMessageDesc, data); return boolToError(handlePvdEvent(SendPropertyMessageFromGroup(toStream(instance), data))); } virtual PvdError endPropertyMessageGroup() { PX_ASSERT(mStreamState == DataStreamState::PropertyMessageGroup); mStreamState = DataStreamState::Open; return boolToError(handlePvdEvent(EndPropertyMessageGroup())); } virtual PvdError pushBackObjectRef(const void* instance, String propName, const void* data) { PX_ASSERT(isInstanceValid(instance)); PX_ASSERT(isInstanceValid(data)); PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent(PushBackObjectRef(toStream(instance), toStream(propName), toStream(data)))); } virtual PvdError removeObjectRef(const void* instance, String propName, const void* data) { PX_ASSERT(isInstanceValid(instance)); PX_ASSERT(isInstanceValid(data)); PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent(RemoveObjectRef(toStream(instance), toStream(propName), toStream(data)))); } // Instance elimination. virtual PvdError destroyInstance(const void* instance) { PX_ASSERT(isInstanceValid(instance)); PX_ASSERT(mStreamState == DataStreamState::Open); mMetaDataProvider.destroyInstance(instance); return boolToError(handlePvdEvent(DestroyInstance(toStream(instance)))); } // Profiling hooks virtual PvdError beginSection(const void* instance, String name) { PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent( BeginSection(toStream(instance), toStream(name), PxTime::getCurrentCounterValue()))); } virtual PvdError endSection(const void* instance, String name) { PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent( EndSection(toStream(instance), toStream(name), PxTime::getCurrentCounterValue()))); } virtual PvdError originShift(const void* scene, PxVec3 shift) { PX_ASSERT(mStreamState == DataStreamState::Open); return boolToError(handlePvdEvent(OriginShift(toStream(scene), shift))); } virtual void addProfileZone(void* zone, const char* name) { handlePvdEvent(AddProfileZone(toStream(zone), name)); } virtual void addProfileZoneEvent(void* zone, const char* name, uint16_t eventId, bool compileTimeEnabled) { handlePvdEvent(AddProfileZoneEvent(toStream(zone), name, eventId, compileTimeEnabled)); } // add a variable sized event void addEvent(const EventSerializeable& evt, PvdCommStreamEventTypes::Enum evtType) { MeasureStream measure; PvdCommStreamEventSink::writeStreamEvent(evt, evtType, measure); EventGroup evtGroup(measure.mSize, 1, mStreamId, PxTime::getCurrentCounterValue()); EventStreamifier<PxPvdTransport> streamifier(mTransport.lock()); evtGroup.serialize(streamifier); PvdCommStreamEventSink::writeStreamEvent(evt, evtType, mTransport); mTransport.unlock(); } void setIsTopLevelUIElement(const void* instance, bool topLevel) { addEvent(SetIsTopLevel(static_cast<uint64_t>(reinterpret_cast<size_t>(instance)), topLevel), getCommStreamEventType<SetIsTopLevel>()); } void sendErrorMessage(uint32_t code, const char* message, const char* file, uint32_t line) { addEvent(ErrorMessage(code, message, file, line), getCommStreamEventType<ErrorMessage>()); } void updateCamera(const char* name, const PxVec3& origin, const PxVec3& up, const PxVec3& target) { addEvent(SetCamera(name, origin, up, target), getCommStreamEventType<SetCamera>()); } template <typename TEventType> bool handlePvdEvent(const TEventType& evt) { addEvent(evt, getCommStreamEventType<TEventType>()); return mConnected; } virtual PvdPropertyDefinitionHelper& getPropertyDefinitionHelper() { mPropertyDefinitionHelper.clearBufferedData(); return mPropertyDefinitionHelper; } virtual bool isConnected() { return mConnected; } virtual void* allocateMemForCmd(uint32_t length) { return mPvdCommandPool.allocate(length); } virtual void pushPvdCommand(PvdCommand& cmd) { mPvdCommandArray.pushBack(&cmd); } virtual void flushPvdCommand() { uint32_t cmdQueueSize = mPvdCommandArray.size(); for(uint32_t i = 0; i < cmdQueueSize; i++) { if(mPvdCommandArray[i]) { // if(mPvdCommandArray[i]->canRun(*this)) mPvdCommandArray[i]->run(*this); mPvdCommandArray[i]->~PvdCommand(); } } mPvdCommandArray.clear(); mPvdCommandPool.clear(); } PX_NOCOPY(PvdOutStream) }; } PvdDataStream* PvdDataStream::create(PxPvd* pvd) { if(pvd == NULL) { PxGetFoundation().error(PxErrorCode::eINVALID_PARAMETER, PX_FL, "PvdDataStream::create - pvd must be non-NULL!"); return NULL; } PvdImpl* pvdImpl = static_cast<PvdImpl*>(pvd); return PVD_NEW(PvdOutStream)(*pvdImpl->getTransport(), pvdImpl->getMetaDataProvider(), pvdImpl->getNextStreamId()); }
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileScopedMutexLock.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_SCOPED_MUTEX_LOCK_H #define PX_PROFILE_SCOPED_MUTEX_LOCK_H #include "foundation/Px.h" namespace physx { namespace profile { /** * Generic class to wrap any mutex type that has lock and unlock methods */ template<typename TMutexType> struct ScopedLockImpl { TMutexType* mMutex; ScopedLockImpl( TMutexType* inM ) : mMutex( inM ) { if ( mMutex ) mMutex->lock(); } ~ScopedLockImpl() { if ( mMutex ) mMutex->unlock(); } }; /** * Null locking system that does nothing. */ struct NullLock { template<typename TDataType> NullLock( TDataType*) {} }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventMutex.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_MUTEX_H #define PX_PROFILE_EVENT_MUTEX_H #include "foundation/Px.h" namespace physx { namespace profile { /** * Mutex interface that hides implementation around lock and unlock. * The event system locks the mutex for every interaction. */ class PxProfileEventMutex { protected: virtual ~PxProfileEventMutex(){} public: virtual void lock() = 0; virtual void unlock() = 0; }; /** * Take any mutex type that implements lock and unlock and make an EventMutex out of it. */ template<typename TMutexType> struct PxProfileEventMutexImpl : public PxProfileEventMutex { TMutexType* mMutex; PxProfileEventMutexImpl( TMutexType* inMtx ) : mMutex( inMtx ) {} virtual void lock() { mMutex->lock(); } virtual void unlock() { mMutex->unlock(); } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectRegistrar.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_OBJECT_REGISTRAR_H #define PX_PVD_OBJECT_REGISTRAR_H /** \addtogroup pvd @{ */ #include "foundation/PxHashMap.h" #include "foundation/PxMutex.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif class ObjectRegistrar { PX_NOCOPY(ObjectRegistrar) public: ObjectRegistrar() { } virtual ~ObjectRegistrar() { } bool addItem(const void* inItem); bool decItem(const void* inItem); void clear(); private: physx::PxHashMap<const void*, uint32_t> mRefCountMap; physx::PxMutex mRefCountMapLock; }; #if !PX_DOXYGEN } // pvdsdk } // physx #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdProfileZoneClient.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_PROFILE_ZONE_CLIENT_H #define PX_PVD_PROFILE_ZONE_CLIENT_H #include "PxPvdClient.h" #include "foundation/PxHashMap.h" #include "foundation/PxMutex.h" #include "PxProfileZoneManager.h" namespace physx { namespace pvdsdk { class PvdImpl; class PvdDataStream; struct ProfileZoneClient; class PvdProfileZoneClient : public PvdClient, public profile::PxProfileZoneHandler, public PxUserAllocated { PX_NOCOPY(PvdProfileZoneClient) public: PvdProfileZoneClient(PvdImpl& pvd); virtual ~PvdProfileZoneClient(); bool isConnected() const; void onPvdConnected(); void onPvdDisconnected(); void flush(); PvdDataStream* getDataStream(); // PxProfileZoneHandler void onZoneAdded(profile::PxProfileZone& inSDK); void onZoneRemoved(profile::PxProfileZone& inSDK); private: PxMutex mMutex; // zoneAdded can called from different threads PvdImpl& mSDKPvd; PvdDataStream* mPvdDataStream; physx::PxArray<ProfileZoneClient*> mProfileZoneClients; bool mIsConnected; }; } // namespace pvdsdk } // namespace physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventBufferClientManager.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_BUFFER_CLIENT_MANAGER_H #define PX_PROFILE_EVENT_BUFFER_CLIENT_MANAGER_H #include "PxProfileEventBufferClient.h" namespace physx { namespace profile { /** \brief Manager keep collections of PxProfileEventBufferClient clients. @see PxProfileEventBufferClient */ class PxProfileEventBufferClientManager { protected: virtual ~PxProfileEventBufferClientManager(){} public: /** \brief Adds new client. \param inClient Client to add. */ virtual void addClient( PxProfileEventBufferClient& inClient ) = 0; /** \brief Removes a client. \param inClient Client to remove. */ virtual void removeClient( PxProfileEventBufferClient& inClient ) = 0; /** \brief Check if manager has clients. \return True if manager has added clients. */ virtual bool hasClients() const = 0; }; /** \brief Manager keep collections of PxProfileZoneClient clients. @see PxProfileZoneClient */ class PxProfileZoneClientManager { protected: virtual ~PxProfileZoneClientManager(){} public: /** \brief Adds new client. \param inClient Client to add. */ virtual void addClient( PxProfileZoneClient& inClient ) = 0; /** \brief Removes a client. \param inClient Client to remove. */ virtual void removeClient( PxProfileZoneClient& inClient ) = 0; /** \brief Check if manager has clients. \return True if manager has added clients. */ virtual bool hasClients() const = 0; }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileDataBuffer.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_DATA_BUFFER_H #define PX_PROFILE_DATA_BUFFER_H #include "PxProfileAllocatorWrapper.h" #include "PxProfileMemoryBuffer.h" #include "PxProfileEventBufferClient.h" namespace physx { namespace profile { template<typename TMutex , typename TScopedLock> class DataBuffer //base class for buffers that cache data and then dump the data to clients. { public: typedef TMutex TMutexType; typedef TScopedLock TScopedLockType; typedef PxProfileWrapperNamedAllocator TU8AllocatorType; typedef MemoryBuffer<TU8AllocatorType > TMemoryBufferType; typedef PxProfileArray<PxProfileEventBufferClient*> TBufferClientArray; protected: PxProfileAllocatorWrapper mWrapper; TMemoryBufferType mDataArray; TBufferClientArray mBufferClients; uint32_t mBufferFullAmount; EventContextInformation mEventContextInformation; TMutexType* mBufferMutex; volatile bool mHasClients; EventSerializer<TMemoryBufferType > mSerializer; public: DataBuffer( PxAllocatorCallback* inFoundation , uint32_t inBufferFullAmount , TMutexType* inBufferMutex , const char* inAllocationName ) : mWrapper( inFoundation ) , mDataArray( TU8AllocatorType( mWrapper, inAllocationName ) ) , mBufferClients( mWrapper ) , mBufferFullAmount( inBufferFullAmount ) , mBufferMutex( inBufferMutex ) , mHasClients( false ) , mSerializer( &mDataArray ) { //The data array is never resized really. We ensure //it is bigger than it will ever need to be. mDataArray.reserve( inBufferFullAmount + 68 ); } virtual ~DataBuffer() { while(mBufferClients.size() ) { removeClient( *mBufferClients[0] ); } } PxProfileAllocatorWrapper& getWrapper() { return mWrapper; } TMutexType* getBufferMutex() { return mBufferMutex; } void setBufferMutex(TMutexType* mutex) { mBufferMutex = mutex; } void addClient( PxProfileEventBufferClient& inClient ) { TScopedLockType lock( mBufferMutex ); mBufferClients.pushBack( &inClient ); mHasClients = true; } void removeClient( PxProfileEventBufferClient& inClient ) { TScopedLockType lock( mBufferMutex ); for ( uint32_t idx =0; idx < mBufferClients.size(); ++idx ) { if (mBufferClients[idx] == &inClient ) { inClient.handleClientRemoved(); mBufferClients.replaceWithLast( idx ); break; } } mHasClients = mBufferClients.size() != 0; } bool hasClients() const { return mHasClients; } virtual void flushEvents() { TScopedLockType lock(mBufferMutex); const uint8_t* theData = mDataArray.begin(); uint32_t theDataSize = mDataArray.size(); sendDataToClients(theData, theDataSize); mDataArray.clear(); clearCachedData(); } //Used for chaining together event buffers. virtual void handleBufferFlush( const uint8_t* inData, uint32_t inDataSize ) { TScopedLockType lock( mBufferMutex ); if ( inData && inDataSize ) { clearCachedData(); if ( mDataArray.size() + inDataSize >= mBufferFullAmount ) flushEvents(); if ( inDataSize >= mBufferFullAmount ) sendDataToClients( inData, inDataSize ); else mDataArray.write( inData, inDataSize ); } } protected: virtual void clearCachedData() { } private: void sendDataToClients( const uint8_t* inData, uint32_t inDataSize ) { uint32_t clientCount = mBufferClients.size(); for( uint32_t idx =0; idx < clientCount; ++idx ) mBufferClients[idx]->handleBufferFlush( inData, inDataSize ); } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdBits.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_BITS_H #define PX_PVD_BITS_H #include "PxPvdObjectModelBaseTypes.h" namespace physx { namespace pvdsdk { // Marshallers cannot assume src is aligned, but they can assume dest is aligned. typedef void (*TSingleMarshaller)(const uint8_t* src, uint8_t* dest); typedef void (*TBlockMarshaller)(const uint8_t* src, uint8_t* dest, uint32_t numItems); template <uint8_t ByteCount> static inline void doSwapBytes(uint8_t* __restrict inData) { for(uint32_t idx = 0; idx < ByteCount / 2; ++idx) { uint32_t endIdx = ByteCount - idx - 1; uint8_t theTemp = inData[idx]; inData[idx] = inData[endIdx]; inData[endIdx] = theTemp; } } template <uint8_t ByteCount> static inline void doSwapBytes(uint8_t* __restrict inData, uint32_t itemCount) { uint8_t* end = inData + itemCount * ByteCount; for(; inData < end; inData += ByteCount) doSwapBytes<ByteCount>(inData); } static inline void swapBytes(uint8_t* __restrict dataPtr, uint32_t numBytes, uint32_t itemWidth) { uint32_t numItems = numBytes / itemWidth; switch(itemWidth) { case 1: break; case 2: doSwapBytes<2>(dataPtr, numItems); break; case 4: doSwapBytes<4>(dataPtr, numItems); break; case 8: doSwapBytes<8>(dataPtr, numItems); break; case 16: doSwapBytes<16>(dataPtr, numItems); break; default: PX_ASSERT(false); break; } } static inline void swapBytes(uint8_t&) { } static inline void swapBytes(int8_t&) { } static inline void swapBytes(uint16_t& inData) { doSwapBytes<2>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(int16_t& inData) { doSwapBytes<2>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(uint32_t& inData) { doSwapBytes<4>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(int32_t& inData) { doSwapBytes<4>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(float& inData) { doSwapBytes<4>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(uint64_t& inData) { doSwapBytes<8>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(int64_t& inData) { doSwapBytes<8>(reinterpret_cast<uint8_t*>(&inData)); } static inline void swapBytes(double& inData) { doSwapBytes<8>(reinterpret_cast<uint8_t*>(&inData)); } static inline bool checkLength(const uint8_t* inStart, const uint8_t* inStop, uint32_t inLength) { return static_cast<uint32_t>(inStop - inStart) >= inLength; } } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdCommStreamEvents.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_COMM_STREAM_EVENTS_H #define PX_PVD_COMM_STREAM_EVENTS_H #include "foundation/PxVec3.h" #include "foundation/PxFlags.h" #include "foundation/PxTime.h" #include "PxPvdObjectModelBaseTypes.h" namespace physx { namespace pvdsdk { struct CommStreamFlagTypes { enum Enum { Is64BitPtr = 1 }; }; typedef PxFlags<CommStreamFlagTypes::Enum, uint32_t> CommStreamFlags; template <typename TDataType> struct PvdCommVariableSizedEventCheck { bool variable_size_check; }; // Pick out the events that are possibly very large. // This helps us keep our buffers close to the size the user requested. #define DECLARE_TYPE_VARIABLE_SIZED(type) \ template <> \ struct PvdCommVariableSizedEventCheck<type> \ { \ uint32_t variable_size_check; \ }; struct NameHandleValue; struct StreamPropMessageArg; struct StringHandleEvent; struct CreateClass; struct DeriveClass; struct CreateProperty; struct CreatePropertyMessage; struct CreateInstance; struct SetPropertyValue; struct BeginSetPropertyValue; struct AppendPropertyValueData; struct EndSetPropertyValue; struct SetPropertyMessage; struct BeginPropertyMessageGroup; struct SendPropertyMessageFromGroup; struct EndPropertyMessageGroup; struct CreateDestroyInstanceProperty; struct PushBackObjectRef; struct RemoveObjectRef; struct BeginSection; struct EndSection; struct SetPickable; struct SetColor; struct SetIsTopLevel; struct SetCamera; struct AddProfileZone; struct AddProfileZoneEvent; struct StreamEndEvent; struct ErrorMessage; struct OriginShift; struct DestroyInstance; #define DECLARE_COMM_STREAM_EVENTS \ \ DECLARE_PVD_COMM_STREAM_EVENT(StringHandleEvent) \ DECLARE_PVD_COMM_STREAM_EVENT(CreateClass) \ DECLARE_PVD_COMM_STREAM_EVENT(DeriveClass) \ DECLARE_PVD_COMM_STREAM_EVENT(CreateProperty) \ DECLARE_PVD_COMM_STREAM_EVENT(CreatePropertyMessage) \ DECLARE_PVD_COMM_STREAM_EVENT(CreateInstance) \ DECLARE_PVD_COMM_STREAM_EVENT(SetPropertyValue) \ DECLARE_PVD_COMM_STREAM_EVENT(BeginSetPropertyValue) \ DECLARE_PVD_COMM_STREAM_EVENT(AppendPropertyValueData) \ DECLARE_PVD_COMM_STREAM_EVENT(EndSetPropertyValue) \ DECLARE_PVD_COMM_STREAM_EVENT(SetPropertyMessage) \ DECLARE_PVD_COMM_STREAM_EVENT(BeginPropertyMessageGroup) \ DECLARE_PVD_COMM_STREAM_EVENT(SendPropertyMessageFromGroup) \ DECLARE_PVD_COMM_STREAM_EVENT(EndPropertyMessageGroup) \ DECLARE_PVD_COMM_STREAM_EVENT(DestroyInstance) \ DECLARE_PVD_COMM_STREAM_EVENT(PushBackObjectRef) \ DECLARE_PVD_COMM_STREAM_EVENT(RemoveObjectRef) \ DECLARE_PVD_COMM_STREAM_EVENT(BeginSection) \ DECLARE_PVD_COMM_STREAM_EVENT(EndSection) \ DECLARE_PVD_COMM_STREAM_EVENT(SetPickable) \ DECLARE_PVD_COMM_STREAM_EVENT(SetColor) \ DECLARE_PVD_COMM_STREAM_EVENT(SetIsTopLevel) \ DECLARE_PVD_COMM_STREAM_EVENT(SetCamera) \ DECLARE_PVD_COMM_STREAM_EVENT(AddProfileZone) \ DECLARE_PVD_COMM_STREAM_EVENT(AddProfileZoneEvent) \ DECLARE_PVD_COMM_STREAM_EVENT(StreamEndEvent) \ DECLARE_PVD_COMM_STREAM_EVENT(ErrorMessage) \ DECLARE_PVD_COMM_STREAM_EVENT_NO_COMMA(OriginShift) struct PvdCommStreamEventTypes { enum Enum { Unknown = 0, #define DECLARE_PVD_COMM_STREAM_EVENT(x) x, #define DECLARE_PVD_COMM_STREAM_EVENT_NO_COMMA(x) x DECLARE_COMM_STREAM_EVENTS #undef DECLARE_PVD_COMM_STREAM_EVENT_NO_COMMA #undef DECLARE_PVD_COMM_STREAM_EVENT , Last }; }; template <typename TDataType> struct DatatypeToCommEventType { bool compile_error; }; template <PvdCommStreamEventTypes::Enum TEnumType> struct CommEventTypeToDatatype { bool compile_error; }; #define DECLARE_PVD_COMM_STREAM_EVENT(x) \ template <> \ struct DatatypeToCommEventType<x> \ { \ enum Enum \ { \ EEventTypeMap = PvdCommStreamEventTypes::x \ }; \ }; \ template <> \ struct CommEventTypeToDatatype<PvdCommStreamEventTypes::x> \ { \ typedef x TEventType; \ }; #define DECLARE_PVD_COMM_STREAM_EVENT_NO_COMMA(x) \ \ template<> struct DatatypeToCommEventType<x> \ { \ enum Enum \ { \ EEventTypeMap = PvdCommStreamEventTypes::x \ }; \ }; \ \ template<> struct CommEventTypeToDatatype<PvdCommStreamEventTypes::x> \ { \ typedef x TEventType; \ }; DECLARE_COMM_STREAM_EVENTS #undef DECLARE_PVD_COMM_STREAM_EVENT_NO_COMMA #undef DECLARE_PVD_COMM_STREAM_EVENT template <typename TDataType> PvdCommStreamEventTypes::Enum getCommStreamEventType() { return static_cast<PvdCommStreamEventTypes::Enum>(DatatypeToCommEventType<TDataType>::EEventTypeMap); } struct StreamNamespacedName { StringHandle mNamespace; // StringHandle handles StringHandle mName; StreamNamespacedName(StringHandle ns = 0, StringHandle nm = 0) : mNamespace(ns), mName(nm) { } }; class EventSerializeable; class PvdEventSerializer { protected: virtual ~PvdEventSerializer() { } public: virtual void streamify(uint8_t& val) = 0; virtual void streamify(uint16_t& val) = 0; virtual void streamify(uint32_t& val) = 0; virtual void streamify(float& val) = 0; virtual void streamify(uint64_t& val) = 0; virtual void streamify(String& val) = 0; virtual void streamify(DataRef<const uint8_t>& data) = 0; virtual void streamify(DataRef<NameHandleValue>& data) = 0; virtual void streamify(DataRef<StreamPropMessageArg>& data) = 0; virtual void streamify(DataRef<StringHandle>& data) = 0; void streamify(StringHandle& hdl) { streamify(hdl.mHandle); } void streamify(CommStreamFlags& flags) { uint32_t val(flags); streamify(val); flags = CommStreamFlags(val); } void streamify(PvdCommStreamEventTypes::Enum& val) { uint8_t detyped = static_cast<uint8_t>(val); streamify(detyped); val = static_cast<PvdCommStreamEventTypes::Enum>(detyped); } void streamify(PropertyType::Enum& val) { uint8_t detyped = static_cast<uint8_t>(val); streamify(detyped); val = static_cast<PropertyType::Enum>(detyped); } void streamify(bool& val) { uint8_t detyped = uint8_t(val ? 1 : 0); streamify(detyped); val = detyped ? true : false; } void streamify(StreamNamespacedName& name) { streamify(name.mNamespace); streamify(name.mName); } void streamify(PvdColor& color) { streamify(color.r); streamify(color.g); streamify(color.b); streamify(color.a); } void streamify(PxVec3& vec) { streamify(vec.x); streamify(vec.y); streamify(vec.z); } static uint32_t measure(const EventSerializeable& evt); }; class EventSerializeable { protected: virtual ~EventSerializeable() { } public: virtual void serialize(PvdEventSerializer& serializer) = 0; }; /** Numbers generated from random.org 129919156 17973702 401496246 144984007 336950759 907025328 837150850 679717896 601529147 269478202 */ struct StreamInitialization : public EventSerializeable { static uint32_t getStreamId() { return 837150850; } static uint32_t getStreamVersion() { return 1; } uint32_t mStreamId; uint32_t mStreamVersion; uint64_t mTimestampNumerator; uint64_t mTimestampDenominator; CommStreamFlags mStreamFlags; StreamInitialization() : mStreamId(getStreamId()) , mStreamVersion(getStreamVersion()) , mTimestampNumerator(physx::PxTime::getCounterFrequency().mNumerator * 10) , mTimestampDenominator(physx::PxTime::getCounterFrequency().mDenominator) , mStreamFlags(sizeof(void*) == 4 ? 0 : 1) { } void serialize(PvdEventSerializer& s) { s.streamify(mStreamId); s.streamify(mStreamVersion); s.streamify(mTimestampNumerator); s.streamify(mTimestampDenominator); s.streamify(mStreamFlags); } }; struct EventGroup : public EventSerializeable { uint32_t mDataSize; // in bytes, data directly follows this header uint32_t mNumEvents; uint64_t mStreamId; uint64_t mTimestamp; EventGroup(uint32_t dataSize = 0, uint32_t numEvents = 0, uint64_t streamId = 0, uint64_t ts = 0) : mDataSize(dataSize), mNumEvents(numEvents), mStreamId(streamId), mTimestamp(ts) { } void serialize(PvdEventSerializer& s) { s.streamify(mDataSize); s.streamify(mNumEvents); s.streamify(mStreamId); s.streamify(mTimestamp); } }; struct StringHandleEvent : public EventSerializeable { String mString; uint32_t mHandle; StringHandleEvent(String str, uint32_t hdl) : mString(str), mHandle(hdl) { } StringHandleEvent() { } void serialize(PvdEventSerializer& s) { s.streamify(mString); s.streamify(mHandle); } }; DECLARE_TYPE_VARIABLE_SIZED(StringHandleEvent) typedef uint64_t Timestamp; struct CreateClass : public EventSerializeable { StreamNamespacedName mName; CreateClass(StreamNamespacedName nm) : mName(nm) { } CreateClass() { } void serialize(PvdEventSerializer& s) { s.streamify(mName); } }; struct DeriveClass : public EventSerializeable { StreamNamespacedName mParent; StreamNamespacedName mChild; DeriveClass(StreamNamespacedName p, StreamNamespacedName c) : mParent(p), mChild(c) { } DeriveClass() { } void serialize(PvdEventSerializer& s) { s.streamify(mParent); s.streamify(mChild); } }; struct NameHandleValue : public EventSerializeable { StringHandle mName; uint32_t mValue; NameHandleValue(StringHandle name, uint32_t val) : mName(name), mValue(val) { } NameHandleValue() { } void serialize(PvdEventSerializer& s) { s.streamify(mName); s.streamify(mValue); } }; /*virtual PvdError createProperty( StreamNamespacedName clsName, StringHandle name, StringHandle semantic , StreamNamespacedName dtypeName, PropertyType::Enum propertyType , DataRef<NamedValue> values = DataRef<NamedValue>() ) = 0; */ struct CreateProperty : public EventSerializeable { StreamNamespacedName mClass; StringHandle mName; StringHandle mSemantic; StreamNamespacedName mDatatypeName; PropertyType::Enum mPropertyType; DataRef<NameHandleValue> mValues; CreateProperty(StreamNamespacedName cls, StringHandle name, StringHandle semantic, StreamNamespacedName dtypeName, PropertyType::Enum ptype, DataRef<NameHandleValue> values) : mClass(cls), mName(name), mSemantic(semantic), mDatatypeName(dtypeName), mPropertyType(ptype), mValues(values) { } CreateProperty() { } void serialize(PvdEventSerializer& s) { s.streamify(mClass); s.streamify(mName); s.streamify(mSemantic); s.streamify(mDatatypeName); s.streamify(mPropertyType); s.streamify(mValues); } }; struct StreamPropMessageArg : public EventSerializeable { StringHandle mPropertyName; StreamNamespacedName mDatatypeName; uint32_t mMessageOffset; uint32_t mByteSize; StreamPropMessageArg(StringHandle pname, StreamNamespacedName dtypeName, uint32_t offset, uint32_t byteSize) : mPropertyName(pname), mDatatypeName(dtypeName), mMessageOffset(offset), mByteSize(byteSize) { } StreamPropMessageArg() { } void serialize(PvdEventSerializer& s) { s.streamify(mPropertyName); s.streamify(mDatatypeName); s.streamify(mMessageOffset); s.streamify(mByteSize); } }; /* virtual PvdError createPropertyMessage( StreamNamespacedName cls, StreamNamespacedName msgName , DataRef<PropertyMessageArg> entries, uint32_t messageSizeInBytes ) = 0;*/ struct CreatePropertyMessage : public EventSerializeable { StreamNamespacedName mClass; StreamNamespacedName mMessageName; DataRef<StreamPropMessageArg> mMessageEntries; uint32_t mMessageByteSize; CreatePropertyMessage(StreamNamespacedName cls, StreamNamespacedName msgName, DataRef<StreamPropMessageArg> propArg, uint32_t messageByteSize) : mClass(cls), mMessageName(msgName), mMessageEntries(propArg), mMessageByteSize(messageByteSize) { } CreatePropertyMessage() { } void serialize(PvdEventSerializer& s) { s.streamify(mClass); s.streamify(mMessageName); s.streamify(mMessageEntries); s.streamify(mMessageByteSize); } }; /**Changing immediate data on instances*/ // virtual PvdError createInstance( StreamNamespacedName cls, uint64_t instance ) = 0; struct CreateInstance : public EventSerializeable { StreamNamespacedName mClass; uint64_t mInstanceId; CreateInstance(StreamNamespacedName cls, uint64_t streamId) : mClass(cls), mInstanceId(streamId) { } CreateInstance() { } void serialize(PvdEventSerializer& s) { s.streamify(mClass); s.streamify(mInstanceId); } }; // virtual PvdError setPropertyValue( uint64_t instance, StringHandle name, DataRef<const uint8_t> data, // StreamNamespacedName incomingTypeName ) = 0; struct SetPropertyValue : public EventSerializeable { uint64_t mInstanceId; StringHandle mPropertyName; DataRef<const uint8_t> mData; StreamNamespacedName mIncomingTypeName; uint32_t mNumItems; SetPropertyValue(uint64_t instance, StringHandle name, DataRef<const uint8_t> data, StreamNamespacedName incomingTypeName, uint32_t numItems) : mInstanceId(instance), mPropertyName(name), mData(data), mIncomingTypeName(incomingTypeName), mNumItems(numItems) { } SetPropertyValue() { } void serializeBeginning(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mPropertyName); s.streamify(mIncomingTypeName); s.streamify(mNumItems); } void serialize(PvdEventSerializer& s) { serializeBeginning(s); s.streamify(mData); } }; DECLARE_TYPE_VARIABLE_SIZED(SetPropertyValue) struct BeginSetPropertyValue : public EventSerializeable { uint64_t mInstanceId; StringHandle mPropertyName; StreamNamespacedName mIncomingTypeName; BeginSetPropertyValue(uint64_t instance, StringHandle name, StreamNamespacedName incomingTypeName) : mInstanceId(instance), mPropertyName(name), mIncomingTypeName(incomingTypeName) { } BeginSetPropertyValue() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mPropertyName); s.streamify(mIncomingTypeName); } }; // virtual PvdError appendPropertyValueData( DataRef<const uint8_t> data ) = 0; struct AppendPropertyValueData : public EventSerializeable { DataRef<const uint8_t> mData; uint32_t mNumItems; AppendPropertyValueData(DataRef<const uint8_t> data, uint32_t numItems) : mData(data), mNumItems(numItems) { } AppendPropertyValueData() { } void serialize(PvdEventSerializer& s) { s.streamify(mData); s.streamify(mNumItems); } }; DECLARE_TYPE_VARIABLE_SIZED(AppendPropertyValueData) // virtual PvdError endSetPropertyValue() = 0; struct EndSetPropertyValue : public EventSerializeable { EndSetPropertyValue() { } void serialize(PvdEventSerializer&) { } }; // virtual PvdError setPropertyMessage( uint64_t instance, StreamNamespacedName msgName, DataRef<const uint8_t> data ) = // 0; struct SetPropertyMessage : public EventSerializeable { uint64_t mInstanceId; StreamNamespacedName mMessageName; DataRef<const uint8_t> mData; SetPropertyMessage(uint64_t instance, StreamNamespacedName msgName, DataRef<const uint8_t> data) : mInstanceId(instance), mMessageName(msgName), mData(data) { } SetPropertyMessage() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mMessageName); s.streamify(mData); } }; DECLARE_TYPE_VARIABLE_SIZED(SetPropertyMessage) // virtual PvdError beginPropertyMessageGroup( StreamNamespacedName msgName ) = 0; struct BeginPropertyMessageGroup : public EventSerializeable { StreamNamespacedName mMsgName; BeginPropertyMessageGroup(StreamNamespacedName msgName) : mMsgName(msgName) { } BeginPropertyMessageGroup() { } void serialize(PvdEventSerializer& s) { s.streamify(mMsgName); } }; // virtual PvdError sendPropertyMessageFromGroup( uint64_t instance, DataRef<const uint8_t*> data ) = 0; struct SendPropertyMessageFromGroup : public EventSerializeable { uint64_t mInstance; DataRef<const uint8_t> mData; SendPropertyMessageFromGroup(uint64_t instance, DataRef<const uint8_t> data) : mInstance(instance), mData(data) { } SendPropertyMessageFromGroup() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstance); s.streamify(mData); } }; DECLARE_TYPE_VARIABLE_SIZED(SendPropertyMessageFromGroup) // virtual PvdError endPropertyMessageGroup() = 0; struct EndPropertyMessageGroup : public EventSerializeable { EndPropertyMessageGroup() { } void serialize(PvdEventSerializer&) { } }; struct PushBackObjectRef : public EventSerializeable { uint64_t mInstanceId; StringHandle mProperty; uint64_t mObjectRef; PushBackObjectRef(uint64_t instId, StringHandle prop, uint64_t objRef) : mInstanceId(instId), mProperty(prop), mObjectRef(objRef) { } PushBackObjectRef() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mProperty); s.streamify(mObjectRef); } }; struct RemoveObjectRef : public EventSerializeable { uint64_t mInstanceId; StringHandle mProperty; uint64_t mObjectRef; RemoveObjectRef(uint64_t instId, StringHandle prop, uint64_t objRef) : mInstanceId(instId), mProperty(prop), mObjectRef(objRef) { } RemoveObjectRef() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mProperty); s.streamify(mObjectRef); } }; // virtual PvdError destroyInstance( uint64_t key ) = 0; struct DestroyInstance : public EventSerializeable { uint64_t mInstanceId; DestroyInstance(uint64_t instance) : mInstanceId(instance) { } DestroyInstance() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); } }; // virtual PvdError beginSection( uint64_t sectionId, StringHandle name ) = 0; struct BeginSection : public EventSerializeable { uint64_t mSectionId; StringHandle mName; Timestamp mTimestamp; BeginSection(uint64_t sectionId, StringHandle name, uint64_t timestamp) : mSectionId(sectionId), mName(name), mTimestamp(timestamp) { } BeginSection() { } void serialize(PvdEventSerializer& s) { s.streamify(mSectionId); s.streamify(mName); s.streamify(mTimestamp); } }; // virtual PvdError endSection( uint64_t sectionId, StringHandle name ) = 0; struct EndSection : public EventSerializeable { uint64_t mSectionId; StringHandle mName; Timestamp mTimestamp; EndSection(uint64_t sectionId, StringHandle name, uint64_t timestamp) : mSectionId(sectionId), mName(name), mTimestamp(timestamp) { } EndSection() { } void serialize(PvdEventSerializer& s) { s.streamify(mSectionId); s.streamify(mName); s.streamify(mTimestamp); } }; // virtual void setPickable( void* instance, bool pickable ) = 0; struct SetPickable : public EventSerializeable { uint64_t mInstanceId; bool mPickable; SetPickable(uint64_t instId, bool pick) : mInstanceId(instId), mPickable(pick) { } SetPickable() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mPickable); } }; // virtual void setColor( void* instance, const PvdColor& color ) = 0; struct SetColor : public EventSerializeable { uint64_t mInstanceId; PvdColor mColor; SetColor(uint64_t instId, PvdColor color) : mInstanceId(instId), mColor(color) { } SetColor() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mColor); } }; // virtual void setColor( void* instance, const PvdColor& color ) = 0; struct SetIsTopLevel : public EventSerializeable { uint64_t mInstanceId; bool mIsTopLevel; SetIsTopLevel(uint64_t instId, bool topLevel) : mInstanceId(instId), mIsTopLevel(topLevel) { } SetIsTopLevel() : mIsTopLevel(false) { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mIsTopLevel); } }; struct SetCamera : public EventSerializeable { String mName; PxVec3 mPosition; PxVec3 mUp; PxVec3 mTarget; SetCamera(String name, const PxVec3& pos, const PxVec3& up, const PxVec3& target) : mName(name), mPosition(pos), mUp(up), mTarget(target) { } SetCamera() : mName(NULL) { } void serialize(PvdEventSerializer& s) { s.streamify(mName); s.streamify(mPosition); s.streamify(mUp); s.streamify(mTarget); } }; struct ErrorMessage : public EventSerializeable { uint32_t mCode; String mMessage; String mFile; uint32_t mLine; ErrorMessage(uint32_t code, String message, String file, uint32_t line) : mCode(code), mMessage(message), mFile(file), mLine(line) { } ErrorMessage() : mMessage(NULL), mFile(NULL) { } void serialize(PvdEventSerializer& s) { s.streamify(mCode); s.streamify(mMessage); s.streamify(mFile); s.streamify(mLine); } }; struct AddProfileZone : public EventSerializeable { uint64_t mInstanceId; String mName; AddProfileZone(uint64_t iid, String nm) : mInstanceId(iid), mName(nm) { } AddProfileZone() : mName(NULL) { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mName); } }; struct AddProfileZoneEvent : public EventSerializeable { uint64_t mInstanceId; String mName; uint16_t mEventId; bool mCompileTimeEnabled; AddProfileZoneEvent(uint64_t iid, String nm, uint16_t eid, bool cte) : mInstanceId(iid), mName(nm), mEventId(eid), mCompileTimeEnabled(cte) { } AddProfileZoneEvent() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mName); s.streamify(mEventId); s.streamify(mCompileTimeEnabled); } }; struct StreamEndEvent : public EventSerializeable { String mName; StreamEndEvent() : mName("StreamEnd") { } void serialize(PvdEventSerializer& s) { s.streamify(mName); } }; struct OriginShift : public EventSerializeable { uint64_t mInstanceId; PxVec3 mShift; OriginShift(uint64_t iid, const PxVec3& shift) : mInstanceId(iid), mShift(shift) { } OriginShift() { } void serialize(PvdEventSerializer& s) { s.streamify(mInstanceId); s.streamify(mShift); } }; } // pvdsdk } // physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdProfileZoneClient.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdImpl.h" #include "PxPvdProfileZoneClient.h" #include "PxPvdProfileZone.h" namespace physx { namespace pvdsdk { struct ProfileZoneClient : public profile::PxProfileZoneClient, public PxUserAllocated { profile::PxProfileZone& mZone; PvdDataStream& mStream; ProfileZoneClient(profile::PxProfileZone& zone, PvdDataStream& stream) : mZone(zone), mStream(stream) { } ~ProfileZoneClient() { mZone.removeClient(*this); } virtual void createInstance() { mStream.addProfileZone(&mZone, mZone.getName()); mStream.createInstance(&mZone); mZone.addClient(*this); profile::PxProfileNames names(mZone.getProfileNames()); PVD_FOREACH(idx, names.eventCount) { handleEventAdded(names.events[idx]); } } virtual void handleEventAdded(const profile::PxProfileEventName& inName) { mStream.addProfileZoneEvent(&mZone, inName.name, inName.eventId.eventId, inName.eventId.compileTimeEnabled); } virtual void handleBufferFlush(const uint8_t* inData, uint32_t inLength) { mStream.setPropertyValue(&mZone, "events", inData, inLength); } virtual void handleClientRemoved() { mStream.destroyInstance(&mZone); } private: ProfileZoneClient& operator=(const ProfileZoneClient&); }; } } using namespace physx; using namespace pvdsdk; PvdProfileZoneClient::PvdProfileZoneClient(PvdImpl& pvd) : mSDKPvd(pvd), mPvdDataStream(NULL), mIsConnected(false) { } PvdProfileZoneClient::~PvdProfileZoneClient() { mSDKPvd.removeClient(this); // all zones should removed PX_ASSERT(mProfileZoneClients.size() == 0); } PvdDataStream* PvdProfileZoneClient::getDataStream() { return mPvdDataStream; } bool PvdProfileZoneClient::isConnected() const { return mIsConnected; } void PvdProfileZoneClient::onPvdConnected() { if(mIsConnected) return; mIsConnected = true; mPvdDataStream = PvdDataStream::create(&mSDKPvd); } void PvdProfileZoneClient::onPvdDisconnected() { if(!mIsConnected) return; mIsConnected = false; flush(); mPvdDataStream->release(); mPvdDataStream = NULL; } void PvdProfileZoneClient::flush() { PVD_FOREACH(idx, mProfileZoneClients.size()) mProfileZoneClients[idx]->mZone.flushProfileEvents(); } void PvdProfileZoneClient::onZoneAdded(profile::PxProfileZone& zone) { PX_ASSERT(mIsConnected); ProfileZoneClient* client = PVD_NEW(ProfileZoneClient)(zone, *mPvdDataStream); mMutex.lock(); client->createInstance(); mProfileZoneClients.pushBack(client); mMutex.unlock(); } void PvdProfileZoneClient::onZoneRemoved(profile::PxProfileZone& zone) { for(uint32_t i = 0; i < mProfileZoneClients.size(); i++) { if(&zone == &mProfileZoneClients[i]->mZone) { mMutex.lock(); ProfileZoneClient* client = mProfileZoneClients[i]; mProfileZoneClients.replaceWithLast(i); PVD_DELETE(client); mMutex.unlock(); return; } } }
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileEventBufferClient.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_EVENT_BUFFER_CLIENT_H #define PX_PROFILE_EVENT_BUFFER_CLIENT_H #include "PxProfileEventNames.h" namespace physx { namespace profile { /** \brief Client handles the data when an event buffer flushes. This data can be parsed (PxProfileEventHandler.h) as a binary set of events. */ class PxProfileEventBufferClient { protected: virtual ~PxProfileEventBufferClient(){} public: /** \brief Callback when the event buffer is full. This data is serialized profile events and can be read back using: PxProfileEventHandler::parseEventBuffer. \param inData Provided buffer data. \param inLength Data length. @see PxProfileEventHandler::parseEventBuffer. */ virtual void handleBufferFlush( const uint8_t* inData, uint32_t inLength ) = 0; /** \brief Happens if something removes all the clients from the manager. */ virtual void handleClientRemoved() = 0; }; /** \brief Client handles new profile event add. */ class PxProfileZoneClient : public PxProfileEventBufferClient { protected: virtual ~PxProfileZoneClient(){} public: /** \brief Callback when new profile event is added. \param inName Added profile event name. */ virtual void handleEventAdded( const PxProfileEventName& inName ) = 0; }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdUserRenderImpl.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_USER_RENDER_IMPL_H #define PX_PVD_USER_RENDER_IMPL_H #include "PxPvdUserRenderer.h" namespace physx { namespace pvdsdk { struct PvdUserRenderTypes { enum Enum { Unknown = 0, #define DECLARE_PVD_IMMEDIATE_RENDER_TYPE(type) type, #define DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA(type) type #include "PxPvdUserRenderTypes.h" #undef DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA #undef DECLARE_PVD_IMMEDIATE_RENDER_TYPE }; }; class RenderSerializer { protected: virtual ~RenderSerializer() { } public: virtual void streamify(uint64_t& val) = 0; virtual void streamify(float& val) = 0; virtual void streamify(uint32_t& val) = 0; virtual void streamify(uint8_t& val) = 0; virtual void streamify(DataRef<uint8_t>& val) = 0; virtual void streamify(DataRef<PxDebugPoint>& val) = 0; virtual void streamify(DataRef<PxDebugLine>& val) = 0; virtual void streamify(DataRef<PxDebugTriangle>& val) = 0; virtual void streamify(PxDebugText& val) = 0; virtual bool isGood() = 0; virtual uint32_t hasData() = 0; void streamify(PvdUserRenderTypes::Enum& val) { uint8_t data = static_cast<uint8_t>(val); streamify(data); val = static_cast<PvdUserRenderTypes::Enum>(data); } void streamify(PxVec3& val) { streamify(val[0]); streamify(val[1]); streamify(val[2]); } void streamify(PvdColor& val) { streamify(val.r); streamify(val.g); streamify(val.b); streamify(val.a); } void streamify(PxTransform& val) { streamify(val.q.x); streamify(val.q.y); streamify(val.q.z); streamify(val.q.w); streamify(val.p.x); streamify(val.p.y); streamify(val.p.z); } void streamify(bool& val) { uint8_t tempVal = uint8_t(val ? 1 : 0); streamify(tempVal); val = tempVal ? true : false; } }; template <typename TBulkRenderType> struct BulkRenderEvent { DataRef<TBulkRenderType> mData; BulkRenderEvent(const TBulkRenderType* data, uint32_t count) : mData(data, count) { } BulkRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(mData); } }; struct SetInstanceIdRenderEvent { uint64_t mInstanceId; SetInstanceIdRenderEvent(uint64_t iid) : mInstanceId(iid) { } SetInstanceIdRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(mInstanceId); } }; struct PointsRenderEvent : BulkRenderEvent<PxDebugPoint> { PointsRenderEvent(const PxDebugPoint* data, uint32_t count) : BulkRenderEvent<PxDebugPoint>(data, count) { } PointsRenderEvent() { } }; struct LinesRenderEvent : BulkRenderEvent<PxDebugLine> { LinesRenderEvent(const PxDebugLine* data, uint32_t count) : BulkRenderEvent<PxDebugLine>(data, count) { } LinesRenderEvent() { } }; struct TrianglesRenderEvent : BulkRenderEvent<PxDebugTriangle> { TrianglesRenderEvent(const PxDebugTriangle* data, uint32_t count) : BulkRenderEvent<PxDebugTriangle>(data, count) { } TrianglesRenderEvent() { } }; struct DebugRenderEvent { DataRef<PxDebugPoint> mPointData; DataRef<PxDebugLine> mLineData; DataRef<PxDebugTriangle> mTriangleData; DebugRenderEvent(const PxDebugPoint* pointData, uint32_t pointCount, const PxDebugLine* lineData, uint32_t lineCount, const PxDebugTriangle* triangleData, uint32_t triangleCount) : mPointData(pointData, pointCount), mLineData(lineData, lineCount), mTriangleData(triangleData, triangleCount) { } DebugRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(mPointData); serializer.streamify(mLineData); serializer.streamify(mTriangleData); } }; struct TextRenderEvent { PxDebugText mText; TextRenderEvent(const PxDebugText& text) { mText.color = text.color; mText.position = text.position; mText.size = text.size; mText.string = text.string; } TextRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(mText); } }; struct JointFramesRenderEvent { PxTransform parent; PxTransform child; JointFramesRenderEvent(const PxTransform& p, const PxTransform& c) : parent(p), child(c) { } JointFramesRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(parent); serializer.streamify(child); } }; struct LinearLimitRenderEvent { PxTransform t0; PxTransform t1; float value; bool active; LinearLimitRenderEvent(const PxTransform& _t0, const PxTransform& _t1, float _value, bool _active) : t0(_t0), t1(_t1), value(_value), active(_active) { } LinearLimitRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(t0); serializer.streamify(t1); serializer.streamify(value); serializer.streamify(active); } }; struct AngularLimitRenderEvent { PxTransform t0; float lower; float upper; bool active; AngularLimitRenderEvent(const PxTransform& _t0, float _lower, float _upper, bool _active) : t0(_t0), lower(_lower), upper(_upper), active(_active) { } AngularLimitRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(t0); serializer.streamify(lower); serializer.streamify(upper); serializer.streamify(active); } }; struct LimitConeRenderEvent { PxTransform t; float ySwing; float zSwing; bool active; LimitConeRenderEvent(const PxTransform& _t, float _ySwing, float _zSwing, bool _active) : t(_t), ySwing(_ySwing), zSwing(_zSwing), active(_active) { } LimitConeRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(t); serializer.streamify(ySwing); serializer.streamify(zSwing); serializer.streamify(active); } }; struct DoubleConeRenderEvent { PxTransform t; float angle; bool active; DoubleConeRenderEvent(const PxTransform& _t, float _angle, bool _active) : t(_t), angle(_angle), active(_active) { } DoubleConeRenderEvent() { } void serialize(RenderSerializer& serializer) { serializer.streamify(t); serializer.streamify(angle); serializer.streamify(active); } }; template <typename TDataType> struct RenderSerializerMap { void serialize(RenderSerializer& s, TDataType& d) { d.serialize(s); } }; template <> struct RenderSerializerMap<uint8_t> { void serialize(RenderSerializer& s, uint8_t& d) { s.streamify(d); } }; template <> struct RenderSerializerMap<PxDebugPoint> { void serialize(RenderSerializer& s, PxDebugPoint& d) { s.streamify(d.pos); s.streamify(d.color); } }; template <> struct RenderSerializerMap<PxDebugLine> { void serialize(RenderSerializer& s, PxDebugLine& d) { s.streamify(d.pos0); s.streamify(d.color0); s.streamify(d.pos1); s.streamify(d.color1); } }; template <> struct RenderSerializerMap<PxDebugTriangle> { void serialize(RenderSerializer& s, PxDebugTriangle& d) { s.streamify(d.pos0); s.streamify(d.color0); s.streamify(d.pos1); s.streamify(d.color1); s.streamify(d.pos2); s.streamify(d.color2); } }; template <typename TDataType> struct PvdTypeToRenderType { bool compile_error; }; #define DECLARE_PVD_IMMEDIATE_RENDER_TYPE(type) \ template <> \ struct PvdTypeToRenderType<type##RenderEvent> \ { \ enum Enum \ { \ EnumVal = PvdUserRenderTypes::type \ }; \ }; #include "PxPvdUserRenderTypes.h" #undef DECLARE_PVD_IMMEDIATE_RENDER_TYPE template <typename TDataType> PvdUserRenderTypes::Enum getPvdRenderTypeFromType() { return static_cast<PvdUserRenderTypes::Enum>(PvdTypeToRenderType<TDataType>::EnumVal); } } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileZoneImpl.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_ZONE_IMPL_H #define PX_PROFILE_ZONE_IMPL_H #include "PxPvdProfileZone.h" #include "PxProfileZoneManager.h" #include "PxProfileContextProviderImpl.h" #include "PxProfileScopedMutexLock.h" #include "PxProfileEventBufferAtomic.h" #include "foundation/PxMutex.h" namespace physx { namespace profile { /** \brief Simple event filter that enables all events. */ struct PxProfileNullEventFilter { void setEventEnabled( const PxProfileEventId&, bool) { PX_ASSERT(false); } bool isEventEnabled( const PxProfileEventId&) const { return true; } }; typedef PxMutexT<PxProfileWrapperReflectionAllocator<uint8_t> > TZoneMutexType; typedef ScopedLockImpl<TZoneMutexType> TZoneLockType; typedef EventBuffer< PxDefaultContextProvider, TZoneMutexType, TZoneLockType, PxProfileNullEventFilter > TZoneEventBufferType; //typedef EventBufferAtomic< PxDefaultContextProvider, TZoneMutexType, TZoneLockType, PxProfileNullEventFilter > TZoneEventBufferType; template<typename TNameProvider> class ZoneImpl : TZoneEventBufferType //private inheritance intended , public PxProfileZone , public PxProfileEventBufferClient { typedef PxMutexT<PxProfileWrapperReflectionAllocator<uint8_t> > TMutexType; typedef PxProfileHashMap<const char*, uint32_t> TNameToEvtIndexMap; //ensure we don't reuse event ids. typedef PxProfileHashMap<uint16_t, const char*> TEvtIdToNameMap; typedef TMutexType::ScopedLock TLockType; const char* mName; mutable TMutexType mMutex; PxProfileArray<PxProfileEventName> mEventNames; // to avoid locking, read-only and read-write map exist TNameToEvtIndexMap mNameToEvtIndexMapR; TNameToEvtIndexMap mNameToEvtIndexMapRW; //ensure we don't reuse event ids. TEvtIdToNameMap mEvtIdToNameMap; PxProfileZoneManager* mProfileZoneManager; PxProfileArray<PxProfileZoneClient*> mZoneClients; volatile bool mEventsActive; PX_NOCOPY(ZoneImpl<TNameProvider>) public: ZoneImpl( PxAllocatorCallback* inAllocator, const char* inName, uint32_t bufferSize = 0x10000 /*64k*/, const TNameProvider& inProvider = TNameProvider() ) : TZoneEventBufferType( inAllocator, bufferSize, PxDefaultContextProvider(), NULL, PxProfileNullEventFilter() ) , mName( inName ) , mMutex( PxProfileWrapperReflectionAllocator<uint8_t>( mWrapper ) ) , mEventNames( mWrapper ) , mNameToEvtIndexMapR( mWrapper ) , mNameToEvtIndexMapRW( mWrapper ) , mEvtIdToNameMap( mWrapper ) , mProfileZoneManager( NULL ) , mZoneClients( mWrapper ) , mEventsActive( false ) { TZoneEventBufferType::setBufferMutex( &mMutex ); //Initialize the event name structure with existing names from the name provider. PxProfileNames theNames( inProvider.getProfileNames() ); for ( uint32_t idx = 0; idx < theNames.eventCount; ++idx ) { const PxProfileEventName& theName (theNames.events[idx]); doAddName( theName.name, theName.eventId.eventId, theName.eventId.compileTimeEnabled ); } TZoneEventBufferType::addClient( *this ); } virtual ~ZoneImpl() { if ( mProfileZoneManager != NULL ) mProfileZoneManager->removeProfileZone( *this ); mProfileZoneManager = NULL; TZoneEventBufferType::removeClient( *this ); } void doAddName( const char* inName, uint16_t inEventId, bool inCompileTimeEnabled ) { TLockType theLocker( mMutex ); mEvtIdToNameMap.insert( inEventId, inName ); uint32_t idx = static_cast<uint32_t>( mEventNames.size() ); mNameToEvtIndexMapRW.insert( inName, idx ); mEventNames.pushBack( PxProfileEventName( inName, PxProfileEventId( inEventId, inCompileTimeEnabled ) ) ); } virtual void flushEventIdNameMap() { // copy the RW map into R map if (mNameToEvtIndexMapRW.size()) { for (TNameToEvtIndexMap::Iterator iter = mNameToEvtIndexMapRW.getIterator(); !iter.done(); ++iter) { mNameToEvtIndexMapR.insert(iter->first, iter->second); } mNameToEvtIndexMapRW.clear(); } } virtual uint16_t getEventIdForName( const char* inName ) { return getEventIdsForNames( &inName, 1 ); } virtual uint16_t getEventIdsForNames( const char** inNames, uint32_t inLen ) { if ( inLen == 0 ) return 0; // search the read-only map first const TNameToEvtIndexMap::Entry* theEntry( mNameToEvtIndexMapR.find( inNames[0] ) ); if ( theEntry ) return mEventNames[theEntry->second].eventId; TLockType theLocker(mMutex); const TNameToEvtIndexMap::Entry* theReEntry(mNameToEvtIndexMapRW.find(inNames[0])); if (theReEntry) return mEventNames[theReEntry->second].eventId; //Else git R dun. uint16_t nameSize = static_cast<uint16_t>( mEventNames.size() ); //We don't allow 0 as an event id. uint16_t eventId = nameSize; //Find a contiguous set of unique event ids bool foundAnEventId = false; do { foundAnEventId = false; ++eventId; for ( uint16_t idx = 0; idx < inLen && foundAnEventId == false; ++idx ) foundAnEventId = mEvtIdToNameMap.find( uint16_t(eventId + idx) ) != NULL; } while( foundAnEventId ); uint32_t clientCount = mZoneClients.size(); for ( uint16_t nameIdx = 0; nameIdx < inLen; ++nameIdx ) { uint16_t newId = uint16_t(eventId + nameIdx); doAddName( inNames[nameIdx], newId, true ); for( uint32_t clientIdx =0; clientIdx < clientCount; ++clientIdx ) mZoneClients[clientIdx]->handleEventAdded( PxProfileEventName( inNames[nameIdx], PxProfileEventId( newId ) ) ); } return eventId; } virtual void setProfileZoneManager(PxProfileZoneManager* inMgr) { mProfileZoneManager = inMgr; } virtual PxProfileZoneManager* getProfileZoneManager() { return mProfileZoneManager; } const char* getName() { return mName; } PxProfileEventBufferClient* getEventBufferClient() { return this; } //SDK implementation void addClient( PxProfileZoneClient& inClient ) { TLockType lock( mMutex ); mZoneClients.pushBack( &inClient ); mEventsActive = true; } void removeClient( PxProfileZoneClient& inClient ) { TLockType lock( mMutex ); for ( uint32_t idx =0; idx < mZoneClients.size(); ++idx ) { if (mZoneClients[idx] == &inClient ) { inClient.handleClientRemoved(); mZoneClients.replaceWithLast( idx ); break; } } mEventsActive = mZoneClients.size() != 0; } virtual bool hasClients() const { return mEventsActive; } virtual PxProfileNames getProfileNames() const { TLockType theLocker( mMutex ); const PxProfileEventName* theNames = mEventNames.begin(); uint32_t theEventCount = uint32_t(mEventNames.size()); return PxProfileNames( theEventCount, theNames ); } virtual void release() { PX_PROFILE_DELETE( mWrapper.getAllocator(), this ); } //Implementation chaining the buffer flush to our clients virtual void handleBufferFlush( const uint8_t* inData, uint32_t inLength ) { TLockType theLocker( mMutex ); uint32_t clientCount = mZoneClients.size(); for( uint32_t idx =0; idx < clientCount; ++idx ) mZoneClients[idx]->handleBufferFlush( inData, inLength ); } //Happens if something removes all the clients from the manager. virtual void handleClientRemoved() {} //Send a profile event, optionally with a context. Events are sorted by thread //and context in the client side. virtual void startEvent( uint16_t inId, uint64_t contextId) { if( mEventsActive ) { TZoneEventBufferType::startEvent( inId, contextId ); } } virtual void stopEvent( uint16_t inId, uint64_t contextId) { if( mEventsActive ) { TZoneEventBufferType::stopEvent( inId, contextId ); } } virtual void startEvent( uint16_t inId, uint64_t contextId, uint32_t threadId) { if( mEventsActive ) { TZoneEventBufferType::startEvent( inId, contextId, threadId ); } } virtual void stopEvent( uint16_t inId, uint64_t contextId, uint32_t threadId ) { if( mEventsActive ) { TZoneEventBufferType::stopEvent( inId, contextId, threadId ); } } virtual void atEvent(uint16_t inId, uint64_t contextId, uint32_t threadId, uint64_t start, uint64_t stop) { if (mEventsActive) { TZoneEventBufferType::startEvent(inId, threadId, contextId, 0, 0, start); TZoneEventBufferType::stopEvent(inId, threadId, contextId, 0, 0, stop); } } /** * Set an specific events value. This is different than the profiling value * for the event; it is a value recorded and kept around without a timestamp associated * with it. This value is displayed when the event itself is processed. */ virtual void eventValue( uint16_t inId, uint64_t contextId, int64_t inValue ) { if( mEventsActive ) { TZoneEventBufferType::eventValue( inId, contextId, inValue ); } } virtual void flushProfileEvents() { TZoneEventBufferType::flushProfileEvents(); } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileZoneManager.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PROFILE_ZONE_MANAGER_H #define PX_PROFILE_ZONE_MANAGER_H #include "PxProfileEventSender.h" #include "PxProfileEventNames.h" namespace physx { class PxAllocatorCallback; namespace profile { class PxProfileZone; class PxProfileNameProvider; /** \brief Profile zone handler for zone add/remove notification. */ class PxProfileZoneHandler { protected: virtual ~PxProfileZoneHandler(){} public: /** \brief On zone added notification \note Not a threadsafe call; handlers are expected to be able to handle this from any thread. \param inSDK Added zone. */ virtual void onZoneAdded( PxProfileZone& inSDK ) = 0; /** \brief On zone removed notification \note Not a threadsafe call; handlers are expected to be able to handle this from any thread. \param inSDK removed zone. */ virtual void onZoneRemoved( PxProfileZone& inSDK ) = 0; }; /** \brief The profiling system was setup in the expectation that there would be several systems that each had its own island of profile information. PhysX, client code, and APEX would be the first examples of these. Each one of these islands is represented by a profile zone. The Manager is a singleton-like object where all these different systems can be registered so that clients of the profiling system can have one point to capture *all* profiling events. Flushing the manager implies that you want to loop through all the profile zones and flush each one. @see PxProfileEventFlusher */ class PxProfileZoneManager : public PxProfileEventFlusher //Tell all SDK's to flush their queue of profile events. { protected: virtual ~PxProfileZoneManager(){} public: /** \brief Add new profile zone for the manager. \note Threadsafe call, can be done from any thread. Handlers that are already connected will get a new callback on the current thread. \param inSDK Profile zone to add. */ virtual void addProfileZone( PxProfileZone& inSDK ) = 0; /** \brief Removes profile zone from the manager. \note Threadsafe call, can be done from any thread. Handlers that are already connected will get a new callback on the current thread. \param inSDK Profile zone to remove. */ virtual void removeProfileZone( PxProfileZone& inSDK ) = 0; /** \brief Add profile zone handler callback for the profile zone notifications. \note Threadsafe call. The new handler will immediately be notified about all known SDKs. \param inHandler Profile zone handler to add. */ virtual void addProfileZoneHandler( PxProfileZoneHandler& inHandler ) = 0; /** \brief Removes profile zone handler callback for the profile zone notifications. \note Threadsafe call. The new handler will immediately be notified about all known SDKs. \param inHandler Profile zone handler to remove. */ virtual void removeProfileZoneHandler( PxProfileZoneHandler& inHandler ) = 0; /** \brief Create a new profile zone. This means you don't need access to a PxFoundation to create your profile zone object, and your object is automatically registered with the profile zone manager. You still need to release your object when you are finished with it. \param inSDKName Name of the SDK object. \param inNames Option set of event id to name mappings. \param inEventBufferByteSize rough maximum size of the event buffer. May exceed this size by sizeof one event. When full an immediate call to all listeners is made. */ virtual PxProfileZone& createProfileZone( const char* inSDKName, PxProfileNames inNames = PxProfileNames(), uint32_t inEventBufferByteSize = 0x4000 /*16k*/ ) = 0; /** \brief Releases the profile manager instance. */ virtual void release() = 0; /** \brief Create the profile zone manager. \param inAllocatorCallback Allocator callback. */ static PxProfileZoneManager& createProfileZoneManager(PxAllocatorCallback* inAllocatorCallback ); }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdInternalByteStreams.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_INTERNAL_BYTE_STREAMS_H #define PX_PVD_INTERNAL_BYTE_STREAMS_H #include "PxPvdByteStreams.h" #include "PxPvdFoundation.h" namespace physx { namespace pvdsdk { struct MemPvdInputStream : public PvdInputStream { const uint8_t* mBegin; const uint8_t* mEnd; bool mGood; MemPvdInputStream(const uint8_t* beg = NULL, const uint8_t* end = NULL) { mBegin = beg; mEnd = end; mGood = true; } uint32_t size() const { return mGood ? static_cast<uint32_t>(mEnd - mBegin) : 0; } bool isGood() const { return mGood; } void setup(uint8_t* start, uint8_t* stop) { mBegin = start; mEnd = stop; } void nocopyRead(uint8_t*& buffer, uint32_t& len) { if(len == 0 || mGood == false) { len = 0; buffer = NULL; return; } uint32_t original = len; len = PxMin(len, size()); if(mGood && len != original) mGood = false; buffer = const_cast<uint8_t*>(mBegin); mBegin += len; } virtual bool read(uint8_t* buffer, uint32_t& len) { if(len == 0) return true; uint32_t original = len; len = PxMin(len, size()); physx::intrinsics::memCopy(buffer, mBegin, len); mBegin += len; if(len < original) physx::intrinsics::memZero(buffer + len, original - len); mGood = mGood && len == original; return mGood; } }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileMemoryBuffer.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_MEMORY_BUFFER_H #define PX_PROFILE_MEMORY_BUFFER_H #include "foundation/PxAllocator.h" #include "foundation/PxMemory.h" namespace physx { namespace profile { template<typename TAllocator = typename PxAllocatorTraits<uint8_t>::Type > class MemoryBuffer : public TAllocator { uint8_t* mBegin; uint8_t* mEnd; uint8_t* mCapacityEnd; public: MemoryBuffer( const TAllocator& inAlloc = TAllocator() ) : TAllocator( inAlloc ), mBegin( 0 ), mEnd( 0 ), mCapacityEnd( 0 ) {} ~MemoryBuffer() { if ( mBegin ) TAllocator::deallocate( mBegin ); } uint32_t size() const { return static_cast<uint32_t>( mEnd - mBegin ); } uint32_t capacity() const { return static_cast<uint32_t>( mCapacityEnd - mBegin ); } uint8_t* begin() { return mBegin; } uint8_t* end() { return mEnd; } void setEnd(uint8_t* nEnd) { mEnd = nEnd; } const uint8_t* begin() const { return mBegin; } const uint8_t* end() const { return mEnd; } void clear() { mEnd = mBegin; } uint32_t write( uint8_t inValue ) { growBuf( 1 ); *mEnd = inValue; ++mEnd; return 1; } template<typename TDataType> uint32_t write( const TDataType& inValue ) { uint32_t writtenSize = sizeof(TDataType); growBuf(writtenSize); const uint8_t* __restrict readPtr = reinterpret_cast< const uint8_t* >( &inValue ); uint8_t* __restrict writePtr = mEnd; for ( uint32_t idx = 0; idx < sizeof(TDataType); ++idx ) writePtr[idx] = readPtr[idx]; mEnd += writtenSize; return writtenSize; } template<typename TDataType> uint32_t write( const TDataType* inValue, uint32_t inLength ) { if ( inValue && inLength ) { uint32_t writeSize = inLength * sizeof( TDataType ); growBuf( writeSize ); PxMemCopy( mBegin + size(), inValue, writeSize ); mEnd += writeSize; return writeSize; } return 0; } // used by atomic write. Store the data and write the end afterwards // we dont check the buffer size, it should not resize on the fly template<typename TDataType> uint32_t write(const TDataType* inValue, uint32_t inLength, int32_t index) { if (inValue && inLength) { uint32_t writeSize = inLength * sizeof(TDataType); PX_ASSERT(mBegin + index + writeSize < mCapacityEnd); PxMemCopy(mBegin + index, inValue, writeSize); return writeSize; } return 0; } void growBuf( uint32_t inAmount ) { uint32_t newSize = size() + inAmount; reserve( newSize ); } void resize( uint32_t inAmount ) { reserve( inAmount ); mEnd = mBegin + inAmount; } void reserve( uint32_t newSize ) { uint32_t currentSize = size(); if ( newSize >= capacity() ) { const uint32_t allocSize = mBegin ? newSize * 2 : newSize; uint8_t* newData = static_cast<uint8_t*>(TAllocator::allocate(allocSize, PX_FL)); memset(newData, 0xf,allocSize); if ( mBegin ) { PxMemCopy( newData, mBegin, currentSize ); TAllocator::deallocate( mBegin ); } mBegin = newData; mEnd = mBegin + currentSize; mCapacityEnd = mBegin + allocSize; } } }; class TempMemoryBuffer { uint8_t* mBegin; uint8_t* mEnd; uint8_t* mCapacityEnd; public: TempMemoryBuffer(uint8_t* data, int32_t size) : mBegin(data), mEnd(data), mCapacityEnd(data + size) {} ~TempMemoryBuffer() { } uint32_t size() const { return static_cast<uint32_t>(mEnd - mBegin); } uint32_t capacity() const { return static_cast<uint32_t>(mCapacityEnd - mBegin); } const uint8_t* begin() { return mBegin; } uint8_t* end() { return mEnd; } const uint8_t* begin() const { return mBegin; } const uint8_t* end() const { return mEnd; } uint32_t write(uint8_t inValue) { *mEnd = inValue; ++mEnd; return 1; } template<typename TDataType> uint32_t write(const TDataType& inValue) { uint32_t writtenSize = sizeof(TDataType); const uint8_t* __restrict readPtr = reinterpret_cast<const uint8_t*>(&inValue); uint8_t* __restrict writePtr = mEnd; for (uint32_t idx = 0; idx < sizeof(TDataType); ++idx) writePtr[idx] = readPtr[idx]; mEnd += writtenSize; return writtenSize; } template<typename TDataType> uint32_t write(const TDataType* inValue, uint32_t inLength) { if (inValue && inLength) { uint32_t writeSize = inLength * sizeof(TDataType); PxMemCopy(mBegin + size(), inValue, writeSize); mEnd += writeSize; return writeSize; } return 0; } }; }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdDefaultSocketTransport.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_DEFAULT_SOCKET_TRANSPORT_H #define PX_PVD_DEFAULT_SOCKET_TRANSPORT_H #include "pvd/PxPvdTransport.h" #include "foundation/PxUserAllocated.h" #include "foundation/PxSocket.h" #include "foundation/PxMutex.h" namespace physx { namespace pvdsdk { class PvdDefaultSocketTransport : public PxPvdTransport, public PxUserAllocated { PX_NOCOPY(PvdDefaultSocketTransport) public: PvdDefaultSocketTransport(const char* host, int port, unsigned int timeoutInMilliseconds); virtual ~PvdDefaultSocketTransport(); virtual bool connect(); virtual void disconnect(); virtual bool isConnected(); virtual bool write(const uint8_t* inBytes, uint32_t inLength); virtual void flush(); virtual PxPvdTransport& lock(); virtual void unlock(); virtual uint64_t getWrittenDataSize(); virtual void release(); private: PxSocket mSocket; const char* mHost; uint16_t mPort; unsigned int mTimeout; bool mConnected; uint64_t mWrittenData; PxMutex mMutex; bool mlocked; }; } // pvdsdk } // physx #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdObjectRegistrar.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "PxPvdObjectRegistrar.h" namespace physx { namespace pvdsdk { bool ObjectRegistrar::addItem(const void* inItem) { physx::PxMutex::ScopedLock lock(mRefCountMapLock); if(mRefCountMap.find(inItem)) { uint32_t& counter = mRefCountMap[inItem]; counter++; return false; } else { mRefCountMap.insert(inItem, 1); return true; } } bool ObjectRegistrar::decItem(const void* inItem) { physx::PxMutex::ScopedLock lock(mRefCountMapLock); const physx::PxHashMap<const void*, uint32_t>::Entry* entry = mRefCountMap.find(inItem); if(entry) { uint32_t& retval(const_cast<uint32_t&>(entry->second)); if(retval) --retval; uint32_t theValue = retval; if(theValue == 0) { mRefCountMap.erase(inItem); return true; } } return false; } void ObjectRegistrar::clear() { physx::PxMutex::ScopedLock lock(mRefCountMapLock); mRefCountMap.clear(); } } // pvdsdk } // physx
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdProfileZone.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_PROFILE_ZONE_H #define PX_PVD_PROFILE_ZONE_H #include "foundation/PxPreprocessor.h" #include "PxProfileEventBufferClientManager.h" #include "PxProfileEventNames.h" #include "PxProfileEventSender.h" namespace physx { class PxAllocatorCallback; namespace profile { class PxProfileZoneManager; /** \brief The profiling system was setup in the expectation that there would be several systems that each had its own island of profile information. PhysX, client code, and APEX would be the first examples of these. Each one of these islands is represented by a profile zone. A profile zone combines a name, a place where all the events coming from its interface can flushed, and a mapping from event number to full event name. It also provides a top level filtering service where profile events can be filtered by event id. The profile zone implements a system where if there is no one listening to events it doesn't provide a mechanism to send them. In this way the event system is short circuited when there aren't any clients. All functions on this interface should be considered threadsafe. @see PxProfileZoneClientManager, PxProfileNameProvider, PxProfileEventSender, PxProfileEventFlusher */ class PxProfileZone : public PxProfileZoneClientManager , public PxProfileNameProvider , public PxProfileEventSender , public PxProfileEventFlusher { protected: virtual ~PxProfileZone(){} public: /** \brief Get profile zone name. \return Zone name. */ virtual const char* getName() = 0; /** \brief Release the profile zone. */ virtual void release() = 0; /** \brief Set profile zone manager for the zone. \param inMgr Profile zone manager. */ virtual void setProfileZoneManager(PxProfileZoneManager* inMgr) = 0; /** \brief Get profile zone manager for the zone. \return Profile zone manager. */ virtual PxProfileZoneManager* getProfileZoneManager() = 0; /** \brief Get or create a new event id for a given name. If you pass in a previously defined event name (including one returned) from the name provider) you will just get the same event id back. \param inName Profile event name. */ virtual uint16_t getEventIdForName( const char* inName ) = 0; /** \brief Specifies that it is a safe point to flush read-write name map into read-only map. Make sure getEventIdForName is not called from a different thread. */ virtual void flushEventIdNameMap() = 0; /** \brief Reserve a contiguous set of profile event ids for a set of names. This function does not do any meaningful error checking other than to ensure that if it does generate new ids they are contiguous. If the first name is already registered, that is the ID that will be returned regardless of what other names are registered. Thus either use this function alone (without the above function) or don't use it. If you register "one","two","three" and the function returns an id of 4, then "one" is mapped to 4, "two" is mapped to 5, and "three" is mapped to 6. \param inNames set of names to register. \param inLen Length of the name list. \return The first id associated with the first name. The rest of the names will be associated with monotonically incrementing uint16_t values from the first id. */ virtual uint16_t getEventIdsForNames( const char** inNames, uint32_t inLen ) = 0; /** \brief Create a new profile zone. \param inAllocator memory allocation is controlled through the foundation if one is passed in. \param inSDKName Name of the profile zone; useful for clients to understand where events came from. \param inNames Mapping from event id -> event name. \param inEventBufferByteSize Size of the canonical event buffer. This does not need to be a large number as profile events are fairly small individually. \return a profile zone implementation. */ static PxProfileZone& createProfileZone(PxAllocatorCallback* inAllocator, const char* inSDKName, PxProfileNames inNames = PxProfileNames(), uint32_t inEventBufferByteSize = 0x10000 /*64k*/); }; } } #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxProfileMemoryEvents.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_MEMORY_EVENTS_H #define PX_PROFILE_MEMORY_EVENTS_H #include "PxProfileEvents.h" //Memory events define their own event stream namespace physx { namespace profile { struct MemoryEventTypes { enum Enum { Unknown = 0, StringTableEvent, //introduce a new mapping of const char* -> integer AllocationEvent, DeallocationEvent, FullAllocationEvent }; }; template<unsigned numBits, typename TDataType> inline unsigned char convertToNBits( TDataType inType ) { uint8_t conversion = static_cast<uint8_t>( inType ); PX_ASSERT( conversion < (1 << numBits) ); return conversion; } template<typename TDataType> inline unsigned char convertToTwoBits( TDataType inType ) { return convertToNBits<2>( inType ); } template<typename TDataType> inline unsigned char convertToFourBits( TDataType inType ) { return convertToNBits<4>( inType ); } inline EventStreamCompressionFlags::Enum fromNumber( uint8_t inNum ) { return static_cast<EventStreamCompressionFlags::Enum>( inNum ); } template<unsigned lhs, unsigned rhs> inline void compileCheckSize() { PX_COMPILE_TIME_ASSERT( lhs <= rhs ); } //Used for predictable bit fields. template<typename TDataType , uint8_t TNumBits , uint8_t TOffset , typename TInputType> struct BitMaskSetter { //Create a mask that masks out the orginal value shift into place static TDataType createOffsetMask() { return TDataType(createMask() << TOffset); } //Create a mask of TNumBits number of tis static TDataType createMask() { return static_cast<TDataType>((1 << TNumBits) - 1); } void setValue( TDataType& inCurrent, TInputType inData ) { PX_ASSERT( inData < ( 1 << TNumBits ) ); //Create a mask to remove the current value. TDataType theMask = TDataType(~(createOffsetMask())); //Clear out current value. inCurrent = TDataType(inCurrent & theMask); //Create the new value. TDataType theAddition = static_cast<TDataType>( inData << TOffset ); //or it into the existing value. inCurrent = TDataType(inCurrent | theAddition); } TInputType getValue( TDataType inCurrent ) { return static_cast<TInputType>( ( inCurrent >> TOffset ) & createMask() ); } }; struct MemoryEventHeader { uint16_t mValue; typedef BitMaskSetter<uint16_t, 4, 0, uint8_t> TTypeBitmask; typedef BitMaskSetter<uint16_t, 2, 4, uint8_t> TAddrCompressBitmask; typedef BitMaskSetter<uint16_t, 2, 6, uint8_t> TTypeCompressBitmask; typedef BitMaskSetter<uint16_t, 2, 8, uint8_t> TFnameCompressBitmask; typedef BitMaskSetter<uint16_t, 2, 10, uint8_t> TSizeCompressBitmask; typedef BitMaskSetter<uint16_t, 2, 12, uint8_t> TLineCompressBitmask; //That leaves size as the only thing not compressed usually. MemoryEventHeader( MemoryEventTypes::Enum inType = MemoryEventTypes::Unknown ) : mValue( 0 ) { uint8_t defaultCompression( convertToTwoBits( EventStreamCompressionFlags::U64 ) ); TTypeBitmask().setValue( mValue, convertToFourBits( inType ) ); TAddrCompressBitmask().setValue( mValue, defaultCompression ); TTypeCompressBitmask().setValue( mValue, defaultCompression ); TFnameCompressBitmask().setValue( mValue, defaultCompression ); TSizeCompressBitmask().setValue( mValue, defaultCompression ); TLineCompressBitmask().setValue( mValue, defaultCompression ); } MemoryEventTypes::Enum getType() const { return static_cast<MemoryEventTypes::Enum>( TTypeBitmask().getValue( mValue ) ); } #define DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( name ) \ void set##name( EventStreamCompressionFlags::Enum inEnum ) { T##name##Bitmask().setValue( mValue, convertToTwoBits( inEnum ) ); } \ EventStreamCompressionFlags::Enum get##name() const { return fromNumber( T##name##Bitmask().getValue( mValue ) ); } DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( AddrCompress ) DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( TypeCompress ) DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( FnameCompress ) DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( SizeCompress ) DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR( LineCompress ) #undef DEFINE_MEMORY_HEADER_COMPRESSION_ACCESSOR bool operator==( const MemoryEventHeader& inOther ) const { return mValue == inOther.mValue; } template<typename TStreamType> void streamify( TStreamType& inStream ) { inStream.streamify( "Header", mValue ); } }; //Declaration of type level getMemoryEventType function that maps enumeration event types to datatypes template<typename TDataType> inline MemoryEventTypes::Enum getMemoryEventType() { PX_ASSERT( false ); return MemoryEventTypes::Unknown; } inline bool safeStrEq( const char* lhs, const char* rhs ) { if ( lhs == rhs ) return true; //If they aren't equal, and one of them is null, //then they can't be equal. //This is assuming that the null char* is not equal to //the empty "" char*. if ( !lhs || !rhs ) return false; return ::strcmp( lhs, rhs ) == 0; } struct StringTableEvent { const char* mString; uint32_t mHandle; void init( const char* inStr = "", uint32_t inHdl = 0 ) { mString = inStr; mHandle = inHdl; } void init( const StringTableEvent& inData ) { mString = inData.mString; mHandle = inData.mHandle; } bool operator==( const StringTableEvent& inOther ) const { return mHandle == inOther.mHandle && safeStrEq( mString, inOther.mString ); } void setup( MemoryEventHeader& ) const {} template<typename TStreamType> void streamify( TStreamType& inStream, const MemoryEventHeader& ) { inStream.streamify( "String", mString ); inStream.streamify( "Handle", mHandle ); } }; template<> inline MemoryEventTypes::Enum getMemoryEventType<StringTableEvent>() { return MemoryEventTypes::StringTableEvent; } struct MemoryEventData { uint64_t mAddress; void init( uint64_t addr ) { mAddress = addr; } void init( const MemoryEventData& inData) { mAddress = inData.mAddress; } bool operator==( const MemoryEventData& inOther ) const { return mAddress == inOther.mAddress; } void setup( MemoryEventHeader& inHeader ) const { inHeader.setAddrCompress( findCompressionValue( mAddress ) ); } template<typename TStreamType> void streamify( TStreamType& inStream, const MemoryEventHeader& inHeader ) { inStream.streamify( "Address", mAddress, inHeader.getAddrCompress() ); } }; struct AllocationEvent : public MemoryEventData { uint32_t mSize; uint32_t mType; uint32_t mFile; uint32_t mLine; void init( size_t size = 0, uint32_t type = 0, uint32_t file = 0, uint32_t line = 0, uint64_t addr = 0 ) { MemoryEventData::init( addr ); mSize = static_cast<uint32_t>( size ); mType = type; mFile = file; mLine = line; } void init( const AllocationEvent& inData ) { MemoryEventData::init( inData ); mSize = inData.mSize; mType = inData.mType; mFile = inData.mFile; mLine = inData.mLine; } bool operator==( const AllocationEvent& inOther ) const { return MemoryEventData::operator==( inOther ) && mSize == inOther.mSize && mType == inOther.mType && mFile == inOther.mFile && mLine == inOther.mLine; } void setup( MemoryEventHeader& inHeader ) const { inHeader.setTypeCompress( findCompressionValue( mType ) ); inHeader.setFnameCompress( findCompressionValue( mFile ) ); inHeader.setSizeCompress( findCompressionValue( mSize ) ); inHeader.setLineCompress( findCompressionValue( mLine ) ); MemoryEventData::setup( inHeader ); } template<typename TStreamType> void streamify( TStreamType& inStream, const MemoryEventHeader& inHeader ) { inStream.streamify( "Size", mSize, inHeader.getSizeCompress() ); inStream.streamify( "Type", mType, inHeader.getTypeCompress() ); inStream.streamify( "File", mFile, inHeader.getFnameCompress() ); inStream.streamify( "Line", mLine, inHeader.getLineCompress() ); MemoryEventData::streamify( inStream, inHeader ); } }; template<> inline MemoryEventTypes::Enum getMemoryEventType<AllocationEvent>() { return MemoryEventTypes::AllocationEvent; } struct FullAllocationEvent : public MemoryEventData { size_t mSize; const char* mType; const char* mFile; uint32_t mLine; void init( size_t size, const char* type, const char* file, uint32_t line, uint64_t addr ) { MemoryEventData::init( addr ); mSize = size; mType = type; mFile = file; mLine = line; } void init( const FullAllocationEvent& inData ) { MemoryEventData::init( inData ); mSize = inData.mSize; mType = inData.mType; mFile = inData.mFile; mLine = inData.mLine; } bool operator==( const FullAllocationEvent& inOther ) const { return MemoryEventData::operator==( inOther ) && mSize == inOther.mSize && safeStrEq( mType, inOther.mType ) && safeStrEq( mFile, inOther.mFile ) && mLine == inOther.mLine; } void setup( MemoryEventHeader& ) const {} }; template<> inline MemoryEventTypes::Enum getMemoryEventType<FullAllocationEvent>() { return MemoryEventTypes::FullAllocationEvent; } struct DeallocationEvent : public MemoryEventData { void init( uint64_t addr = 0 ) { MemoryEventData::init( addr ); } void init( const DeallocationEvent& inData ) { MemoryEventData::init( inData ); } }; template<> inline MemoryEventTypes::Enum getMemoryEventType<DeallocationEvent>() { return MemoryEventTypes::DeallocationEvent; } class MemoryEvent { public: typedef PX_PROFILE_UNION_5(StringTableEvent, AllocationEvent, DeallocationEvent, FullAllocationEvent, uint8_t) EventData; private: MemoryEventHeader mHeader; EventData mData; public: MemoryEvent() {} MemoryEvent( MemoryEventHeader inHeader, const EventData& inData = EventData() ) : mHeader( inHeader ) , mData( inData ) { } template<typename TDataType> MemoryEvent( const TDataType& inType ) : mHeader( getMemoryEventType<TDataType>() ) , mData( inType ) { //set the appropriate compression bits. inType.setup( mHeader ); } const MemoryEventHeader& getHeader() const { return mHeader; } const EventData& getData() const { return mData; } template<typename TDataType> const TDataType& getValue() const { PX_ASSERT( mHeader.getType() == getMemoryEventType<TDataType>() ); return mData.toType<TDataType>(); } template<typename TDataType> TDataType& getValue() { PX_ASSERT( mHeader.getType() == getMemoryEventType<TDataType>() ); return mData.toType<TDataType>(); } template<typename TRetVal, typename TOperator> inline TRetVal visit( TOperator inOp ) const; bool operator==( const MemoryEvent& inOther ) const { if ( !(mHeader == inOther.mHeader ) ) return false; if ( mHeader.getType() ) return inOther.visit<bool>( EventDataEqualOperator<EventData>( mData ) ); return true; } }; template<typename TRetVal, typename TOperator> inline TRetVal visit( MemoryEventTypes::Enum inEventType, const MemoryEvent::EventData& inData, TOperator inOperator ) { switch( inEventType ) { case MemoryEventTypes::StringTableEvent: return inOperator( inData.toType( Type2Type<StringTableEvent>() ) ); case MemoryEventTypes::AllocationEvent: return inOperator( inData.toType( Type2Type<AllocationEvent>() ) ); case MemoryEventTypes::DeallocationEvent: return inOperator( inData.toType( Type2Type<DeallocationEvent>() ) ); case MemoryEventTypes::FullAllocationEvent: return inOperator( inData.toType( Type2Type<FullAllocationEvent>() ) ); case MemoryEventTypes::Unknown: return inOperator( static_cast<uint8_t>( inEventType ) ); } return TRetVal(); } template<typename TRetVal, typename TOperator> inline TRetVal MemoryEvent::visit( TOperator inOp ) const { return physx::profile::visit<TRetVal>( mHeader.getType(), mData, inOp ); } }} #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/src/PxPvdFoundation.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_FOUNDATION_H #define PX_PVD_FOUNDATION_H #include "foundation/PxVec3.h" #include "foundation/PxTransform.h" #include "foundation/PxBounds3.h" #include "foundation/PxHashSet.h" #include "foundation/PxHashMap.h" #include "foundation/PxArray.h" #include "foundation/PxString.h" #include "foundation/PxPool.h" #include "PxPvdObjectModelBaseTypes.h" namespace physx { namespace pvdsdk { extern PxAllocatorCallback* gPvdAllocatorCallback; class ForwardingAllocator : public PxAllocatorCallback { void* allocate(size_t size, const char* typeName, const char* filename, int line) { return PxGetBroadcastAllocator()->allocate(size, typeName, filename, line); } void deallocate(void* ptr) { PxGetBroadcastAllocator()->deallocate(ptr); } }; class RawMemoryBuffer { uint8_t* mBegin; uint8_t* mEnd; uint8_t* mCapacityEnd; const char* mBufDataName; public: RawMemoryBuffer(const char* name) : mBegin(0), mEnd(0), mCapacityEnd(0),mBufDataName(name) { PX_UNUSED(mBufDataName); } ~RawMemoryBuffer() { PX_FREE(mBegin); } uint32_t size() const { return static_cast<uint32_t>(mEnd - mBegin); } uint32_t capacity() const { return static_cast<uint32_t>(mCapacityEnd - mBegin); } uint8_t* begin() { return mBegin; } uint8_t* end() { return mEnd; } const uint8_t* begin() const { return mBegin; } const uint8_t* end() const { return mEnd; } void clear() { mEnd = mBegin; } const char* cStr() { if(mEnd && (*mEnd != 0)) write(0); return reinterpret_cast<const char*>(mBegin); } uint32_t write(uint8_t inValue) { *growBuf(1) = inValue; return 1; } template <typename TDataType> uint32_t write(const TDataType& inValue) { const uint8_t* __restrict readPtr = reinterpret_cast<const uint8_t*>(&inValue); uint8_t* __restrict writePtr = growBuf(sizeof(TDataType)); for(uint32_t idx = 0; idx < sizeof(TDataType); ++idx) writePtr[idx] = readPtr[idx]; return sizeof(TDataType); } template <typename TDataType> uint32_t write(const TDataType* inValue, uint32_t inLength) { uint32_t writeSize = inLength * sizeof(TDataType); if(inValue && inLength) { physx::intrinsics::memCopy(growBuf(writeSize), inValue, writeSize); } if(inLength && !inValue) { PX_ASSERT(false); // You can't not write something, because that will cause // the receiving end to crash. for(uint32_t idx = 0; idx < writeSize; ++idx) write(0); } return writeSize; } uint8_t* growBuf(uint32_t inAmount) { uint32_t offset = size(); uint32_t newSize = offset + inAmount; reserve(newSize); mEnd += inAmount; return mBegin + offset; } void writeZeros(uint32_t inAmount) { uint32_t offset = size(); growBuf(inAmount); physx::intrinsics::memZero(begin() + offset, inAmount); } void reserve(uint32_t newSize) { uint32_t currentSize = size(); if(newSize && newSize >= capacity()) { uint32_t newDataSize = newSize > 4096 ? newSize + (newSize >> 2) : newSize*2; uint8_t* newData = static_cast<uint8_t*>(PX_ALLOC(newDataSize, mBufDataName)); if(mBegin) { physx::intrinsics::memCopy(newData, mBegin, currentSize); PX_FREE(mBegin); } mBegin = newData; mEnd = mBegin + currentSize; mCapacityEnd = mBegin + newDataSize; } } }; struct ForwardingMemoryBuffer : public RawMemoryBuffer { ForwardingMemoryBuffer(const char* bufDataName) : RawMemoryBuffer(bufDataName) { } ForwardingMemoryBuffer& operator<<(const char* inString) { if(inString && *inString) { uint32_t len = static_cast<uint32_t>(strlen(inString)); write(inString, len); } return *this; } template <typename TDataType> inline ForwardingMemoryBuffer& toStream(const char* inFormat, const TDataType inData) { char buffer[128] = { 0 }; Pxsnprintf(buffer, 128, inFormat, inData); *this << buffer; return *this; } inline ForwardingMemoryBuffer& operator<<(bool inData) { *this << (inData ? "true" : "false"); return *this; } inline ForwardingMemoryBuffer& operator<<(int32_t inData) { return toStream("%d", inData); } inline ForwardingMemoryBuffer& operator<<(uint16_t inData) { return toStream("%u", uint32_t(inData)); } inline ForwardingMemoryBuffer& operator<<(uint8_t inData) { return toStream("%u", uint32_t(inData)); } inline ForwardingMemoryBuffer& operator<<(char inData) { return toStream("%c", inData); } inline ForwardingMemoryBuffer& operator<<(uint32_t inData) { return toStream("%u", inData); } inline ForwardingMemoryBuffer& operator<<(uint64_t inData) { return toStream("%I64u", inData); } inline ForwardingMemoryBuffer& operator<<(int64_t inData) { return toStream("%I64d", inData); } inline ForwardingMemoryBuffer& operator<<(const void* inData) { return *this << static_cast<uint64_t>(reinterpret_cast<size_t>(inData)); } inline ForwardingMemoryBuffer& operator<<(float inData) { return toStream("%g", double(inData)); } inline ForwardingMemoryBuffer& operator<<(double inData) { return toStream("%g", inData); } inline ForwardingMemoryBuffer& operator<<(const PxVec3& inData) { *this << inData[0]; *this << " "; *this << inData[1]; *this << " "; *this << inData[2]; return *this; } inline ForwardingMemoryBuffer& operator<<(const PxQuat& inData) { *this << inData.x; *this << " "; *this << inData.y; *this << " "; *this << inData.z; *this << " "; *this << inData.w; return *this; } inline ForwardingMemoryBuffer& operator<<(const PxTransform& inData) { *this << inData.q; *this << " "; *this << inData.p; return *this; } inline ForwardingMemoryBuffer& operator<<(const PxBounds3& inData) { *this << inData.minimum; *this << " "; *this << inData.maximum; return *this; } }; template <typename TDataType> inline void* PvdAllocate(const char* typeName, const char* file, int line) { PX_ASSERT(gPvdAllocatorCallback); return gPvdAllocatorCallback->allocate(sizeof(TDataType), typeName, file, line); } template <typename TDataType> inline void PvdDeleteAndDeallocate(TDataType* inDType) { PX_ASSERT(gPvdAllocatorCallback); if(inDType) { inDType->~TDataType(); gPvdAllocatorCallback->deallocate(inDType); } } } } #define PVD_NEW(dtype) new (PvdAllocate<dtype>(#dtype, PX_FL)) dtype #define PVD_DELETE(obj) PvdDeleteAndDeallocate(obj); //#define PVD_NEW(dtype) PX_NEW(dtype) //#define PVD_DELETE(obj) PX_DELETE(obj) #define PVD_FOREACH(varname, stop) for(uint32_t varname = 0; varname < stop; ++varname) #define PVD_POINTER_TO_U64(ptr) static_cast<uint64_t>(reinterpret_cast<size_t>(ptr)) #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdErrorCodes.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_ERROR_CODES_H #define PX_PVD_ERROR_CODES_H /** \addtogroup pvd @{ */ #include "foundation/Px.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif struct PvdErrorType { enum Enum { Success = 0, NetworkError, ArgumentError, Disconnect, InternalProblem }; }; typedef PvdErrorType::Enum PvdError; #if !PX_DOXYGEN } } #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdUserRenderer.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_USER_RENDERER_H #define PX_PVD_USER_RENDERER_H /** \addtogroup pvd @{ */ #include "foundation/PxVec3.h" #include "foundation/PxTransform.h" #include "common/PxRenderBuffer.h" #include "pvd/PxPvd.h" #include "PxPvdDataStream.h" #include "foundation/PxUserAllocated.h" #if !PX_DOXYGEN namespace physx { #endif class PxPvd; #if !PX_DOXYGEN namespace pvdsdk { #endif class RendererEventClient; class PvdUserRenderer : public PxUserAllocated { protected: virtual ~PvdUserRenderer() { } public: virtual void release() = 0; virtual void setClient(RendererEventClient* client) = 0; // Instance to associate the further rendering with. virtual void setInstanceId(const void* instanceId) = 0; // Draw these points associated with this instance virtual void drawPoints(const PxDebugPoint* points, uint32_t count) = 0; // Draw these lines associated with this instance virtual void drawLines(const PxDebugLine* lines, uint32_t count) = 0; // Draw these triangles associated with this instance virtual void drawTriangles(const PxDebugTriangle* triangles, uint32_t count) = 0; // Draw this text associated with this instance virtual void drawText(const PxDebugText& text) = 0; // Draw SDK debug render virtual void drawRenderbuffer(const PxDebugPoint* pointData, uint32_t pointCount, const PxDebugLine* lineData, uint32_t lineCount, const PxDebugTriangle* triangleData, uint32_t triangleCount) = 0; // Constraint visualization routines virtual void visualizeJointFrames(const PxTransform& parent, const PxTransform& child) = 0; virtual void visualizeLinearLimit(const PxTransform& t0, const PxTransform& t1, float value) = 0; virtual void visualizeAngularLimit(const PxTransform& t0, float lower, float upper) = 0; virtual void visualizeLimitCone(const PxTransform& t, float tanQSwingY, float tanQSwingZ) = 0; virtual void visualizeDoubleCone(const PxTransform& t, float angle) = 0; // Clear the immedate buffer. virtual void flushRenderEvents() = 0; static PvdUserRenderer* create(uint32_t bufferSize = 0x2000); }; class RendererEventClient { public: virtual ~RendererEventClient(){} virtual void handleBufferFlush(const uint8_t* inData, uint32_t inLength) = 0; }; #if !PX_DOXYGEN } } #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdClient.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PVD_CLIENT_H #define PX_PVD_CLIENT_H /** \addtogroup pvd @{ */ #include "foundation/PxFlags.h" #include "foundation/PxVec3.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif class PvdDataStream; class PvdUserRenderer; /** \brief PvdClient is the per-client connection to PVD. It provides callback when PVD is connected/disconnted. It provides access to the internal object so that advanced users can create extension client. */ class PvdClient { public: virtual PvdDataStream* getDataStream() = 0; virtual bool isConnected() const = 0; virtual void onPvdConnected() = 0; virtual void onPvdDisconnected() = 0; virtual void flush() = 0; protected: virtual ~PvdClient() { } }; #if !PX_DOXYGEN } // namespace pvdsdk } // namespace physx #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdDataStream.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_DATA_STREAM_H #define PX_PVD_DATA_STREAM_H /** \addtogroup pvd @{ */ #include "pvd/PxPvd.h" #include "PxPvdErrorCodes.h" #include "PxPvdObjectModelBaseTypes.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif class PvdPropertyDefinitionHelper; class PvdMetaDataStream { protected: virtual ~PvdMetaDataStream() { } public: virtual PvdError createClass(const NamespacedName& nm) = 0; template <typename TDataType> PvdError createClass() { return createClass(getPvdNamespacedNameForType<TDataType>()); } virtual PvdError deriveClass(const NamespacedName& parent, const NamespacedName& child) = 0; template <typename TParentType, typename TChildType> PvdError deriveClass() { return deriveClass(getPvdNamespacedNameForType<TParentType>(), getPvdNamespacedNameForType<TChildType>()); } virtual bool isClassExist(const NamespacedName& nm) = 0; template <typename TDataType> bool isClassExist() { return isClassExist(getPvdNamespacedNameForType<TDataType>()); } virtual PvdError createProperty(const NamespacedName& clsName, const char* name, const char* semantic, const NamespacedName& dtypeName, PropertyType::Enum propertyType, DataRef<NamedValue> values = DataRef<NamedValue>()) = 0; template <typename TClsType, typename TDataType> PvdError createProperty(String name, String semantic = "", PropertyType::Enum propertyType = PropertyType::Scalar, DataRef<NamedValue> values = DataRef<NamedValue>()) { return createProperty(getPvdNamespacedNameForType<TClsType>(), name, semantic, getPvdNamespacedNameForType<TDataType>(), propertyType, values); } virtual PvdError createPropertyMessage(const NamespacedName& cls, const NamespacedName& msgName, DataRef<PropertyMessageArg> entries, uint32_t messageSizeInBytes) = 0; template <typename TClsType, typename TMsgType> PvdError createPropertyMessage(DataRef<PropertyMessageArg> entries) { return createPropertyMessage(getPvdNamespacedNameForType<TClsType>(), getPvdNamespacedNameForType<TMsgType>(), entries, sizeof(TMsgType)); } }; class PvdInstanceDataStream { protected: virtual ~PvdInstanceDataStream() { } public: virtual PvdError createInstance(const NamespacedName& cls, const void* instance) = 0; template <typename TDataType> PvdError createInstance(const TDataType* inst) { return createInstance(getPvdNamespacedNameForType<TDataType>(), inst); } virtual bool isInstanceValid(const void* instance) = 0; // If the property will fit or is already completely in memory virtual PvdError setPropertyValue(const void* instance, String name, DataRef<const uint8_t> data, const NamespacedName& incomingTypeName) = 0; template <typename TDataType> PvdError setPropertyValue(const void* instance, String name, const TDataType& value) { const uint8_t* dataStart = reinterpret_cast<const uint8_t*>(&value); return setPropertyValue(instance, name, DataRef<const uint8_t>(dataStart, dataStart + sizeof(TDataType)), getPvdNamespacedNameForType<TDataType>()); } template <typename TDataType> PvdError setPropertyValue(const void* instance, String name, const TDataType* value, uint32_t numItems) { const uint8_t* dataStart = reinterpret_cast<const uint8_t*>(value); return setPropertyValue(instance, name, DataRef<const uint8_t>(dataStart, dataStart + sizeof(TDataType) * numItems), getPvdNamespacedNameForType<TDataType>()); } // Else if the property is very large (contact reports) you can send it in chunks. virtual PvdError beginSetPropertyValue(const void* instance, String name, const NamespacedName& incomingTypeName) = 0; template <typename TDataType> PvdError beginSetPropertyValue(const void* instance, String name) { return beginSetPropertyValue(instance, name, getPvdNamespacedNameForType<TDataType>()); } virtual PvdError appendPropertyValueData(DataRef<const uint8_t> data) = 0; template <typename TDataType> PvdError appendPropertyValueData(const TDataType* value, uint32_t numItems) { const uint8_t* dataStart = reinterpret_cast<const uint8_t*>(value); return appendPropertyValueData(DataRef<const uint8_t>(dataStart, dataStart + numItems * sizeof(TDataType))); } virtual PvdError endSetPropertyValue() = 0; // Set a set of properties to various values on an object. virtual PvdError setPropertyMessage(const void* instance, const NamespacedName& msgName, DataRef<const uint8_t> data) = 0; template <typename TDataType> PvdError setPropertyMessage(const void* instance, const TDataType& value) { const uint8_t* dataStart = reinterpret_cast<const uint8_t*>(&value); return setPropertyMessage(instance, getPvdNamespacedNameForType<TDataType>(), DataRef<const uint8_t>(dataStart, sizeof(TDataType))); } // If you need to send of lot of identical messages, this avoids a hashtable lookup per message. virtual PvdError beginPropertyMessageGroup(const NamespacedName& msgName) = 0; template <typename TDataType> PvdError beginPropertyMessageGroup() { return beginPropertyMessageGroup(getPvdNamespacedNameForType<TDataType>()); } virtual PvdError sendPropertyMessageFromGroup(const void* instance, DataRef<const uint8_t> data) = 0; template <typename TDataType> PvdError sendPropertyMessageFromGroup(const void* instance, const TDataType& value) { const uint8_t* dataStart = reinterpret_cast<const uint8_t*>(&value); return sendPropertyMessageFromGroup(instance, DataRef<const uint8_t>(dataStart, sizeof(TDataType))); } virtual PvdError endPropertyMessageGroup() = 0; // These functions ensure the target array doesn't contain duplicates virtual PvdError pushBackObjectRef(const void* instId, String propName, const void* objRef) = 0; virtual PvdError removeObjectRef(const void* instId, String propName, const void* objRef) = 0; // Instance elimination. virtual PvdError destroyInstance(const void* key) = 0; // Profiling hooks virtual PvdError beginSection(const void* instance, String name) = 0; virtual PvdError endSection(const void* instance, String name) = 0; // Origin Shift virtual PvdError originShift(const void* scene, PxVec3 shift) = 0; public: /*For some cases, pvd command cannot be run immediately. For example, when create joints, while the actors may still *pending for insert, the joints update commands can be run deffered. */ class PvdCommand { public: // Assigned is needed for copying PvdCommand(const PvdCommand&) { } PvdCommand& operator=(const PvdCommand&) { return *this; } public: PvdCommand() { } virtual ~PvdCommand() { } // Not pure virtual so can have default PvdCommand obj virtual bool canRun(PvdInstanceDataStream&) { return false; } virtual void run(PvdInstanceDataStream&) { } }; // PVD SDK provide this helper function to allocate cmd's memory and release them at after flush the command queue virtual void* allocateMemForCmd(uint32_t length) = 0; // PVD will call the destructor of PvdCommand object at the end fo flushPvdCommand virtual void pushPvdCommand(PvdCommand& cmd) = 0; virtual void flushPvdCommand() = 0; }; class PvdDataStream : public PvdInstanceDataStream, public PvdMetaDataStream { protected: virtual ~PvdDataStream() { } public: virtual void release() = 0; virtual bool isConnected() = 0; virtual void addProfileZone(void* zone, const char* name) = 0; virtual void addProfileZoneEvent(void* zone, const char* name, uint16_t eventId, bool compileTimeEnabled) = 0; virtual PvdPropertyDefinitionHelper& getPropertyDefinitionHelper() = 0; virtual void setIsTopLevelUIElement(const void* instance, bool topLevel) = 0; virtual void sendErrorMessage(uint32_t code, const char* message, const char* file, uint32_t line) = 0; virtual void updateCamera(const char* name, const PxVec3& origin, const PxVec3& up, const PxVec3& target) = 0; /** \brief Create a new PvdDataStream. \param pvd A pointer to a valid PxPvd instance. This must be non-null. */ static PvdDataStream* create(PxPvd* pvd); }; #if !PX_DOXYGEN } // pvdsdk } // physx #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PsPvd.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PS_PVD_H #define PS_PVD_H /** \addtogroup pvd @{ */ #include "pvd/PxPvd.h" #include "foundation/PxBroadcast.h" #if !PX_DOXYGEN namespace physx { #endif class PxPvdTransport; #if !PX_DOXYGEN namespace pvdsdk { #endif class PvdDataStream; class PvdClient; class PvdOMMetaDataProvider; // PsPvd is used for advanced user, it support custom pvd client API class PsPvd : public physx::PxPvd, public PxAllocationListener { public: virtual void addClient(PvdClient* client) = 0; virtual void removeClient(PvdClient* client) = 0; virtual bool registerObject(const void* inItem) = 0; virtual bool unRegisterObject(const void* inItem) = 0; //AllocationListener void onAllocation(size_t size, const char* typeName, const char* filename, int line, void* allocatedMemory) = 0; void onDeallocation(void* addr) = 0; virtual PvdOMMetaDataProvider& getMetaDataProvider() = 0; virtual uint64_t getNextStreamId() = 0; // Call to flush events to PVD virtual void flush() = 0; }; #if !PX_DOXYGEN } // namespace pvdsdk } // namespace physx #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdDataStreamHelpers.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_DATA_STREAM_HELPERS_H #define PX_PVD_DATA_STREAM_HELPERS_H /** \addtogroup pvd @{ */ #include "PxPvdObjectModelBaseTypes.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif class PvdPropertyDefinitionHelper { protected: virtual ~PvdPropertyDefinitionHelper() { } public: /** Push a name c such that it appends such as a.b.c. */ virtual void pushName(const char* inName, const char* inAppendStr = ".") = 0; /** Push a name c such that it appends like a.b[c] */ virtual void pushBracketedName(const char* inName, const char* leftBracket = "[", const char* rightBracket = "]") = 0; /** * Pop the current name */ virtual void popName() = 0; virtual void clearNameStack() = 0; /** * Get the current name at the top of the name stack. * Would return "a.b.c" or "a.b[c]" in the above examples. */ virtual const char* getTopName() = 0; virtual void addNamedValue(const char* name, uint32_t value) = 0; virtual void clearNamedValues() = 0; virtual DataRef<NamedValue> getNamedValues() = 0; /** * Define a property using the top of the name stack and the passed-in semantic */ virtual void createProperty(const NamespacedName& clsName, const char* inSemantic, const NamespacedName& dtypeName, PropertyType::Enum propType = PropertyType::Scalar) = 0; template <typename TClsType, typename TDataType> void createProperty(const char* inSemantic = "", PropertyType::Enum propType = PropertyType::Scalar) { createProperty(getPvdNamespacedNameForType<TClsType>(), inSemantic, getPvdNamespacedNameForType<TDataType>(), propType); } // The datatype used for instances needs to be pointer unless you actually have pvdsdk::InstanceId members on your // value structs. virtual void addPropertyMessageArg(const NamespacedName& inDatatype, uint32_t inOffset, uint32_t inSize) = 0; template <typename TDataType> void addPropertyMessageArg(uint32_t offset) { addPropertyMessageArg(getPvdNamespacedNameForType<TDataType>(), offset, static_cast<uint32_t>(sizeof(TDataType))); } virtual void addPropertyMessage(const NamespacedName& clsName, const NamespacedName& msgName, uint32_t inStructSizeInBytes) = 0; template <typename TClsType, typename TMsgType> void addPropertyMessage() { addPropertyMessage(getPvdNamespacedNameForType<TClsType>(), getPvdNamespacedNameForType<TMsgType>(), static_cast<uint32_t>(sizeof(TMsgType))); } virtual void clearPropertyMessageArgs() = 0; void clearBufferedData() { clearNameStack(); clearPropertyMessageArgs(); clearNamedValues(); } }; #if !PX_DOXYGEN } // pvdsdk } // physx #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxPvdObjectModelBaseTypes.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #ifndef PX_PVD_OBJECT_MODEL_BASE_TYPES_H #define PX_PVD_OBJECT_MODEL_BASE_TYPES_H /** \addtogroup pvd @{ */ #include "foundation/PxAssert.h" #if !PX_DOXYGEN namespace physx { namespace pvdsdk { #endif using namespace physx; inline const char* nonNull(const char* str) { return str ? str : ""; } // strcmp will crash if passed a null string, however, // so we need to make sure that doesn't happen. We do that // by equating NULL and the empty string, "". inline bool safeStrEq(const char* lhs, const char* rhs) { return ::strcmp(nonNull(lhs), nonNull(rhs)) == 0; } // Does this string have useful information in it. inline bool isMeaningful(const char* str) { return *(nonNull(str)) > 0; } inline uint32_t safeStrLen(const char* str) { str = nonNull(str); return static_cast<uint32_t>(strlen(str)); } struct ObjectRef { int32_t mInstanceId; ObjectRef(int32_t iid = -1) : mInstanceId(iid) { } operator int32_t() const { return mInstanceId; } bool hasValue() const { return mInstanceId > 0; } }; struct U32Array4 { uint32_t mD0; uint32_t mD1; uint32_t mD2; uint32_t mD3; U32Array4(uint32_t d0, uint32_t d1, uint32_t d2, uint32_t d3) : mD0(d0), mD1(d1), mD2(d2), mD3(d3) { } U32Array4() : mD0(0), mD1(0), mD2(0), mD3(0) { } }; typedef bool PvdBool; typedef const char* String; typedef void* VoidPtr; typedef double PvdF64; typedef float PvdF32; typedef int64_t PvdI64; typedef uint64_t PvdU64; typedef int32_t PvdI32; typedef uint32_t PvdU32; typedef int16_t PvdI16; typedef uint16_t PvdU16; typedef int8_t PvdI8; typedef uint8_t PvdU8; struct PvdColor { uint8_t r; uint8_t g; uint8_t b; uint8_t a; PvdColor(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a = 255) : r(_r), g(_g), b(_b), a(_a) { } PvdColor() : r(0), g(0), b(0), a(255) { } PvdColor(uint32_t abgr) { uint8_t* valPtr = reinterpret_cast<uint8_t*>(&abgr); r = valPtr[0]; g = valPtr[1]; b = valPtr[2]; a = valPtr[3]; } }; struct StringHandle { uint32_t mHandle; StringHandle(uint32_t val = 0) : mHandle(val) { } operator uint32_t() const { return mHandle; } }; #define DECLARE_TYPES \ DECLARE_BASE_PVD_TYPE(PvdI8) \ DECLARE_BASE_PVD_TYPE(PvdU8) \ DECLARE_BASE_PVD_TYPE(PvdI16) \ DECLARE_BASE_PVD_TYPE(PvdU16) \ DECLARE_BASE_PVD_TYPE(PvdI32) \ DECLARE_BASE_PVD_TYPE(PvdU32) \ DECLARE_BASE_PVD_TYPE(PvdI64) \ DECLARE_BASE_PVD_TYPE(PvdU64) \ DECLARE_BASE_PVD_TYPE(PvdF32) \ DECLARE_BASE_PVD_TYPE(PvdF64) \ DECLARE_BASE_PVD_TYPE(PvdBool) \ DECLARE_BASE_PVD_TYPE(PvdColor) \ DECLARE_BASE_PVD_TYPE(String) \ DECLARE_BASE_PVD_TYPE(StringHandle) \ DECLARE_BASE_PVD_TYPE(ObjectRef) \ DECLARE_BASE_PVD_TYPE(VoidPtr) \ DECLARE_BASE_PVD_TYPE(PxVec2) \ DECLARE_BASE_PVD_TYPE(PxVec3) \ DECLARE_BASE_PVD_TYPE(PxVec4) \ DECLARE_BASE_PVD_TYPE(PxBounds3) \ DECLARE_BASE_PVD_TYPE(PxQuat) \ DECLARE_BASE_PVD_TYPE(PxTransform) \ DECLARE_BASE_PVD_TYPE(PxMat33) \ DECLARE_BASE_PVD_TYPE(PxMat44) \ DECLARE_BASE_PVD_TYPE(U32Array4) struct PvdBaseType { enum Enum { None = 0, InternalStart = 1, InternalStop = 64, #define DECLARE_BASE_PVD_TYPE(type) type, DECLARE_TYPES Last #undef DECLARE_BASE_PVD_TYPE }; }; struct NamespacedName { String mNamespace; String mName; NamespacedName(String ns, String nm) : mNamespace(ns), mName(nm) { } NamespacedName(String nm = "") : mNamespace(""), mName(nm) { } bool operator==(const NamespacedName& other) const { return safeStrEq(mNamespace, other.mNamespace) && safeStrEq(mName, other.mName); } }; struct NamedValue { String mName; uint32_t mValue; NamedValue(String nm = "", uint32_t val = 0) : mName(nm), mValue(val) { } }; template <typename T> struct BaseDataTypeToTypeMap { bool compile_error; }; template <PvdBaseType::Enum> struct BaseTypeToDataTypeMap { bool compile_error; }; // Users can extend this mapping with new datatypes. template <typename T> struct PvdDataTypeToNamespacedNameMap { bool Name; }; // This mapping tells you the what class id to use for the base datatypes // #define DECLARE_BASE_PVD_TYPE(type) \ template <> \ struct BaseDataTypeToTypeMap<type> \ { \ enum Enum \ { \ BaseTypeEnum = PvdBaseType::type \ }; \ }; \ template <> \ struct BaseDataTypeToTypeMap<const type&> \ { \ enum Enum \ { \ BaseTypeEnum = PvdBaseType::type \ }; \ }; \ template <> \ struct BaseTypeToDataTypeMap<PvdBaseType::type> \ { \ typedef type TDataType; \ }; \ template <> \ struct PvdDataTypeToNamespacedNameMap<type> \ { \ NamespacedName Name; \ PvdDataTypeToNamespacedNameMap<type>() : Name("physx3", #type) \ { \ } \ }; \ template <> \ struct PvdDataTypeToNamespacedNameMap<const type&> \ { \ NamespacedName Name; \ PvdDataTypeToNamespacedNameMap<const type&>() : Name("physx3", #type) \ { \ } \ }; DECLARE_TYPES #undef DECLARE_BASE_PVD_TYPE template <typename TDataType> inline int32_t getPvdTypeForType() { return static_cast<PvdBaseType::Enum>(BaseDataTypeToTypeMap<TDataType>::BaseTypeEnum); } template <typename TDataType> inline NamespacedName getPvdNamespacedNameForType() { return PvdDataTypeToNamespacedNameMap<TDataType>().Name; } #define DEFINE_PVD_TYPE_NAME_MAP(type, ns, name) \ template <> \ struct PvdDataTypeToNamespacedNameMap<type> \ { \ NamespacedName Name; \ PvdDataTypeToNamespacedNameMap<type>() : Name(ns, name) \ { \ } \ }; #define DEFINE_PVD_TYPE_ALIAS(newType, oldType) \ template <> \ struct PvdDataTypeToNamespacedNameMap<newType> \ { \ NamespacedName Name; \ PvdDataTypeToNamespacedNameMap<newType>() : Name(PvdDataTypeToNamespacedNameMap<oldType>().Name) \ { \ } \ }; DEFINE_PVD_TYPE_ALIAS(const void*, void*) struct ArrayData { uint8_t* mBegin; uint8_t* mEnd; uint8_t* mCapacity; //>= stop ArrayData(uint8_t* beg = NULL, uint8_t* end = NULL, uint8_t* cap = NULL) : mBegin(beg), mEnd(end), mCapacity(cap) { } uint8_t* begin() { return mBegin; } uint8_t* end() { return mEnd; } uint32_t byteCapacity() { return static_cast<uint32_t>(mCapacity - mBegin); } uint32_t byteSize() const { return static_cast<uint32_t>(mEnd - mBegin); } // in bytes uint32_t numberOfItems(uint32_t objectByteSize) { if(objectByteSize) return byteSize() / objectByteSize; return 0; } void forgetData() { mBegin = mEnd = mCapacity = 0; } }; template <typename T> class DataRef { const T* mBegin; const T* mEnd; public: DataRef(const T* b, uint32_t count) : mBegin(b), mEnd(b + count) { } DataRef(const T* b = NULL, const T* e = NULL) : mBegin(b), mEnd(e) { } DataRef(const DataRef& o) : mBegin(o.mBegin), mEnd(o.mEnd) { } DataRef& operator=(const DataRef& o) { mBegin = o.mBegin; mEnd = o.mEnd; return *this; } uint32_t size() const { return static_cast<uint32_t>(mEnd - mBegin); } const T* begin() const { return mBegin; } const T* end() const { return mEnd; } const T& operator[](uint32_t idx) const { PX_ASSERT(idx < size()); return mBegin[idx]; } const T& back() const { PX_ASSERT(mEnd > mBegin); return *(mEnd - 1); } }; struct PropertyType { enum Enum { Unknown = 0, Scalar, Array }; }; // argument to the create property message function struct PropertyMessageArg { String mPropertyName; NamespacedName mDatatypeName; // where in the message this property starts. uint32_t mMessageOffset; // size of this entry object uint32_t mByteSize; PropertyMessageArg(String propName, NamespacedName dtype, uint32_t msgOffset, uint32_t byteSize) : mPropertyName(propName), mDatatypeName(dtype), mMessageOffset(msgOffset), mByteSize(byteSize) { } PropertyMessageArg() : mPropertyName(""), mMessageOffset(0), mByteSize(0) { } }; class PvdUserRenderer; DEFINE_PVD_TYPE_NAME_MAP(PvdUserRenderer, "_debugger_", "PvdUserRenderer") #if !PX_DOXYGEN } } #endif /** @} */ #endif
NVIDIA-Omniverse/PhysX/physx/source/pvd/include/PxProfileAllocatorWrapper.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PROFILE_ALLOCATOR_WRAPPER_H #define PX_PROFILE_ALLOCATOR_WRAPPER_H #include "foundation/PxPreprocessor.h" #include "foundation/PxAllocatorCallback.h" #include "foundation/PxErrorCallback.h" #include "foundation/PxAssert.h" #include "foundation/PxHashMap.h" #include "foundation/PxArray.h" namespace physx { namespace profile { /** \brief Helper struct to encapsulate the user allocator callback Useful for array and hash templates */ struct PxProfileAllocatorWrapper { PxAllocatorCallback* mUserAllocator; PxProfileAllocatorWrapper( PxAllocatorCallback& inUserAllocator ) : mUserAllocator( &inUserAllocator ) { } PxProfileAllocatorWrapper( PxAllocatorCallback* inUserAllocator ) : mUserAllocator( inUserAllocator ) { } PxAllocatorCallback& getAllocator() const { PX_ASSERT( NULL != mUserAllocator ); return *mUserAllocator; } }; /** \brief Helper class to encapsulate the reflection allocator */ template <typename T> class PxProfileWrapperReflectionAllocator { static const char* getName() { #if PX_LINUX || PX_OSX || PX_EMSCRIPTEN || PX_SWITCH return __PRETTY_FUNCTION__; #else return typeid(T).name(); #endif } PxProfileAllocatorWrapper* mWrapper; public: PxProfileWrapperReflectionAllocator(PxProfileAllocatorWrapper& inWrapper) : mWrapper( &inWrapper ) {} PxProfileWrapperReflectionAllocator( const PxProfileWrapperReflectionAllocator& inOther ) : mWrapper( inOther.mWrapper ) { } PxProfileWrapperReflectionAllocator& operator=( const PxProfileWrapperReflectionAllocator& inOther ) { mWrapper = inOther.mWrapper; return *this; } PxAllocatorCallback& getAllocator() { return mWrapper->getAllocator(); } void* allocate(size_t size, const char* filename, int line) { #if PX_CHECKED // checked and debug builds if(!size) return 0; return getAllocator().allocate(size, getName(), filename, line); #else return getAllocator().allocate(size, "<no allocation names in this config>", filename, line); #endif } void deallocate(void* ptr) { if(ptr) getAllocator().deallocate(ptr); } }; /** \brief Helper class to encapsulate the named allocator */ struct PxProfileWrapperNamedAllocator { PxProfileAllocatorWrapper* mWrapper; const char* mAllocationName; PxProfileWrapperNamedAllocator(PxProfileAllocatorWrapper& inWrapper, const char* inAllocationName) : mWrapper( &inWrapper ) , mAllocationName( inAllocationName ) {} PxProfileWrapperNamedAllocator( const PxProfileWrapperNamedAllocator& inOther ) : mWrapper( inOther.mWrapper ) , mAllocationName( inOther.mAllocationName ) { } PxProfileWrapperNamedAllocator& operator=( const PxProfileWrapperNamedAllocator& inOther ) { mWrapper = inOther.mWrapper; mAllocationName = inOther.mAllocationName; return *this; } PxAllocatorCallback& getAllocator() { return mWrapper->getAllocator(); } void* allocate(size_t size, const char* filename, int line) { if(!size) return 0; return getAllocator().allocate(size, mAllocationName, filename, line); } void deallocate(void* ptr) { if(ptr) getAllocator().deallocate(ptr); } }; /** \brief Helper struct to encapsulate the array */ template<class T> struct PxProfileArray : public PxArray<T, PxProfileWrapperReflectionAllocator<T> > { typedef PxProfileWrapperReflectionAllocator<T> TAllocatorType; PxProfileArray( PxProfileAllocatorWrapper& inWrapper ) : PxArray<T, TAllocatorType >( TAllocatorType( inWrapper ) ) { } PxProfileArray( const PxProfileArray< T >& inOther ) : PxArray<T, TAllocatorType >( inOther, inOther ) { } }; /** \brief Helper struct to encapsulate the array */ template<typename TKeyType, typename TValueType, typename THashType=PxHash<TKeyType> > struct PxProfileHashMap : public PxHashMap<TKeyType, TValueType, THashType, PxProfileWrapperReflectionAllocator< TValueType > > { typedef PxHashMap<TKeyType, TValueType, THashType, PxProfileWrapperReflectionAllocator< TValueType > > THashMapType; typedef PxProfileWrapperReflectionAllocator<TValueType> TAllocatorType; PxProfileHashMap( PxProfileAllocatorWrapper& inWrapper ) : THashMapType( TAllocatorType( inWrapper ) ) { } }; /** \brief Helper function to encapsulate the profile allocation */ template<typename TDataType> inline TDataType* PxProfileAllocate( PxAllocatorCallback* inAllocator, const char* file, int inLine ) { PxProfileAllocatorWrapper wrapper( inAllocator ); typedef PxProfileWrapperReflectionAllocator< TDataType > TAllocator; TAllocator theAllocator( wrapper ); return reinterpret_cast<TDataType*>( theAllocator.allocate( sizeof( TDataType ), file, inLine ) ); } /** \brief Helper function to encapsulate the profile allocation */ template<typename TDataType> inline TDataType* PxProfileAllocate( PxAllocatorCallback& inAllocator, const char* file, int inLine ) { return PxProfileAllocate<TDataType>( &inAllocator, file, inLine ); } /** \brief Helper function to encapsulate the profile deallocation */ template<typename TDataType> inline void PxProfileDeleteAndDeallocate( PxProfileAllocatorWrapper& inAllocator, TDataType* inDType ) { PX_ASSERT(inDType); PxAllocatorCallback& allocator( inAllocator.getAllocator() ); inDType->~TDataType(); allocator.deallocate( inDType ); } /** \brief Helper function to encapsulate the profile deallocation */ template<typename TDataType> inline void PxProfileDeleteAndDeallocate( PxAllocatorCallback& inAllocator, TDataType* inDType ) { PxProfileAllocatorWrapper wrapper( &inAllocator ); PxProfileDeleteAndDeallocate( wrapper, inDType ); } } } #define PX_PROFILE_NEW( allocator, dtype ) new (physx::profile::PxProfileAllocate<dtype>( allocator, PX_FL)) dtype #define PX_PROFILE_DELETE( allocator, obj ) physx::profile::PxProfileDeleteAndDeallocate( allocator, obj ); #endif
NVIDIA-Omniverse/PhysX/physx/source/physxcooking/src/Cooking.h
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef COOKING_H #define COOKING_H #include "foundation/PxMemory.h" #include "cooking/PxCooking.h" #include "foundation/PxUserAllocated.h" namespace physx { class TriangleMeshBuilder; class TetrahedronMeshBuilder; class ConvexMeshBuilder; class ConvexHullLib; class PxInsertionCallback; struct PxTriangleMeshInternalData; struct PxBVHInternalData; } #endif
NVIDIA-Omniverse/PhysX/physx/source/physxcooking/src/Cooking.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "Cooking.h" #include "GuCooking.h" #include "GuBVH.h" /////////////////////////////////////////////////////////////////////////////// using namespace physx; using namespace Gu; #include "cooking/PxCookingInternal.h" #include "GuTriangleMeshBV4.h" physx::PxTriangleMesh* PxCreateTriangleMeshInternal(const physx::PxTriangleMeshInternalData& data) { TriangleMesh* np; PX_NEW_SERIALIZED(np, BV4TriangleMesh)(data); return np; } physx::PxBVH* PxCreateBVHInternal(const physx::PxBVHInternalData& data) { BVH* np; PX_NEW_SERIALIZED(np, BVH)(data); return np; } /////////////////////////////////////////////////////////////////////////////// PxInsertionCallback* PxGetStandaloneInsertionCallback() { return immediateCooking::getInsertionCallback(); } bool PxCookBVH(const PxBVHDesc& desc, PxOutputStream& stream) { return immediateCooking::cookBVH(desc, stream); } PxBVH* PxCreateBVH(const PxBVHDesc& desc, PxInsertionCallback& insertionCallback) { return immediateCooking::createBVH(desc, insertionCallback); } bool PxCookHeightField(const PxHeightFieldDesc& desc, PxOutputStream& stream) { return immediateCooking::cookHeightField(desc, stream); } PxHeightField* PxCreateHeightField(const PxHeightFieldDesc& desc, PxInsertionCallback& insertionCallback) { return immediateCooking::createHeightField(desc, insertionCallback); } bool PxCookConvexMesh(const PxCookingParams& params, const PxConvexMeshDesc& desc, PxOutputStream& stream, PxConvexMeshCookingResult::Enum* condition) { return immediateCooking::cookConvexMesh(params, desc, stream, condition); } PxConvexMesh* PxCreateConvexMesh(const PxCookingParams& params, const PxConvexMeshDesc& desc, PxInsertionCallback& insertionCallback, PxConvexMeshCookingResult::Enum* condition) { return immediateCooking::createConvexMesh(params, desc, insertionCallback, condition); } bool PxValidateConvexMesh(const PxCookingParams& params, const PxConvexMeshDesc& desc) { return immediateCooking::validateConvexMesh(params, desc); } bool PxComputeHullPolygons(const PxCookingParams& params, const PxSimpleTriangleMesh& mesh, PxAllocatorCallback& inCallback, PxU32& nbVerts, PxVec3*& vertices, PxU32& nbIndices, PxU32*& indices, PxU32& nbPolygons, PxHullPolygon*& hullPolygons) { return immediateCooking::computeHullPolygons(params, mesh, inCallback, nbVerts, vertices, nbIndices, indices, nbPolygons, hullPolygons); } bool PxValidateTriangleMesh(const PxCookingParams& params, const PxTriangleMeshDesc& desc) { return immediateCooking::validateTriangleMesh(params, desc); } PxTriangleMesh* PxCreateTriangleMesh(const PxCookingParams& params, const PxTriangleMeshDesc& desc, PxInsertionCallback& insertionCallback, PxTriangleMeshCookingResult::Enum* condition) { return immediateCooking::createTriangleMesh(params, desc, insertionCallback, condition); } bool PxCookTriangleMesh(const PxCookingParams& params, const PxTriangleMeshDesc& desc, PxOutputStream& stream, PxTriangleMeshCookingResult::Enum* condition) { return immediateCooking::cookTriangleMesh(params, desc, stream, condition); } bool PxCookTetrahedronMesh(const PxCookingParams& params, const PxTetrahedronMeshDesc& meshDesc, PxOutputStream& stream) { return immediateCooking::cookTetrahedronMesh(params, meshDesc, stream); } PxTetrahedronMesh* PxCreateTetrahedronMesh(const PxCookingParams& params, const PxTetrahedronMeshDesc& meshDesc, PxInsertionCallback& insertionCallback) { return immediateCooking::createTetrahedronMesh(params, meshDesc, insertionCallback); } bool PxCookSoftBodyMesh(const PxCookingParams& params, const PxTetrahedronMeshDesc& simulationMeshDesc, const PxTetrahedronMeshDesc& collisionMeshDesc, const PxSoftBodySimulationDataDesc& softbodyDataDesc, PxOutputStream& stream) { return immediateCooking::cookSoftBodyMesh(params, simulationMeshDesc, collisionMeshDesc, softbodyDataDesc, stream); } PxSoftBodyMesh* PxCreateSoftBodyMesh(const PxCookingParams& params, const PxTetrahedronMeshDesc& simulationMeshDesc, const PxTetrahedronMeshDesc& collisionMeshDesc, const PxSoftBodySimulationDataDesc& softbodyDataDesc, PxInsertionCallback& insertionCallback) { return immediateCooking::createSoftBodyMesh(params, simulationMeshDesc, collisionMeshDesc, softbodyDataDesc, insertionCallback); } PxCollisionMeshMappingData* PxComputeModelsMapping(const PxCookingParams& params, PxTetrahedronMeshData& simulationMesh, const PxTetrahedronMeshData& collisionMesh, const PxSoftBodyCollisionData& collisionData, const PxBoundedData* vertexToTet) { return immediateCooking::computeModelsMapping(params, simulationMesh, collisionMesh, collisionData, vertexToTet); } PxCollisionTetrahedronMeshData* PxComputeCollisionData(const PxCookingParams& params, const PxTetrahedronMeshDesc& collisionMeshDesc) { return immediateCooking::computeCollisionData(params, collisionMeshDesc); } PxSimulationTetrahedronMeshData* PxComputeSimulationData(const PxCookingParams& params, const PxTetrahedronMeshDesc& simulationMeshDesc) { return immediateCooking::computeSimulationData(params, simulationMeshDesc); } PxSoftBodyMesh* PxAssembleSoftBodyMesh(PxTetrahedronMeshData& simulationMesh, PxSoftBodySimulationData& simulationData, PxTetrahedronMeshData& collisionMesh, PxSoftBodyCollisionData& collisionData, PxCollisionMeshMappingData& mappingData, PxInsertionCallback& insertionCallback) { return immediateCooking::assembleSoftBodyMesh(simulationMesh, simulationData, collisionMesh, collisionData, mappingData, insertionCallback); } PxSoftBodyMesh* PxAssembleSoftBodyMesh_Sim(PxSimulationTetrahedronMeshData& simulationMesh, PxCollisionTetrahedronMeshData& collisionMesh, PxCollisionMeshMappingData& mappingData, PxInsertionCallback& insertionCallback) { return immediateCooking::assembleSoftBodyMesh_Sim(simulationMesh, collisionMesh, mappingData, insertionCallback); }
NVIDIA-Omniverse/PhysX/physx/source/physxcooking/src/windows/WindowsCookingDelayLoadHook.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "common/windows/PxWindowsDelayLoadHook.h" #include "foundation/windows/PxWindowsInclude.h" #include "windows/CmWindowsLoadLibrary.h" static const physx::PxDelayLoadHook* gCookingDelayLoadHook = NULL; void physx::PxSetPhysXCookingDelayLoadHook(const physx::PxDelayLoadHook* hook) { gCookingDelayLoadHook = hook; } // delay loading is enabled only for non static configuration #if !defined PX_PHYSX_STATIC_LIB // Prior to Visual Studio 2015 Update 3, these hooks were non-const. #define DELAYIMP_INSECURE_WRITABLE_HOOKS #include <delayimp.h> using namespace physx; #pragma comment(lib, "delayimp") FARPROC WINAPI cookingDelayHook(unsigned dliNotify, PDelayLoadInfo pdli) { switch (dliNotify) { case dliStartProcessing : break; case dliNotePreLoadLibrary : { return Cm::physXCommonDliNotePreLoadLibrary(pdli->szDll,gCookingDelayLoadHook); } break; case dliNotePreGetProcAddress : break; case dliFailLoadLib : break; case dliFailGetProc : break; case dliNoteEndProcessing : break; default : return NULL; } return NULL; } PfnDliHook __pfnDliNotifyHook2 = cookingDelayHook; #endif
NVIDIA-Omniverse/PhysX/physx/source/task/src/TaskManager.cpp
// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. #include "task/PxTask.h" #include "foundation/PxErrors.h" #include "foundation/PxHashMap.h" #include "foundation/PxAllocator.h" #include "foundation/PxAtomic.h" #include "foundation/PxMutex.h" #include "foundation/PxArray.h" #include "foundation/PxThread.h" #define LOCK() PxMutex::ScopedLock _lock_(mMutex) namespace physx { const int EOL = -1; typedef PxHashMap<const char *, PxTaskID> PxTaskNameToIDMap; struct PxTaskDepTableRow { PxTaskID mTaskID; int mNextDep; }; typedef PxArray<PxTaskDepTableRow> PxTaskDepTable; class PxTaskTableRow { public: PxTaskTableRow() : mRefCount( 1 ), mStartDep(EOL), mLastDep(EOL) {} void addDependency( PxTaskDepTable& depTable, PxTaskID taskID ) { int newDep = int(depTable.size()); PxTaskDepTableRow row; row.mTaskID = taskID; row.mNextDep = EOL; depTable.pushBack( row ); if( mLastDep == EOL ) { mStartDep = mLastDep = newDep; } else { depTable[ uint32_t(mLastDep) ].mNextDep = newDep; mLastDep = newDep; } } PxTask * mTask; volatile int mRefCount; PxTaskType::Enum mType; int mStartDep; int mLastDep; }; typedef PxArray<PxTaskTableRow> PxTaskTable; /* Implementation of PxTaskManager abstract API */ class PxTaskMgr : public PxTaskManager, public PxUserAllocated { PX_NOCOPY(PxTaskMgr) public: PxTaskMgr(PxErrorCallback& , PxCpuDispatcher*); ~PxTaskMgr(); void setCpuDispatcher( PxCpuDispatcher& ref ) { mCpuDispatcher = &ref; } PxCpuDispatcher* getCpuDispatcher() const { return mCpuDispatcher; } void resetDependencies(); void startSimulation(); void stopSimulation(); void taskCompleted( PxTask& task ); PxTaskID getNamedTask( const char *name ); PxTaskID submitNamedTask( PxTask *task, const char *name, PxTaskType::Enum type = PxTaskType::eCPU ); PxTaskID submitUnnamedTask( PxTask& task, PxTaskType::Enum type = PxTaskType::eCPU ); PxTask* getTaskFromID( PxTaskID ); void dispatchTask( PxTaskID taskID ); void resolveRow( PxTaskID taskID ); void release(); void finishBefore( PxTask& task, PxTaskID taskID ); void startAfter( PxTask& task, PxTaskID taskID ); void addReference( PxTaskID taskID ); void decrReference( PxTaskID taskID ); int32_t getReference( PxTaskID taskID ) const; void decrReference( PxLightCpuTask& lighttask ); void addReference( PxLightCpuTask& lighttask ); PxErrorCallback& mErrorCallback; PxCpuDispatcher *mCpuDispatcher; PxTaskNameToIDMap mName2IDmap; volatile int mPendingTasks; PxMutex mMutex; PxTaskDepTable mDepTable; PxTaskTable mTaskTable; PxArray<PxTaskID> mStartDispatch; }; PxTaskManager* PxTaskManager::createTaskManager(PxErrorCallback& errorCallback, PxCpuDispatcher* cpuDispatcher) { return PX_NEW(PxTaskMgr)(errorCallback, cpuDispatcher); } PxTaskMgr::PxTaskMgr(PxErrorCallback& errorCallback, PxCpuDispatcher* cpuDispatcher) : mErrorCallback (errorCallback) , mCpuDispatcher( cpuDispatcher ) , mPendingTasks( 0 ) , mDepTable("PxTaskDepTable") , mTaskTable("PxTaskTable") , mStartDispatch("StartDispatch") { } PxTaskMgr::~PxTaskMgr() { } void PxTaskMgr::release() { PX_DELETE_THIS; } void PxTaskMgr::decrReference(PxLightCpuTask& lighttask) { /* This does not need a lock! */ if (!PxAtomicDecrement(&lighttask.mRefCount)) { PX_ASSERT(mCpuDispatcher); if (mCpuDispatcher) { mCpuDispatcher->submitTask(lighttask); } else { lighttask.release(); } } } void PxTaskMgr::addReference(PxLightCpuTask& lighttask) { /* This does not need a lock! */ PxAtomicIncrement(&lighttask.mRefCount); } /* * Called by the owner (Scene) at the start of every frame, before * asking for tasks to be submitted. */ void PxTaskMgr::resetDependencies() { PX_ASSERT( !mPendingTasks ); // only valid if you don't resubmit named tasks, this is true for the SDK PX_ASSERT( mCpuDispatcher ); mTaskTable.clear(); mDepTable.clear(); mName2IDmap.clear(); mPendingTasks = 0; } /* * Called by the owner (Scene) to start simulating the task graph. * Dispatch all tasks with refCount == 1 */ void PxTaskMgr::startSimulation() { PX_ASSERT( mCpuDispatcher ); /* Handle empty task graph */ if( mPendingTasks == 0 ) return; for( PxTaskID i = 0 ; i < mTaskTable.size() ; i++ ) { if( mTaskTable[ i ].mType == PxTaskType::eCOMPLETED ) { continue; } if( !PxAtomicDecrement( &mTaskTable[ i ].mRefCount ) ) { mStartDispatch.pushBack(i); } } for( uint32_t i=0; i<mStartDispatch.size(); ++i) { dispatchTask( mStartDispatch[i] ); } //mStartDispatch.resize(0); mStartDispatch.forceSize_Unsafe(0); } void PxTaskMgr::stopSimulation() { } PxTaskID PxTaskMgr::getNamedTask( const char *name ) { const PxTaskNameToIDMap::Entry *ret; { LOCK(); ret = mName2IDmap.find( name ); } if( ret ) { return ret->second; } else { // create named entry in task table, without a task return submitNamedTask( NULL, name, PxTaskType::eNOT_PRESENT ); } } PxTask* PxTaskMgr::getTaskFromID( PxTaskID id ) { LOCK(); // todo: reader lock necessary? return mTaskTable[ id ].mTask; } /* If called at runtime, must be thread-safe */ PxTaskID PxTaskMgr::submitNamedTask( PxTask *task, const char *name, PxTaskType::Enum type ) { if( task ) { task->mTm = this; task->submitted(); } LOCK(); const PxTaskNameToIDMap::Entry *ret = mName2IDmap.find( name ); if( ret ) { PxTaskID prereg = ret->second; if( task ) { /* name was registered for us by a dependent task */ PX_ASSERT( !mTaskTable[ prereg ].mTask ); PX_ASSERT( mTaskTable[ prereg ].mType == PxTaskType::eNOT_PRESENT ); mTaskTable[ prereg ].mTask = task; mTaskTable[ prereg ].mType = type; task->mTaskID = prereg; } return prereg; } else { PxAtomicIncrement(&mPendingTasks); PxTaskID id = static_cast<PxTaskID>(mTaskTable.size()); mName2IDmap[ name ] = id; if( task ) { task->mTaskID = id; } PxTaskTableRow r; r.mTask = task; r.mType = type; mTaskTable.pushBack(r); return id; } } /* * Add an unnamed task to the task table */ PxTaskID PxTaskMgr::submitUnnamedTask( PxTask& task, PxTaskType::Enum type ) { PxAtomicIncrement(&mPendingTasks); task.mTm = this; task.submitted(); LOCK(); task.mTaskID = static_cast<PxTaskID>(mTaskTable.size()); PxTaskTableRow r; r.mTask = &task; r.mType = type; mTaskTable.pushBack(r); return task.mTaskID; } /* Called by worker threads (or cooperating application threads) when a * PxTask has completed. Propogate depdenencies, decrementing all * referenced tasks' refCounts. If any of those reach zero, activate * those tasks. */ void PxTaskMgr::taskCompleted( PxTask& task ) { LOCK(); resolveRow(task.mTaskID); } /* ================== Private Functions ======================= */ /* * Add a dependency to force 'task' to complete before the * referenced 'taskID' is allowed to be dispatched. */ void PxTaskMgr::finishBefore( PxTask& task, PxTaskID taskID ) { LOCK(); PX_ASSERT( mTaskTable[ taskID ].mType != PxTaskType::eCOMPLETED ); mTaskTable[ task.mTaskID ].addDependency( mDepTable, taskID ); PxAtomicIncrement( &mTaskTable[ taskID ].mRefCount ); } /* * Add a dependency to force 'task' to wait for the referenced 'taskID' * to complete before it is allowed to be dispatched. */ void PxTaskMgr::startAfter( PxTask& task, PxTaskID taskID ) { LOCK(); PX_ASSERT( mTaskTable[ taskID ].mType != PxTaskType::eCOMPLETED ); mTaskTable[ taskID ].addDependency( mDepTable, task.mTaskID ); PxAtomicIncrement( &mTaskTable[ task.mTaskID ].mRefCount ); } void PxTaskMgr::addReference( PxTaskID taskID ) { LOCK(); PxAtomicIncrement( &mTaskTable[ taskID ].mRefCount ); } /* * Remove one reference count from a task. Must be done here to make it thread safe. */ void PxTaskMgr::decrReference( PxTaskID taskID ) { LOCK(); if( !PxAtomicDecrement( &mTaskTable[ taskID ].mRefCount ) ) { dispatchTask(taskID); } } int32_t PxTaskMgr::getReference(PxTaskID taskID) const { return mTaskTable[ taskID ].mRefCount; } /* * A task has completed, decrement all dependencies and submit tasks * that are ready to run. Signal simulation end if ther are no more * pending tasks. */ void PxTaskMgr::resolveRow( PxTaskID taskID ) { int depRow = mTaskTable[ taskID ].mStartDep; while( depRow != EOL ) { PxTaskDepTableRow& row = mDepTable[ uint32_t(depRow) ]; PxTaskTableRow& dtt = mTaskTable[ row.mTaskID ]; if( !PxAtomicDecrement( &dtt.mRefCount ) ) { dispatchTask( row.mTaskID ); } depRow = row.mNextDep; } PxAtomicDecrement( &mPendingTasks ); } /* * Submit a ready task to its appropriate dispatcher. */ void PxTaskMgr::dispatchTask( PxTaskID taskID ) { LOCK(); // todo: reader lock necessary? PxTaskTableRow& tt = mTaskTable[ taskID ]; // prevent re-submission if( tt.mType == PxTaskType::eCOMPLETED ) { mErrorCallback.reportError(PxErrorCode::eDEBUG_WARNING, "PxTask dispatched twice", PX_FL); return; } switch ( tt.mType ) { case PxTaskType::eCPU: mCpuDispatcher->submitTask( *tt.mTask ); break; case PxTaskType::eNOT_PRESENT: /* No task registered with this taskID, resolve its dependencies */ PX_ASSERT(!tt.mTask); //PxGetFoundation().error(PX_INFO, "unregistered task resolved"); resolveRow( taskID ); break; case PxTaskType::eCOMPLETED: default: mErrorCallback.reportError(PxErrorCode::eDEBUG_WARNING, "Unknown task type", PX_FL); resolveRow( taskID ); break; } tt.mType = PxTaskType::eCOMPLETED; } }// end physx namespace
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/LowLevelAABB.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build LowLevelAABB common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LLAABB_DIR ${PHYSX_SOURCE_DIR}/lowlevelaabb) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/LowLevelAABB.cmake) SET(LLAABB_HEADERS ${LLAABB_DIR}/include/BpAABBManager.h ${LLAABB_DIR}/include/BpVolumeData.h ${LLAABB_DIR}/include/BpAABBManagerBase.h ${LLAABB_DIR}/include/BpAABBManagerTasks.h ${LLAABB_DIR}/include/BpBroadPhase.h ${LLAABB_DIR}/include/BpBroadPhaseUpdate.h ${LLAABB_DIR}/include/BpFiltering.h ) SOURCE_GROUP("include" FILES ${LLAABB_HEADERS}) SET(LLAABB_SOURCE ${LLAABB_DIR}/src/BpAABBManager.cpp ${LLAABB_DIR}/src/BpAABBManagerBase.cpp ${LLAABB_DIR}/src/BpBroadPhase.cpp ${LLAABB_DIR}/src/BpBroadPhaseUpdate.cpp ${LLAABB_DIR}/src/BpBroadPhaseABP.cpp ${LLAABB_DIR}/src/BpBroadPhaseABP.h ${LLAABB_DIR}/src/BpBroadPhaseMBP.cpp ${LLAABB_DIR}/src/BpBroadPhaseMBP.h ${LLAABB_DIR}/src/BpBroadPhaseMBPCommon.h ${LLAABB_DIR}/src/BpBroadPhaseSap.cpp ${LLAABB_DIR}/src/BpBroadPhaseSap.h ${LLAABB_DIR}/src/BpBroadPhaseSapAux.cpp ${LLAABB_DIR}/src/BpBroadPhaseSapAux.h ${LLAABB_DIR}/src/BpBroadPhaseShared.cpp ${LLAABB_DIR}/src/BpBroadPhaseShared.h ${LLAABB_DIR}/src/BpBroadPhaseIntegerAABB.h ${LLAABB_DIR}/src/BpFiltering.cpp ) SOURCE_GROUP("src" FILES ${LLAABB_SOURCE}) ADD_LIBRARY(LowLevelAABB ${LOWLEVELAABB_LIBTYPE} ${LLAABB_HEADERS} ${LLAABB_SOURCE} ) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(LowLevelAABB PRIVATE ${LOWLEVELAABB_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/api/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/utils PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/pipeline PRIVATE ${PHYSX_SOURCE_DIR}/lowlevelaabb/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevelaabb/src ) TARGET_COMPILE_DEFINITIONS(LowLevelAABB PRIVATE ${LOWLEVELAABB_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(LowLevelAABB PROPERTIES LINK_FLAGS ${LOWLEVELAABB_PLATFORM_LINK_FLAGS} ) SET_TARGET_PROPERTIES(LowLevelAABB PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "LowLevelAABB_static" ARCHIVE_OUTPUT_NAME_CHECKED "LowLevelAABB_static" ARCHIVE_OUTPUT_NAME_PROFILE "LowLevelAABB_static" ARCHIVE_OUTPUT_NAME_RELEASE "LowLevelAABB_static" ) IF(LLAABB_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(LowLevelAABB PROPERTIES COMPILE_PDB_NAME_DEBUG "${LLAABB_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${LLAABB_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${LLAABB_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${LLAABB_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(LowLevelAABB PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LLAABB_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LLAABB_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(LowLevelAABB PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXCharacterKinematic.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXCharacterKinematic common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxcharacterkinematic/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXCharacterKinematic.cmake) SET(PHYSXCCT_HEADERS ${PHYSX_ROOT_DIR}/include/characterkinematic/PxBoxController.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxCapsuleController.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxController.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxControllerBehavior.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxControllerManager.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxControllerObstacles.h ${PHYSX_ROOT_DIR}/include/characterkinematic/PxExtended.h ) SOURCE_GROUP(include FILES ${PHYSXCCT_HEADERS}) SET(PHYSXCCT_SOURCE ${LL_SOURCE_DIR}/CctBoxController.cpp ${LL_SOURCE_DIR}/CctCapsuleController.cpp ${LL_SOURCE_DIR}/CctCharacterController.cpp ${LL_SOURCE_DIR}/CctCharacterControllerCallbacks.cpp ${LL_SOURCE_DIR}/CctCharacterControllerManager.cpp ${LL_SOURCE_DIR}/CctController.cpp ${LL_SOURCE_DIR}/CctObstacleContext.cpp ${LL_SOURCE_DIR}/CctSweptBox.cpp ${LL_SOURCE_DIR}/CctSweptCapsule.cpp ${LL_SOURCE_DIR}/CctSweptVolume.cpp ${LL_SOURCE_DIR}/CctBoxController.h ${LL_SOURCE_DIR}/CctCapsuleController.h ${LL_SOURCE_DIR}/CctCharacterController.h ${LL_SOURCE_DIR}/CctCharacterControllerManager.h ${LL_SOURCE_DIR}/CctController.h ${LL_SOURCE_DIR}/CctInternalStructs.h ${LL_SOURCE_DIR}/CctObstacleContext.h ${LL_SOURCE_DIR}/CctSweptBox.h ${LL_SOURCE_DIR}/CctSweptCapsule.h ${LL_SOURCE_DIR}/CctSweptVolume.h ${LL_SOURCE_DIR}/CctUtils.h ) SOURCE_GROUP(src FILES ${PHYSXCCT_SOURCE}) ADD_LIBRARY(PhysXCharacterKinematic ${PHYSXCHARACTERKINEMATIC_LIBTYPE} ${PHYSXCCT_HEADERS} ${PHYSXCCT_SOURCE} ) INSTALL(FILES ${PHYSXCCT_HEADERS} DESTINATION include/characterkinematic) TARGET_INCLUDE_DIRECTORIES(PhysXCharacterKinematic PRIVATE ${PHYSXCHARACTERKINEMATICS_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include ) TARGET_COMPILE_DEFINITIONS(PhysXCharacterKinematic # Common to all configurations PRIVATE ${PHYSXCHARACTERKINEMATICS_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXCharacterKinematic PROPERTIES OUTPUT_NAME PhysXCharacterKinematic ) IF(PHYSXCHARACTERKINEMATIC_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXCharacterKinematic PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXCharacterKinematic_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXCharacterKinematic_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXCharacterKinematic_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXCharacterKinematic_static" ) ENDIF() IF(PHYSXCHARACTERKINEMATIC_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXCharacterKinematic PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXCHARACTERKINEMATIC_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXCHARACTERKINEMATIC_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXCHARACTERKINEMATIC_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXCHARACTERKINEMATIC_COMPILE_PDB_NAME_RELEASE} ) ENDIF() TARGET_LINK_LIBRARIES(PhysXCharacterKinematic PUBLIC ${PHYSXCHARACTERKINEMATICS_PLATFORM_LINKED_LIBS} PUBLIC PhysXFoundation ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCCT_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCCT_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXCharacterKinematic PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXFoundation.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXFoundation common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/foundation) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXFoundation.cmake) SET(PHYSXFOUNDATION_HEADERS ${PHYSX_ROOT_DIR}/include/foundation/PxFoundation.h ${PHYSX_ROOT_DIR}/include/foundation/PxAssert.h ${PHYSX_ROOT_DIR}/include/foundation/PxFoundationConfig.h ${PHYSX_ROOT_DIR}/include/foundation/PxMathUtils.h ${PHYSX_ROOT_DIR}/include/foundation/Px.h ${PHYSX_ROOT_DIR}/include/foundation/PxAlignedMalloc.h ${PHYSX_ROOT_DIR}/include/foundation/PxAllocatorCallback.h ${PHYSX_ROOT_DIR}/include/foundation/PxProfiler.h ${PHYSX_ROOT_DIR}/include/foundation/PxAoS.h ${PHYSX_ROOT_DIR}/include/foundation/PxAlloca.h ${PHYSX_ROOT_DIR}/include/foundation/PxAllocator.h ${PHYSX_ROOT_DIR}/include/foundation/PxArray.h ${PHYSX_ROOT_DIR}/include/foundation/PxAtomic.h ${PHYSX_ROOT_DIR}/include/foundation/PxBasicTemplates.h ${PHYSX_ROOT_DIR}/include/foundation/PxBitMap.h ${PHYSX_ROOT_DIR}/include/foundation/PxBitAndData.h ${PHYSX_ROOT_DIR}/include/foundation/PxBitUtils.h ${PHYSX_ROOT_DIR}/include/foundation/PxBounds3.h ${PHYSX_ROOT_DIR}/include/foundation/PxBroadcast.h ${PHYSX_ROOT_DIR}/include/foundation/PxErrorCallback.h ${PHYSX_ROOT_DIR}/include/foundation/PxErrors.h ${PHYSX_ROOT_DIR}/include/foundation/PxFlags.h ${PHYSX_ROOT_DIR}/include/foundation/PxFPU.h ${PHYSX_ROOT_DIR}/include/foundation/PxInlineAoS.h ${PHYSX_ROOT_DIR}/include/foundation/PxIntrinsics.h ${PHYSX_ROOT_DIR}/include/foundation/PxHash.h ${PHYSX_ROOT_DIR}/include/foundation/PxHashInternals.h ${PHYSX_ROOT_DIR}/include/foundation/PxHashMap.h ${PHYSX_ROOT_DIR}/include/foundation/PxHashSet.h ${PHYSX_ROOT_DIR}/include/foundation/PxInlineAllocator.h ${PHYSX_ROOT_DIR}/include/foundation/PxInlineArray.h ${PHYSX_ROOT_DIR}/include/foundation/PxPinnedArray.h ${PHYSX_ROOT_DIR}/include/foundation/PxMathIntrinsics.h ${PHYSX_ROOT_DIR}/include/foundation/PxMutex.h ${PHYSX_ROOT_DIR}/include/foundation/PxIO.h ${PHYSX_ROOT_DIR}/include/foundation/PxMat33.h ${PHYSX_ROOT_DIR}/include/foundation/PxMat34.h ${PHYSX_ROOT_DIR}/include/foundation/PxMat44.h ${PHYSX_ROOT_DIR}/include/foundation/PxMath.h ${PHYSX_ROOT_DIR}/include/foundation/PxMemory.h ${PHYSX_ROOT_DIR}/include/foundation/PxPlane.h ${PHYSX_ROOT_DIR}/include/foundation/PxPool.h ${PHYSX_ROOT_DIR}/include/foundation/PxPreprocessor.h ${PHYSX_ROOT_DIR}/include/foundation/PxQuat.h ${PHYSX_ROOT_DIR}/include/foundation/PxPhysicsVersion.h ${PHYSX_ROOT_DIR}/include/foundation/PxSortInternals.h ${PHYSX_ROOT_DIR}/include/foundation/PxSimpleTypes.h ${PHYSX_ROOT_DIR}/include/foundation/PxSList.h ${PHYSX_ROOT_DIR}/include/foundation/PxSocket.h ${PHYSX_ROOT_DIR}/include/foundation/PxSort.h ${PHYSX_ROOT_DIR}/include/foundation/PxStrideIterator.h ${PHYSX_ROOT_DIR}/include/foundation/PxString.h ${PHYSX_ROOT_DIR}/include/foundation/PxSync.h ${PHYSX_ROOT_DIR}/include/foundation/PxTempAllocator.h ${PHYSX_ROOT_DIR}/include/foundation/PxThread.h ${PHYSX_ROOT_DIR}/include/foundation/PxTransform.h ${PHYSX_ROOT_DIR}/include/foundation/PxTime.h ${PHYSX_ROOT_DIR}/include/foundation/PxUnionCast.h ${PHYSX_ROOT_DIR}/include/foundation/PxUserAllocated.h ${PHYSX_ROOT_DIR}/include/foundation/PxUtilities.h ${PHYSX_ROOT_DIR}/include/foundation/PxVec2.h ${PHYSX_ROOT_DIR}/include/foundation/PxVec3.h ${PHYSX_ROOT_DIR}/include/foundation/PxVec4.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecMath.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecMathAoSScalar.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecMathAoSScalarInline.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecMathSSE.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecQuat.h ${PHYSX_ROOT_DIR}/include/foundation/PxVecTransform.h ${PHYSX_ROOT_DIR}/include/foundation/PxSIMDHelpers.h ) SOURCE_GROUP(include FILES ${PHYSXFOUNDATION_HEADERS}) SET(PHYSXFOUNDATION_SOURCE ${LL_SOURCE_DIR}/FdAllocator.cpp ${LL_SOURCE_DIR}/FdString.cpp ${LL_SOURCE_DIR}/FdTempAllocator.cpp ${LL_SOURCE_DIR}/FdAssert.cpp ${LL_SOURCE_DIR}/FdMathUtils.cpp ${LL_SOURCE_DIR}/FdFoundation.cpp ${LL_SOURCE_DIR}/FdFoundation.h ) SOURCE_GROUP(src FILES ${PHYSXFOUNDATION_SOURCE}) ADD_LIBRARY(PhysXFoundation ${PHYSXFOUNDATION_LIBTYPE} ${PHYSXFOUNDATION_HEADERS} ${PHYSXFOUNDATION_SOURCE} ${PHYSXFOUNDATION_PLATFORM_FILES} ) # Add the headers to the install INSTALL(FILES ${PHYSXFOUNDATION_HEADERS} DESTINATION include/foundation) TARGET_INCLUDE_DIRECTORIES(PhysXFoundation PUBLIC ${PHYSX_ROOT_DIR}/include # FIXME: This is really terrible! Don't export src directories PUBLIC ${LL_SOURCE_DIR}/include PRIVATE ${PHYSXFOUNDATION_PLATFORM_INCLUDES} ) TARGET_COMPILE_DEFINITIONS(PhysXFoundation PRIVATE ${PHYSXFOUNDATION_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES OUTPUT_NAME PhysXFoundation ) IF(PHYSXFOUNDATION_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXFoundation_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXFoundation_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXFoundation_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXFoundation_static" ) ENDIF() IF(PHYSXFOUNDATION_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXFOUNDATION_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXFOUNDATION_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXFOUNDATION_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXFOUNDATION_COMPILE_PDB_NAME_RELEASE} ) ENDIF() # Add linked libraries TARGET_LINK_LIBRARIES(PhysXFoundation PRIVATE ${PHYSXFOUNDATION_PLATFORM_LINKED_LIBS} ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXFOUNDATION_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXFOUNDATION_SOURCE_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXFOUNDATION_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXFOUNDATION_PLATFORM_FILES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PXSHARED_PLATFORM_HEADERS}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES POSITION_INDEPENDENT_CODE TRUE) IF(PLATFORM_COMPILE_FLAGS) SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES COMPILE_FLAGS ${PLATFORM_COMPILE_FLAGS}) ENDIF()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXCommon.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXCommon common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(COMMON_SRC_DIR ${PHYSX_SOURCE_DIR}/common/src) SET(COMMON_INCLUDE_DIR ${PHYSX_SOURCE_DIR}/common/include) SET(GU_SOURCE_DIR ${PHYSX_SOURCE_DIR}/geomutils) SET(PXCOMMON_PLATFORM_LINK_FLAGS_DEBUG " ") SET(PXCOMMON_PLATFORM_LINK_FLAGS_CHECKED " ") SET(PXCOMMON_PLATFORM_LINK_FLAGS_PROFILE " ") SET(PXCOMMON_PLATFORM_LINK_FLAGS_RELEASE " ") # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXCommon.cmake) SET(PHYSX_COMMON_SOURCE ${COMMON_SRC_DIR}/CmPtrTable.cpp ${COMMON_SRC_DIR}/CmRenderBuffer.h ${COMMON_SRC_DIR}/CmBlockArray.h ${COMMON_SRC_DIR}/CmCollection.h ${COMMON_SRC_DIR}/CmCollection.cpp ${COMMON_SRC_DIR}/CmConeLimitHelper.h ${COMMON_SRC_DIR}/CmFlushPool.h ${COMMON_SRC_DIR}/CmIDPool.h ${COMMON_SRC_DIR}/CmMatrix34.h ${COMMON_SRC_DIR}/CmPool.h ${COMMON_SRC_DIR}/CmPreallocatingPool.h ${COMMON_SRC_DIR}/CmPriorityQueue.h ${COMMON_SRC_DIR}/CmPtrTable.h ${COMMON_SRC_DIR}/CmRadixSort.h ${COMMON_SRC_DIR}/CmRadixSort.cpp ${COMMON_SRC_DIR}/CmRandom.h ${COMMON_SRC_DIR}/CmRefCountable.h ${COMMON_SRC_DIR}/CmScaling.h ${COMMON_SRC_DIR}/CmSerialize.h ${COMMON_SRC_DIR}/CmSerialize.cpp ${COMMON_SRC_DIR}/CmSpatialVector.h ${COMMON_SRC_DIR}/CmTask.h ${COMMON_SRC_DIR}/CmTransformUtils.h ${COMMON_SRC_DIR}/CmUtils.h ${COMMON_SRC_DIR}/CmVisualization.h ${COMMON_SRC_DIR}/CmVisualization.cpp ) SOURCE_GROUP(common\\src FILES ${PHYSX_COMMON_SOURCE}) SET(PHYSXCOMMON_COMMON_INTERNAL_HEADERS ${COMMON_INCLUDE_DIR}/omnipvd/CmOmniPvdAutoGenClearDefines.h ${COMMON_INCLUDE_DIR}/omnipvd/CmOmniPvdAutoGenCreateRegistrationStruct.h ${COMMON_INCLUDE_DIR}/omnipvd/CmOmniPvdAutoGenRegisterData.h ${COMMON_INCLUDE_DIR}/omnipvd/CmOmniPvdAutoGenSetData.h ) SOURCE_GROUP(common\\include\\omnipvd FILES ${PHYSXCOMMON_COMMON_INTERNAL_HEADERS}) SET(PHYSXCOMMON_COMMON_HEADERS ${PHYSX_ROOT_DIR}/include/common/PxBase.h ${PHYSX_ROOT_DIR}/include/common/PxCollection.h ${PHYSX_ROOT_DIR}/include/common/PxCoreUtilityTypes.h ${PHYSX_ROOT_DIR}/include/common/PxMetaData.h ${PHYSX_ROOT_DIR}/include/common/PxMetaDataFlags.h ${PHYSX_ROOT_DIR}/include/common/PxInsertionCallback.h ${PHYSX_ROOT_DIR}/include/common/PxPhysXCommonConfig.h ${PHYSX_ROOT_DIR}/include/common/PxRenderBuffer.h ${PHYSX_ROOT_DIR}/include/common/PxRenderOutput.h ${PHYSX_ROOT_DIR}/include/common/PxSerialFramework.h ${PHYSX_ROOT_DIR}/include/common/PxSerializer.h ${PHYSX_ROOT_DIR}/include/common/PxStringTable.h ${PHYSX_ROOT_DIR}/include/common/PxTolerancesScale.h ${PHYSX_ROOT_DIR}/include/common/PxTypeInfo.h ${PHYSX_ROOT_DIR}/include/common/PxProfileZone.h ) SOURCE_GROUP(include\\common FILES ${PHYSXCOMMON_COMMON_HEADERS}) SET(PHYSXCOMMON_GEOMETRY_HEADERS ${PHYSX_ROOT_DIR}/include/geometry/PxBoxGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxCapsuleGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxConvexMesh.h ${PHYSX_ROOT_DIR}/include/geometry/PxConvexMeshGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxCustomGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryInternal.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryHelpers.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryHit.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryQuery.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryQueryFlags.h ${PHYSX_ROOT_DIR}/include/geometry/PxGeometryQueryContext.h ${PHYSX_ROOT_DIR}/include/geometry/PxHairSystemDesc.h ${PHYSX_ROOT_DIR}/include/geometry/PxHairSystemGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxHeightField.h ${PHYSX_ROOT_DIR}/include/geometry/PxHeightFieldDesc.h ${PHYSX_ROOT_DIR}/include/geometry/PxHeightFieldFlag.h ${PHYSX_ROOT_DIR}/include/geometry/PxHeightFieldGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxHeightFieldSample.h ${PHYSX_ROOT_DIR}/include/geometry/PxMeshQuery.h ${PHYSX_ROOT_DIR}/include/geometry/PxMeshScale.h ${PHYSX_ROOT_DIR}/include/geometry/PxPlaneGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxReportCallback.h ${PHYSX_ROOT_DIR}/include/geometry/PxSimpleTriangleMesh.h ${PHYSX_ROOT_DIR}/include/geometry/PxSphereGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxTriangle.h ${PHYSX_ROOT_DIR}/include/geometry/PxTriangleMesh.h ${PHYSX_ROOT_DIR}/include/geometry/PxTriangleMeshGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxBVH.h ${PHYSX_ROOT_DIR}/include/geometry/PxBVHBuildStrategy.h ${PHYSX_ROOT_DIR}/include/geometry/PxTetrahedron.h ${PHYSX_ROOT_DIR}/include/geometry/PxTetrahedronMesh.h ${PHYSX_ROOT_DIR}/include/geometry/PxTetrahedronMeshGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxParticleSystemGeometry.h ${PHYSX_ROOT_DIR}/include/geometry/PxGjkQuery.h ) SOURCE_GROUP(include\\geometry FILES ${PHYSXCOMMON_GEOMETRY_HEADERS}) SET(PHYSXCOMMON_GEOMUTILS_HEADERS ${PHYSX_ROOT_DIR}/include/geomutils/PxContactBuffer.h ${PHYSX_ROOT_DIR}/include/geomutils/PxContactPoint.h ) SOURCE_GROUP(include\\geomutils FILES ${PHYSXCOMMON_GEOMUTILS_HEADERS}) SET(PHYSXCOMMON_COLLISION_HEADERS ${PHYSX_ROOT_DIR}/include/collision/PxCollisionDefs.h ) SOURCE_GROUP(include\\collision FILES ${PHYSXCOMMON_COLLISION_HEADERS}) SET(PHYSXCOMMON_GU_HEADERS ${GU_SOURCE_DIR}/include/GuBox.h ${GU_SOURCE_DIR}/include/GuSphere.h ${GU_SOURCE_DIR}/include/GuSegment.h ${GU_SOURCE_DIR}/include/GuCapsule.h ${GU_SOURCE_DIR}/include/GuCenterExtents.h ${GU_SOURCE_DIR}/include/GuBounds.h ${GU_SOURCE_DIR}/include/GuDistanceSegmentBox.h ${GU_SOURCE_DIR}/include/GuDistanceSegmentSegment.h ${GU_SOURCE_DIR}/include/GuIntersectionBoxBox.h ${GU_SOURCE_DIR}/include/GuIntersectionTetrahedronBox.h ${GU_SOURCE_DIR}/include/GuIntersectionTriangleBoxRef.h ${GU_SOURCE_DIR}/include/GuIntersectionTriangleTriangle.h ${GU_SOURCE_DIR}/include/GuRaycastTests.h ${GU_SOURCE_DIR}/include/GuOverlapTests.h ${GU_SOURCE_DIR}/include/GuSweepTests.h ${GU_SOURCE_DIR}/include/GuCachedFuncs.h ${GU_SOURCE_DIR}/include/GuPruner.h ${GU_SOURCE_DIR}/include/GuPrunerTypedef.h ${GU_SOURCE_DIR}/include/GuPrunerPayload.h ${GU_SOURCE_DIR}/include/GuPrunerMergeData.h ${GU_SOURCE_DIR}/include/GuSqInternal.h ${GU_SOURCE_DIR}/include/GuActorShapeMap.h ${GU_SOURCE_DIR}/include/GuQuerySystem.h ${GU_SOURCE_DIR}/include/GuFactory.h ${GU_SOURCE_DIR}/include/GuDistancePointTetrahedron.h ${GU_SOURCE_DIR}/include/GuDistancePointTriangle.h ${GU_SOURCE_DIR}/include/GuIntersectionTriangleBox.h ${GU_SOURCE_DIR}/include/GuCooking.h ) SOURCE_GROUP(geomutils\\include FILES ${PHYSXCOMMON_GU_HEADERS}) #SET(PHYSXCOMMON_GU_PXHEADERS # ${PHYSX_ROOT_DIR}/include/geomutils/GuContactBuffer.h # ${PHYSX_ROOT_DIR}/include/geomutils/GuContactPoint.h #) #SOURCE_GROUP(geomutils\\include FILES ${PHYSXCOMMON_GU_PXHEADERS}) SET(PHYSXCOMMON_GU_SOURCE ${GU_SOURCE_DIR}/src/GuBox.cpp ${GU_SOURCE_DIR}/src/GuCapsule.cpp ${GU_SOURCE_DIR}/src/GuCCTSweepTests.cpp ${GU_SOURCE_DIR}/src/GuGeometryQuery.cpp ${GU_SOURCE_DIR}/src/GuInternal.cpp ${GU_SOURCE_DIR}/src/GuMeshFactory.cpp ${GU_SOURCE_DIR}/src/GuMetaData.cpp ${GU_SOURCE_DIR}/src/GuMTD.cpp ${GU_SOURCE_DIR}/src/GuOverlapTests.cpp ${GU_SOURCE_DIR}/src/GuRaycastTests.cpp ${GU_SOURCE_DIR}/src/GuSweepMTD.cpp ${GU_SOURCE_DIR}/src/GuSweepSharedTests.cpp ${GU_SOURCE_DIR}/src/GuSweepTests.cpp ${GU_SOURCE_DIR}/src/GuGeometryChecks.h ${GU_SOURCE_DIR}/src/GuInternal.h ${GU_SOURCE_DIR}/src/GuMeshFactory.h ${GU_SOURCE_DIR}/src/GuMTD.h ${GU_SOURCE_DIR}/src/GuSweepMTD.h ${GU_SOURCE_DIR}/src/GuSweepSharedTests.h ${GU_SOURCE_DIR}/src/GuSDF.h ${GU_SOURCE_DIR}/src/GuSDF.cpp ${GU_SOURCE_DIR}/src/GuCookingSDF.h ${GU_SOURCE_DIR}/src/GuCookingSDF.cpp ${GU_SOURCE_DIR}/src/GuGjkQuery.cpp ${GU_SOURCE_DIR}/src/GuWindingNumber.cpp ${GU_SOURCE_DIR}/src/GuWindingNumber.h ${GU_SOURCE_DIR}/src/GuWindingNumberCluster.h ${GU_SOURCE_DIR}/src/GuWindingNumberT.h ) SOURCE_GROUP(geomutils\\src FILES ${PHYSXCOMMON_GU_SOURCE}) SET(PHYSXCOMMON_GU_CCD_SOURCE ${GU_SOURCE_DIR}/src/ccd/GuCCDSweepConvexMesh.cpp ${GU_SOURCE_DIR}/src/ccd/GuCCDSweepPrimitives.cpp ${GU_SOURCE_DIR}/src/ccd/GuCCDSweepConvexMesh.h ) SOURCE_GROUP(geomutils\\src\\ccd FILES ${PHYSXCOMMON_GU_CCD_SOURCE}) SET(PHYSXCOMMON_GU_COMMON_SOURCE ${GU_SOURCE_DIR}/src/common/GuBarycentricCoordinates.cpp ${GU_SOURCE_DIR}/src/common/GuBarycentricCoordinates.h ${GU_SOURCE_DIR}/src/common/GuBoxConversion.h ${GU_SOURCE_DIR}/src/common/GuEdgeCache.h ${GU_SOURCE_DIR}/src/common/GuAdjacencies.h ${GU_SOURCE_DIR}/src/common/GuAdjacencies.cpp ${GU_SOURCE_DIR}/src/common/GuEdgeList.h ${GU_SOURCE_DIR}/src/common/GuEdgeList.cpp ${GU_SOURCE_DIR}/src/common/GuSeparatingAxes.h ${GU_SOURCE_DIR}/src/common/GuSeparatingAxes.cpp ${GU_SOURCE_DIR}/src/common/GuQuantizer.h ${GU_SOURCE_DIR}/src/common/GuQuantizer.cpp ${GU_SOURCE_DIR}/src/common/GuMeshCleaner.h ${GU_SOURCE_DIR}/src/common/GuMeshCleaner.cpp ${GU_SOURCE_DIR}/src/common/GuVertexReducer.h ${GU_SOURCE_DIR}/src/common/GuVertexReducer.cpp ${GU_SOURCE_DIR}/src/common/GuMeshAnalysis.h ${GU_SOURCE_DIR}/src/common/GuMeshAnalysis.cpp ) SOURCE_GROUP(geomutils\\src\\common FILES ${PHYSXCOMMON_GU_COMMON_SOURCE}) SET(PHYSXCOMMON_GU_CONTACT_SOURCE ${GU_SOURCE_DIR}/src/contact/GuContactBoxBox.cpp ${GU_SOURCE_DIR}/src/contact/GuContactCapsuleBox.cpp ${GU_SOURCE_DIR}/src/contact/GuContactCapsuleCapsule.cpp ${GU_SOURCE_DIR}/src/contact/GuContactCapsuleConvex.cpp ${GU_SOURCE_DIR}/src/contact/GuContactCapsuleMesh.cpp ${GU_SOURCE_DIR}/src/contact/GuContactConvexConvex.cpp ${GU_SOURCE_DIR}/src/contact/GuContactConvexMesh.cpp ${GU_SOURCE_DIR}/src/contact/GuContactPlaneBox.cpp ${GU_SOURCE_DIR}/src/contact/GuContactPlaneCapsule.cpp ${GU_SOURCE_DIR}/src/contact/GuContactPlaneConvex.cpp ${GU_SOURCE_DIR}/src/contact/GuContactPolygonPolygon.cpp ${GU_SOURCE_DIR}/src/contact/GuContactSphereBox.cpp ${GU_SOURCE_DIR}/src/contact/GuContactSphereCapsule.cpp ${GU_SOURCE_DIR}/src/contact/GuContactSphereMesh.cpp ${GU_SOURCE_DIR}/src/contact/GuContactSpherePlane.cpp ${GU_SOURCE_DIR}/src/contact/GuContactSphereSphere.cpp ${GU_SOURCE_DIR}/src/contact/GuContactCustomGeometry.cpp ${GU_SOURCE_DIR}/src/contact/GuFeatureCode.cpp ${GU_SOURCE_DIR}/src/contact/GuContactMethodImpl.h ${GU_SOURCE_DIR}/src/contact/GuContactPolygonPolygon.h ${GU_SOURCE_DIR}/src/contact/GuFeatureCode.h ) SOURCE_GROUP(geomutils\\src\\contact FILES ${PHYSXCOMMON_GU_CONTACT_SOURCE}) SET(PHYSXCOMMON_GU_CONVEX_SOURCE ${GU_SOURCE_DIR}/src/convex/GuBigConvexData.cpp ${GU_SOURCE_DIR}/src/convex/GuConvexHelper.cpp ${GU_SOURCE_DIR}/src/convex/GuConvexMesh.cpp ${GU_SOURCE_DIR}/src/convex/GuConvexSupportTable.cpp ${GU_SOURCE_DIR}/src/convex/GuConvexUtilsInternal.cpp ${GU_SOURCE_DIR}/src/convex/GuHillClimbing.cpp ${GU_SOURCE_DIR}/src/convex/GuShapeConvex.cpp ${GU_SOURCE_DIR}/src/convex/GuBigConvexData.h ${GU_SOURCE_DIR}/src/convex/GuBigConvexData2.h ${GU_SOURCE_DIR}/src/convex/GuConvexEdgeFlags.h ${GU_SOURCE_DIR}/src/convex/GuConvexHelper.h ${GU_SOURCE_DIR}/src/convex/GuConvexMesh.h ${GU_SOURCE_DIR}/src/convex/GuConvexMeshData.h ${GU_SOURCE_DIR}/src/convex/GuConvexSupportTable.h ${GU_SOURCE_DIR}/src/convex/GuConvexUtilsInternal.h ${GU_SOURCE_DIR}/src/convex/GuCubeIndex.h ${GU_SOURCE_DIR}/src/convex/GuHillClimbing.h ${GU_SOURCE_DIR}/src/convex/GuShapeConvex.h ) SOURCE_GROUP(geomutils\\src\\convex FILES ${PHYSXCOMMON_GU_CONVEX_SOURCE}) SET(PHYSXCOMMON_GU_DISTANCE_SOURCE ${GU_SOURCE_DIR}/src/distance/GuDistancePointBox.cpp ${GU_SOURCE_DIR}/src/distance/GuDistancePointTriangle.cpp ${GU_SOURCE_DIR}/src/distance/GuDistanceSegmentBox.cpp ${GU_SOURCE_DIR}/src/distance/GuDistanceSegmentSegment.cpp ${GU_SOURCE_DIR}/src/distance/GuDistanceSegmentTriangle.cpp ${GU_SOURCE_DIR}/src/distance/GuDistanceTriangleTriangle.cpp ${GU_SOURCE_DIR}/src/distance/GuDistancePointTetrahedron.cpp ${GU_SOURCE_DIR}/src/distance/GuDistancePointBox.h ${GU_SOURCE_DIR}/src/distance/GuDistancePointSegment.h ${GU_SOURCE_DIR}/src/distance/GuDistanceSegmentTriangle.h ${GU_SOURCE_DIR}/src/distance/GuDistanceTriangleTriangle.h ${GU_SOURCE_DIR}/src/distance/GuDistancePointTetrahedron.h ) SOURCE_GROUP(geomutils\\src\\distance FILES ${PHYSXCOMMON_GU_DISTANCE_SOURCE}) SET(PHYSXCOMMON_GU_GJK_SOURCE ${GU_SOURCE_DIR}/src/gjk/GuEPA.cpp ${GU_SOURCE_DIR}/src/gjk/GuGJKSimplex.cpp ${GU_SOURCE_DIR}/src/gjk/GuGJKTest.cpp ${GU_SOURCE_DIR}/src/gjk/GuEPA.h ${GU_SOURCE_DIR}/src/gjk/GuEPAFacet.h ${GU_SOURCE_DIR}/src/gjk/GuGJK.h ${GU_SOURCE_DIR}/src/gjk/GuGJKPenetration.h ${GU_SOURCE_DIR}/src/gjk/GuGJKRaycast.h ${GU_SOURCE_DIR}/src/gjk/GuGJKSimplex.h ${GU_SOURCE_DIR}/src/gjk/GuGJKTest.h ${GU_SOURCE_DIR}/src/gjk/GuGJKType.h ${GU_SOURCE_DIR}/src/gjk/GuGJKUtil.h ${GU_SOURCE_DIR}/src/gjk/GuVecBox.h ${GU_SOURCE_DIR}/src/gjk/GuVecCapsule.h ${GU_SOURCE_DIR}/src/gjk/GuVecConvex.h ${GU_SOURCE_DIR}/src/gjk/GuVecConvexHull.h ${GU_SOURCE_DIR}/src/gjk/GuVecConvexHullNoScale.h ${GU_SOURCE_DIR}/src/gjk/GuVecPlane.h ${GU_SOURCE_DIR}/src/gjk/GuVecSphere.h ${GU_SOURCE_DIR}/src/gjk/GuVecTriangle.h ${GU_SOURCE_DIR}/src/gjk/GuVecTetrahedron.h ) SOURCE_GROUP(geomutils\\src\\gjk FILES ${PHYSXCOMMON_GU_GJK_SOURCE}) SET(PHYSXCOMMON_GU_HF_SOURCE ${GU_SOURCE_DIR}/src/hf/GuHeightField.cpp ${GU_SOURCE_DIR}/src/hf/GuHeightFieldUtil.cpp ${GU_SOURCE_DIR}/src/hf/GuOverlapTestsHF.cpp ${GU_SOURCE_DIR}/src/hf/GuSweepsHF.cpp ${GU_SOURCE_DIR}/src/hf/GuEntityReport.h ${GU_SOURCE_DIR}/src/hf/GuHeightField.h ${GU_SOURCE_DIR}/src/hf/GuHeightFieldData.h ${GU_SOURCE_DIR}/src/hf/GuHeightFieldUtil.h ) SOURCE_GROUP(geomutils\\src\\hf FILES ${PHYSXCOMMON_GU_HF_SOURCE}) SET(PHYSXCOMMON_GU_INTERSECTION_SOURCE ${GU_SOURCE_DIR}/src/intersection/GuIntersectionBoxBox.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionCapsuleTriangle.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionEdgeEdge.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayBox.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayCapsule.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRaySphere.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionSphereBox.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionTetrahedronBox.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionTriangleBox.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionTriangleTriangle.cpp ${GU_SOURCE_DIR}/src/intersection/GuIntersectionCapsuleTriangle.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionEdgeEdge.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRay.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayBox.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayCapsule.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayPlane.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRaySphere.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionRayTriangle.h ${GU_SOURCE_DIR}/src/intersection/GuIntersectionSphereBox.h ) SOURCE_GROUP(geomutils\\src\\intersection FILES ${PHYSXCOMMON_GU_INTERSECTION_SOURCE}) SET(PXCOMMON_BVH4_FILES ${GU_SOURCE_DIR}/src/mesh/GuBV4_AABBSweep.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_BoxOverlap.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_CapsuleSweep.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_CapsuleSweepAA.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_MeshMeshOverlap.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_OBBSweep.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_Raycast.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_SphereOverlap.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4_SphereSweep.cpp ${GU_SOURCE_DIR}/src/mesh/GuMidphaseBV4.cpp ) SET(PHYSXCOMMON_GU_MESH_SOURCE ${GU_SOURCE_DIR}/src/mesh/GuBV4.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV4Build.cpp ${PXCOMMON_BVH4_FILES} ${GU_SOURCE_DIR}/src/mesh/GuMeshQuery.cpp ${GU_SOURCE_DIR}/src/mesh/GuMidphaseRTree.cpp ${GU_SOURCE_DIR}/src/mesh/GuOverlapTestsMesh.cpp ${GU_SOURCE_DIR}/src/mesh/GuRTree.cpp ${GU_SOURCE_DIR}/src/mesh/GuRTreeQueries.cpp ${GU_SOURCE_DIR}/src/mesh/GuSweepsMesh.cpp ${GU_SOURCE_DIR}/src/mesh/GuTriangleMesh.cpp ${GU_SOURCE_DIR}/src/mesh/GuTriangleMeshBV4.cpp ${GU_SOURCE_DIR}/src/mesh/GuTriangleMeshRTree.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV32.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV32Build.cpp ${GU_SOURCE_DIR}/src/mesh/GuTetrahedronMesh.cpp ${GU_SOURCE_DIR}/src/mesh/GuTetrahedronMeshUtils.cpp ${GU_SOURCE_DIR}/src/mesh/GuBV32.h ${GU_SOURCE_DIR}/src/mesh/GuBV32Build.h ${GU_SOURCE_DIR}/src/mesh/GuBV4.h ${GU_SOURCE_DIR}/src/mesh/GuBV4Build.h ${GU_SOURCE_DIR}/src/mesh/GuBV4Settings.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_AABBAABBSweepTest.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_BoxBoxOverlapTest.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_BoxOverlap_Internal.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_BoxSweep_Internal.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_BoxSweep_Params.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_CapsuleSweep_Internal.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Common.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Internal.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamNoOrder_OBBOBB.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamNoOrder_SegmentAABB.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamNoOrder_SegmentAABB_Inflated.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamNoOrder_SphereAABB.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamOrdered_OBBOBB.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamOrdered_SegmentAABB.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_ProcessStreamOrdered_SegmentAABB_Inflated.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Slabs.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Slabs_KajiyaNoOrder.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Slabs_KajiyaOrdered.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Slabs_SwizzledNoOrder.h ${GU_SOURCE_DIR}/src/mesh/GuBV4_Slabs_SwizzledOrdered.h ${GU_SOURCE_DIR}/src/mesh/GuBVConstants.h ${GU_SOURCE_DIR}/src/mesh/GuMeshData.h ${GU_SOURCE_DIR}/src/mesh/GuMidphaseInterface.h ${GU_SOURCE_DIR}/src/mesh/GuRTree.h ${GU_SOURCE_DIR}/src/mesh/GuSweepConvexTri.h ${GU_SOURCE_DIR}/src/mesh/GuSweepMesh.h ${GU_SOURCE_DIR}/src/mesh/GuTriangle.h ${GU_SOURCE_DIR}/src/mesh/GuTriangleCache.h ${GU_SOURCE_DIR}/src/mesh/GuTriangleMesh.h ${GU_SOURCE_DIR}/src/mesh/GuTriangleMeshBV4.h ${GU_SOURCE_DIR}/src/mesh/GuTriangleMeshRTree.h ${GU_SOURCE_DIR}/src/mesh/GuTetrahedron.h ${GU_SOURCE_DIR}/src/mesh/GuTetrahedronMesh.h ${GU_SOURCE_DIR}/src/mesh/GuTetrahedronMeshUtils.h ) SOURCE_GROUP(geomutils\\src\\mesh FILES ${PHYSXCOMMON_GU_MESH_SOURCE}) SET(PHYSXCOMMON_GU_PCM_SOURCE ${GU_SOURCE_DIR}/src/pcm/GuPCMContactBoxBox.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactBoxConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCapsuleBox.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCapsuleCapsule.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCapsuleConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCapsuleHeightField.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCapsuleMesh.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactConvexCommon.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactConvexConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactConvexHeightField.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactConvexMesh.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactGenBoxConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactGenSphereCapsule.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactPlaneBox.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactPlaneCapsule.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactPlaneConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereBox.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereCapsule.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereHeightField.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereMesh.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSpherePlane.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactSphereSphere.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactCustomGeometry.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMShapeConvex.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMTriangleContactGen.cpp ${GU_SOURCE_DIR}/src/pcm/GuPersistentContactManifold.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactConvexCommon.h ${GU_SOURCE_DIR}/src/pcm/GuPCMContactGen.h ${GU_SOURCE_DIR}/src/pcm/GuPCMContactGenUtil.h ${GU_SOURCE_DIR}/src/pcm/GuPCMContactGenUtil.cpp ${GU_SOURCE_DIR}/src/pcm/GuPCMContactMeshCallback.h ${GU_SOURCE_DIR}/src/pcm/GuPCMShapeConvex.h ${GU_SOURCE_DIR}/src/pcm/GuPCMTriangleContactGen.h ${GU_SOURCE_DIR}/src/pcm/GuPersistentContactManifold.h ) SOURCE_GROUP(geomutils\\src\\pcm FILES ${PHYSXCOMMON_GU_PCM_SOURCE}) SET(PHYSXCOMMON_GU_SWEEP_SOURCE ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxBox.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxSphere.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxTriangle_FeatureBased.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxTriangle_SAT.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleBox.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleCapsule.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleTriangle.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereCapsule.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereSphere.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereTriangle.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepTriangleUtils.cpp ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxBox.h ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxSphere.h ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxTriangle_FeatureBased.h ${GU_SOURCE_DIR}/src/sweep/GuSweepBoxTriangle_SAT.h ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleBox.h ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleCapsule.h ${GU_SOURCE_DIR}/src/sweep/GuSweepCapsuleTriangle.h ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereCapsule.h ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereSphere.h ${GU_SOURCE_DIR}/src/sweep/GuSweepSphereTriangle.h ${GU_SOURCE_DIR}/src/sweep/GuSweepTriangleUtils.h ) SOURCE_GROUP(geomutils\\src\\sweep FILES ${PHYSXCOMMON_GU_SWEEP_SOURCE}) SET(PHYSXCOMMON_GU_PRUNERS_SOURCE ${GU_SOURCE_DIR}/src/GuBounds.cpp ${GU_SOURCE_DIR}/src/GuQuery.h ${GU_SOURCE_DIR}/src/GuAABBTree.cpp ${GU_SOURCE_DIR}/src/GuAABBTree.h ${GU_SOURCE_DIR}/src/GuAABBTreeUpdateMap.h ${GU_SOURCE_DIR}/src/GuAABBTreeUpdateMap.cpp ${GU_SOURCE_DIR}/src/GuAABBTreeBounds.h ${GU_SOURCE_DIR}/src/GuAABBTreeNode.h ${GU_SOURCE_DIR}/src/GuAABBTreeBuildStats.h ${GU_SOURCE_DIR}/src/GuAABBTreeQuery.h ${GU_SOURCE_DIR}/src/GuSqInternal.cpp ${GU_SOURCE_DIR}/src/GuIncrementalAABBTree.h ${GU_SOURCE_DIR}/src/GuIncrementalAABBTree.cpp ${GU_SOURCE_DIR}/src/GuSAH.cpp ${GU_SOURCE_DIR}/src/GuSAH.h ${GU_SOURCE_DIR}/src/GuBVH.cpp ${GU_SOURCE_DIR}/src/GuBVH.h ${GU_SOURCE_DIR}/src/GuBVHTestsSIMD.h ${GU_SOURCE_DIR}/src/GuIncrementalAABBPrunerCore.h ${GU_SOURCE_DIR}/src/GuIncrementalAABBPrunerCore.cpp ${GU_SOURCE_DIR}/src/GuIncrementalAABBPruner.h ${GU_SOURCE_DIR}/src/GuIncrementalAABBPruner.cpp ${GU_SOURCE_DIR}/src/GuPruningPool.h ${GU_SOURCE_DIR}/src/GuPruningPool.cpp ${GU_SOURCE_DIR}/src/GuBucketPruner.h ${GU_SOURCE_DIR}/src/GuBucketPruner.cpp ${GU_SOURCE_DIR}/src/GuMaverickNode.h ${GU_SOURCE_DIR}/src/GuMaverickNode.cpp ${GU_SOURCE_DIR}/src/GuExtendedBucketPruner.h ${GU_SOURCE_DIR}/src/GuExtendedBucketPruner.cpp ${GU_SOURCE_DIR}/src/GuSecondaryPruner.h ${GU_SOURCE_DIR}/src/GuSecondaryPruner.cpp ${GU_SOURCE_DIR}/src/GuAABBPruner.h ${GU_SOURCE_DIR}/src/GuAABBPruner.cpp ${GU_SOURCE_DIR}/src/GuActorShapeMap.cpp ${GU_SOURCE_DIR}/src/GuCallbackAdapter.h ${GU_SOURCE_DIR}/src/GuQuerySystem.cpp ${GU_SOURCE_DIR}/src/GuFactory.cpp ) SOURCE_GROUP(geomutils\\src\\pruners FILES ${PHYSXCOMMON_GU_PRUNERS_SOURCE}) SET(PHYSXCOMMON_GU_COOKING_SOURCE ${GU_SOURCE_DIR}/src/cooking/GuRTreeCooking.h ${GU_SOURCE_DIR}/src/cooking/GuRTreeCooking.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingBVH.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingHF.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingGrbTriangleMesh.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexMesh.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingTriangleMesh.h ${GU_SOURCE_DIR}/src/cooking/GuCookingTriangleMesh.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingTetrahedronMesh.h ${GU_SOURCE_DIR}/src/cooking/GuCookingTetrahedronMesh.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingVolumeIntegration.h ${GU_SOURCE_DIR}/src/cooking/GuCookingVolumeIntegration.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingQuickHullConvexHullLib.h ${GU_SOURCE_DIR}/src/cooking/GuCookingQuickHullConvexHullLib.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexPolygonsBuilder.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexPolygonsBuilder.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexMeshBuilder.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexMeshBuilder.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullUtils.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullUtils.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullLib.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullLib.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullBuilder.h ${GU_SOURCE_DIR}/src/cooking/GuCookingConvexHullBuilder.cpp ${GU_SOURCE_DIR}/src/cooking/GuCookingBigConvexDataBuilder.h ${GU_SOURCE_DIR}/src/cooking/GuCookingBigConvexDataBuilder.cpp ) SOURCE_GROUP(geomutils\\src\\cooking FILES ${PHYSXCOMMON_GU_COOKING_SOURCE}) ADD_LIBRARY(PhysXCommon ${PHYSXCOMMON_LIBTYPE} ${PHYSX_COMMON_SOURCE} ${PHYSXCOMMON_COMMON_INTERNAL_HEADERS} ${PHYSXCOMMON_COMMON_HEADERS} ${PHYSXCOMMON_GEOMETRY_HEADERS} ${PHYSXCOMMON_GEOMUTILS_HEADERS} ${PHYSXCOMMON_COLLISION_HEADERS} ${PXCOMMON_PLATFORM_SRC_FILES} ${PHYSXCOMMON_GU_HEADERS} # ${PHYSXCOMMON_GU_PXHEADERS} ${PHYSXCOMMON_GU_SOURCE} ${PHYSXCOMMON_GU_CCD_SOURCE} ${PHYSXCOMMON_GU_COMMON_SOURCE} ${PHYSXCOMMON_GU_CONTACT_SOURCE} ${PHYSXCOMMON_GU_CONVEX_SOURCE} ${PHYSXCOMMON_GU_DISTANCE_SOURCE} ${PHYSXCOMMON_GU_GJK_SOURCE} ${PHYSXCOMMON_GU_HF_SOURCE} ${PHYSXCOMMON_GU_INTERSECTION_SOURCE} ${PHYSXCOMMON_GU_MESH_SOURCE} ${PHYSXCOMMON_GU_PCM_SOURCE} ${PHYSXCOMMON_GU_SWEEP_SOURCE} ${PHYSXCOMMON_GU_PRUNERS_SOURCE} ${PHYSXCOMMON_GU_COOKING_SOURCE} ) INSTALL(FILES ${PHYSXCOMMON_GEOMETRY_HEADERS} DESTINATION include/geometry) INSTALL(FILES ${PHYSXCOMMON_GEOMUTILS_HEADERS} DESTINATION include/geomutils) TARGET_INCLUDE_DIRECTORIES(PhysXCommon PRIVATE ${PXCOMMON_PLATFORM_INCLUDES} PUBLIC ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/common PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/convex PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/distance PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/sweep PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/gjk PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/hf PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/pcm PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/ccd PRIVATE ${PHYSX_SOURCE_DIR}/physxgpu/include ) TARGET_COMPILE_DEFINITIONS(PhysXCommon PRIVATE ${PXCOMMON_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES OUTPUT_NAME PhysXCommon ) IF(PHYSXCOMMON_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXCommon_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXCommon_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXCommon_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXCommon_static" ) ENDIF() IF(PHYSXCOMMON_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES COMPILE_PDB_NAME_DEBUG "${PHYSXCOMMON_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${PHYSXCOMMON_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${PHYSXCOMMON_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${PHYSXCOMMON_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES LINK_FLAGS "${PXCOMMON_PLATFORM_LINK_FLAGS}" LINK_FLAGS_DEBUG "${PXCOMMON_PLATFORM_LINK_FLAGS_DEBUG}" LINK_FLAGS_CHECKED "${PXCOMMON_PLATFORM_LINK_FLAGS_CHECKED}" LINK_FLAGS_PROFILE "${PXCOMMON_PLATFORM_LINK_FLAGS_PROFILE}" LINK_FLAGS_RELEASE "${PXCOMMON_PLATFORM_LINK_FLAGS_RELEASE}" ) TARGET_LINK_LIBRARIES(PhysXCommon PUBLIC ${PXCOMMON_PLATFORM_LINKED_LIBS} PUBLIC PhysXFoundation PRIVATE ${PHYSXCOMMON_PLATFORM_LINKED_LIBS} ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_COMMON_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_COMMON_INTERNAL_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_COMMON_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GEOMETRY_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GEOMUTILS_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PXCOMMON_PLATFORM_SRC_FILES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_HEADERS}) #LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_PXHEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_CCD_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_COMMON_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_CONTACT_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_CONVEX_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_DISTANCE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_GJK_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_HF_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_INTERSECTION_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_MESH_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_PCM_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_SWEEP_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_PRUNERS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_GU_COOKING_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOMMON_COLLISION_HEADERS}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/LowLevel.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build LowLevel common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/lowlevel) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/LowLevel.cmake) SET(LL_API_DIR ${LL_SOURCE_DIR}/api/) SET(LL_API_HEADERS ${LL_API_DIR}/include/PxsMaterialShared.h ${LL_API_DIR}/include/PxsMaterialCore.h ${LL_API_DIR}/include/PxsFEMSoftBodyMaterialCore.h ${LL_API_DIR}/include/PxsFEMClothMaterialCore.h ${LL_API_DIR}/include/PxsPBDMaterialCore.h ${LL_API_DIR}/include/PxsFLIPMaterialCore.h ${LL_API_DIR}/include/PxsMPMMaterialCore.h ${LL_API_DIR}/include/PxsMaterialManager.h ${LL_API_DIR}/include/PxvConfig.h ${LL_API_DIR}/include/PxvDynamics.h ${LL_API_DIR}/include/PxvGeometry.h ${LL_API_DIR}/include/PxvGlobals.h ${LL_API_DIR}/include/PxvManager.h ${LL_API_DIR}/include/PxvSimStats.h ) SOURCE_GROUP("API Includes" FILES ${LL_API_HEADERS}) SET(LL_API_SOURCE ${LL_API_DIR}/src/px_globals.cpp ) SOURCE_GROUP("API Source" FILES ${LL_API_SOURCE}) SET(LL_COMMON_DIR ${LL_SOURCE_DIR}/common/) SET(LL_COMMON_COLLISION_HEADERS ${LL_COMMON_DIR}/include/collision/PxcContactMethodImpl.h ) SOURCE_GROUP("Common Includes\\collision" FILES ${LL_COMMON_COLLISION_HEADERS}) SET(LL_COMMON_PIPELINE_HEADERS ${LL_COMMON_DIR}/include/pipeline/PxcConstraintBlockStream.h ${LL_COMMON_DIR}/include/pipeline/PxcContactCache.h ${LL_COMMON_DIR}/include/pipeline/PxcMaterialMethodImpl.h ${LL_COMMON_DIR}/include/pipeline/PxcNpBatch.h ${LL_COMMON_DIR}/include/pipeline/PxcNpCache.h ${LL_COMMON_DIR}/include/pipeline/PxcNpCacheStreamPair.h ${LL_COMMON_DIR}/include/pipeline/PxcNpContactPrepShared.h ${LL_COMMON_DIR}/include/pipeline/PxcNpMemBlockPool.h ${LL_COMMON_DIR}/include/pipeline/PxcNpThreadContext.h ${LL_COMMON_DIR}/include/pipeline/PxcNpWorkUnit.h ) SOURCE_GROUP("Common Includes\\pipeline" FILES ${LL_COMMON_PIPELINE_HEADERS}) SET(LL_COMMON_UTILS_HEADERS ${LL_COMMON_DIR}/include/utils/PxcScratchAllocator.h ${LL_COMMON_DIR}/include/utils/PxcThreadCoherentCache.h ) SOURCE_GROUP("Common Includes\\utils" FILES ${LL_COMMON_UTILS_HEADERS}) SET(LL_COMMON_PIPELINE_SOURCE ${LL_COMMON_DIR}/src/pipeline/PxcContactCache.cpp ${LL_COMMON_DIR}/src/pipeline/PxcContactMethodImpl.cpp ${LL_COMMON_DIR}/src/pipeline/PxcMaterialMethodImpl.cpp ${LL_COMMON_DIR}/src/pipeline/PxcNpBatch.cpp ${LL_COMMON_DIR}/src/pipeline/PxcNpCacheStreamPair.cpp ${LL_COMMON_DIR}/src/pipeline/PxcNpContactPrepShared.cpp ${LL_COMMON_DIR}/src/pipeline/PxcNpMemBlockPool.cpp ${LL_COMMON_DIR}/src/pipeline/PxcNpThreadContext.cpp ) SOURCE_GROUP("Common Source\\pipeline" FILES ${LL_COMMON_PIPELINE_SOURCE}) SET(LL_SOFTWARE_DIR ${LL_SOURCE_DIR}/software/) SET(LL_SOFTWARE_HEADERS ${LL_SOFTWARE_DIR}/include/PxsCCD.h ${LL_SOFTWARE_DIR}/include/PxsContactManager.h ${LL_SOFTWARE_DIR}/include/PxsContactManagerState.h ${LL_SOFTWARE_DIR}/include/PxsContext.h ${LL_SOFTWARE_DIR}/include/PxsHeapMemoryAllocator.h ${LL_SOFTWARE_DIR}/include/PxsIslandManagerTypes.h ${LL_SOFTWARE_DIR}/include/PxsIslandSim.h ${LL_SOFTWARE_DIR}/include/PxsKernelWrangler.h ${LL_SOFTWARE_DIR}/include/PxsMaterialCombiner.h ${LL_SOFTWARE_DIR}/include/PxsMemoryManager.h ${LL_SOFTWARE_DIR}/include/PxsNphaseImplementationContext.h ${LL_SOFTWARE_DIR}/include/PxsRigidBody.h ${LL_SOFTWARE_DIR}/include/PxsShapeSim.h ${LL_SOFTWARE_DIR}/include/PxsSimpleIslandManager.h ${LL_SOFTWARE_DIR}/include/PxsSimulationController.h ${LL_SOFTWARE_DIR}/include/PxsTransformCache.h ${LL_SOFTWARE_DIR}/include/PxsNphaseCommon.h ${LL_SOFTWARE_DIR}/include/PxvNphaseImplementationContext.h ) SOURCE_GROUP("Software Includes" FILES ${LL_SOFTWARE_HEADERS}) SET(LL_SOFTWARE_SOURCE ${LL_SOFTWARE_DIR}/src/PxsCCD.cpp ${LL_SOFTWARE_DIR}/src/PxsContactManager.cpp ${LL_SOFTWARE_DIR}/src/PxsContext.cpp ${LL_SOFTWARE_DIR}/src/PxsDefaultMemoryManager.cpp ${LL_SOFTWARE_DIR}/src/PxsIslandSim.cpp ${LL_SOFTWARE_DIR}/src/PxsNphaseImplementationContext.cpp ${LL_SOFTWARE_DIR}/src/PxsSimpleIslandManager.cpp ) SOURCE_GROUP("Software Source" FILES ${LL_SOFTWARE_SOURCE}) ADD_LIBRARY(LowLevel ${LOWLEVEL_LIBTYPE} ${LL_API_HEADERS} ${LL_API_SOURCE} ${LL_COMMON_COLLISION_HEADERS} ${LL_COMMON_COLLISION_SOURCE} ${LL_COMMON_PIPELINE_HEADERS} ${LL_COMMON_PIPELINE_SOURCE} ${LL_COMMON_UTILS_HEADERS} ${LL_SOFTWARE_HEADERS} ${LL_SOFTWARE_SOURCE} ) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(LowLevel PRIVATE ${LOWLEVEL_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/physxgpu/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/common PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/convex PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/distance PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/sweep PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/gjk PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/hf PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/pcm PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/ccd PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/api/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/collision PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/pipeline PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/utils PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/software/include PRIVATE ${PHYSX_SOURCE_DIR}/lowleveldynamics/include ) TARGET_COMPILE_DEFINITIONS(LowLevel PRIVATE ${LOWLEVEL_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(LowLevel PROPERTIES LINK_FLAGS ${LOWLEVEL_PLATFORM_LINK_FLAGS} ) SET_TARGET_PROPERTIES(LowLevel PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "LowLevel_static" ARCHIVE_OUTPUT_NAME_CHECKED "LowLevel_static" ARCHIVE_OUTPUT_NAME_PROFILE "LowLevel_static" ARCHIVE_OUTPUT_NAME_RELEASE "LowLevel_static" ) IF(LL_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(LowLevel PROPERTIES COMPILE_PDB_NAME_DEBUG "${LL_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${LL_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${LL_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${LL_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(LowLevel PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_SOFTWARE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_SOFTWARE_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_API_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_API_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_COMMON_COLLISION_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_COMMON_COLLISION_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_COMMON_PIPELINE_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_COMMON_PIPELINE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LL_COMMON_UTILS_HEADERS}) ENDIF() SET_TARGET_PROPERTIES(LowLevel PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXVehicle.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXVehicle common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxvehicle/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXVehicle.cmake) SET(PHYSX_VEHICLE_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleComponents.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleDrive.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleDrive4W.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleDriveNW.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleDriveTank.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleNoDrive.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleSDK.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleShaders.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleTireFriction.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleUpdate.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleUtil.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleUtilControl.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleUtilSetup.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleUtilTelemetry.h ${PHYSX_ROOT_DIR}/include/vehicle/PxVehicleWheels.h ) SOURCE_GROUP(include FILES ${PHYSX_VEHICLE_HEADERS}) SET(PHYSX_VEHICLE_SOURCE ${LL_SOURCE_DIR}/PxVehicleComponents.cpp ${LL_SOURCE_DIR}/PxVehicleDrive.cpp ${LL_SOURCE_DIR}/PxVehicleDrive4W.cpp ${LL_SOURCE_DIR}/PxVehicleDriveNW.cpp ${LL_SOURCE_DIR}/PxVehicleDriveTank.cpp ${LL_SOURCE_DIR}/PxVehicleMetaData.cpp ${LL_SOURCE_DIR}/PxVehicleNoDrive.cpp ${LL_SOURCE_DIR}/PxVehicleSDK.cpp ${LL_SOURCE_DIR}/PxVehicleSerialization.cpp ${LL_SOURCE_DIR}/PxVehicleSuspWheelTire4.cpp ${LL_SOURCE_DIR}/PxVehicleTireFriction.cpp ${LL_SOURCE_DIR}/PxVehicleUpdate.cpp ${LL_SOURCE_DIR}/PxVehicleWheels.cpp ${LL_SOURCE_DIR}/VehicleUtilControl.cpp ${LL_SOURCE_DIR}/VehicleUtilSetup.cpp ${LL_SOURCE_DIR}/VehicleUtilTelemetry.cpp ${LL_SOURCE_DIR}/PxVehicleLinearMath.h ${LL_SOURCE_DIR}/PxVehicleSerialization.h ${LL_SOURCE_DIR}/PxVehicleSuspLimitConstraintShader.h ${LL_SOURCE_DIR}/PxVehicleSuspWheelTire4.h ) SOURCE_GROUP(src FILES ${PHYSX_VEHICLE_SOURCE}) SET(PHYSX_VEHICLE_METADATA_HEADERS ${LL_SOURCE_DIR}/physxmetadata/include/PxVehicleAutoGeneratedMetaDataObjectNames.h ${LL_SOURCE_DIR}/physxmetadata/include/PxVehicleAutoGeneratedMetaDataObjects.h ${LL_SOURCE_DIR}/physxmetadata/include/PxVehicleMetaDataObjects.h ) SOURCE_GROUP(metadata\\include FILES ${PHYSX_VEHICLE_METADATA_HEADERS}) SET(PHYSX_VEHICLE_METADATA_SOURCE ${LL_SOURCE_DIR}/physxmetadata/src/PxVehicleAutoGeneratedMetaDataObjects.cpp ${LL_SOURCE_DIR}/physxmetadata/src/PxVehicleMetaDataObjects.cpp ) SOURCE_GROUP(metadata\\src FILES ${PHYSX_VEHICLE_METADATA_SOURCE}) ADD_LIBRARY(PhysXVehicle ${PHYSXVEHICLE_LIBTYPE} ${PHYSX_VEHICLE_SOURCE} ${PHYSX_VEHICLE_HEADERS} ${PHYSX_VEHICLE_METADATA_HEADERS} ${PHYSX_VEHICLE_METADATA_SOURCE} ) INSTALL(FILES ${PHYSX_VEHICLE_HEADERS} DESTINATION include/vehicle) TARGET_INCLUDE_DIRECTORIES(PhysXVehicle PRIVATE ${PHYSXVEHICLE_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/physxvehicle/src PRIVATE ${PHYSX_SOURCE_DIR}/physxvehicle/src/physxmetadata/include PRIVATE ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/include PRIVATE ${PHYSX_SOURCE_DIR}/physxmetadata/core/include PRIVATE ${PHYSX_SOURCE_DIR}/physxextensions/src/serialization/Xml PRIVATE ${PHYSX_SOURCE_DIR}/pvdsdk/src PRIVATE ${PHYSX_SOURCE_DIR}/pvd/include ) # No linked libraries # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(PhysXVehicle PRIVATE ${PHYSXVEHICLE_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES OUTPUT_NAME PhysXVehicle ) IF(PHYSXVEHICLE_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXVehicle_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXVehicle_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXVehicle_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXVehicle_static" ) ENDIF() IF(PHYSXVEHICLE_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXVEHICLE_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXVEHICLE_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXVEHICLE_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXVEHICLE_COMPILE_PDB_NAME_RELEASE} ) ENDIF() TARGET_LINK_LIBRARIES(PhysXVehicle PUBLIC ${PHYSXVEHICLE_PLATFORM_LINKED_LIBS} PhysXFoundation PhysXPvdSDK ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE_METADATA_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE_METADATA_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXVehicle PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXPvdSDK.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXPvdSDK common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/pvd) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXPvdSDK.cmake) SET(PHYSXPVDSDK_HEADERS ${PHYSX_ROOT_DIR}/include/pvd/PxPvd.h ${PHYSX_ROOT_DIR}/include/pvd/PxPvdTransport.h ) SOURCE_GROUP(include FILES ${PHYSXPVDSDK_HEADERS}) SET(PHYSXPVDSDK_SOURCE ${LL_SOURCE_DIR}/src/PxProfileContextProvider.h ${LL_SOURCE_DIR}/src/PxProfileContextProviderImpl.h ${LL_SOURCE_DIR}/src/PxProfileDataBuffer.h ${LL_SOURCE_DIR}/src/PxProfileDataParsing.h ${LL_SOURCE_DIR}/src/PxProfileEventBuffer.h ${LL_SOURCE_DIR}/src/PxProfileEventBufferAtomic.h ${LL_SOURCE_DIR}/src/PxProfileEventBufferClient.h ${LL_SOURCE_DIR}/src/PxProfileEventBufferClientManager.h ${LL_SOURCE_DIR}/src/PxProfileEventId.h ${LL_SOURCE_DIR}/src/PxProfileEventImpl.cpp ${LL_SOURCE_DIR}/src/PxProfileEventMutex.h ${LL_SOURCE_DIR}/src/PxProfileEventNames.h ${LL_SOURCE_DIR}/src/PxProfileEvents.h ${LL_SOURCE_DIR}/src/PxProfileEventSender.h ${LL_SOURCE_DIR}/src/PxProfileEventSerialization.h ${LL_SOURCE_DIR}/src/PxProfileMemory.h ${LL_SOURCE_DIR}/src/PxProfileMemoryBuffer.h ${LL_SOURCE_DIR}/src/PxProfileMemoryEventBuffer.h ${LL_SOURCE_DIR}/src/PxProfileMemoryEvents.h ${LL_SOURCE_DIR}/src/PxProfileScopedEvent.h ${LL_SOURCE_DIR}/src/PxProfileScopedMutexLock.h ${LL_SOURCE_DIR}/src/PxPvdProfileZone.h ${LL_SOURCE_DIR}/src/PxProfileZoneImpl.h ${LL_SOURCE_DIR}/src/PxProfileZoneManager.h ${LL_SOURCE_DIR}/src/PxProfileZoneManagerImpl.h ${LL_SOURCE_DIR}/src/PxPvd.cpp ${LL_SOURCE_DIR}/src/PxPvdBits.h ${LL_SOURCE_DIR}/src/PxPvdByteStreams.h ${LL_SOURCE_DIR}/src/PxPvdCommStreamEvents.h ${LL_SOURCE_DIR}/src/PxPvdCommStreamEventSink.h ${LL_SOURCE_DIR}/src/PxPvdCommStreamTypes.h ${LL_SOURCE_DIR}/src/PxPvdDataStream.cpp ${LL_SOURCE_DIR}/src/PxPvdDefaultFileTransport.cpp ${LL_SOURCE_DIR}/src/PxPvdDefaultFileTransport.h ${LL_SOURCE_DIR}/src/PxPvdDefaultSocketTransport.cpp ${LL_SOURCE_DIR}/src/PxPvdDefaultSocketTransport.h ${LL_SOURCE_DIR}/src/PxPvdFoundation.h ${LL_SOURCE_DIR}/src/PxPvdImpl.cpp ${LL_SOURCE_DIR}/src/PxPvdImpl.h ${LL_SOURCE_DIR}/src/PxPvdInternalByteStreams.h ${LL_SOURCE_DIR}/src/PxPvdMarshalling.h ${LL_SOURCE_DIR}/src/PxPvdMemClient.cpp ${LL_SOURCE_DIR}/src/PxPvdMemClient.h ${LL_SOURCE_DIR}/src/PxPvdObjectModelInternalTypeDefs.h ${LL_SOURCE_DIR}/src/PxPvdObjectModelInternalTypes.h ${LL_SOURCE_DIR}/src/PxPvdObjectModelMetaData.cpp ${LL_SOURCE_DIR}/src/PxPvdObjectModelMetaData.h ${LL_SOURCE_DIR}/src/PxPvdObjectRegistrar.cpp ${LL_SOURCE_DIR}/src/PxPvdObjectRegistrar.h ${LL_SOURCE_DIR}/src/PxPvdProfileZoneClient.cpp ${LL_SOURCE_DIR}/src/PxPvdProfileZoneClient.h ${LL_SOURCE_DIR}/src/PxPvdUserRenderer.cpp ${LL_SOURCE_DIR}/src/PxPvdUserRenderImpl.h ${LL_SOURCE_DIR}/src/PxPvdUserRenderTypes.h ) SOURCE_GROUP(src\\src FILES ${PHYSXPVDSDK_SOURCE}) SET(PHYSXPVDSDK_INTERNAL_HEADERS ${LL_SOURCE_DIR}/include/PsPvd.h ${LL_SOURCE_DIR}/include/PxProfileAllocatorWrapper.h ${LL_SOURCE_DIR}/include/PxPvdClient.h ${LL_SOURCE_DIR}/include/PxPvdDataStream.h ${LL_SOURCE_DIR}/include/PxPvdDataStreamHelpers.h ${LL_SOURCE_DIR}/include/PxPvdErrorCodes.h ${LL_SOURCE_DIR}/include/PxPvdObjectModelBaseTypes.h ${LL_SOURCE_DIR}/include/PxPvdUserRenderer.h ) SOURCE_GROUP(src\\include FILES ${PHYSXPVDSDK_INTERNAL_HEADERS}) SET(PHYSXPVDSDK_FILEBUF_FILES ${PHYSX_SOURCE_DIR}/filebuf/include/PsFileBuffer.h ) SOURCE_GROUP(filebuf\\include FILES ${PHYSXPVDSDK_FILEBUF_FILES}) ADD_LIBRARY(PhysXPvdSDK ${PHYSXPVDSDK_LIBTYPE} ${PHYSXPVDSDK_HEADERS} ${PHYSXPVDSDK_FILEBUF_FILES} ${PHYSXPVDSDK_INTERNAL_HEADERS} ${PHYSXPVDSDK_SOURCE} ${PHYSXPVDSDK_PLATFORM_FILES} ) TARGET_INCLUDE_DIRECTORIES(PhysXPvdSDK PRIVATE ${PHYSXPVDSDK_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${LL_SOURCE_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/filebuf/include ) TARGET_COMPILE_DEFINITIONS(PhysXPvdSDK PRIVATE ${PHYSXPVDSDK_COMPILE_DEFS} ) # Add linked libraries IF(PX_GENERATE_STATIC_LIBRARIES) TARGET_LINK_LIBRARIES(PhysXPvdSDK PUBLIC ${PHYSXPVDSDK_PLATFORM_LINKED_LIBS} PRIVATE PhysX PhysXFoundation ) ELSE() TARGET_LINK_LIBRARIES(PhysXPvdSDK PUBLIC ${PHYSXPVDSDK_PLATFORM_LINKED_LIBS} PRIVATE PhysXFoundation ) ENDIF() SET_TARGET_PROPERTIES(PhysXPvdSDK PROPERTIES OUTPUT_NAME PhysXPvdSDK ) IF(PHYSXPVDSDK_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXPvdSDK PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXPvdSDK_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXPvdSDK_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXPvdSDK_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXPvdSDK_static" ) ENDIF() IF(PHYSXPVDSDK_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXPvdSDK PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXPVDSDK_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXPVDSDK_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXPVDSDK_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXPVDSDK_COMPILE_PDB_NAME_RELEASE} ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXPVDSDK_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXPVDSDK_INTERNAL_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXPVDSDK_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXPVDSDK_PLATFORM_FILES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXPVDSDK_FILEBUF_FILES}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXPvdSDK PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/LowLevelDynamics.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build LowLevelDynamics common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/lowleveldynamics/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/LowLevelDynamics.cmake) SET(LLDYNAMICS_BASE_DIR ${PHYSX_ROOT_DIR}/source/lowleveldynamics) SET(LLDYNAMICS_INCLUDES ${LLDYNAMICS_BASE_DIR}/include/DyArticulationCore.h ${LLDYNAMICS_BASE_DIR}/include/DyVArticulation.h ${LLDYNAMICS_BASE_DIR}/include/DyArticulationTendon.h ${LLDYNAMICS_BASE_DIR}/include/DySoftBodyCore.h ${LLDYNAMICS_BASE_DIR}/include/DySoftBody.h ${LLDYNAMICS_BASE_DIR}/include/DyFEMClothCore.h ${LLDYNAMICS_BASE_DIR}/include/DyFEMCloth.h ${LLDYNAMICS_BASE_DIR}/include/DyHairSystemCore.h ${LLDYNAMICS_BASE_DIR}/include/DyHairSystem.h ${LLDYNAMICS_BASE_DIR}/include/DyFeatherstoneArticulation.h ${LLDYNAMICS_BASE_DIR}/include/DyFeatherstoneArticulationJointData.h ${LLDYNAMICS_BASE_DIR}/include/DyFeatherstoneArticulationUtils.h ${LLDYNAMICS_BASE_DIR}/include/DyConstraint.h ${LLDYNAMICS_BASE_DIR}/include/DyConstraintWriteBack.h ${LLDYNAMICS_BASE_DIR}/include/DyContext.h ${LLDYNAMICS_BASE_DIR}/include/DySleepingConfigulation.h ${LLDYNAMICS_BASE_DIR}/include/DyThresholdTable.h ${LLDYNAMICS_BASE_DIR}/include/DyArticulationJointCore.h ${LLDYNAMICS_BASE_DIR}/include/DyParticleSystemCore.h ${LLDYNAMICS_BASE_DIR}/include/DyParticleSystem.h ) SOURCE_GROUP("include" FILES ${LLDYNAMICS_INCLUDES}) SET(LLDYNAMICS_SOURCE ${LLDYNAMICS_BASE_DIR}/src/DyArticulationContactPrep.cpp ${LLDYNAMICS_BASE_DIR}/src/DyArticulationContactPrepPF.cpp ${LLDYNAMICS_BASE_DIR}/src/DyFeatherstoneArticulation.cpp ${LLDYNAMICS_BASE_DIR}/src/DyFeatherstoneForwardDynamic.cpp ${LLDYNAMICS_BASE_DIR}/src/DyFeatherstoneInverseDynamic.cpp ${LLDYNAMICS_BASE_DIR}/src/DyConstraintPartition.cpp ${LLDYNAMICS_BASE_DIR}/src/DyConstraintSetup.cpp ${LLDYNAMICS_BASE_DIR}/src/DyConstraintSetupBlock.cpp ${LLDYNAMICS_BASE_DIR}/src/DyContactPrep.cpp ${LLDYNAMICS_BASE_DIR}/src/DyContactPrep4.cpp ${LLDYNAMICS_BASE_DIR}/src/DyContactPrep4PF.cpp ${LLDYNAMICS_BASE_DIR}/src/DyContactPrepPF.cpp ${LLDYNAMICS_BASE_DIR}/src/DyDynamics.cpp ${LLDYNAMICS_BASE_DIR}/src/DyFrictionCorrelation.cpp ${LLDYNAMICS_BASE_DIR}/src/DyRigidBodyToSolverBody.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraints.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraintsBlock.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverControl.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverControlPF.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverPFConstraints.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverPFConstraintsBlock.cpp ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraint1DStep.h ${LLDYNAMICS_BASE_DIR}/src/DyThreadContext.cpp ${LLDYNAMICS_BASE_DIR}/src/DyThresholdTable.cpp ${LLDYNAMICS_BASE_DIR}/src/DyTGSDynamics.cpp ${LLDYNAMICS_BASE_DIR}/src/DyTGSContactPrep.cpp ${LLDYNAMICS_BASE_DIR}/src/DyTGSContactPrepBlock.cpp ${LLDYNAMICS_BASE_DIR}/src/DyArticulationContactPrep.h ${LLDYNAMICS_BASE_DIR}/src/DyArticulationCpuGpu.h ${LLDYNAMICS_BASE_DIR}/src/DyArticulationPImpl.h ${LLDYNAMICS_BASE_DIR}/src/DyArticulationUtils.h ${LLDYNAMICS_BASE_DIR}/src/DyFeatherstoneArticulationLink.h ${LLDYNAMICS_BASE_DIR}/src/DyBodyCoreIntegrator.h ${LLDYNAMICS_BASE_DIR}/src/DyConstraintPartition.h ${LLDYNAMICS_BASE_DIR}/src/DyConstraintPrep.h ${LLDYNAMICS_BASE_DIR}/src/DyContactPrep.h ${LLDYNAMICS_BASE_DIR}/src/DyContactPrepShared.h ${LLDYNAMICS_BASE_DIR}/src/DyContactReduction.h ${LLDYNAMICS_BASE_DIR}/src/DyCorrelationBuffer.h ${LLDYNAMICS_BASE_DIR}/src/DyDynamics.h ${LLDYNAMICS_BASE_DIR}/src/DyFrictionPatch.h ${LLDYNAMICS_BASE_DIR}/src/DyFrictionPatchStreamPair.h ${LLDYNAMICS_BASE_DIR}/src/DySolverBody.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraint1D.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraint1D4.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraintDesc.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraintExtShared.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraintsShared.h ${LLDYNAMICS_BASE_DIR}/src/DySolverConstraintTypes.h ${LLDYNAMICS_BASE_DIR}/src/DySolverContact.h ${LLDYNAMICS_BASE_DIR}/src/DySolverContact4.h ${LLDYNAMICS_BASE_DIR}/src/DySolverContactPF.h ${LLDYNAMICS_BASE_DIR}/src/DySolverContactPF4.h ${LLDYNAMICS_BASE_DIR}/src/DySolverContext.h ${LLDYNAMICS_BASE_DIR}/src/DySolverControl.h ${LLDYNAMICS_BASE_DIR}/src/DySolverControlPF.h ${LLDYNAMICS_BASE_DIR}/src/DySolverCore.h ${LLDYNAMICS_BASE_DIR}/src/DySolverExt.h ${LLDYNAMICS_BASE_DIR}/src/DyThreadContext.h ${LLDYNAMICS_BASE_DIR}/src/DyTGSDynamics.h ${LLDYNAMICS_BASE_DIR}/src/DyTGSContactPrep.h ${LLDYNAMICS_BASE_DIR}/src/DyTGS.h ${LLDYNAMICS_BASE_DIR}/src/DyPGS.h ${LLDYNAMICS_BASE_DIR}/src/DySleep.h ${LLDYNAMICS_BASE_DIR}/src/DySleep.cpp ) SOURCE_GROUP("src" FILES ${LLDYNAMICS_SOURCE}) ADD_LIBRARY(LowLevelDynamics ${LOWLEVELDYNAMICS_LIBTYPE} ${LLDYNAMICS_INCLUDES} ${LLDYNAMICS_SOURCE} ) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(LowLevelDynamics PRIVATE ${LOWLEVELDYNAMICS_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/api/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/pipeline PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/utils PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/software/include PRIVATE ${PHYSX_SOURCE_DIR}/lowleveldynamics/include PRIVATE ${PHYSX_SOURCE_DIR}/lowleveldynamics/src PRIVATE ${PHYSX_SOURCE_DIR}/physxgpu/include ) # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(LowLevelDynamics # Common to all configurations PRIVATE ${LOWLEVELDYNAMICS_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(LowLevelDynamics PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "LowLevelDynamics_static" ARCHIVE_OUTPUT_NAME_CHECKED "LowLevelDynamics_static" ARCHIVE_OUTPUT_NAME_PROFILE "LowLevelDynamics_static" ARCHIVE_OUTPUT_NAME_RELEASE "LowLevelDynamics_static" ) IF(LLDYNAMICS_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(LowLevelDynamics PROPERTIES COMPILE_PDB_NAME_DEBUG "${LLDYNAMICS_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${LLDYNAMICS_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${LLDYNAMICS_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${LLDYNAMICS_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(LowLevelDynamics PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LLDYNAMICS_INCLUDES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${LLDYNAMICS_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(LowLevelDynamics PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/SceneQuery.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build SceneQuery common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/scenequery/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/SceneQuery.cmake) SET(SCENEQUERY_BASE_DIR ${PHYSX_ROOT_DIR}/source/scenequery) SET(SCENEQUERY_HEADERS ${SCENEQUERY_BASE_DIR}/include/SqFactory.h ${SCENEQUERY_BASE_DIR}/include/SqPruner.h ${SCENEQUERY_BASE_DIR}/include/SqPrunerData.h ${SCENEQUERY_BASE_DIR}/include/SqManager.h ${SCENEQUERY_BASE_DIR}/include/SqQuery.h ${SCENEQUERY_BASE_DIR}/include/SqTypedef.h ) SOURCE_GROUP(include FILES ${SCENEQUERY_HEADERS}) SET(SCENEQUERY_SOURCE ${SCENEQUERY_BASE_DIR}/src/SqFactory.cpp ${SCENEQUERY_BASE_DIR}/src/SqCompoundPruner.cpp ${SCENEQUERY_BASE_DIR}/src/SqCompoundPruner.h ${SCENEQUERY_BASE_DIR}/src/SqCompoundPruningPool.cpp ${SCENEQUERY_BASE_DIR}/src/SqCompoundPruningPool.h ${SCENEQUERY_BASE_DIR}/src/SqManager.cpp ${SCENEQUERY_BASE_DIR}/src/SqQuery.cpp ) SOURCE_GROUP(src FILES ${SCENEQUERY_SOURCE}) ADD_LIBRARY(SceneQuery ${SCENEQUERY_LIBTYPE} ${SCENEQUERY_HEADERS} ${SCENEQUERY_SOURCE} ) # Target specific compile options GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(SceneQuery PRIVATE ${SCENEQUERY_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/common PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/convex PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/distance PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/sweep PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/gjk PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/hf PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/pcm PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/ccd PRIVATE ${PHYSX_SOURCE_DIR}/scenequery/include PRIVATE ${PHYSX_SOURCE_DIR}/pvd/include ) # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(SceneQuery # Common to all configurations PRIVATE ${SCENEQUERY_COMPILE_DEFS} ) IF(SCENEQUERY_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(SceneQuery PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "SceneQuery_static" ARCHIVE_OUTPUT_NAME_CHECKED "SceneQuery_static" ARCHIVE_OUTPUT_NAME_PROFILE "SceneQuery_static" ARCHIVE_OUTPUT_NAME_RELEASE "SceneQuery_static" ) ENDIF() IF(SQ_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(SceneQuery PROPERTIES COMPILE_PDB_NAME_DEBUG "${SQ_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${SQ_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${SQ_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${SQ_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(SceneQuery PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${SCENEQUERY_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${SCENEQUERY_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(SceneQuery PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysX.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysX (PROJECT not SOLUTION) common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(PX_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physx/src) SET(MD_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxmetadata) SET(PHYSX_PLATFORM_LINK_FLAGS " ") SET(PHYSX_PLATFORM_LINK_FLAGS_DEBUG " ") SET(PHYSX_PLATFORM_LINK_FLAGS_CHECKED " ") SET(PHYSX_PLATFORM_LINK_FLAGS_PROFILE " ") SET(PHYSX_PLATFORM_LINK_FLAGS_RELEASE " ") # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysX.cmake) SET(PHYSX_HEADERS ${PHYSX_ROOT_DIR}/include/PxActor.h ${PHYSX_ROOT_DIR}/include/PxActorData.h ${PHYSX_ROOT_DIR}/include/PxAggregate.h ${PHYSX_ROOT_DIR}/include/PxArticulationFlag.h ${PHYSX_ROOT_DIR}/include/PxArticulationJointReducedCoordinate.h ${PHYSX_ROOT_DIR}/include/PxArticulationLink.h ${PHYSX_ROOT_DIR}/include/PxArticulationReducedCoordinate.h ${PHYSX_ROOT_DIR}/include/PxArticulationTendon.h ${PHYSX_ROOT_DIR}/include/PxArticulationTendonData.h ${PHYSX_ROOT_DIR}/include/PxAttachment.h ${PHYSX_ROOT_DIR}/include/PxBroadPhase.h ${PHYSX_ROOT_DIR}/include/PxClient.h ${PHYSX_ROOT_DIR}/include/PxConeLimitedConstraint.h ${PHYSX_ROOT_DIR}/include/PxConstraint.h ${PHYSX_ROOT_DIR}/include/PxConstraintDesc.h ${PHYSX_ROOT_DIR}/include/PxContact.h ${PHYSX_ROOT_DIR}/include/PxContactModifyCallback.h ${PHYSX_ROOT_DIR}/include/PxDeletionListener.h ${PHYSX_ROOT_DIR}/include/PxFEMParameter.h ${PHYSX_ROOT_DIR}/include/PxFEMClothFlags.h ${PHYSX_ROOT_DIR}/include/PxFiltering.h ${PHYSX_ROOT_DIR}/include/PxForceMode.h ${PHYSX_ROOT_DIR}/include/PxHairSystemFlag.h ${PHYSX_ROOT_DIR}/include/PxImmediateMode.h ${PHYSX_ROOT_DIR}/include/PxLockedData.h ${PHYSX_ROOT_DIR}/include/PxNodeIndex.h ${PHYSX_ROOT_DIR}/include/PxParticleBuffer.h ${PHYSX_ROOT_DIR}/include/PxParticleGpu.h ${PHYSX_ROOT_DIR}/include/PxParticleSolverType.h ${PHYSX_ROOT_DIR}/include/PxParticleSystem.h ${PHYSX_ROOT_DIR}/include/PxParticleSystemFlag.h ${PHYSX_ROOT_DIR}/include/PxPBDParticleSystem.h ${PHYSX_ROOT_DIR}/include/PxPhysics.h ${PHYSX_ROOT_DIR}/include/PxPhysicsAPI.h ${PHYSX_ROOT_DIR}/include/PxPhysicsSerialization.h ${PHYSX_ROOT_DIR}/include/PxPhysXConfig.h ${PHYSX_ROOT_DIR}/include/PxPruningStructure.h ${PHYSX_ROOT_DIR}/include/PxQueryFiltering.h ${PHYSX_ROOT_DIR}/include/PxQueryReport.h ${PHYSX_ROOT_DIR}/include/PxRigidActor.h ${PHYSX_ROOT_DIR}/include/PxRigidBody.h ${PHYSX_ROOT_DIR}/include/PxRigidDynamic.h ${PHYSX_ROOT_DIR}/include/PxRigidStatic.h ${PHYSX_ROOT_DIR}/include/PxScene.h ${PHYSX_ROOT_DIR}/include/PxSceneDesc.h ${PHYSX_ROOT_DIR}/include/PxSceneLock.h ${PHYSX_ROOT_DIR}/include/PxSceneQueryDesc.h ${PHYSX_ROOT_DIR}/include/PxSceneQuerySystem.h ${PHYSX_ROOT_DIR}/include/PxShape.h ${PHYSX_ROOT_DIR}/include/PxSimulationEventCallback.h ${PHYSX_ROOT_DIR}/include/PxSimulationStatistics.h ${PHYSX_ROOT_DIR}/include/PxSoftBody.h ${PHYSX_ROOT_DIR}/include/PxSoftBodyFlag.h ${PHYSX_ROOT_DIR}/include/PxSparseGridParams.h ${PHYSX_ROOT_DIR}/include/PxVisualizationParameter.h ${PHYSX_ROOT_DIR}/include/PxIsosurfaceExtraction.h ${PHYSX_ROOT_DIR}/include/PxSmoothing.h ${PHYSX_ROOT_DIR}/include/PxAnisotropy.h ${PHYSX_ROOT_DIR}/include/PxParticleNeighborhoodProvider.h ${PHYSX_ROOT_DIR}/include/PxArrayConverter.h ${PHYSX_ROOT_DIR}/include/PxLineStripSkinning.h ${PHYSX_ROOT_DIR}/include/PxSDFBuilder.h ) IF(NOT PX_GENERATE_SOURCE_DISTRO AND NOT PUBLIC_RELEASE) LIST(APPEND PHYSX_HEADERS ${PHYSX_ROOT_DIR}/include/PxFEMCloth.h ${PHYSX_ROOT_DIR}/include/PxFLIPParticleSystem.h ${PHYSX_ROOT_DIR}/include/PxGridParticleSystem.h ${PHYSX_ROOT_DIR}/include/PxHairSystem.h ${PHYSX_ROOT_DIR}/include/PxMPMParticleSystem.h ) ENDIF() SOURCE_GROUP(include FILES ${PHYSX_HEADERS}) SET(PHYSX_MATERIAL_HEADERS ${PHYSX_ROOT_DIR}/include/PxBaseMaterial.h ${PHYSX_ROOT_DIR}/include/PxFEMMaterial.h ${PHYSX_ROOT_DIR}/include/PxFEMSoftBodyMaterial.h ${PHYSX_ROOT_DIR}/include/PxFEMClothMaterial.h ${PHYSX_ROOT_DIR}/include/PxParticleMaterial.h ${PHYSX_ROOT_DIR}/include/PxPBDMaterial.h ${PHYSX_ROOT_DIR}/include/PxFLIPMaterial.h ${PHYSX_ROOT_DIR}/include/PxMPMMaterial.h ${PHYSX_ROOT_DIR}/include/PxMaterial.h ) SOURCE_GROUP(include\\materials FILES ${PHYSX_MATERIAL_HEADERS}) SET(PHYSX_COMMON_HEADERS ${PHYSX_ROOT_DIR}/include/common/PxBase.h ${PHYSX_ROOT_DIR}/include/common/PxCollection.h ${PHYSX_ROOT_DIR}/include/common/PxCoreUtilityTypes.h ${PHYSX_ROOT_DIR}/include/common/PxInsertionCallback.h ${PHYSX_ROOT_DIR}/include/common/PxMetaData.h ${PHYSX_ROOT_DIR}/include/common/PxMetaDataFlags.h ${PHYSX_ROOT_DIR}/include/common/PxPhysXCommonConfig.h ${PHYSX_ROOT_DIR}/include/common/PxProfileZone.h ${PHYSX_ROOT_DIR}/include/common/PxRenderBuffer.h ${PHYSX_ROOT_DIR}/include/common/PxRenderOutput.h ${PHYSX_ROOT_DIR}/include/common/PxSerialFramework.h ${PHYSX_ROOT_DIR}/include/common/PxSerializer.h ${PHYSX_ROOT_DIR}/include/common/PxStringTable.h ${PHYSX_ROOT_DIR}/include/common/PxTolerancesScale.h ${PHYSX_ROOT_DIR}/include/common/PxTypeInfo.h ) SOURCE_GROUP(include\\common FILES ${PHYSX_COMMON_HEADERS}) SET(PHYSX_OMNIPVD_HEADERS ${PHYSX_ROOT_DIR}/include/omnipvd/PxOmniPvd.h ) SOURCE_GROUP(include\\omnipvd FILES ${PHYSX_OMNIPVD_HEADERS}) SET(PHYSX_PVD_HEADERS ${PHYSX_ROOT_DIR}/include/pvd/PxPvdSceneClient.h ${PHYSX_ROOT_DIR}/include/pvd/PxPvd.h ${PHYSX_ROOT_DIR}/include/pvd/PxPvdTransport.h ) SOURCE_GROUP(include\\pvd FILES ${PHYSX_PVD_HEADERS}) SET(PHYSX_COLLISION_HEADERS ${PHYSX_ROOT_DIR}/include/collision/PxCollisionDefs.h ) SOURCE_GROUP(include\\collision FILES ${PHYSX_COLLISION_HEADERS}) SET(PHYSX_SOLVER_HEADERS ${PHYSX_ROOT_DIR}/include/solver/PxSolverDefs.h ) SOURCE_GROUP(include\\solver FILES ${PHYSX_SOLVER_HEADERS}) SET(PHYSX_METADATA_HEADERS ${MD_SOURCE_DIR}/core/include/PvdMetaDataDefineProperties.h ${MD_SOURCE_DIR}/core/include/PvdMetaDataExtensions.h ${MD_SOURCE_DIR}/core/include/PvdMetaDataPropertyVisitor.h ${MD_SOURCE_DIR}/core/include/PxAutoGeneratedMetaDataObjectNames.h ${MD_SOURCE_DIR}/core/include/PxAutoGeneratedMetaDataObjects.h ${MD_SOURCE_DIR}/core/include/PxMetaDataCompare.h ${MD_SOURCE_DIR}/core/include/PxMetaDataCppPrefix.h ${MD_SOURCE_DIR}/core/include/PxMetaDataObjects.h ${MD_SOURCE_DIR}/core/include/RepXMetaDataPropertyVisitor.h ) SOURCE_GROUP(metadata\\include FILES ${PHYSX_METADATA_HEADERS}) SET(PHYSX_METADATA_SOURCE ${MD_SOURCE_DIR}/core/src/PxAutoGeneratedMetaDataObjects.cpp ${MD_SOURCE_DIR}/core/src/PxMetaDataObjects.cpp ) SOURCE_GROUP(metadata\\src FILES ${PHYSX_METADATA_SOURCE}) SET(PHYSX_OMNIPVD_SOURCE ${PX_SOURCE_DIR}/omnipvd/NpOmniPvd.h ${PX_SOURCE_DIR}/omnipvd/NpOmniPvd.cpp ${PX_SOURCE_DIR}/omnipvd/NpOmniPvdRegistrationData.h ${PX_SOURCE_DIR}/omnipvd/NpOmniPvdRegistrationData.cpp ${PX_SOURCE_DIR}/omnipvd/NpOmniPvdSetData.h ${PX_SOURCE_DIR}/omnipvd/OmniPvdPxSampler.cpp ${PX_SOURCE_DIR}/omnipvd/OmniPvdPxSampler.h ${PX_SOURCE_DIR}/omnipvd/OmniPvdChunkAlloc.cpp ${PX_SOURCE_DIR}/omnipvd/OmniPvdChunkAlloc.h ${PX_SOURCE_DIR}/omnipvd/OmniPvdTypes.h ) SOURCE_GROUP(src\\omnipvd FILES ${PHYSX_OMNIPVD_SOURCE}) SET(PHYSX_PVD_SOURCE ${PX_SOURCE_DIR}/NpPvdSceneClient.cpp ${PX_SOURCE_DIR}/NpPvdSceneClient.h ${PX_SOURCE_DIR}/NpPvdSceneQueryCollector.cpp ${PX_SOURCE_DIR}/NpPvdSceneQueryCollector.h ${PX_SOURCE_DIR}/PvdMetaDataPvdBinding.cpp ${PX_SOURCE_DIR}/PvdPhysicsClient.cpp ${PX_SOURCE_DIR}/PvdMetaDataBindingData.h ${PX_SOURCE_DIR}/PvdMetaDataPvdBinding.h ${PX_SOURCE_DIR}/PvdPhysicsClient.h ${PX_SOURCE_DIR}/PvdTypeNames.h ) SOURCE_GROUP(src\\pvd FILES ${PHYSX_PVD_SOURCE}) SET(PHYSX_IMMEDIATEMODE_SOURCE ${PHYSX_ROOT_DIR}/source/immediatemode/src/NpImmediateMode.cpp ) SOURCE_GROUP(src\\immediatemode FILES ${PHYSX_IMMEDIATEMODE_SOURCE}) SET(PHYSX_MATERIALS_SOURCE ${PX_SOURCE_DIR}/NpMaterial.cpp ${PX_SOURCE_DIR}/NpFEMSoftBodyMaterial.cpp ${PX_SOURCE_DIR}/NpFEMClothMaterial.cpp ${PX_SOURCE_DIR}/NpPBDMaterial.cpp ${PX_SOURCE_DIR}/NpFLIPMaterial.cpp ${PX_SOURCE_DIR}/NpMPMMaterial.cpp ${PX_SOURCE_DIR}/NpPBDMaterial.h ${PX_SOURCE_DIR}/NpFLIPMaterial.h ${PX_SOURCE_DIR}/NpMPMMaterial.h ${PX_SOURCE_DIR}/NpFEMSoftBodyMaterial.h ${PX_SOURCE_DIR}/NpFEMClothMaterial.h ${PX_SOURCE_DIR}/NpMaterial.h ) SOURCE_GROUP(src\\materials FILES ${PHYSX_MATERIALS_SOURCE}) SET(PHYSX_ARTICULATIONS_SOURCE ${PX_SOURCE_DIR}/NpArticulationReducedCoordinate.cpp ${PX_SOURCE_DIR}/NpArticulationJointReducedCoordinate.cpp ${PX_SOURCE_DIR}/NpArticulationLink.cpp ${PX_SOURCE_DIR}/NpArticulationTendon.cpp ${PX_SOURCE_DIR}/NpArticulationSensor.cpp ${PX_SOURCE_DIR}/NpArticulationReducedCoordinate.h ${PX_SOURCE_DIR}/NpArticulationJointReducedCoordinate.h ${PX_SOURCE_DIR}/NpArticulationLink.h ${PX_SOURCE_DIR}/NpArticulationTendon.h ${PX_SOURCE_DIR}/NpArticulationSensor.h ) SOURCE_GROUP(src\\articulations FILES ${PHYSX_ARTICULATIONS_SOURCE}) SET(PHYSX_CORE_SOURCE ${PX_SOURCE_DIR}/NpActor.cpp ${PX_SOURCE_DIR}/NpAggregate.cpp ${PX_SOURCE_DIR}/NpSoftBody.cpp ${PX_SOURCE_DIR}/NpFEMCloth.cpp ${PX_SOURCE_DIR}/NpParticleSystem.cpp ${PX_SOURCE_DIR}/NpHairSystem.cpp ${PX_SOURCE_DIR}/NpConstraint.cpp ${PX_SOURCE_DIR}/NpFactory.cpp ${PX_SOURCE_DIR}/NpMetaData.cpp ${PX_SOURCE_DIR}/NpPhysics.cpp ${PX_SOURCE_DIR}/NpBounds.h ${PX_SOURCE_DIR}/NpBounds.cpp ${PX_SOURCE_DIR}/NpPruningStructure.h ${PX_SOURCE_DIR}/NpPruningStructure.cpp ${PX_SOURCE_DIR}/NpCheck.cpp ${PX_SOURCE_DIR}/NpRigidDynamic.cpp ${PX_SOURCE_DIR}/NpRigidStatic.cpp ${PX_SOURCE_DIR}/NpScene.cpp ${PX_SOURCE_DIR}/NpSceneFetchResults.cpp ${PX_SOURCE_DIR}/NpSceneQueries.cpp ${PX_SOURCE_DIR}/NpSerializerAdapter.cpp ${PX_SOURCE_DIR}/NpShape.cpp ${PX_SOURCE_DIR}/NpShapeManager.cpp ${PX_SOURCE_DIR}/NpBase.h ${PX_SOURCE_DIR}/NpActor.h ${PX_SOURCE_DIR}/NpActorTemplate.h ${PX_SOURCE_DIR}/NpAggregate.h ${PX_SOURCE_DIR}/NpSoftBody.h ${PX_SOURCE_DIR}/NpFEMCloth.h ${PX_SOURCE_DIR}/NpParticleSystem.h ${PX_SOURCE_DIR}/NpHairSystem.h ${PX_SOURCE_DIR}/NpConnector.h ${PX_SOURCE_DIR}/NpConstraint.h ${PX_SOURCE_DIR}/NpFactory.h ${PX_SOURCE_DIR}/NpMaterialManager.h ${PX_SOURCE_DIR}/NpPhysics.h ${PX_SOURCE_DIR}/NpPhysicsInsertionCallback.h ${PX_SOURCE_DIR}/NpPtrTableStorageManager.h ${PX_SOURCE_DIR}/NpCheck.h ${PX_SOURCE_DIR}/NpRigidActorTemplate.h ${PX_SOURCE_DIR}/NpRigidActorTemplateInternal.h ${PX_SOURCE_DIR}/NpRigidBodyTemplate.h ${PX_SOURCE_DIR}/NpRigidDynamic.h ${PX_SOURCE_DIR}/NpRigidStatic.h ${PX_SOURCE_DIR}/NpScene.h ${PX_SOURCE_DIR}/NpSceneQueries.h ${PX_SOURCE_DIR}/NpSceneAccessor.h ${PX_SOURCE_DIR}/NpShape.h ${PX_SOURCE_DIR}/NpShapeManager.h ${PX_SOURCE_DIR}/NpDebugViz.h ${PX_SOURCE_DIR}/NpDebugViz.cpp ) SOURCE_GROUP(src FILES ${PHYSX_CORE_SOURCE}) ADD_LIBRARY(PhysX ${PHYSX_LIBTYPE} ${PHYSX_HEADERS} ${PHYSX_COMMON_HEADERS} ${PHYSX_MATERIAL_HEADERS} ${PHYSX_PVD_HEADERS} ${PHYSX_OMNIPVD_HEADERS} ${PHYSX_OMNIPVD_SOURCE} ${PHYSX_PVD_SOURCE} ${PHYSX_SOLVER_HEADERS} ${PHYSX_COLLISION_HEADERS} ${PHYSX_METADATA_HEADERS} ${PHYSX_METADATA_SOURCE} ${PHYSX_CORE_SOURCE} ${PHYSX_BUFFERING_SOURCE} ${PHYSX_IMMEDIATEMODE_SOURCE} ${PHYSX_MATERIALS_SOURCE} ${PHYSX_ARTICULATIONS_SOURCE} ${PHYSX_PLATFORM_SRC_FILES} ) # Add the headers to the install INSTALL(FILES ${PHYSX_HEADERS} DESTINATION include) INSTALL(FILES ${PHYSX_MATERIAL_HEADERS} DESTINATION include) INSTALL(FILES ${PHYSX_COMMON_HEADERS} DESTINATION include/common) INSTALL(FILES ${PHYSX_PVD_HEADERS} DESTINATION include/pvd) INSTALL(FILES ${PHYSX_OMNIPVD_HEADERS} DESTINATION include/omnipvd) INSTALL(FILES ${PHYSX_COLLISION_HEADERS} DESTINATION include/collision) INSTALL(FILES ${PHYSX_SOLVER_HEADERS} DESTINATION include/solver) # install the custom config file INSTALL(FILES ${PHYSX_ROOT_DIR}/include/PxConfig.h DESTINATION include) TARGET_INCLUDE_DIRECTORIES(PhysX PRIVATE ${PHYSX_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/physx/src PRIVATE ${PHYSX_SOURCE_DIR}/physx/src/device PRIVATE ${PHYSX_SOURCE_DIR}/physxgpu/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/common PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/convex PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/distance PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/sweep PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/gjk PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/hf PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/pcm PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/ccd PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/api/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/software/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/pipeline PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/utils PRIVATE ${PHYSX_SOURCE_DIR}/lowlevelaabb/include PRIVATE ${PHYSX_SOURCE_DIR}/lowleveldynamics/include PRIVATE ${PHYSX_SOURCE_DIR}/simulationcontroller/include PRIVATE ${PHYSX_SOURCE_DIR}/simulationcontroller/src PRIVATE ${PHYSX_SOURCE_DIR}/scenequery/include PRIVATE ${PHYSX_SOURCE_DIR}/physxmetadata/core/include PRIVATE ${PHYSX_SOURCE_DIR}/immediatemode/include PRIVATE ${PHYSX_SOURCE_DIR}/pvd/include PRIVATE ${PHYSX_SOURCE_DIR}/gpucommon/include PRIVATE ${PHYSX_SOURCE_DIR}/gpucommon/src/DX PRIVATE ${PHYSX_SOURCE_DIR}/gpucommon/src/CUDA PRIVATE ${PHYSX_SOURCE_DIR}/omnipvd PRIVATE ${PHYSX_ROOT_DIR}/pvdruntime/include ) TARGET_COMPILE_DEFINITIONS(PhysX # Common to all configurations PRIVATE ${PHYSX_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysX PROPERTIES OUTPUT_NAME PhysX ) IF(PHYSX_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysX PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysX_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysX_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysX_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysX_static" ) ENDIF() IF(PHYSX_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysX PROPERTIES COMPILE_PDB_NAME_DEBUG "${PHYSX_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${PHYSX_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${PHYSX_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${PHYSX_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() TARGET_LINK_LIBRARIES(PhysX PRIVATE ${PHYSX_PRIVATE_PLATFORM_LINKED_LIBS} PRIVATE PhysXPvdSDK PhysXCommon PhysXFoundation PUBLIC ${PHYSX_PLATFORM_LINKED_LIBS} ) SET_TARGET_PROPERTIES(PhysX PROPERTIES LINK_FLAGS "${PHYSX_PLATFORM_LINK_FLAGS}" LINK_FLAGS_DEBUG "${PHYSX_PLATFORM_LINK_FLAGS_DEBUG}" LINK_FLAGS_CHECKED "${PHYSX_PLATFORM_LINK_FLAGS_CHECKED}" LINK_FLAGS_PROFILE "${PHYSX_PLATFORM_LINK_FLAGS_PROFILE}" LINK_FLAGS_RELEASE "${PHYSX_PLATFORM_LINK_FLAGS_RELEASE}" ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_COMMON_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_MATERIAL_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_PVD_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_OMNIPVD_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_OMNIPVD_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_PVD_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_METADATA_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_METADATA_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_CORE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_BUFFERING_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_IMMEDIATEMODE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_MATERIALS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_ARTICULATIONS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_PLATFORM_SRC_FILES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_SOLVER_HEADERS}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysX PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/CMakeLists.txt
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. cmake_minimum_required(VERSION 3.7) project(PhysX C CXX) CMAKE_POLICY(SET CMP0057 NEW) # Enable IN_LIST OPTION(PX_SCALAR_MATH "Disable SIMD math" OFF) OPTION(PX_GENERATE_STATIC_LIBRARIES "Generate static libraries" OFF) OPTION(PX_EXPORT_LOWLEVEL_PDB "Export low level pdb's" OFF) IF(NOT DEFINED PHYSX_ROOT_DIR) STRING(REPLACE "\\" "/" BRD_TEMP $ENV{PHYSX_ROOT_DIR}) # This env variable is set by GenerateProjects.bat, and is no longer available when CMake rebuilds, so this stores it in the cache SET(PHYSX_ROOT_DIR ${BRD_TEMP} CACHE INTERNAL "Root of the PhysX source tree") ENDIF() MESSAGE("PHYSX ROOT ${PHYSX_ROOT_DIR}") IF(NOT EXISTS ${PHYSX_ROOT_DIR}) MESSAGE(FATAL_ERROR "PHYSX_ROOT_DIR environment variable wasn't set or was invalid.") ENDIF() MESSAGE("PhysX Build Platform: " ${TARGET_BUILD_PLATFORM}) MESSAGE("Using CXX Compiler: " ${CMAKE_CXX_COMPILER}) INCLUDE(NvidiaBuildOptions) IF(CMAKE_CONFIGURATION_TYPES) SET(CMAKE_CONFIGURATION_TYPES debug checked profile release) SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Reset config to what we need" FORCE) SET(CMAKE_SHARED_LINKER_FLAGS_CHECKED "") SET(CMAKE_SHARED_LINKER_FLAGS_PROFILE "") # Build PDBs for all configurations SET(CMAKE_SHARED_LINKER_FLAGS "/DEBUG") ENDIF() # Prevent failure due to command line limitations IF(USE_RESPONSE_FILES) SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1) SET(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1) SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1) SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1) ENDIF() IF($ENV{PHYSX_AUTOBUILD}) IF($ENV{PHYSX_AUTOBUILD} STREQUAL "1") SET(PHYSX_AUTOBUILD "PHYSX_AUTOBUILD") ENDIF() ENDIF() SET(PROJECT_CMAKE_FILES_DIR source/compiler/cmake) SET(PLATFORM_CMAKELISTS ${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/CMakeLists.txt) IF(NOT EXISTS ${PLATFORM_CMAKELISTS}) MESSAGE(FATAL_ERROR "Unable to find platform CMakeLists.txt for ${TARGET_BUILD_PLATFORM} at ${PLATFORM_CMAKELISTS}") ENDIF() SET(CMAKE_POSITION_INDEPENDENT_CODE ON) SET(SOURCE_DISTRO_FILE_LIST "") SET(HEADER_GUARD_NAME "CONFIG") SET(HEADER_CONTENT "") FILE(READ ${PHYSX_ROOT_DIR}/buildtools/templates/boilerplate_bsd.txt BOILERPLATE_CONTENT) # Include the platform specific CMakeLists INCLUDE(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/CMakeLists.txt) # generate PxConfig.h header that will contain PhysX configuration defines like PX_PHYSX_STATIC_LIB CONFIGURE_FILE(${PHYSX_ROOT_DIR}/buildtools/templates/PxIncludeTemplate.h ${PHYSX_ROOT_DIR}/include/PxConfig.h) IF(PX_GENERATE_SOURCE_DISTRO) FOREACH(FILE_NAME ${SOURCE_DISTRO_FILE_LIST}) FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/source_distro_list.txt" "${FILE_NAME}\n") ENDFOREACH() ENDIF()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXCooking.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXCooking common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxcooking/src) SET(PHYSXCOOKING_LINK_FLAGS_DEBUG " ") SET(PHYSXCOOKING_LINK_FLAGS_CHECKED " ") SET(PHYSXCOOKING_LINK_FLAGS_PROFILE " ") SET(PHYSXCOOKING_LINK_FLAGS_RELEASE " ") # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXCooking.cmake) SET(PHYSX_COOKING_HEADERS ${PHYSX_ROOT_DIR}/include/cooking/PxBVH33MidphaseDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxBVH34MidphaseDesc.h ${PHYSX_ROOT_DIR}/include/cooking/Pxc.h ${PHYSX_ROOT_DIR}/include/cooking/PxConvexMeshDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxCooking.h ${PHYSX_ROOT_DIR}/include/cooking/PxCookingInternal.h ${PHYSX_ROOT_DIR}/include/cooking/PxMidphaseDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxTriangleMeshDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxTetrahedronMeshDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxBVHDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxTetrahedronMeshDesc.h ${PHYSX_ROOT_DIR}/include/cooking/PxSDFDesc.h ) SOURCE_GROUP(include FILES ${PHYSX_COOKING_HEADERS}) SET(PHYSX_COOKING_SOURCE ${LL_SOURCE_DIR}/Cooking.cpp ${LL_SOURCE_DIR}/Cooking.h ) SOURCE_GROUP(src FILES ${PHYSX_COOKING_SOURCE}) ADD_LIBRARY(PhysXCooking ${PHYSXCOOKING_LIBTYPE} ${PHYSX_COOKING_HEADERS} ${PHYSX_COOKING_SOURCE} ${PHYSXCOOKING_PLATFORM_SRC_FILES} ) INSTALL(FILES ${PHYSX_COOKING_HEADERS} DESTINATION include/cooking) # Target specific compile options TARGET_INCLUDE_DIRECTORIES(PhysXCooking PRIVATE ${PHYSXCOOKING_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PUBLIC ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh ) TARGET_LINK_LIBRARIES(PhysXCooking PUBLIC PhysXCommon PUBLIC PhysXFoundation PRIVATE ${PHYSXCOOKING_PLATFORM_LINKED_LIBS} ) # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(PhysXCooking PRIVATE ${PHYSXCOOKING_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES OUTPUT_NAME PhysXCooking ) IF(PHYSXCOOKING_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXCooking_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXCooking_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXCooking_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXCooking_static" ) ENDIF() IF(PHYSXCOOKING_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXCOOKING_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXCOOKING_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXCOOKING_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXCOOKING_COMPILE_PDB_NAME_RELEASE} ) ENDIF() SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES LINK_FLAGS ${PHYSXCOOKING_LINK_FLAGS} LINK_FLAGS_DEBUG ${PHYSXCOOKING_LINK_FLAGS_DEBUG} LINK_FLAGS_CHECKED ${PHYSXCOOKING_LINK_FLAGS_CHECKED} LINK_FLAGS_PROFILE ${PHYSXCOOKING_LINK_FLAGS_PROFILE} LINK_FLAGS_RELEASE ${PHYSXCOOKING_LINK_FLAGS_RELEASE} ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_COOKING_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_COOKING_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXCOOKING_PLATFORM_SRC_FILES}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/FastXml.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build FastXml common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/fastxml) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/FastXml.cmake) SET(FASTXML_HEADERS ${LL_SOURCE_DIR}/include/PsFastXml.h ) SOURCE_GROUP(include FILES ${FASTXML_HEADERS}) SET(FASTXML_SOURCE ${LL_SOURCE_DIR}/src/PsFastXml.cpp ) SOURCE_GROUP(src FILES ${FASTXML_SOURCE}) ADD_LIBRARY(FastXml ${FASTXML_LIBTYPE} ${FASTXML_HEADERS} ${FASTXML_SOURCE} ) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(FastXml PRIVATE ${FASTXML_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${LL_SOURCE_DIR}/include ) TARGET_COMPILE_DEFINITIONS(FastXml PRIVATE ${FASTXML_COMPILE_DEFS} ) IF(FASTXML_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(FastXml PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "FastXml_static" ARCHIVE_OUTPUT_NAME_CHECKED "FastXml_static" ARCHIVE_OUTPUT_NAME_PROFILE "FastXml_static" ARCHIVE_OUTPUT_NAME_RELEASE "FastXml_static" ) ENDIF() IF(FASTXML_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(FastXml PROPERTIES COMPILE_PDB_NAME_DEBUG "${FASTXML_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${FASTXML_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${FASTXML_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${FASTXML_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() INSTALL(FILES ${FASTXML_HEADERS} DESTINATION source/fastxml/include) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${FASTXML_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${FASTXML_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(FastXml PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXExtensions.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXExtensions common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxextensions/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXExtensions.cmake) SET(PHYSX_EXTENSIONS_SOURCE ${LL_SOURCE_DIR}/ExtBroadPhase.cpp ${LL_SOURCE_DIR}/ExtCollection.cpp ${LL_SOURCE_DIR}/ExtConvexMeshExt.cpp ${LL_SOURCE_DIR}/ExtCpuWorkerThread.cpp ${LL_SOURCE_DIR}/ExtDefaultCpuDispatcher.cpp ${LL_SOURCE_DIR}/ExtDefaultErrorCallback.cpp ${LL_SOURCE_DIR}/ExtDefaultSimulationFilterShader.cpp ${LL_SOURCE_DIR}/ExtDefaultStreams.cpp ${LL_SOURCE_DIR}/ExtExtensions.cpp ${LL_SOURCE_DIR}/ExtMetaData.cpp ${LL_SOURCE_DIR}/ExtPvd.cpp ${LL_SOURCE_DIR}/ExtPxStringTable.cpp ${LL_SOURCE_DIR}/ExtRaycastCCD.cpp ${LL_SOURCE_DIR}/ExtRigidBodyExt.cpp ${LL_SOURCE_DIR}/ExtRigidActorExt.cpp ${LL_SOURCE_DIR}/ExtSceneQueryExt.cpp ${LL_SOURCE_DIR}/ExtSceneQuerySystem.cpp ${LL_SOURCE_DIR}/ExtCustomSceneQuerySystem.cpp ${LL_SOURCE_DIR}/ExtSqQuery.cpp ${LL_SOURCE_DIR}/ExtSqQuery.h ${LL_SOURCE_DIR}/ExtSqManager.cpp ${LL_SOURCE_DIR}/ExtSqManager.h ${LL_SOURCE_DIR}/ExtSimpleFactory.cpp ${LL_SOURCE_DIR}/ExtSmoothNormals.cpp ${LL_SOURCE_DIR}/ExtSoftBodyExt.cpp ${LL_SOURCE_DIR}/ExtTriangleMeshExt.cpp ${LL_SOURCE_DIR}/ExtTetrahedronMeshExt.cpp ${LL_SOURCE_DIR}/ExtRemeshingExt.cpp ${LL_SOURCE_DIR}/ExtCpuWorkerThread.h ${LL_SOURCE_DIR}/ExtDefaultCpuDispatcher.h ${LL_SOURCE_DIR}/ExtInertiaTensor.h ${LL_SOURCE_DIR}/ExtPlatform.h ${LL_SOURCE_DIR}/ExtPvd.h ${LL_SOURCE_DIR}/ExtSerialization.h ${LL_SOURCE_DIR}/ExtSharedQueueEntryPool.h ${LL_SOURCE_DIR}/ExtTaskQueueHelper.h ${LL_SOURCE_DIR}/ExtSampling.cpp ${LL_SOURCE_DIR}/ExtTetMakerExt.cpp ${LL_SOURCE_DIR}/ExtGjkQueryExt.cpp ${LL_SOURCE_DIR}/ExtCustomGeometryExt.cpp ) #TODO, create a propper define for whether GPU features are enabled or not! IF ((PUBLIC_RELEASE OR PX_GENERATE_GPU_PROJECTS) AND (NOT CMAKE_CROSSCOMPILING)) LIST(APPEND PHYSX_EXTENSIONS_SOURCE "${LL_SOURCE_DIR}/ExtParticleExt.cpp") LIST(APPEND PHYSX_EXTENSIONS_SOURCE "${LL_SOURCE_DIR}/ExtParticleClothCooker.cpp") IF(NOT PX_GENERATE_SOURCE_DISTRO AND NOT PUBLIC_RELEASE) LIST(APPEND PHYSX_EXTENSIONS_SOURCE "${LL_SOURCE_DIR}/ExtFEMClothExt.cpp") ENDIF() ENDIF() SOURCE_GROUP(src FILES ${PHYSX_EXTENSIONS_SOURCE}) SET(PHYSX_EXTENSIONS_JOINTS_SOURCE ${LL_SOURCE_DIR}/ExtGearJoint.cpp ${LL_SOURCE_DIR}/ExtGearJoint.h ${LL_SOURCE_DIR}/ExtRackAndPinionJoint.cpp ${LL_SOURCE_DIR}/ExtRackAndPinionJoint.h ${LL_SOURCE_DIR}/ExtD6Joint.cpp ${LL_SOURCE_DIR}/ExtD6JointCreate.cpp ${LL_SOURCE_DIR}/ExtDistanceJoint.cpp ${LL_SOURCE_DIR}/ExtContactJoint.cpp ${LL_SOURCE_DIR}/ExtFixedJoint.cpp ${LL_SOURCE_DIR}/ExtJoint.cpp ${LL_SOURCE_DIR}/ExtPrismaticJoint.cpp ${LL_SOURCE_DIR}/ExtRevoluteJoint.cpp ${LL_SOURCE_DIR}/ExtSphericalJoint.cpp ${LL_SOURCE_DIR}/ExtConstraintHelper.h ${LL_SOURCE_DIR}/ExtD6Joint.h ${LL_SOURCE_DIR}/ExtDistanceJoint.h ${LL_SOURCE_DIR}/ExtContactJoint.h ${LL_SOURCE_DIR}/ExtFixedJoint.h ${LL_SOURCE_DIR}/ExtJoint.h ${LL_SOURCE_DIR}/ExtJointData.h ${LL_SOURCE_DIR}/ExtJointMetaDataExtensions.h ${LL_SOURCE_DIR}/ExtPrismaticJoint.h ${LL_SOURCE_DIR}/ExtRevoluteJoint.h ${LL_SOURCE_DIR}/ExtSphericalJoint.h ) SOURCE_GROUP(src\\joints FILES ${PHYSX_EXTENSIONS_JOINTS_SOURCE}) SET(PHYSX_EXTENSIONS_TET_SOURCE ${LL_SOURCE_DIR}/tet/ExtUtilities.h ${LL_SOURCE_DIR}/tet/ExtUtilities.cpp ${LL_SOURCE_DIR}/tet/ExtTetUnionFind.h ${LL_SOURCE_DIR}/tet/ExtTetUnionFind.cpp ${LL_SOURCE_DIR}/tet/ExtDelaunayBoundaryInserter.cpp ${LL_SOURCE_DIR}/tet/ExtDelaunayBoundaryInserter.h ${LL_SOURCE_DIR}/tet/ExtDelaunayTetrahedralizer.cpp ${LL_SOURCE_DIR}/tet/ExtDelaunayTetrahedralizer.h ${LL_SOURCE_DIR}/tet/ExtVec3.h ${LL_SOURCE_DIR}/tet/ExtTetSplitting.cpp ${LL_SOURCE_DIR}/tet/ExtTetSplitting.h ${LL_SOURCE_DIR}/tet/ExtFastWindingNumber.cpp ${LL_SOURCE_DIR}/tet/ExtFastWindingNumber.h ${LL_SOURCE_DIR}/tet/ExtRandomAccessHeap.h ${LL_SOURCE_DIR}/tet/ExtQuadric.h ${LL_SOURCE_DIR}/tet/ExtMeshSimplificator.h ${LL_SOURCE_DIR}/tet/ExtMeshSimplificator.cpp ${LL_SOURCE_DIR}/tet/ExtBVH.cpp ${LL_SOURCE_DIR}/tet/ExtBVH.h ${LL_SOURCE_DIR}/tet/ExtRemesher.cpp ${LL_SOURCE_DIR}/tet/ExtRemesher.h ${LL_SOURCE_DIR}/tet/ExtMarchingCubesTable.h ${LL_SOURCE_DIR}/tet/ExtMultiList.h ${LL_SOURCE_DIR}/tet/ExtInsideTester.cpp ${LL_SOURCE_DIR}/tet/ExtInsideTester.h ${LL_SOURCE_DIR}/tet/ExtOctreeTetrahedralizer.cpp ${LL_SOURCE_DIR}/tet/ExtOctreeTetrahedralizer.h ${LL_SOURCE_DIR}/tet/ExtVoxelTetrahedralizer.cpp ${LL_SOURCE_DIR}/tet/ExtVoxelTetrahedralizer.h ) SOURCE_GROUP(src\\tet FILES ${PHYSX_EXTENSIONS_TET_SOURCE}) SET(PHYSX_EXTENSIONS_METADATA_SOURCE ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/src/PxExtensionAutoGeneratedMetaDataObjects.cpp ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/include/PxExtensionAutoGeneratedMetaDataObjectNames.h ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/include/PxExtensionAutoGeneratedMetaDataObjects.h ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/include/PxExtensionMetaDataObjects.h ) SOURCE_GROUP(src\\metadata FILES ${PHYSX_EXTENSIONS_METADATA_SOURCE}) SET(PHYSX_EXTENSIONS_OMNIPVD_SOURCE ${LL_SOURCE_DIR}/omnipvd/ExtOmniPvdRegistrationData.cpp ${LL_SOURCE_DIR}/omnipvd/ExtOmniPvdRegistrationData.h ${LL_SOURCE_DIR}/omnipvd/ExtOmniPvdSetData.h ${LL_SOURCE_DIR}/omnipvd/OmniPvdPxExtensionsTypes.h ${LL_SOURCE_DIR}/omnipvd/OmniPvdPxExtensionsSampler.h ${LL_SOURCE_DIR}/omnipvd/OmniPvdPxExtensionsSampler.cpp ) SOURCE_GROUP(src\\omnipvd FILES ${PHYSX_EXTENSIONS_OMNIPVD_SOURCE}) SET(PHYSX_EXTENSIONS_HEADERS ${PHYSX_ROOT_DIR}/include/extensions/PxBinaryConverter.h ${PHYSX_ROOT_DIR}/include/extensions/PxBroadPhaseExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxCollectionExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxConvexMeshExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxDefaultAllocator.h ${PHYSX_ROOT_DIR}/include/extensions/PxDefaultCpuDispatcher.h ${PHYSX_ROOT_DIR}/include/extensions/PxDefaultErrorCallback.h ${PHYSX_ROOT_DIR}/include/extensions/PxDefaultSimulationFilterShader.h ${PHYSX_ROOT_DIR}/include/extensions/PxDefaultStreams.h ${PHYSX_ROOT_DIR}/include/extensions/PxExtensionsAPI.h ${PHYSX_ROOT_DIR}/include/extensions/PxMassProperties.h ${PHYSX_ROOT_DIR}/include/extensions/PxRaycastCCD.h ${PHYSX_ROOT_DIR}/include/extensions/PxRepXSerializer.h ${PHYSX_ROOT_DIR}/include/extensions/PxRepXSimpleType.h ${PHYSX_ROOT_DIR}/include/extensions/PxRigidActorExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxRigidBodyExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxSceneQueryExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxSceneQuerySystemExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxCustomSceneQuerySystem.h ${PHYSX_ROOT_DIR}/include/extensions/PxSerialization.h ${PHYSX_ROOT_DIR}/include/extensions/PxShapeExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxSimpleFactory.h ${PHYSX_ROOT_DIR}/include/extensions/PxSmoothNormals.h ${PHYSX_ROOT_DIR}/include/extensions/PxSoftBodyExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxStringTableExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxTriangleMeshExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxTetrahedronMeshExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxRemeshingExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxTriangleMeshAnalysisResult.h ${PHYSX_ROOT_DIR}/include/extensions/PxTetrahedronMeshAnalysisResult.h ${PHYSX_ROOT_DIR}/include/extensions/PxTetMakerExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxGjkQueryExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxCustomGeometryExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxSamplingExt.h ) #TODO, create a propper define for whether GPU features are enabled or not! IF ((PUBLIC_RELEASE OR PX_GENERATE_GPU_PROJECTS) AND (NOT CMAKE_CROSSCOMPILING)) LIST(APPEND PHYSX_EXTENSIONS_HEADERS "${PHYSX_ROOT_DIR}/include/extensions/PxParticleClothCooker.h") LIST(APPEND PHYSX_EXTENSIONS_HEADERS "${PHYSX_ROOT_DIR}/include/extensions/PxParticleExt.h") IF(NOT PX_GENERATE_SOURCE_DISTRO AND NOT PUBLIC_RELEASE) LIST(APPEND PHYSX_EXTENSIONS_HEADERS ${PHYSX_ROOT_DIR}/include/extensions/PxFEMClothExt.h ) ENDIF() ENDIF() SOURCE_GROUP(include FILES ${PHYSX_EXTENSIONS_HEADERS}) SET(PHYSX_JOINT_HEADERS ${PHYSX_ROOT_DIR}/include/extensions/PxConstraintExt.h ${PHYSX_ROOT_DIR}/include/extensions/PxContactJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxD6Joint.h ${PHYSX_ROOT_DIR}/include/extensions/PxD6JointCreate.h ${PHYSX_ROOT_DIR}/include/extensions/PxDistanceJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxContactJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxFixedJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxGearJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxRackAndPinionJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxJointLimit.h # ${PHYSX_ROOT_DIR}/include/extensions/PxJointRepXSerializer.h ${PHYSX_ROOT_DIR}/include/extensions/PxPrismaticJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxRevoluteJoint.h ${PHYSX_ROOT_DIR}/include/extensions/PxSphericalJoint.h ) SOURCE_GROUP(include\\joints FILES ${PHYSX_JOINT_HEADERS}) SET(PHYSX_FILEBUF_HEADERS ${PHYSX_ROOT_DIR}/include/filebuf/PxFileBuf.h ) SOURCE_GROUP(include\\filebuf FILES ${PHYSX_FILEBUF_HEADERS}) SET(PHYSX_EXTENSIONS_SERIALIZATION_SOURCE ${LL_SOURCE_DIR}/serialization/SnSerialization.cpp ${LL_SOURCE_DIR}/serialization/SnSerializationRegistry.cpp ${LL_SOURCE_DIR}/serialization/SnSerializationRegistry.h ${LL_SOURCE_DIR}/serialization/SnSerialUtils.cpp ${LL_SOURCE_DIR}/serialization/SnSerialUtils.h ) SOURCE_GROUP(serialization FILES ${PHYSX_EXTENSIONS_SERIALIZATION_SOURCE}) SET(PHYSX_EXTENSIONS_SERIALIZATION_XML_SOURCE ${LL_SOURCE_DIR}/serialization/Xml/SnJointRepXSerializer.cpp ${LL_SOURCE_DIR}/serialization/Xml/SnJointRepXSerializer.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepXCoreSerializer.cpp ${LL_SOURCE_DIR}/serialization/Xml/SnRepXUpgrader.cpp ${LL_SOURCE_DIR}/serialization/Xml/SnXmlSerialization.cpp ${LL_SOURCE_DIR}/serialization/Xml/SnPxStreamOperators.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepX1_0Defaults.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepX3_1Defaults.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepX3_2Defaults.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepXCollection.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepXCoreSerializer.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepXSerializerImpl.h ${LL_SOURCE_DIR}/serialization/Xml/SnRepXUpgrader.h ${LL_SOURCE_DIR}/serialization/Xml/SnSimpleXmlWriter.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlDeserializer.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlImpl.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlMemoryAllocator.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlMemoryPool.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlMemoryPoolStreams.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlReader.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlSerializer.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlSimpleXmlWriter.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlStringToType.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlVisitorReader.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlVisitorWriter.h ${LL_SOURCE_DIR}/serialization/Xml/SnXmlWriter.h ) SOURCE_GROUP(serialization\\xml FILES ${PHYSX_EXTENSIONS_SERIALIZATION_XML_SOURCE}) SET(PHYSX_EXTENSIONS_SERIALIZATION_FILE_SOURCE ${LL_SOURCE_DIR}/serialization/File/SnFile.h ) SOURCE_GROUP(serialization\\file FILES ${PHYSX_EXTENSIONS_SERIALIZATION_FILE_SOURCE}) SET(PHYSX_EXTENSIONS_SERIALIZATION_BINARY_SOURCE ${LL_SOURCE_DIR}/serialization/Binary/SnBinaryDeserialization.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnBinarySerialization.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Align.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Convert.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Error.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_MetaData.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Output.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Union.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnSerializationContext.cpp ${LL_SOURCE_DIR}/serialization/Binary/SnConvX.h ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Align.h ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Common.h ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_MetaData.h ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Output.h ${LL_SOURCE_DIR}/serialization/Binary/SnConvX_Union.h ${LL_SOURCE_DIR}/serialization/Binary/SnSerializationContext.h ) SOURCE_GROUP(serialization\\binary FILES ${PHYSX_EXTENSIONS_SERIALIZATION_BINARY_SOURCE}) ADD_LIBRARY(PhysXExtensions ${PHYSXEXTENSIONS_LIBTYPE} ${PHYSXEXTENSIONS_PLATFORM_SRC_FILES} ${PHYSX_EXTENSIONS_SOURCE} ${PHYSX_EXTENSIONS_TET_SOURCE} ${PHYSX_EXTENSIONS_JOINTS_SOURCE} ${PHYSX_EXTENSIONS_METADATA_SOURCE} ${PHYSX_EXTENSIONS_OMNIPVD_SOURCE} ${PHYSX_EXTENSIONS_HEADERS} ${PHYSX_JOINT_HEADERS} ${PHYSX_FILEBUF_HEADERS} ${PHYSX_EXTENSIONS_SERIALIZATION_SOURCE} ${PHYSX_EXTENSIONS_SERIALIZATION_XML_SOURCE} ${PHYSX_EXTENSIONS_SERIALIZATION_FILE_SOURCE} ${PHYSX_EXTENSIONS_SERIALIZATION_BINARY_SOURCE} ) INSTALL(FILES ${PHYSX_EXTENSIONS_HEADERS} DESTINATION include/extensions) INSTALL(FILES ${PHYSX_JOINT_HEADERS} DESTINATION include/extensions) INSTALL(FILES ${PHYSX_FILEBUF_HEADERS} DESTINATION include/filebuf) TARGET_INCLUDE_DIRECTORIES(PhysXExtensions PRIVATE ${PHYSXEXTENSIONS_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/physxmetadata/core/include PRIVATE ${PHYSX_SOURCE_DIR}/physxmetadata/extensions/include PRIVATE ${PHYSX_SOURCE_DIR}/physxextensions/src PRIVATE ${PHYSX_SOURCE_DIR}/physxextensions/src/serialization/Xml PRIVATE ${PHYSX_SOURCE_DIR}/physxextensions/src/serialization/Binary PRIVATE ${PHYSX_SOURCE_DIR}/physxextensions/src/serialization/File PRIVATE ${PHYSX_SOURCE_DIR}/physx/src PRIVATE ${PHYSX_SOURCE_DIR}/pvd/include PRIVATE ${PHYSX_SOURCE_DIR}/scenequery/include PRIVATE ${PHYSX_SOURCE_DIR}/fastxml/include ) TARGET_LINK_LIBRARIES(PhysXExtensions PRIVATE ${PHYSXEXTENSIONS_PRIVATE_PLATFORM_LINKED_LIBS} PUBLIC PhysXFoundation PUBLIC PhysXPvdSDK PUBLIC PhysX ) # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(PhysXExtensions PRIVATE ${PHYSXEXTENSIONS_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXExtensions PROPERTIES OUTPUT_NAME PhysXExtensions ) IF(PHYSXEXTENSIONS_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXExtensions PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXExtensions_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXExtensions_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXExtensions_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXExtensions_static" ) ENDIF() IF(PHYSXEXTENSIONS_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXExtensions PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXEXTENSIONS_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXEXTENSIONS_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXEXTENSIONS_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXEXTENSIONS_COMPILE_PDB_NAME_RELEASE} ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXEXTENSIONS_PLATFORM_SRC_FILES}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_TET_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_JOINTS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_METADATA_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_OMNIPVD_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_JOINT_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_FILEBUF_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_SERIALIZATION_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_SERIALIZATION_XML_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_SERIALIZATION_FILE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_EXTENSIONS_SERIALIZATION_BINARY_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXExtensions PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXTask.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXTask common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/task) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXTask.cmake) SET(PHYSXTASK_HEADERS ${PHYSX_ROOT_DIR}/include/task/PxCpuDispatcher.h ${PHYSX_ROOT_DIR}/include/task/PxTask.h ${PHYSX_ROOT_DIR}/include/task/PxTaskManager.h ) SOURCE_GROUP(include FILES ${PHYSXTASK_HEADERS}) SET(PHYSXTASK_SOURCE ${LL_SOURCE_DIR}/src/TaskManager.cpp ) SOURCE_GROUP(src FILES ${PHYSXTASK_SOURCE}) ADD_LIBRARY(PhysXTask ${PHYSXTASK_LIBTYPE} ${PHYSXTASK_HEADERS} ${PHYSXTASK_SOURCE} ) INSTALL(FILES ${PHYSXTASK_HEADERS} DESTINATION include/task) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(PhysXTask PRIVATE ${PHYSXTASK_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/cudamanager/include ) TARGET_COMPILE_DEFINITIONS(PhysXTask PRIVATE ${PHYSXTASK_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXTask PROPERTIES OUTPUT_NAME PhysXTask ) IF(PHYSXTASK_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXTask PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXTask_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXTask_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXTask_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXTask_static" ) ENDIF() IF(PT_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXTask PROPERTIES COMPILE_PDB_NAME_DEBUG "${PT_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${PT_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${PT_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${PT_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(PhysXTask PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXTASK_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSXTASK_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXTask PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/SimulationController.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build SimulationController common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/simulationcontroller/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/SimulationController.cmake) SET(SIMULATIONCONTROLLER_BASE_DIR ${PHYSX_ROOT_DIR}/source/simulationcontroller) SET(SIMULATIONCONTROLLER_HEADERS ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScActorCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationJointCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationSensor.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScBodyCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScBroadphase.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScConstraintCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScIterators.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScPhysics.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScRigidCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScScene.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScShapeCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScSqBoundsSync.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScStaticCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScSoftBodyCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScFEMClothCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScHairSystemCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScParticleSystemCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationTendonCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationAttachmentCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/include/ScArticulationTendonJointCore.h ) SOURCE_GROUP(include FILES ${SIMULATIONCONTROLLER_HEADERS}) SET(SIMULATIONCONTROLLER_SOURCE ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScActorCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScActorPair.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScActorSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScActorSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationJointCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationTendonCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationJointSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationJointSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationTendonJointCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationTendonSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationTendonSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationSensorSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScArticulationSensorSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScBroadphase.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSoftBodyCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSoftBodySim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSoftBodySim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSoftBodyShapeSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSoftBodyShapeSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFEMClothCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFEMClothSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFEMClothSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFEMClothShapeSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFEMClothShapeSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFiltering.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScFiltering.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemShapeCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemShapeCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemShapeSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScParticleSystemShapeSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemShapeCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemShapeCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemShapeSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScHairSystemShapeSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScBodyCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScBodySim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScBodySim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintBreakage.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintInteraction.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintInteraction.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScConstraintSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScContactReportBuffer.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScContactStream.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScElementInteractionMarker.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScElementInteractionMarker.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScElementSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScElementSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScElementSimInteraction.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScInteraction.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScInteraction.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScInteractionFlags.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScIterators.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScKinematics.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScMetaData.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScNPhaseCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScNPhaseCore.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScObjectIDTracker.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScPhysics.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScRigidCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScRigidSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScRigidSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScScene.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScCCD.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeInteraction.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeInteraction.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeSim.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeSimBase.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScShapeSimBase.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSimStateData.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSimStats.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSimStats.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSimulationController.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSimulationController.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSqBoundsManager.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSqBoundsManager.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScStaticCore.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScStaticSim.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScTriggerInteraction.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScTriggerInteraction.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScTriggerPairs.h ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScVisualize.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScSleep.cpp ${SIMULATIONCONTROLLER_BASE_DIR}/src/ScPipeline.cpp ) SOURCE_GROUP(src FILES ${SIMULATIONCONTROLLER_SOURCE}) ADD_LIBRARY(SimulationController ${SIMULATIONCONTROLLER_LIBTYPE} ${SIMULATIONCONTROLLER_HEADERS} ${SIMULATIONCONTROLLER_SOURCE} ) GET_TARGET_PROPERTY(PHYSXFOUNDATION_INCLUDES PhysXFoundation INTERFACE_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(SimulationController PRIVATE ${SIMULATIONCONTROLLER_PLATFORM_INCLUDES} PRIVATE ${PHYSXFOUNDATION_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_SOURCE_DIR}/common/include PRIVATE ${PHYSX_SOURCE_DIR}/common/src PRIVATE ${PHYSX_SOURCE_DIR}/physxgpu/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/include PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/contact PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/common PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/convex PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/distance PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/sweep PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/gjk PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/intersection PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/mesh PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/hf PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/pcm PRIVATE ${PHYSX_SOURCE_DIR}/geomutils/src/ccd PRIVATE ${PHYSX_SOURCE_DIR}/simulationcontroller/include PRIVATE ${PHYSX_SOURCE_DIR}/simulationcontroller/src PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/api/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/collision PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/pipeline PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/common/include/utils PRIVATE ${PHYSX_SOURCE_DIR}/lowlevel/software/include PRIVATE ${PHYSX_SOURCE_DIR}/lowleveldynamics/include PRIVATE ${PHYSX_SOURCE_DIR}/lowlevelaabb/include ) # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(SimulationController # Common to all configurations PRIVATE ${SIMULATIONCONTROLLER_COMPILE_DEFS} ) IF(SIMULATIONCONTROLLER_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(SimulationController PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "SimulationController_static" ARCHIVE_OUTPUT_NAME_CHECKED "SimulationController_static" ARCHIVE_OUTPUT_NAME_PROFILE "SimulationController_static" ARCHIVE_OUTPUT_NAME_RELEASE "SimulationController_static" ) ENDIF() IF(SC_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(SimulationController PROPERTIES COMPILE_PDB_NAME_DEBUG "${SC_COMPILE_PDB_NAME_DEBUG}" COMPILE_PDB_NAME_CHECKED "${SC_COMPILE_PDB_NAME_CHECKED}" COMPILE_PDB_NAME_PROFILE "${SC_COMPILE_PDB_NAME_PROFILE}" COMPILE_PDB_NAME_RELEASE "${SC_COMPILE_PDB_NAME_RELEASE}" ) ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) SET_TARGET_PROPERTIES(SimulationController PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/debug/" COMPILE_PDB_OUTPUT_DIRECTORY_CHECKED "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/checked/" COMPILE_PDB_OUTPUT_DIRECTORY_PROFILE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/profile/" COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE "${PHYSX_ROOT_DIR}/${PX_ROOT_LIB_DIR}/release/" ) ENDIF() IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${SIMULATIONCONTROLLER_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${SIMULATIONCONTROLLER_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(SimulationController PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/PhysXVehicle2.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build PhysXVehicle2 common # SET(PHYSX_SOURCE_DIR ${PHYSX_ROOT_DIR}/source) SET(LL_SOURCE_DIR ${PHYSX_SOURCE_DIR}/physxvehicle2/src) # Include here after the directories are defined so that the platform specific file can use the variables. include(${PHYSX_ROOT_DIR}/${PROJECT_CMAKE_FILES_DIR}/${TARGET_BUILD_PLATFORM}/PhysXVehicle2.cmake) SET(PHYSX_VEHICLE2_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleAPI.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleComponent.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleComponentSequence.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleLimits.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/PxVehicleMaths.h ) SET(PHYSX_VEHICLE2_BRAKING_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/braking/PxVehicleBrakingFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/braking/PxVehicleBrakingParams.h ) SET(PHYSX_VEHICLE2_COMMAND_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/commands/PxVehicleCommandHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/commands/PxVehicleCommandParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/commands/PxVehicleCommandStates.h ) SET(PHYSX_VEHICLE2_DRIVETRAIN_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/drivetrain/PxVehicleDrivetrainComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/drivetrain/PxVehicleDrivetrainFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/drivetrain/PxVehicleDrivetrainHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/drivetrain/PxVehicleDrivetrainParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/drivetrain/PxVehicleDrivetrainStates.h ) SET(PHYSX_VEHICLE2_PHYSXACTOR_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/physxActor/PxVehiclePhysXActorComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxActor/PxVehiclePhysXActorFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxActor/PxVehiclePhysXActorHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxActor/PxVehiclePhysXActorStates.h ) SET(PHYSX_VEHICLE2_PHYSXCONSTRAINT_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/physxConstraints/PxVehiclePhysXConstraintComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxConstraints/PxVehiclePhysXConstraintFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxConstraints/PxVehiclePhysXConstraintHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxConstraints/PxVehiclePhysXConstraintParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h ) SET(PHYSX_VEHICLE2_PHYSXROADGEOMETRY_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/physxRoadGeometry/PxVehiclePhysXRoadGeometryState.h ) SET(PHYSX_VEHICLE2_RIGIDBODY_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/rigidBody/PxVehicleRigidBodyComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/rigidBody/PxVehicleRigidBodyFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/rigidBody/PxVehicleRigidBodyParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/rigidBody/PxVehicleRigidBodyStates.h ) SET(PHYSX_VEHICLE2_ROADGEOMETRY_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/roadGeometry/PxVehicleRoadGeometryState.h ) SET(PHYSX_VEHICLE2_STEERING_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/steering/PxVehicleSteeringFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/steering/PxVehicleSteeringParams.h ) SET(PHYSX_VEHICLE2_SUSPENSION_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/suspension/PxVehicleSuspensionComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/suspension/PxVehicleSuspensionFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/suspension/PxVehicleSuspensionParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/suspension/PxVehicleSuspensionStates.h ${PHYSX_ROOT_DIR}/include/vehicle2/suspension/PxVehicleSuspensionHelpers.h ) SET(PHYSX_VEHICLE2_TIRE_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/tire/PxVehicleTireComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/tire/PxVehicleTireFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/tire/PxVehicleTireHelpers.h ${PHYSX_ROOT_DIR}/include/vehicle2/tire/PxVehicleTireParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/tire/PxVehicleTireStates.h ) SET(PHYSX_VEHICLE2_WHEEL_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/wheel/PxVehicleWheelComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/wheel/PxVehicleWheelFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/wheel/PxVehicleWheelParams.h ${PHYSX_ROOT_DIR}/include/vehicle2/wheel/PxVehicleWheelStates.h ${PHYSX_ROOT_DIR}/include/vehicle2/wheel/PxVehicleWheelHelpers.h ) SET(PHYSX_VEHICLE2_PVD_HEADERS ${PHYSX_ROOT_DIR}/include/vehicle2/pvd/PxVehiclePvdComponents.h ${PHYSX_ROOT_DIR}/include/vehicle2/pvd/PxVehiclePvdFunctions.h ${PHYSX_ROOT_DIR}/include/vehicle2/pvd/PxVehiclePvdHelpers.h ) SOURCE_GROUP(include FILES ${PHYSX_VEHICLE2_HEADERS}) SOURCE_GROUP(include\\braking FILES ${PHYSX_VEHICLE2_BRAKING_HEADERS}) SOURCE_GROUP(include\\commands FILES ${PHYSX_VEHICLE2_COMMAND_HEADERS}) SOURCE_GROUP(include\\drivetrain FILES ${PHYSX_VEHICLE2_DRIVETRAIN_HEADERS}) SOURCE_GROUP(include\\physxActor FILES ${PHYSX_VEHICLE2_PHYSXACTOR_HEADERS}) SOURCE_GROUP(include\\physxConstraints FILES ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_HEADERS}) SOURCE_GROUP(include\\rigidBody FILES ${PHYSX_VEHICLE2_RIGIDBODY_HEADERS}) SOURCE_GROUP(include\\roadGeometry FILES ${PHYSX_VEHICLE2_ROADGEOMETRY_HEADERS}) SOURCE_GROUP(include\\physxRoadGeometry FILES ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_HEADERS}) SOURCE_GROUP(include\\steering FILES ${PHYSX_VEHICLE2_STEERING_HEADERS}) SOURCE_GROUP(include\\suspension FILES ${PHYSX_VEHICLE2_SUSPENSION_HEADERS}) SOURCE_GROUP(include\\tire FILES ${PHYSX_VEHICLE2_TIRE_HEADERS}) SOURCE_GROUP(include\\wheel FILES ${PHYSX_VEHICLE2_WHEEL_HEADERS}) SOURCE_GROUP(include\\pvd FILES ${PHYSX_VEHICLE2_PVD_HEADERS}) SET(PHYSX_VEHICLE2_BRAKING_SOURCE ) SET(PHYSX_VEHICLE2_COMMANDS_SOURCE ${LL_SOURCE_DIR}/commands/VhCommandHelpers.cpp ) SET(PHYSX_VEHICLE2_DRIVETRAIN_SOURCE ${LL_SOURCE_DIR}/drivetrain/VhDrivetrainFunctions.cpp ${LL_SOURCE_DIR}/drivetrain/VhDrivetrainHelpers.cpp ) SET(PHYSX_VEHICLE2_PHYSXACTOR_SOURCE ${LL_SOURCE_DIR}/physxActor/VhPhysXActorFunctions.cpp ${LL_SOURCE_DIR}/physxActor/VhPhysXActorHelpers.cpp ) SET(PHYSX_VEHICLE2_PHYSXCONSTRAINT_SOURCE ${LL_SOURCE_DIR}/physxConstraints/VhPhysXConstraintFunctions.cpp ${LL_SOURCE_DIR}/physxConstraints/VhPhysXConstraintHelpers.cpp ) SET(PHYSX_VEHICLE2_PHYSXROADGEOMETRY_SOURCE ${LL_SOURCE_DIR}/physxRoadGeometry/VhPhysXRoadGeometryFunctions.cpp ${LL_SOURCE_DIR}/physxRoadGeometry/VhPhysXRoadGeometryHelpers.cpp ) SET(PHYSX_VEHICLE2_RIGIDBODY_SOURCE ${LL_SOURCE_DIR}/rigidBody/VhRigidBodyFunctions.cpp ) SET(PHYSX_VEHICLE2_STEERING_SOURCE ${LL_SOURCE_DIR}/steering/VhSteeringFunctions.cpp ) SET(PHYSX_VEHICLE2_SUSPENSION_SOURCE ${LL_SOURCE_DIR}/suspension/VhSuspensionFunctions.cpp ${LL_SOURCE_DIR}/suspension/VhSuspensionHelpers.cpp ) SET(PHYSX_VEHICLE2_TIRE_SOURCE ${LL_SOURCE_DIR}/tire/VhTireFunctions.cpp ${LL_SOURCE_DIR}/tire/VhTireHelpers.cpp ) SET(PHYSX_VEHICLE2_WHEEL_SOURCE ${LL_SOURCE_DIR}/wheel/VhWheelFunctions.cpp ) SET(PHYSX_VEHICLE2_PVD_SOURCE ${LL_SOURCE_DIR}/pvd/VhPvdAttributeHandles.h ${LL_SOURCE_DIR}/pvd/VhPvdObjectHandles.h ${LL_SOURCE_DIR}/pvd/VhPvdHelpers.cpp ${LL_SOURCE_DIR}/pvd/VhPvdFunctions.cpp ${LL_SOURCE_DIR}/pvd/VhPvdWriter.cpp ${LL_SOURCE_DIR}/pvd/VhPvdWriter.h ) SOURCE_GROUP(src\\braking FILES ${PHYSX_VEHICLE2_BRAKING_SOURCE}) SOURCE_GROUP(src\\commands FILES ${PHYSX_VEHICLE2_COMMANDS_SOURCE}) SOURCE_GROUP(src\\drivetrain FILES ${PHYSX_VEHICLE2_DRIVETRAIN_SOURCE}) SOURCE_GROUP(src\\physxActor FILES ${PHYSX_VEHICLE2_PHYSXACTOR_SOURCE}) SOURCE_GROUP(src\\physxConstraints FILES ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_SOURCE}) SOURCE_GROUP(src\\physxRoadGeometry FILES ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_SOURCE}) SOURCE_GROUP(src\\rigidBody FILES ${PHYSX_VEHICLE2_RIGIDBODY_SOURCE}) SOURCE_GROUP(src\\steering FILES ${PHYSX_VEHICLE2_STEERING_SOURCE}) SOURCE_GROUP(src\\suspension FILES ${PHYSX_VEHICLE2_SUSPENSION_SOURCE}) SOURCE_GROUP(src\\tire FILES ${PHYSX_VEHICLE2_TIRE_SOURCE}) SOURCE_GROUP(src\\wheel FILES ${PHYSX_VEHICLE2_WHEEL_SOURCE}) SOURCE_GROUP(src\\pvd FILES ${PHYSX_VEHICLE2_PVD_SOURCE}) ADD_LIBRARY(PhysXVehicle2 ${PHYSXVEHICLE2_LIBTYPE} ${PHYSX_VEHICLE2_BRAKING_SOURCE} ${PHYSX_VEHICLE2_COMMANDS_SOURCE} ${PHYSX_VEHICLE2_DRIVETRAIN_SOURCE} ${PHYSX_VEHICLE2_PHYSXACTOR_SOURCE} ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_SOURCE} ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_SOURCE} ${PHYSX_VEHICLE2_RIGIDBODY_SOURCE} ${PHYSX_VEHICLE2_STEERING_SOURCE} ${PHYSX_VEHICLE2_SUSPENSION_SOURCE} ${PHYSX_VEHICLE2_TIRE_SOURCE} ${PHYSX_VEHICLE2_WHEEL_SOURCE} ${PHYSX_VEHICLE2_PVD_SOURCE} ${PHYSX_VEHICLE2_HEADERS} ${PHYSX_VEHICLE2_BRAKING_HEADERS} ${PHYSX_VEHICLE2_COMMAND_HEADERS} ${PHYSX_VEHICLE2_DRIVETRAIN_HEADERS} ${PHYSX_VEHICLE2_PHYSXACTOR_HEADERS} ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_HEADERS} ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_HEADERS} ${PHYSX_VEHICLE2_RIGIDBODY_HEADERS} ${PHYSX_VEHICLE2_ROADGEOMETRY_HEADERS} ${PHYSX_VEHICLE2_STEERING_HEADERS} ${PHYSX_VEHICLE2_SUSPENSION_HEADERS} ${PHYSX_VEHICLE2_TIRE_HEADERS} ${PHYSX_VEHICLE2_WHEEL_HEADERS} ${PHYSX_VEHICLE2_PVD_HEADERS} ) INSTALL(FILES ${PHYSX_VEHICLE2_HEADERS} DESTINATION include/vehicle2) INSTALL(FILES ${PHYSX_VEHICLE2_BRAKING_HEADERS} DESTINATION include/vehicle2/braking) INSTALL(FILES ${PHYSX_VEHICLE2_COMMAND_HEADERS} DESTINATION include/vehicle2/commands) INSTALL(FILES ${PHYSX_VEHICLE2_DRIVETRAIN_HEADERS} DESTINATION include/vehicle2/drivetrain) INSTALL(FILES ${PHYSX_VEHICLE2_PHYSXACTOR_HEADERS} DESTINATION include/vehicle2/physxActor) INSTALL(FILES ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_HEADERS} DESTINATION include/vehicle2/physxConstraints) INSTALL(FILES ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_HEADERS} DESTINATION include/vehicle2/physxRoadGeometry) INSTALL(FILES ${PHYSX_VEHICLE2_RIGIDBODY_HEADERS} DESTINATION include/vehicle2/rigidBody) INSTALL(FILES ${PHYSX_VEHICLE2_ROADGEOMETRY_HEADERS} DESTINATION include/vehicle2/roadGeometry) INSTALL(FILES ${PHYSX_VEHICLE2_STEERING_HEADERS} DESTINATION include/vehicle2/steering) INSTALL(FILES ${PHYSX_VEHICLE2_SUSPENSION_HEADERS} DESTINATION include/vehicle2/suspension) INSTALL(FILES ${PHYSX_VEHICLE2_TIRE_HEADERS} DESTINATION include/vehicle2/tire) INSTALL(FILES ${PHYSX_VEHICLE2_WHEEL_HEADERS} DESTINATION include/vehicle2/wheel) INSTALL(FILES ${PHYSX_VEHICLE2_PVD_HEADERS} DESTINATION include/vehicle2/pvd) TARGET_INCLUDE_DIRECTORIES(PhysXVehicle2 PRIVATE ${PHYSXVEHICLE2_PLATFORM_INCLUDES} PRIVATE ${PHYSX_ROOT_DIR}/include PRIVATE ${PHYSX_ROOT_DIR}/pvdruntime/include ) # No linked libraries # Use generator expressions to set config specific preprocessor definitions TARGET_COMPILE_DEFINITIONS(PhysXVehicle2 PRIVATE ${PHYSXVEHICLE2_COMPILE_DEFS} ) SET_TARGET_PROPERTIES(PhysXVehicle2 PROPERTIES OUTPUT_NAME PhysXVehicle2 ) IF(PHYSXVEHICLE2_LIBTYPE STREQUAL "STATIC") SET_TARGET_PROPERTIES(PhysXVehicle2 PROPERTIES ARCHIVE_OUTPUT_NAME_DEBUG "PhysXVehicle2_static" ARCHIVE_OUTPUT_NAME_CHECKED "PhysXVehicle2_static" ARCHIVE_OUTPUT_NAME_PROFILE "PhysXVehicle2_static" ARCHIVE_OUTPUT_NAME_RELEASE "PhysXVehicle2_static" ) ENDIF() IF(PHYSXVEHICLE2_COMPILE_PDB_NAME_DEBUG) SET_TARGET_PROPERTIES(PhysXVehicle2 PROPERTIES COMPILE_PDB_NAME_DEBUG ${PHYSXVEHICLE2_COMPILE_PDB_NAME_DEBUG} COMPILE_PDB_NAME_CHECKED ${PHYSXVEHICLE2_COMPILE_PDB_NAME_CHECKED} COMPILE_PDB_NAME_PROFILE ${PHYSXVEHICLE2_COMPILE_PDB_NAME_PROFILE} COMPILE_PDB_NAME_RELEASE ${PHYSXVEHICLE2_COMPILE_PDB_NAME_RELEASE} ) ENDIF() TARGET_LINK_LIBRARIES(PhysXVehicle2 PUBLIC ${PHYSXVEHICLE2_PLATFORM_LINKED_LIBS} PhysXFoundation PhysXCommon PhysXCooking PhysX PhysXExtensions ) IF(PX_GENERATE_SOURCE_DISTRO) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_BRAKING_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_COMMAND_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_DRIVETRAIN_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXACTOR_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_RIGIDBODY_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_ROADGEOMETRY_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_STEERING_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_SUSPENSION_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_TIRE_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_WHEEL_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PVD_HEADERS}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_BRAKING_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_COMMANDS_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_DRIVETRAIN_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXACTOR_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXCONSTRAINT_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PHYSXROADGEOMETRY_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_RIGIDBODY_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_STEERING_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_SUSPENSION_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_TIRE_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_WHEEL_SOURCE}) LIST(APPEND SOURCE_DISTRO_FILE_LIST ${PHYSX_VEHICLE2_PVD_SOURCE}) ENDIF() # enable -fPIC so we can link static libs with the editor SET_TARGET_PROPERTIES(PhysXVehicle2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/GetCompilerAndPlatform.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. FUNCTION(CompilerDumpVersion _OUTPUT_VERSION) EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION ) STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" COMPILER_VERSION ${COMPILER_VERSION}) SET(${_OUTPUT_VERSION} ${COMPILER_VERSION}) ENDFUNCTION() FUNCTION(GetCompiler _ret) SET(COMPILER_SUFFIX "UNKNOWN") IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER MATCHES "icl" OR CMAKE_CXX_COMPILER MATCHES "icpc") IF(WIN32) SET (COMPILER_SUFFIX "iw") ELSE() SET (COMPILER_SUFFIX "il") ENDIF() ELSEIF (GHSMULTI) SET(COMPILER_SUFFIX "ghs") ELSEIF(MSVC_VERSION GREATER_EQUAL 1930) SET(COMPILER_SUFFIX "vc143") ELSEIF (MSVC_VERSION GREATER_EQUAL 1920) SET(COMPILER_SUFFIX "vc142") ELSEIF (MSVC_VERSION GREATER_EQUAL 1910) SET(COMPILER_SUFFIX "vc141") ELSEIF (MSVC14) SET(COMPILER_SUFFIX "vc140") ELSEIF (MSVC12) SET(COMPILER_SUFFIX "vc120") ELSEIF (MSVC11) SET(COMPILER_SUFFIX "vc110") ELSEIF (MSVC10) SET(COMPILER_SUFFIX "vc100") ELSEIF (MSVC90) SET(COMPILER_SUFFIX "vc90") ELSEIF (MSVC80) SET(COMPILER_SUFFIX "vc80") ELSEIF (MSVC71) SET(COMPILER_SUFFIX "vc71") ELSEIF (MSVC70) # Good luck! SET(COMPILER_SUFFIX "vc7") # yes, this is correct ELSEIF (MSVC60) # Good luck! SET(COMPILER_SUFFIX "vc6") # yes, this is correct ELSEIF (BORLAND) SET(COMPILER_SUFFIX "bcb") ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") SET(COMPILER_SUFFIX "sw") ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "XL") SET(COMPILER_SUFFIX "xlc") ELSEIF (MINGW) CompilerDumpVersion(_COMPILER_VERSION) SET(COMPILER_SUFFIX "mgw${_COMPILER_VERSION}") ELSEIF (UNIX) IF (CMAKE_COMPILER_IS_GNUCXX) CompilerDumpVersion(_COMPILER_VERSION) IF(APPLE) # on Mac OS X/Darwin is "xgcc". SET(COMPILER_SUFFIX "xgcc${_COMPILER_VERSION}") ELSE() SET(COMPILER_SUFFIX "gcc${_COMPILER_VERSION}") ENDIF() ENDIF() ELSE() # add clang! SET(COMPILER_SUFFIX "") ENDIF() SET(${_ret} ${COMPILER_SUFFIX} PARENT_SCOPE) ENDFUNCTION() FUNCTION(GetStaticCRTString _ret) IF(NOT TARGET_BUILD_PLATFORM STREQUAL "windows") return() ENDIF() IF (NV_USE_STATIC_WINCRT) SET(CRT_STRING "mt") ELSE() SET(CRT_STRING "md") ENDIF() SET(${_ret} ${CRT_STRING} PARENT_SCOPE) ENDFUNCTION() FUNCTION (GetPlatformBinName PLATFORM_BIN_NAME LIBPATH_SUFFIX) SET(RETVAL "UNKNOWN") GetCompiler(COMPILER) IF(TARGET_BUILD_PLATFORM STREQUAL "windows") GetStaticCRTString(CRT_STRING) SET(RETVAL "win.x86_${LIBPATH_SUFFIX}.${COMPILER}.${CRT_STRING}") ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "mac") SET(RETVAL "mac.x86_${LIBPATH_SUFFIX}") ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "switch") IF (${CMAKE_GENERATOR_PLATFORM} STREQUAL "NX32") SET(RETVAL "switch32") ELSEIF (${CMAKE_GENERATOR_PLATFORM} STREQUAL "NX64") SET(RETVAL "switch64") ENDIF() ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "linux") IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") SET(RETVAL "linux.clang") ELSEIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") SET(RETVAL "linux.aarch64") ENDIF() ENDIF() SET(${PLATFORM_BIN_NAME} ${RETVAL} PARENT_SCOPE) ENDFUNCTION()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/ConfigureFileMT.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # A simple wrapper around configure_file to try to make it multi-thread safe with a file lock. FUNCTION(Configure_File_MT IN_TEMPLATE OUTPUT_FILENAME) FILE(LOCK ${OUTPUT_FILENAME}.lock GUARD FUNCTION RESULT_VARIABLE LOCK_RESULT TIMEOUT 30) IF (NOT LOCK_RESULT EQUAL 0) MESSAGE(WARNING "Failed to lock file ${OUTPUT_FILENAME} for output ERROR: ${LOCK_RESULT}") return() ENDIF() CONFIGURE_FILE("${IN_TEMPLATE}" "${OUTPUT_FILENAME}" @ONLY) FILE(LOCK ${OUTPUT_FILENAME}.lock RELEASE) ENDFUNCTION()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/SetOutputPaths.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. FUNCTION(SetOutputPaths OUTPUT_EXE_DIR OUTPUT_DLL_DIR OUTPUT_LIB_DIR) SET(EXE_DIR ${OUTPUT_EXE_DIR}) SET(DLL_DIR ${OUTPUT_DLL_DIR}) SET(LIB_DIR ${OUTPUT_LIB_DIR}) # Override the default output directories for all configurations. SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_CHECKED ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_CHECKED ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CHECKED ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_PROFILE ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_PROFILE ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_PROFILE ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${LIB_DIR}) ENDFUNCTION(SetOutputPaths) FUNCTION(SetExeOutputPath OUTPUT_EXE_DIR) SET(EXE_DIR ${OUTPUT_EXE_DIR}) # Override the default output directories for all configurations. SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_CHECKED ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_PROFILE ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXE_DIR} PARENT_SCOPE) ENDFUNCTION(SetExeOutputPath) FUNCTION(SetDllOutputPath OUTPUT_DLL_DIR) SET(DLL_DIR ${OUTPUT_DLL_DIR}) # Override the default output directories for all configurations. SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${DLL_DIR}/${ARGV1} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_PROFILE ${DLL_DIR}/${ARGV2} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_CHECKED ${DLL_DIR}/${ARGV3} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DLL_DIR}/${ARGV4} PARENT_SCOPE) ENDFUNCTION(SetDllOutputPath) FUNCTION(SetLibOutputPath OUTPUT_LIB_DIR) SET(LIB_DIR ${OUTPUT_LIB_DIR}) # Override the default output directories for all configurations. SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIB_DIR}/${ARGV1} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_PROFILE ${LIB_DIR}/${ARGV2} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CHECKED ${LIB_DIR}/${ARGV3} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIB_DIR}/${ARGV4} PARENT_SCOPE) SET(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${LIB_DIR}) ENDFUNCTION(SetLibOutputPath) FUNCTION(SetSingleOutputPath OUTPUT_ALL_DIR) SET(EXE_DIR ${OUTPUT_ALL_DIR}) SET(DLL_DIR ${OUTPUT_ALL_DIR}) SET(LIB_DIR ${OUTPUT_ALL_DIR}) # Override the default output directories for all configurations. SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_CHECKED ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_CHECKED ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CHECKED ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_PROFILE ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_PROFILE ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_PROFILE ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${EXE_DIR} PARENT_SCOPE) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${DLL_DIR} PARENT_SCOPE) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIB_DIR} PARENT_SCOPE) SET(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${LIB_DIR}) ENDFUNCTION(SetSingleOutputPath)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/NvidiaBuildOptions.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # Define the options up front OPTION(NV_APPEND_CONFIG_NAME "Append config (DEBUG, CHECKED, PROFILE or '' for release) to outputted binaries." OFF) OPTION(NV_USE_STATIC_WINCRT "Use the statically linked windows CRT" OFF) OPTION(NV_USE_DEBUG_WINCRT "Use the debug version of the CRT" OFF) OPTION(NV_FORCE_64BIT_SUFFIX "Force a 64 bit suffix for platforms that don't register properly." OFF) OPTION(NV_FORCE_32BIT_SUFFIX "Force a 32 bit suffix for platforms that don't register properly." OFF) INCLUDE(SetOutputPaths) IF(NV_FORCE_32BIT_SUFFIX AND NV_FORCE_64BIT_SUFFIX) MESSAGE(FATAL_ERROR "Cannot specify both NV_FORCE_64BIT_SUFFIX and NV_FORCE_32BIT_SUFFIX. Choose one.") ENDIF() IF(SUPPRESS_SUFFIX) MESSAGE("Suppressing binary suffixes.") SET(LIBPATH_SUFFIX "NONE") # Set default exe suffix. Unset on platforms that don't need it. Include underscore since it's optional SET(EXE_SUFFIX "") ELSEIF(NV_FORCE_32BIT_SUFFIX) MESSAGE("Forcing binary suffixes to 32 bit.") SET(LIBPATH_SUFFIX "32") # Set default exe suffix. Unset on platforms that don't need it. Include underscore since it's optional SET(EXE_SUFFIX "_32") ELSEIF(NV_FORCE_64BIT_SUFFIX) MESSAGE("Forcing binary suffixes to 64 bit.") SET(LIBPATH_SUFFIX "64") # Set default exe suffix. Unset on platforms that don't need it. Include underscore since it's optional SET(EXE_SUFFIX "_64") ELSE() # New bitness suffix IF(CMAKE_SIZEOF_VOID_P EQUAL 8) SET(LIBPATH_SUFFIX "64") # Set default exe suffix. Unset on platforms that don't need it. Include underscore since it's optional SET(EXE_SUFFIX "_64") ELSE() SET(LIBPATH_SUFFIX "32") # Set default exe suffix. Unset on platforms that don't need it. Include underscore since it's optional SET(EXE_SUFFIX "_32") ENDIF() ENDIF() IF (NOT DEFINED PX_OUTPUT_LIB_DIR) MESSAGE(FATAL_ERROR "When using the GameWorks output structure you must specify PX_OUTPUT_LIB_DIR as the base") ENDIF() IF (NOT DEFINED PX_OUTPUT_BIN_DIR) MESSAGE(FATAL_ERROR "When using the GameWorks output structure you must specify PX_OUTPUT_BIN_DIR as the base") ENDIF() # Set the WINCRT_DEBUG and WINCRT_NDEBUG variables for use in project compile settings # Really only relevant to windows SET(DISABLE_ITERATOR_DEBUGGING "/D \"_HAS_ITERATOR_DEBUGGING=0\" /D \"_ITERATOR_DEBUG_LEVEL=0\"") SET(DISABLE_ITERATOR_DEBUGGING_CUDA "-D_HAS_ITERATOR_DEBUGGING=0 -D_ITERATOR_DEBUG_LEVEL=0") SET(CRT_DEBUG_FLAG "/D \"_DEBUG\"") SET(CRT_NDEBUG_FLAG "/D \"NDEBUG\"") # Need a different format for CUDA SET(CUDA_DEBUG_FLAG "${DISABLE_ITERATOR_DEBUGGING_CUDA}") SET(CUDA_NDEBUG_FLAG "-DNDEBUG") SET(CUDA_CRT_COMPILE_OPTIONS_NDEBUG "") SET(CUDA_CRT_COMPILE_OPTIONS_DEBUG "") IF(NV_USE_STATIC_WINCRT) SET(WINCRT_NDEBUG "/MT ${DISABLE_ITERATOR_DEBUGGING} ${CRT_NDEBUG_FLAG}" CACHE INTERNAL "Windows CRT build setting") SET(CUDA_CRT_COMPILE_OPTIONS_NDEBUG "/MT") IF (NV_USE_DEBUG_WINCRT) SET(CUDA_DEBUG_FLAG "-D_DEBUG") SET(WINCRT_DEBUG "/MTd ${CRT_DEBUG_FLAG}" CACHE INTERNAL "Windows CRT build setting") SET(CUDA_CRT_COMPILE_OPTIONS_DEBUG "/MTd") ELSE() SET(WINCRT_DEBUG "/MT ${DISABLE_ITERATOR_DEBUGGING} ${CRT_NDEBUG_FLAG}" CACHE INTERNAL "Windows CRT build setting") SET(CUDA_CRT_COMPILE_OPTIONS_DEBUG "/MT") ENDIF() ELSE() SET(WINCRT_NDEBUG "/MD ${DISABLE_ITERATOR_DEBUGGING} ${CRT_NDEBUG_FLAG}") SET(CUDA_CRT_COMPILE_OPTIONS_NDEBUG "/MD") IF(NV_USE_DEBUG_WINCRT) SET(CUDA_DEBUG_FLAG "-D_DEBUG") SET(WINCRT_DEBUG "/MDd ${CRT_DEBUG_FLAG}" CACHE INTERNAL "Windows CRT build setting") SET(CUDA_CRT_COMPILE_OPTIONS_DEBUG "/MDd") ELSE() SET(WINCRT_DEBUG "/MD ${DISABLE_ITERATOR_DEBUGGING} ${CRT_NDEBUG_FLAG}" CACHE INTERNAL "Windows CRT build setting") SET(CUDA_CRT_COMPILE_OPTIONS_DEBUG "/MD") ENDIF() ENDIF() INCLUDE(GetCompilerAndPlatform) GetPlatformBinName(PLATFORM_BIN_NAME ${LIBPATH_SUFFIX}) SET(PX_ROOT_LIB_DIR "bin/${PLATFORM_BIN_NAME}" CACHE INTERNAL "Relative root of the lib output directory") SET(PX_ROOT_EXE_DIR "bin/${PLATFORM_BIN_NAME}" CACHE INTERNAL "Relative root dir of the exe output directory") IF (NOT DEFINED PX_OUTPUT_ARCH) # platforms with fixed arch like ps4 dont need to have arch defined SET(EXE_SUFFIX "") ENDIF() SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/debug" ) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_PROFILE "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/profile" ) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CHECKED "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/checked" ) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/release" ) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/debug" ) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_PROFILE "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/profile" ) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_CHECKED "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/checked" ) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${PX_OUTPUT_LIB_DIR}/${PX_ROOT_LIB_DIR}/release" ) # RFC 108, we're doing EXEs as the special case since there will be presumable be less of those. SET(PX_EXE_OUTPUT_DIRECTORY_DEBUG "${PX_OUTPUT_BIN_DIR}/${PX_ROOT_EXE_DIR}/debug" CACHE INTERNAL "Directory to put debug exes in") SET(PX_EXE_OUTPUT_DIRECTORY_PROFILE "${PX_OUTPUT_BIN_DIR}/${PX_ROOT_EXE_DIR}/profile" CACHE INTERNAL "Directory to put profile exes in") SET(PX_EXE_OUTPUT_DIRECTORY_CHECKED "${PX_OUTPUT_BIN_DIR}/${PX_ROOT_EXE_DIR}/checked" CACHE INTERNAL "Directory to put checked exes in") SET(PX_EXE_OUTPUT_DIRECTORY_RELEASE "${PX_OUTPUT_BIN_DIR}/${PX_ROOT_EXE_DIR}/release" CACHE INTERNAL "Directory to put release exes in") SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG} ) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_PROFILE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_PROFILE} ) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_CHECKED ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CHECKED} ) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE} ) IF(NV_APPEND_CONFIG_NAME) SET(CMAKE_DEBUG_POSTFIX "DEBUG_${LIBPATH_SUFFIX}") SET(CMAKE_PROFILE_POSTFIX "PROFILE_${LIBPATH_SUFFIX}") SET(CMAKE_CHECKED_POSTFIX "CHECKED_${LIBPATH_SUFFIX}") SET(CMAKE_RELEASE_POSTFIX "_${LIBPATH_SUFFIX}") ELSE() IF (DEFINED PX_OUTPUT_ARCH) # platforms with fixed arch like ps4 dont need to have arch defined, then dont add bitness SET(CMAKE_DEBUG_POSTFIX "_${LIBPATH_SUFFIX}") SET(CMAKE_PROFILE_POSTFIX "_${LIBPATH_SUFFIX}") SET(CMAKE_CHECKED_POSTFIX "_${LIBPATH_SUFFIX}") SET(CMAKE_RELEASE_POSTFIX "_${LIBPATH_SUFFIX}") ENDIF() ENDIF() # Can no longer just use LIBPATH_SUFFIX since it depends on build type IF(CMAKE_CL_64) SET(RESOURCE_LIBPATH_SUFFIX "x64") ELSE(CMAKE_CL_64) SET(RESOURCE_LIBPATH_SUFFIX "x86") ENDIF(CMAKE_CL_64) # removes characters from the version string and leaves just numbers FUNCTION(StripPackmanVersion IN_VERSION _OUTPUT_VERSION) STRING(REGEX REPLACE "([^0-9.])" "" OUT_VERSION ${IN_VERSION}) STRING(REPLACE ".." "." OUT_V2 ${OUT_VERSION}) SET(${_OUTPUT_VERSION} ${OUT_V2} PARENT_SCOPE) ENDFUNCTION(StripPackmanVersion)
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/linux/LinuxAarch64.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. set(CMAKE_SYSTEM_PROCESSOR aarch64) set(TARGET_ABI "linux-gnu") set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) set(CMAKE_C_COMPILER aarch64-${TARGET_ABI}-gcc) set(CMAKE_CXX_COMPILER aarch64-${TARGET_ABI}-g++) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) find_program(GCC_LOCATION ${CMAKE_C_COMPILER}) if(NOT GCC_LOCATION) message(FATAL_ERROR "Failed to find ${CMAKE_C_COMPILER}") endif()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/linux/LinuxCrossToolchain.arm-unknown-linux-gnueabihf.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. IF(NOT $ENV{LINUX_ROOT} EQUAL "") SET(CMAKE_SYSTEM_NAME Linux) # FIXME: fix Linux toolchains to support architectures SET(LINUX_ROOT $ENV{UE_SDKS_ROOT}/HostWin64/Linux_x64/arm-unknown-linux-gnueabihf_v5_clang-3.5.0-ld-2.23.1-glibc-2.13/toolchain) STRING(REGEX REPLACE "\\\\" "/" LINUX_ROOT ${LINUX_ROOT}) message (STATUS "LINUX_ROOT is '${LINUX_ROOT}'") SET(ARCHITECTURE_TRIPLE arm-unknown-linux-gnueabihf) SET(CMAKE_SYSTEM_PROCESSOR aarch64) SET(CMAKE_CROSSCOMPILING TRUE) SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) # sysroot SET(CMAKE_SYSROOT ${LINUX_ROOT}) SET(CMAKE_LIBRARY_ARCHITECTURE ${ARCHITECTURE_TRIPLE}) # specify the cross compiler SET(CMAKE_C_COMPILER ${CMAKE_SYSROOT}/bin/clang.exe) SET(CMAKE_C_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_C_FLAGS "-target ${ARCHITECTURE_TRIPLE} --sysroot ${LINUX_ROOT} ") SET(CMAKE_CXX_COMPILER ${CMAKE_SYSROOT}/bin/clang++.exe) SET(CMAKE_CXX_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_CXX_FLAGS "-target ${ARCHITECTURE_TRIPLE} --sysroot ${LINUX_ROOT} ") SET(CMAKE_FIND_ROOT_PATH ${LINUX_ROOT}) #set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) # hoping to force it to use ar #set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) #set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) ELSE() MESSAGE("LINUX_ROOT environment variable not defined!") ENDIF()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/linux/LinuxCrossToolchain.x86_64-unknown-linux-gnu.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. IF(NOT $ENV{PM_PACKAGES_ROOT} EQUAL "") # See https://stackoverflow.com/a/53635241 - CMake needs this for cross-compiling # see also: https://cmake.org/cmake/help/latest/module/CMakeForceCompiler.html # and https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.html SET(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") SET(LINUX_ROOT $ENV{PM_CLANGCROSSCOMPILE_PATH}/x86_64-unknown-linux-gnu) STRING(REGEX REPLACE "\\\\" "/" LINUX_ROOT ${LINUX_ROOT}) MESSAGE(STATUS "LINUX_ROOT is '${LINUX_ROOT}'") SET(ARCHITECTURE_TRIPLE x86_64-unknown-linux-gnu) SET(CMAKE_SYSTEM_PROCESSOR x86_64) SET(CMAKE_CROSSCOMPILING TRUE) SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) # sysroot SET(CMAKE_SYSROOT ${LINUX_ROOT}) SET(CMAKE_LIBRARY_ARCHITECTURE ${ARCHITECTURE_TRIPLE}) # specify the cross compiler SET(CMAKE_C_COMPILER ${CMAKE_SYSROOT}/bin/clang.exe) SET(CMAKE_C_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_CXX_COMPILER ${CMAKE_SYSROOT}/bin/clang++.exe) SET(CMAKE_CXX_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_FIND_ROOT_PATH ${LINUX_ROOT}) ELSE() MESSAGE("PM_PACKAGES_ROOT variable not defined!") ENDIF()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/modules/linux/LinuxCrossToolchain.aarch64-unknown-linux-gnueabihf.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. IF(NOT $ENV{PM_PACKAGES_ROOT} EQUAL "") # See https://stackoverflow.com/a/53635241 - CMake needs this for cross-compiling # see also: https://cmake.org/cmake/help/latest/module/CMakeForceCompiler.html # and https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.html SET(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") SET(LINUX_ROOT $ENV{PM_CLANGCROSSCOMPILE_PATH}/aarch64-unknown-linux-gnueabi) STRING(REGEX REPLACE "\\\\" "/" LINUX_ROOT ${LINUX_ROOT}) MESSAGE(STATUS "LINUX_ROOT is '${LINUX_ROOT}'") SET(ARCHITECTURE_TRIPLE aarch64-unknown-linux-gnueabi) SET(CMAKE_SYSTEM_PROCESSOR aarch64) SET(CMAKE_CROSSCOMPILING TRUE) SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) # sysroot SET(CMAKE_SYSROOT ${LINUX_ROOT}) SET(CMAKE_LIBRARY_ARCHITECTURE ${ARCHITECTURE_TRIPLE}) # specify the cross compiler SET(CMAKE_C_COMPILER ${CMAKE_SYSROOT}/bin/clang.exe) SET(CMAKE_C_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_CXX_COMPILER ${CMAKE_SYSROOT}/bin/clang++.exe) SET(CMAKE_CXX_COMPILER_TARGET ${ARCHITECTURE_TRIPLE}) SET(CMAKE_FIND_ROOT_PATH ${LINUX_ROOT}) ELSE() MESSAGE("PM_PACKAGES_ROOT variable not defined!") ENDIF()
NVIDIA-Omniverse/PhysX/physx/source/compiler/cmake/windows/LowLevelAABB.cmake
## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## * Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## * Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## * Neither the name of NVIDIA CORPORATION nor the names of its ## contributors may be used to endorse or promote products derived ## from this software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## ## Copyright (c) 2008-2023 NVIDIA Corporation. All rights reserved. # # Build LowLevelAABB # SET(LOWLEVELAABB_PLATFORM_INCLUDES ${PHYSX_SOURCE_DIR}/Common/src/windows ${PHYSX_SOURCE_DIR}/LowLevelAABB/windows/include ${PHYSX_SOURCE_DIR}/GpuBroadPhase/include ${PHYSX_SOURCE_DIR}/GpuBroadPhase/src # $ENV{PM_winsdk_PATH}/include/ucrt ) IF(PX_GENERATE_STATIC_LIBRARIES) SET(LOWLEVELAABB_LIBTYPE OBJECT) ELSE() SET(LOWLEVELAABB_LIBTYPE STATIC) ENDIF() SET(LOWLEVELAABB_COMPILE_DEFS # Common to all configurations ${PHYSX_WINDOWS_COMPILE_DEFS};${PHYSX_LIBTYPE_DEFS};${PHYSXGPU_LIBTYPE_DEFS} $<$<CONFIG:debug>:${PHYSX_WINDOWS_DEBUG_COMPILE_DEFS};> $<$<CONFIG:checked>:${PHYSX_WINDOWS_CHECKED_COMPILE_DEFS};> $<$<CONFIG:profile>:${PHYSX_WINDOWS_PROFILE_COMPILE_DEFS};> $<$<CONFIG:release>:${PHYSX_WINDOWS_RELEASE_COMPILE_DEFS};> ) IF(LOWLEVELAABB_LIBTYPE STREQUAL "STATIC") SET(LLAABB_COMPILE_PDB_NAME_DEBUG "LowLevelAABB_static${CMAKE_DEBUG_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_CHECKED "LowLevelAABB_static${CMAKE_CHECKED_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_PROFILE "LowLevelAABB_static${CMAKE_PROFILE_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_RELEASE "LowLevelAABB_static${CMAKE_RELEASE_POSTFIX}") ELSE() SET(LLAABB_COMPILE_PDB_NAME_DEBUG "LowLevelAABB${CMAKE_DEBUG_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_CHECKED "LowLevelAABB${CMAKE_CHECKED_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_PROFILE "LowLevelAABB${CMAKE_PROFILE_POSTFIX}") SET(LLAABB_COMPILE_PDB_NAME_RELEASE "LowLevelAABB${CMAKE_RELEASE_POSTFIX}") ENDIF() IF(PX_EXPORT_LOWLEVEL_PDB) INSTALL(FILES ${PHYSX_ROOT_DIR}/$<$<CONFIG:debug>:${PX_ROOT_LIB_DIR}/debug>$<$<CONFIG:release>:${PX_ROOT_LIB_DIR}/release>$<$<CONFIG:checked>:${PX_ROOT_LIB_DIR}/checked>$<$<CONFIG:profile>:${PX_ROOT_LIB_DIR}/profile>/$<$<CONFIG:debug>:${LLAABB_COMPILE_PDB_NAME_DEBUG}>$<$<CONFIG:checked>:${LLAABB_COMPILE_PDB_NAME_CHECKED}>$<$<CONFIG:profile>:${LLAABB_COMPILE_PDB_NAME_PROFILE}>$<$<CONFIG:release>:${LLAABB_COMPILE_PDB_NAME_RELEASE}>.pdb DESTINATION $<$<CONFIG:debug>:${PX_ROOT_LIB_DIR}/debug>$<$<CONFIG:release>:${PX_ROOT_LIB_DIR}/release>$<$<CONFIG:checked>:${PX_ROOT_LIB_DIR}/checked>$<$<CONFIG:profile>:${PX_ROOT_LIB_DIR}/profile> OPTIONAL) ENDIF() SET(LOWLEVELAABB_PLATFORM_LINK_FLAGS "/MAP")