PhysX SDK 3.2 API Reference: PxTypeInfo.h Source File

PhysX SDK 3.2 API

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-2012 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 //#ifdef REMOVED
00032 
00033 #ifndef PX_PHYSICS_COMMON_PX_TYPEINFO
00034 #define PX_PHYSICS_COMMON_PX_TYPEINFO
00035 
00040 #include "common/PxPhysXCommon.h"
00041 
00042 #ifndef PX_DOXYGEN
00043 namespace physx
00044 {
00045 #endif
00046 
00053 struct PxConcreteType
00054 {
00055     enum Enum
00056     {
00057         eUNDEFINED,
00058 
00059         eHEIGHTFIELD,
00060         eCONVEX_MESH,
00061         eTRIANGLE_MESH,
00062         eCLOTH_FABRIC,
00063 
00064         eRIGID_DYNAMIC,
00065         eRIGID_STATIC,
00066         eSHAPE,
00067         eMATERIAL,
00068         eCONSTRAINT,
00069         eCLOTH,
00070         ePARTICLE_SYSTEM,
00071         ePARTICLE_FLUID,
00072         eAGGREGATE,
00073         eARTICULATION,
00074         eARTICULATION_LINK,
00075         eARTICULATION_JOINT,
00076 
00077         // Bad design here: the following types are "user types" and shouldn't be here in the end
00078         eUSER_SPHERICAL_JOINT,
00079         eUSER_REVOLUTE_JOINT,
00080         eUSER_PRISMATIC_JOINT,
00081         eUSER_FIXED_JOINT,
00082         eUSER_DISTANCE_JOINT,
00083         eUSER_D6_JOINT,
00084 
00085         eUSER_OBSERVER,
00086 
00087         eLAST
00088     };
00089 };
00090 
00097 template<typename T> struct PxTypeInfo {};
00098 
00099 #define PX_DEFINE_TYPEINFO(_name, _fastType) \
00100     class _name; \
00101     template <> struct PxTypeInfo<_name>    {   static const char* name() { return #_name;  }   enum { eFastTypeId = _fastType };   };
00102 
00103 /* 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.
00104  * This implies that B has no concrete subclasses or superclasses.
00105  */
00106 
00107 PX_DEFINE_TYPEINFO(PxSerializable,      PxConcreteType::eUNDEFINED);
00108 PX_DEFINE_TYPEINFO(PxObservable,        PxConcreteType::eUNDEFINED);
00109 PX_DEFINE_TYPEINFO(PxObserver,          PxConcreteType::eUNDEFINED);
00110 PX_DEFINE_TYPEINFO(PxMaterial,          PxConcreteType::eMATERIAL);
00111 PX_DEFINE_TYPEINFO(PxConvexMesh,        PxConcreteType::eCONVEX_MESH);
00112 PX_DEFINE_TYPEINFO(PxTriangleMesh,      PxConcreteType::eTRIANGLE_MESH);
00113 PX_DEFINE_TYPEINFO(PxHeightField,       PxConcreteType::eHEIGHTFIELD);
00114 PX_DEFINE_TYPEINFO(PxActor,             PxConcreteType::eUNDEFINED);
00115 PX_DEFINE_TYPEINFO(PxRigidActor,        PxConcreteType::eUNDEFINED);
00116 PX_DEFINE_TYPEINFO(PxRigidBody,         PxConcreteType::eUNDEFINED);
00117 PX_DEFINE_TYPEINFO(PxRigidDynamic,      PxConcreteType::eRIGID_DYNAMIC);
00118 PX_DEFINE_TYPEINFO(PxRigidStatic,       PxConcreteType::eRIGID_STATIC);
00119 PX_DEFINE_TYPEINFO(PxArticulationLink,  PxConcreteType::eARTICULATION_LINK);
00120 PX_DEFINE_TYPEINFO(PxArticulationJoint, PxConcreteType::eARTICULATION_JOINT);
00121 PX_DEFINE_TYPEINFO(PxArticulation,      PxConcreteType::eARTICULATION);
00122 PX_DEFINE_TYPEINFO(PxAggregate,         PxConcreteType::eAGGREGATE);
00123 PX_DEFINE_TYPEINFO(PxConstraint,        PxConcreteType::eCONSTRAINT);
00124 PX_DEFINE_TYPEINFO(PxShape,             PxConcreteType::eSHAPE);
00125 PX_DEFINE_TYPEINFO(PxClothFabric,       PxConcreteType::eCLOTH_FABRIC);
00126 PX_DEFINE_TYPEINFO(PxCloth,             PxConcreteType::eCLOTH);
00127 PX_DEFINE_TYPEINFO(PxParticleBase,      PxConcreteType::eUNDEFINED);
00128 PX_DEFINE_TYPEINFO(PxParticleFluid,     PxConcreteType::ePARTICLE_FLUID);
00129 PX_DEFINE_TYPEINFO(PxParticleSystem,    PxConcreteType::ePARTICLE_SYSTEM);
00130 
00131 template<typename T> struct PxStripConst            {   typedef T Type;     };
00132 template<typename T> struct PxStripConst<const T>   {   typedef T Type;     };
00133 
00134 #ifndef PX_DOXYGEN
00135 } // namespace physx
00136 #endif
00137 
00139 #endif


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