PxTypeInfo.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 #ifndef PX_PHYSICS_COMMON_PX_TYPEINFO
00031 #define PX_PHYSICS_COMMON_PX_TYPEINFO
00032 
00037 #include "common/PxPhysXCommonConfig.h"
00038 
00039 #if !PX_DOXYGEN
00040 namespace physx
00041 {
00042 #endif
00043 
00053 struct PxConcreteType
00054 {
00055     enum Enum
00056     {
00057         eUNDEFINED,
00058 
00059         eHEIGHTFIELD,
00060         eCONVEX_MESH,
00061         eTRIANGLE_MESH_BVH33,
00062         eTRIANGLE_MESH_BVH34,
00063         eCLOTH_FABRIC,
00064 
00065         eRIGID_DYNAMIC,
00066         eRIGID_STATIC,
00067         eSHAPE,
00068         eMATERIAL,
00069         eCONSTRAINT,
00070         eCLOTH,
00071         ePARTICLE_SYSTEM,
00072         ePARTICLE_FLUID,
00073         eAGGREGATE,
00074         eARTICULATION,
00075         eARTICULATION_LINK,
00076         eARTICULATION_JOINT,
00077         ePRUNING_STRUCTURE,
00078         
00079         ePHYSX_CORE_COUNT,
00080         eFIRST_PHYSX_EXTENSION = 256,
00081         eFIRST_VEHICLE_EXTENSION = 512,
00082         eFIRST_USER_EXTENSION = 1024
00083     };
00084 };
00085 
00092 template<typename T> struct PxTypeInfo {};
00093 
00094 #define PX_DEFINE_TYPEINFO(_name, _fastType) \
00095     class _name; \
00096     template <> struct PxTypeInfo<_name>    {   static const char* name() { return #_name;  }   enum { eFastTypeId = _fastType };   };
00097 
00098 /* the semantics of the fastType are as follows: an object A can be cast to a type B if B's fastType is defined, and A has the same fastType.
00099  * This implies that B has no concrete subclasses or superclasses.
00100  */
00101 
00102 PX_DEFINE_TYPEINFO(PxBase,              PxConcreteType::eUNDEFINED)
00103 PX_DEFINE_TYPEINFO(PxMaterial,          PxConcreteType::eMATERIAL)
00104 PX_DEFINE_TYPEINFO(PxConvexMesh,        PxConcreteType::eCONVEX_MESH)
00105 PX_DEFINE_TYPEINFO(PxTriangleMesh,      PxConcreteType::eUNDEFINED)
00106 PX_DEFINE_TYPEINFO(PxBVH33TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH33)
00107 PX_DEFINE_TYPEINFO(PxBVH34TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH34)
00108 PX_DEFINE_TYPEINFO(PxHeightField,       PxConcreteType::eHEIGHTFIELD)
00109 PX_DEFINE_TYPEINFO(PxActor,             PxConcreteType::eUNDEFINED)
00110 PX_DEFINE_TYPEINFO(PxRigidActor,        PxConcreteType::eUNDEFINED)
00111 PX_DEFINE_TYPEINFO(PxRigidBody,         PxConcreteType::eUNDEFINED)
00112 PX_DEFINE_TYPEINFO(PxRigidDynamic,      PxConcreteType::eRIGID_DYNAMIC)
00113 PX_DEFINE_TYPEINFO(PxRigidStatic,       PxConcreteType::eRIGID_STATIC)
00114 PX_DEFINE_TYPEINFO(PxArticulationLink,  PxConcreteType::eARTICULATION_LINK)
00115 PX_DEFINE_TYPEINFO(PxArticulationJoint, PxConcreteType::eARTICULATION_JOINT)
00116 PX_DEFINE_TYPEINFO(PxArticulation,      PxConcreteType::eARTICULATION)
00117 PX_DEFINE_TYPEINFO(PxAggregate,         PxConcreteType::eAGGREGATE)
00118 PX_DEFINE_TYPEINFO(PxConstraint,        PxConcreteType::eCONSTRAINT)
00119 PX_DEFINE_TYPEINFO(PxShape,             PxConcreteType::eSHAPE)
00120 PX_DEFINE_TYPEINFO(PxClothFabric,       PxConcreteType::eCLOTH_FABRIC)
00121 PX_DEFINE_TYPEINFO(PxCloth,             PxConcreteType::eCLOTH)
00122 PX_DEFINE_TYPEINFO(PxParticleBase,      PxConcreteType::eUNDEFINED)
00123 PX_DEFINE_TYPEINFO(PxParticleFluid,     PxConcreteType::ePARTICLE_FLUID)
00124 PX_DEFINE_TYPEINFO(PxParticleSystem,    PxConcreteType::ePARTICLE_SYSTEM)
00125 PX_DEFINE_TYPEINFO(PxPruningStructure,  PxConcreteType::ePRUNING_STRUCTURE)
00126 
00127 #if !PX_DOXYGEN
00128 } // namespace physx
00129 #endif
00130 
00132 #endif


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