type_precision.hpp
00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2009-06-04
00005 // Updated : 2009-06-04
00006 // Licence : This source is under MIT License
00007 // File    : glm/gtc/type_precision.hpp
00009 // Dependency:
00010 // - GLM core
00011 // - GLM_GTC_half
00012 // - GLM_GTC_quaternion
00014 
00015 #ifndef glm_gtc_type_precision
00016 #define glm_gtc_type_precision
00017 
00018 // Dependency:
00019 #include "../glm.hpp"
00020 #include "../gtc/half_float.hpp"
00021 #include "../gtc/quaternion.hpp"
00022 
00023 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00024 #       pragma message("GLM: GLM_GTC_type_precision extension included")
00025 #endif
00026 
00027 namespace glm{
00028 namespace gtc{
00029 namespace type_precision 
00030 {
00032         // Dependences
00033 
00034         using namespace gtc::half_float;
00035         using namespace gtc::quaternion;
00036 
00038         // Signed int vector types 
00039 
00042 
00043         typedef detail::int8                                            int8;         
00044         typedef detail::int16                                           int16;        
00045         typedef detail::int32                                           int32;        
00046         typedef detail::int64                                           int64;        
00047 
00048         typedef int8                                                            i8;         
00049         typedef int16                                                           i16;        
00050         typedef int32                                                           i32;        
00051         typedef int64                                                           i64;        
00052 
00053         //typedef i8                                                                    i8vec1;         //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension)
00054         typedef detail::tvec2<i8>                                       i8vec2;     
00055         typedef detail::tvec3<i8>                                       i8vec3;     
00056         typedef detail::tvec4<i8>                                       i8vec4;     
00057 
00058         //typedef i16                                                                   i16vec1;        //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension)
00059         typedef detail::tvec2<i16>                                      i16vec2;    
00060         typedef detail::tvec3<i16>                                      i16vec3;    
00061         typedef detail::tvec4<i16>                                      i16vec4;    
00062 
00063         //typedef i32                                                                   i32vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
00064         typedef detail::tvec2<i32>                                      i32vec2;    
00065         typedef detail::tvec3<i32>                                      i32vec3;    
00066         typedef detail::tvec4<i32>                                      i32vec4;    
00067 
00068         //typedef i64                                                                   i64vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
00069         typedef detail::tvec2<i64>                                      i64vec2;    
00070         typedef detail::tvec3<i64>                                      i64vec3;    
00071         typedef detail::tvec4<i64>                                      i64vec4;    
00072 
00074         // Unsigned int vector types 
00075 
00076         typedef detail::uint8                                           uint8;         
00077         typedef detail::uint16                                          uint16;        
00078         typedef detail::uint32                                          uint32;        
00079         typedef detail::uint64                                          uint64;        
00080 
00081         typedef uint8                                                           u8;         
00082         typedef uint16                                                          u16;        
00083         typedef uint32                                                          u32;        
00084         typedef uint64                                                          u64;        
00085 
00086         //typedef u8                                                                    u8vec1;         //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00087         typedef detail::tvec2<u8>                                       u8vec2;     
00088         typedef detail::tvec3<u8>                                       u8vec3;     
00089         typedef detail::tvec4<u8>                                       u8vec4;     
00090 
00091         //typedef u16                                                                   u16vec1;    //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00092         typedef detail::tvec2<u16>                                      u16vec2;    
00093         typedef detail::tvec3<u16>                                      u16vec3;    
00094         typedef detail::tvec4<u16>                                      u16vec4;    
00095 
00096         //typedef u32                                                                   u32vec1;    //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00097         typedef detail::tvec2<u32>                                      u32vec2;    
00098         typedef detail::tvec3<u32>                                      u32vec3;    
00099         typedef detail::tvec4<u32>                                      u32vec4;    
00100 
00101         //typedef u64                                                                   u64vec1;    //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00102         typedef detail::tvec2<u64>                                      u64vec2;    
00103         typedef detail::tvec3<u64>                                      u64vec3;    
00104         typedef detail::tvec4<u64>                                      u64vec4;    
00105 
00107         // Float vector types 
00108 
00109         typedef detail::float16                                         float16;        
00110         typedef detail::float32                                         float32;        
00111         typedef detail::float64                                         float64;        
00112 
00113         typedef float16                                                         f16;        
00114         typedef float32                                                         f32;        
00115         typedef float64                                                         f64;        
00116 
00117         typedef detail::tvec2<float>                            fvec2;          
00118         typedef detail::tvec3<float>                            fvec3;          
00119         typedef detail::tvec4<float>                            fvec4;          
00120 
00121         //typedef f16                                                                   f16vec1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00122         typedef detail::tvec2<f16>                                      f16vec2;    
00123         typedef detail::tvec3<f16>                                      f16vec3;    
00124         typedef detail::tvec4<f16>                                      f16vec4;    
00125 
00126         //typedef f32                                                                   f32vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00127         typedef detail::tvec2<f32>                                      f32vec2;    
00128         typedef detail::tvec3<f32>                                      f32vec3;    
00129         typedef detail::tvec4<f32>                                      f32vec4;    
00130 
00131         //typedef f64                                                                   f64vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00132         typedef detail::tvec2<f64>                                      f64vec2;    
00133         typedef detail::tvec3<f64>                                      f64vec3;    
00134         typedef detail::tvec4<f64>                                      f64vec4;    
00135 
00137         // Float matrix types 
00138 
00139         //typedef f32                                                                   fmat1;  //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00140         typedef detail::tmat2x2<f32>                            fmat2;  
00141         typedef detail::tmat3x3<f32>                            fmat3;  
00142         typedef detail::tmat4x4<f32>                            fmat4;  
00143 
00144         //typedef f32                                                                   fmat1x1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00145         typedef detail::tmat2x2<f32>                            fmat2x2;  
00146         typedef detail::tmat2x3<f32>                            fmat2x3;        
00147         typedef detail::tmat2x4<f32>                            fmat2x4;        
00148         typedef detail::tmat3x2<f32>                            fmat3x2;        
00149         typedef detail::tmat3x3<f32>                            fmat3x3;        
00150         typedef detail::tmat3x4<f32>                            fmat3x4;        
00151         typedef detail::tmat4x2<f32>                            fmat4x2;        
00152         typedef detail::tmat4x3<f32>                            fmat4x3;        
00153         typedef detail::tmat4x4<f32>                            fmat4x4;        
00154 
00155         //typedef f16                                                                   f16mat1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00156         typedef detail::tmat2x2<f16>                            f16mat2;        
00157         typedef detail::tmat3x3<f16>                            f16mat3;        
00158         typedef detail::tmat4x4<f16>                            f16mat4;        
00159 
00160         //typedef f16                                                                   f16mat1x1;      //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00161         typedef detail::tmat2x2<f16>                            f16mat2x2;      
00162         typedef detail::tmat2x3<f16>                            f16mat2x3;      
00163         typedef detail::tmat2x4<f16>                            f16mat2x4;      
00164         typedef detail::tmat3x2<f16>                            f16mat3x2;      
00165         typedef detail::tmat3x3<f16>                            f16mat3x3;      
00166         typedef detail::tmat3x4<f16>                            f16mat3x4;      
00167         typedef detail::tmat4x2<f16>                            f16mat4x2;      
00168         typedef detail::tmat4x3<f16>                            f16mat4x3;      
00169         typedef detail::tmat4x4<f16>                            f16mat4x4;      
00170 
00171         //typedef f32                                                                   f32mat1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00172         typedef detail::tmat2x2<f32>                            f32mat2;        
00173         typedef detail::tmat3x3<f32>                            f32mat3;        
00174         typedef detail::tmat4x4<f32>                            f32mat4;        
00175 
00176         //typedef f32                                                                   f32mat1x1;      //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00177         typedef detail::tmat2x2<f32>                            f32mat2x2;  
00178         typedef detail::tmat2x3<f32>                            f32mat2x3;      
00179         typedef detail::tmat2x4<f32>                            f32mat2x4;      
00180         typedef detail::tmat3x2<f32>                            f32mat3x2;      
00181         typedef detail::tmat3x3<f32>                            f32mat3x3;      
00182         typedef detail::tmat3x4<f32>                            f32mat3x4;      
00183         typedef detail::tmat4x2<f32>                            f32mat4x2;      
00184         typedef detail::tmat4x3<f32>                            f32mat4x3;      
00185         typedef detail::tmat4x4<f32>                            f32mat4x4;      
00186 
00187         //typedef f64                                                                   f64mat1;        //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00188         typedef detail::tmat2x2<f64>                            f64mat2;        
00189         typedef detail::tmat3x3<f64>                            f64mat3;        
00190         typedef detail::tmat4x4<f64>                            f64mat4;        
00191 
00192         //typedef f64                                                                   f64mat1x1;      //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00193         typedef detail::tmat2x2<f64>                            f64mat2x2;      
00194         typedef detail::tmat2x3<f64>                            f64mat2x3;      
00195         typedef detail::tmat2x4<f64>                            f64mat2x4;      
00196         typedef detail::tmat3x2<f64>                            f64mat3x2;      
00197         typedef detail::tmat3x3<f64>                            f64mat3x3;      
00198         typedef detail::tmat3x4<f64>                            f64mat3x4;      
00199         typedef detail::tmat4x2<f64>                            f64mat4x2;      
00200         typedef detail::tmat4x3<f64>                            f64mat4x3;      
00201         typedef detail::tmat4x4<f64>                            f64mat4x4;      
00202 
00204         // Float quaternion types 
00205 
00206         typedef detail::tquat<f16>                                      f16quat;    
00207         typedef detail::tquat<f32>                                      f32quat;    
00208         typedef detail::tquat<f64>                                      f64quat;    
00209 
00211 
00212 }//namespace type_precision
00213 }//namespace gtc
00214 }//namespace glm
00215 
00216 #include "type_precision.inl"
00217 
00218 namespace glm{using namespace gtc::type_precision;}
00219 
00220 #endif//glm_gtc_type_precision
type_precision.hpp Source File
type_precision.hpp
00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2009-06-04
00005 // Updated : 2009-06-04
00006 // Licence : This source is under MIT License
00007 // File    : glm/gtc/type_precision.hpp
00009 // Dependency:
00010 // - GLM core
00011 // - GLM_GTC_half
00012 // - GLM_GTC_quaternion
00014 
00015 #ifndef glm_gtc_type_precision
00016 #define glm_gtc_type_precision
00017 
00018 // Dependency:
00019 #include "../glm.hpp"
00020 #include "../gtc/half_float.hpp"
00021 #include "../gtc/quaternion.hpp"
00022 
00023 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00024 #       pragma message("GLM: GLM_GTC_type_precision extension included")
00025 #endif
00026 
00027 namespace glm{
00028 namespace gtc{
00029 namespace type_precision 
00030 {
00032         // Dependences
00033 
00034         using namespace gtc::half_float;
00035         using namespace gtc::quaternion;
00036 
00038         // Signed int vector types 
00039 
00042 
00043         typedef detail::int8                                            int8;         
00044         typedef detail::int16                                           int16;        
00045         typedef detail::int32                                           int32;        
00046         typedef detail::int64                                           int64;        
00047 
00048         typedef int8                                                            i8;         
00049         typedef int16                                                           i16;        
00050         typedef int32                                                           i32;        
00051         typedef int64                                                           i64;        
00052 
00053         //typedef i8                                                                    i8vec1;         //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension)
00054         typedef detail::tvec2<i8>                                       i8vec2;     
00055         typedef detail::tvec3<i8>                                       i8vec3;     
00056         typedef detail::tvec4<i8>                                       i8vec4;     
00057 
00058         //typedef i16                                                                   i16vec1;        //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension)
00059         typedef detail::tvec2<i16>                                      i16vec2;    
00060         typedef detail::tvec3<i16>                                      i16vec3;    
00061         typedef detail::tvec4<i16>                                      i16vec4;    
00062 
00063         //typedef i32                                                                   i32vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
00064         typedef detail::tvec2<i32>                                      i32vec2;    
00065         typedef detail::tvec3<i32>                                      i32vec3;    
00066         typedef detail::tvec4<i32>                                      i32vec4;    
00067 
00068         //typedef i64                                                                   i64vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)
00069         typedef detail::tvec2<i64>                                      i64vec2;    
00070         typedef detail::tvec3<i64>                                      i64vec3;    
00071         typedef detail::tvec4<i64>                                      i64vec4;    
00072 
00074         // Unsigned int vector types 
00075 
00076         typedef detail::uint8                                           uint8;         
00077         typedef detail::uint16                                          uint16;        
00078         typedef detail::uint32                                          uint32;        
00079         typedef detail::uint64                                          uint64;        
00080 
00081         typedef uint8                                                           u8;         
00082         typedef uint16                                                          u16;        
00083         typedef uint32                                                          u32;        
00084         typedef uint64                                                          u64;        
00085 
00086         //typedef u8                                                                    u8vec1;         //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00087         typedef detail::tvec2<u8>                                       u8vec2;     
00088         typedef detail::tvec3<u8>                                       u8vec3;     
00089         typedef detail::tvec4<u8>                                       u8vec4;     
00090 
00091         //typedef u16                                                                   u16vec1;    //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00092         typedef detail::tvec2<u16>                                      u16vec2;    
00093         typedef detail::tvec3<u16>                                      u16vec3;    
00094         typedef detail::tvec4<u16>                                      u16vec4;    
00095 
00096         //typedef u32                                                                   u32vec1;    //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00097         typedef detail::tvec2<u32>                                      u32vec2;    
00098         typedef detail::tvec3<u32>                                      u32vec3;    
00099         typedef detail::tvec4<u32>                                      u32vec4;    
00100 
00101         //typedef u64                                                                   u64vec1;    //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension)
00102         typedef detail::tvec2<u64>                                      u64vec2;    
00103         typedef detail::tvec3<u64>                                      u64vec3;    
00104         typedef detail::tvec4<u64>                                      u64vec4;    
00105 
00107         // Float vector types 
00108 
00109         typedef detail::float16                                         float16;        
00110         typedef detail::float32                                         float32;        
00111         typedef detail::float64                                         float64;        
00112 
00113         typedef float16                                                         f16;        
00114         typedef float32                                                         f32;        
00115         typedef float64                                                         f64;        
00116 
00117         typedef detail::tvec2<float>                            fvec2;          
00118         typedef detail::tvec3<float>                            fvec3;          
00119         typedef detail::tvec4<float>                            fvec4;          
00120 
00121         //typedef f16                                                                   f16vec1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00122         typedef detail::tvec2<f16>                                      f16vec2;    
00123         typedef detail::tvec3<f16>                                      f16vec3;    
00124         typedef detail::tvec4<f16>                                      f16vec4;    
00125 
00126         //typedef f32                                                                   f32vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00127         typedef detail::tvec2<f32>                                      f32vec2;    
00128         typedef detail::tvec3<f32>                                      f32vec3;    
00129         typedef detail::tvec4<f32>                                      f32vec4;    
00130 
00131         //typedef f64                                                                   f64vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00132         typedef detail::tvec2<f64>                                      f64vec2;    
00133         typedef detail::tvec3<f64>                                      f64vec3;    
00134         typedef detail::tvec4<f64>                                      f64vec4;    
00135 
00137         // Float matrix types 
00138 
00139         //typedef f32                                                                   fmat1;  //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00140         typedef detail::tmat2x2<f32>                            fmat2;  
00141         typedef detail::tmat3x3<f32>                            fmat3;  
00142         typedef detail::tmat4x4<f32>                            fmat4;  
00143 
00144         //typedef f32                                                                   fmat1x1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00145         typedef detail::tmat2x2<f32>                            fmat2x2;  
00146         typedef detail::tmat2x3<f32>                            fmat2x3;        
00147         typedef detail::tmat2x4<f32>                            fmat2x4;        
00148         typedef detail::tmat3x2<f32>                            fmat3x2;        
00149         typedef detail::tmat3x3<f32>                            fmat3x3;        
00150         typedef detail::tmat3x4<f32>                            fmat3x4;        
00151         typedef detail::tmat4x2<f32>                            fmat4x2;        
00152         typedef detail::tmat4x3<f32>                            fmat4x3;        
00153         typedef detail::tmat4x4<f32>                            fmat4x4;        
00154 
00155         //typedef f16                                                                   f16mat1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00156         typedef detail::tmat2x2<f16>                            f16mat2;        
00157         typedef detail::tmat3x3<f16>                            f16mat3;        
00158         typedef detail::tmat4x4<f16>                            f16mat4;        
00159 
00160         //typedef f16                                                                   f16mat1x1;      //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00161         typedef detail::tmat2x2<f16>                            f16mat2x2;      
00162         typedef detail::tmat2x3<f16>                            f16mat2x3;      
00163         typedef detail::tmat2x4<f16>                            f16mat2x4;      
00164         typedef detail::tmat3x2<f16>                            f16mat3x2;      
00165         typedef detail::tmat3x3<f16>                            f16mat3x3;      
00166         typedef detail::tmat3x4<f16>                            f16mat3x4;      
00167         typedef detail::tmat4x2<f16>                            f16mat4x2;      
00168         typedef detail::tmat4x3<f16>                            f16mat4x3;      
00169         typedef detail::tmat4x4<f16>                            f16mat4x4;      
00170 
00171         //typedef f32                                                                   f32mat1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00172         typedef detail::tmat2x2<f32>                            f32mat2;        
00173         typedef detail::tmat3x3<f32>                            f32mat3;        
00174         typedef detail::tmat4x4<f32>                            f32mat4;        
00175 
00176         //typedef f32                                                                   f32mat1x1;      //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00177         typedef detail::tmat2x2<f32>                            f32mat2x2;  
00178         typedef detail::tmat2x3<f32>                            f32mat2x3;      
00179         typedef detail::tmat2x4<f32>                            f32mat2x4;      
00180         typedef detail::tmat3x2<f32>                            f32mat3x2;      
00181         typedef detail::tmat3x3<f32>                            f32mat3x3;      
00182         typedef detail::tmat3x4<f32>                            f32mat3x4;      
00183         typedef detail::tmat4x2<f32>                            f32mat4x2;      
00184         typedef detail::tmat4x3<f32>                            f32mat4x3;      
00185         typedef detail::tmat4x4<f32>                            f32mat4x4;      
00186 
00187         //typedef f64                                                                   f64mat1;        //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00188         typedef detail::tmat2x2<f64>                            f64mat2;        
00189         typedef detail::tmat3x3<f64>                            f64mat3;        
00190         typedef detail::tmat4x4<f64>                            f64mat4;        
00191 
00192         //typedef f64                                                                   f64mat1x1;      //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)
00193         typedef detail::tmat2x2<f64>                            f64mat2x2;      
00194         typedef detail::tmat2x3<f64>                            f64mat2x3;      
00195         typedef detail::tmat2x4<f64>                            f64mat2x4;      
00196         typedef detail::tmat3x2<f64>                            f64mat3x2;      
00197         typedef detail::tmat3x3<f64>                            f64mat3x3;      
00198         typedef detail::tmat3x4<f64>                            f64mat3x4;      
00199         typedef detail::tmat4x2<f64>                            f64mat4x2;      
00200         typedef detail::tmat4x3<f64>                            f64mat4x3;      
00201         typedef detail::tmat4x4<f64>                            f64mat4x4;      
00202 
00204         // Float quaternion types 
00205 
00206         typedef detail::tquat<f16>                                      f16quat;    
00207         typedef detail::tquat<f32>                                      f32quat;    
00208         typedef detail::tquat<f64>                                      f64quat;    
00209 
00211 
00212 }//namespace type_precision
00213 }//namespace gtc
00214 }//namespace glm
00215 
00216 #include "type_precision.inl"
00217 
00218 namespace glm{using namespace gtc::type_precision;}
00219 
00220 #endif//glm_gtc_type_precision