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-2018 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 
00064         eRIGID_DYNAMIC,
00065         eRIGID_STATIC,
00066         eSHAPE,
00067         eMATERIAL,
00068         eCONSTRAINT,
00069         eAGGREGATE,
00070         eARTICULATION,
00071         eARTICULATION_LINK,
00072         eARTICULATION_JOINT,
00073         ePRUNING_STRUCTURE,
00074         eBVH_STRUCTURE,
00075         
00076         ePHYSX_CORE_COUNT,
00077         eFIRST_PHYSX_EXTENSION = 256,
00078         eFIRST_VEHICLE_EXTENSION = 512,
00079         eFIRST_USER_EXTENSION = 1024
00080     };
00081 };
00082 
00089 template<typename T> struct PxTypeInfo {};
00090 
00091 #define PX_DEFINE_TYPEINFO(_name, _fastType) \
00092     class _name; \
00093     template <> struct PxTypeInfo<_name>    {   static const char* name() { return #_name;  }   enum { eFastTypeId = _fastType };   };
00094 
00095 /* 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.
00096  * This implies that B has no concrete subclasses or superclasses.
00097  */
00098 
00099 PX_DEFINE_TYPEINFO(PxBase,              PxConcreteType::eUNDEFINED)
00100 PX_DEFINE_TYPEINFO(PxMaterial,          PxConcreteType::eMATERIAL)
00101 PX_DEFINE_TYPEINFO(PxConvexMesh,        PxConcreteType::eCONVEX_MESH)
00102 PX_DEFINE_TYPEINFO(PxTriangleMesh,      PxConcreteType::eUNDEFINED)
00103 PX_DEFINE_TYPEINFO(PxBVH33TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH33)
00104 PX_DEFINE_TYPEINFO(PxBVH34TriangleMesh, PxConcreteType::eTRIANGLE_MESH_BVH34)
00105 PX_DEFINE_TYPEINFO(PxHeightField,       PxConcreteType::eHEIGHTFIELD)
00106 PX_DEFINE_TYPEINFO(PxActor,             PxConcreteType::eUNDEFINED)
00107 PX_DEFINE_TYPEINFO(PxRigidActor,        PxConcreteType::eUNDEFINED)
00108 PX_DEFINE_TYPEINFO(PxRigidBody,         PxConcreteType::eUNDEFINED)
00109 PX_DEFINE_TYPEINFO(PxRigidDynamic,      PxConcreteType::eRIGID_DYNAMIC)
00110 PX_DEFINE_TYPEINFO(PxRigidStatic,       PxConcreteType::eRIGID_STATIC)
00111 PX_DEFINE_TYPEINFO(PxArticulationLink,  PxConcreteType::eARTICULATION_LINK)
00112 PX_DEFINE_TYPEINFO(PxArticulationJoint, PxConcreteType::eARTICULATION_JOINT)
00113 PX_DEFINE_TYPEINFO(PxArticulation,      PxConcreteType::eARTICULATION)
00114 PX_DEFINE_TYPEINFO(PxAggregate,         PxConcreteType::eAGGREGATE)
00115 PX_DEFINE_TYPEINFO(PxConstraint,        PxConcreteType::eCONSTRAINT)
00116 PX_DEFINE_TYPEINFO(PxShape,             PxConcreteType::eSHAPE)
00117 PX_DEFINE_TYPEINFO(PxPruningStructure,  PxConcreteType::ePRUNING_STRUCTURE)
00118 
00119 #if !PX_DOXYGEN
00120 } // namespace physx
00121 #endif
00122 
00124 #endif


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