PxSimpleTypes.h

Go to the documentation of this file.
00001 //
00002 // Redistribution and use in source and binary forms, with or without
00003 // modification, are permitted provided that the following conditions
00004 // are met:
00005 //  * Redistributions of source code must retain the above copyright
00006 //    notice, this list of conditions and the following disclaimer.
00007 //  * Redistributions in binary form must reproduce the above copyright
00008 //    notice, this list of conditions and the following disclaimer in the
00009 //    documentation and/or other materials provided with the distribution.
00010 //  * Neither the name of NVIDIA CORPORATION nor the names of its
00011 //    contributors may be used to endorse or promote products derived
00012 //    from this software without specific prior written permission.
00013 //
00014 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
00015 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017 // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00018 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 PXFOUNDATION_PXSIMPLETYPES_H
00031 #define PXFOUNDATION_PXSIMPLETYPES_H
00032 
00037 // Platform specific types:
00038 // Design note: Its OK to use int for general loop variables and temps.
00039 
00040 #include "foundation/PxPreprocessor.h"
00041 #if PX_VC
00042 #pragma warning(push)
00043 #pragma warning(disable : 4668) // suppressing warning generated by Microsoft Visual Studio when including this standard
00044 // header
00045 #endif
00046 
00047 #if PX_LINUX
00048 #define __STDC_LIMIT_MACROS
00049 #endif
00050 
00051 #include <stdint.h>
00052 #if PX_VC
00053 #pragma warning(pop)
00054 #endif
00055 
00056 #if PX_VC // we could use inttypes.h starting with VC12
00057 #define PX_PRIu64 "I64u"
00058 #else
00059 #if !PX_PS4 && !PX_APPLE_FAMILY && !PX_SWITCH
00060 #define __STDC_FORMAT_MACROS
00061 #endif
00062 #include <inttypes.h>
00063 #define PX_PRIu64 PRIu64
00064 #endif
00065 
00066 namespace physx
00067 {
00068 typedef int64_t PxI64;
00069 typedef uint64_t PxU64;
00070 typedef int32_t PxI32;
00071 typedef uint32_t PxU32;
00072 typedef int16_t PxI16;
00073 typedef uint16_t PxU16;
00074 typedef int8_t PxI8;
00075 typedef uint8_t PxU8;
00076 typedef float PxF32;
00077 typedef double PxF64;
00078 typedef float PxReal;
00079 }
00080 
00081 // Type ranges
00082 
00083 // These are here because we sometimes have non-IEEE compliant platforms to deal with.
00084 // Removal is under consideration (issue GWSD-34)
00085 
00086 #define PX_MAX_F32 3.4028234663852885981170418348452e+38F
00087 // maximum possible float value
00088 #define PX_MAX_F64 DBL_MAX // maximum possible double value
00089 
00090 #define PX_EPS_F32 FLT_EPSILON // maximum relative error of float rounding
00091 #define PX_EPS_F64 DBL_EPSILON // maximum relative error of double rounding
00092 
00093 #define PX_MAX_REAL PX_MAX_F32
00094 #define PX_EPS_REAL PX_EPS_F32
00095 #define PX_NORMALIZATION_EPSILON float(1e-20f)
00096 
00097 // Legacy type ranges used by PhysX
00098 #define PX_MAX_I8 INT8_MAX
00099 #define PX_MIN_I8 INT8_MIN
00100 #define PX_MAX_U8 UINT8_MAX
00101 #define PX_MIN_U8 UINT8_MIN
00102 #define PX_MAX_I16 INT16_MAX
00103 #define PX_MIN_I16 INT16_MIN
00104 #define PX_MAX_U16 UINT16_MAX
00105 #define PX_MIN_U16 UINT16_MIN
00106 #define PX_MAX_I32 INT32_MAX
00107 #define PX_MIN_I32 INT32_MIN
00108 #define PX_MAX_U32 UINT32_MAX
00109 #define PX_MIN_U32 UINT32_MIN
00110 
00112 #endif // #ifndef PXFOUNDATION_PXSIMPLETYPES_H


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