PxSimpleTypes.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 00032 #ifndef PX_FOUNDATION_PX_SIMPLE_TYPES_H 00033 #define PX_FOUNDATION_PX_SIMPLE_TYPES_H 00034 00039 // Platform specific types: 00040 //Design note: Its OK to use int for general loop variables and temps. 00041 00042 #include "foundation/PxPreprocessor.h" 00043 #include "foundation/Px.h" 00044 #ifndef PX_DOXYGEN 00045 namespace physx 00046 { 00047 #endif 00048 #if defined (PX_WINDOWS) || defined (DOXYGEN) 00049 00050 typedef signed __int64 PxI64; 00051 typedef signed int PxI32; 00052 typedef signed short PxI16; 00053 typedef signed char PxI8; 00054 00055 typedef unsigned __int64 PxU64; 00056 typedef unsigned int PxU32; 00057 typedef unsigned short PxU16; 00058 typedef unsigned char PxU8; 00059 00060 typedef float PxF32; 00061 typedef double PxF64; 00062 00063 #elif defined(PX_LINUX) || defined(PX_ANDROID) 00064 typedef signed long long PxI64; 00065 typedef signed int PxI32; 00066 typedef signed short PxI16; 00067 typedef signed char PxI8; 00068 00069 typedef unsigned long long PxU64; 00070 typedef unsigned int PxU32; 00071 typedef unsigned short PxU16; 00072 typedef unsigned char PxU8; 00073 00074 typedef float PxF32; 00075 typedef double PxF64; 00076 00077 #elif defined(PX_APPLE) 00078 typedef signed long long PxI64; 00079 typedef signed int PxI32; 00080 typedef signed short PxI16; 00081 typedef signed char PxI8; 00082 00083 typedef unsigned long long PxU64; 00084 typedef unsigned int PxU32; 00085 typedef unsigned short PxU16; 00086 typedef unsigned char PxU8; 00087 00088 typedef float PxF32; 00089 typedef double PxF64; 00090 00091 #elif defined(PX_PS3) 00092 typedef signed long long PxI64; 00093 typedef signed int PxI32; 00094 typedef signed short PxI16; 00095 typedef signed char PxI8; 00096 00097 typedef unsigned long long PxU64; 00098 typedef unsigned int PxU32; 00099 typedef unsigned short PxU16; 00100 typedef unsigned char PxU8; 00101 00102 typedef float PxF32; 00103 typedef double PxF64; 00104 00105 #elif defined(PX_PSP2) 00106 typedef signed long long PxI64; 00107 typedef signed int PxI32; 00108 typedef signed short PxI16; 00109 typedef signed char PxI8; 00110 00111 typedef unsigned long long PxU64; 00112 typedef unsigned int PxU32; 00113 typedef unsigned short PxU16; 00114 typedef unsigned char PxU8; 00115 00116 typedef float PxF32; 00117 typedef double PxF64; 00118 00119 #elif defined(PX_X360) 00120 typedef signed __int64 PxI64; 00121 typedef signed int PxI32; 00122 typedef signed short PxI16; 00123 typedef signed char PxI8; 00124 00125 typedef unsigned __int64 PxU64; 00126 typedef unsigned int PxU32; 00127 typedef unsigned short PxU16; 00128 typedef unsigned char PxU8; 00129 00130 typedef float PxF32; 00131 typedef double PxF64; 00132 00133 #elif defined(PX_WII) 00134 typedef signed long long PxI64; 00135 typedef signed int PxI32; 00136 typedef signed short PxI16; 00137 typedef signed char PxI8; 00138 00139 typedef unsigned long long PxU64; 00140 typedef unsigned int PxU32; 00141 typedef unsigned short PxU16; 00142 typedef unsigned char PxU8; 00143 00144 typedef float PxF32; 00145 typedef double PxF64; 00146 #elif defined (PX_WIN8ARM) 00147 00148 typedef signed __int64 PxI64; 00149 typedef signed int PxI32; 00150 typedef signed short PxI16; 00151 typedef signed char PxI8; 00152 00153 typedef unsigned __int64 PxU64; 00154 typedef unsigned int PxU32; 00155 typedef unsigned short PxU16; 00156 typedef unsigned char PxU8; 00157 00158 typedef float PxF32; 00159 typedef double PxF64; 00160 #else 00161 #error Unknown platform! 00162 00163 #endif 00164 00165 PX_COMPILE_TIME_ASSERT(sizeof(PxI8)==1); 00166 PX_COMPILE_TIME_ASSERT(sizeof(PxU8)==1); 00167 PX_COMPILE_TIME_ASSERT(sizeof(PxI16)==2); 00168 PX_COMPILE_TIME_ASSERT(sizeof(PxU16)==2); 00169 PX_COMPILE_TIME_ASSERT(sizeof(PxI32)==4); 00170 PX_COMPILE_TIME_ASSERT(sizeof(PxU32)==4); 00171 PX_COMPILE_TIME_ASSERT(sizeof(PxI64)==8); 00172 PX_COMPILE_TIME_ASSERT(sizeof(PxU64)==8); 00173 00174 // Type ranges 00175 #define PX_MAX_I8 127 //maximum possible sbyte value, 0x7f 00176 #define PX_MIN_I8 (-128) //minimum possible sbyte value, 0x80 00177 #define PX_MAX_U8 255U //maximum possible ubyte value, 0xff 00178 #define PX_MIN_U8 0 //minimum possible ubyte value, 0x00 00179 #define PX_MAX_I16 32767 //maximum possible sword value, 0x7fff 00180 #define PX_MIN_I16 (-32768) //minimum possible sword value, 0x8000 00181 #define PX_MAX_U16 65535U //maximum possible uword value, 0xffff 00182 #define PX_MIN_U16 0 //minimum possible uword value, 0x0000 00183 #define PX_MAX_I32 2147483647 //maximum possible sdword value, 0x7fffffff 00184 #define PX_MIN_I32 (-2147483647 - 1) //minimum possible sdword value, 0x80000000 00185 #define PX_MAX_U32 4294967295U //maximum possible udword value, 0xffffffff 00186 #define PX_MIN_U32 0 //minimum possible udword value, 0x00000000 00187 #define PX_MAX_F32 3.4028234663852885981170418348452e+38F 00188 //maximum possible float value 00189 #define PX_MAX_F64 DBL_MAX //maximum possible double value 00190 00191 #define PX_EPS_F32 FLT_EPSILON //maximum relative error of float rounding 00192 #define PX_EPS_F64 DBL_EPSILON //maximum relative error of double rounding 00193 00194 #ifndef PX_FOUNDATION_USE_F64 00195 00196 typedef PxF32 PxReal; 00197 00198 #define PX_MAX_REAL PX_MAX_F32 00199 #define PX_EPS_REAL PX_EPS_F32 00200 #define PX_NORMALIZATION_EPSILON PxReal(1e-20f) 00201 00202 #else 00203 00204 typedef PxF64 PxReal; 00205 00206 #define PX_MAX_REAL PX_MAX_F64 00207 #define PX_EPS_REAL PX_EPS_F64 00208 #define PX_NORMALIZATION_EPSILON PxReal(1e-180) 00209 00210 #endif 00211 00212 #ifndef PX_DOXYGEN 00213 } // namespace physx 00214 #endif 00215 00217 #endif // PX_FOUNDATION_PX_SIMPLE_TYPES_H
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com