/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// /// @ref core /// @file glm/core/type_vec.hpp /// @date 2010-01-26 / 2011-06-15 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_type_vec #define glm_core_type_vec #include "precision.hpp" #include "type_int.hpp" namespace glm{ namespace detail { template struct tvec1; template struct tvec2; template struct tvec3; template struct tvec4; }//namespace detail typedef detail::tvec1 highp_vec1_t; typedef detail::tvec1 mediump_vec1_t; typedef detail::tvec1 lowp_vec1_t; typedef detail::tvec1 highp_ivec1_t; typedef detail::tvec1 mediump_ivec1_t; typedef detail::tvec1 lowp_ivec1_t; typedef detail::tvec1 highp_uvec1_t; typedef detail::tvec1 mediump_uvec1_t; typedef detail::tvec1 lowp_uvec1_t; typedef detail::tvec1 highp_bvec1_t; typedef detail::tvec1 mediump_bvec1_t; typedef detail::tvec1 lowp_bvec1_t; /// @addtogroup core_precision /// @{ /// 2 components vector of high single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 highp_vec2; /// 2 components vector of medium single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 mediump_vec2; /// 2 components vector of low single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 lowp_vec2; /// 2 components vector of high double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 highp_dvec2; /// 2 components vector of medium double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 mediump_dvec2; /// 2 components vector of low double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 lowp_dvec2; /// 2 components vector of high precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 highp_ivec2; /// 2 components vector of medium precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 mediump_ivec2; /// 2 components vector of low precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 lowp_ivec2; /// 2 components vector of high precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 highp_uvec2; /// 2 components vector of medium precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 mediump_uvec2; /// 2 components vector of low precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 lowp_uvec2; /// 2 components vector of high precision bool numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 highp_bvec2; /// 2 components vector of medium precision bool numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 mediump_bvec2; /// 2 components vector of low precision bool numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec2 lowp_bvec2; /// @} /// @addtogroup core_precision /// @{ /// 3 components vector of high single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 highp_vec3; /// 3 components vector of medium single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 mediump_vec3; /// 3 components vector of low single-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 lowp_vec3; /// 3 components vector of high double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 highp_dvec3; /// 3 components vector of medium double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 mediump_dvec3; /// 3 components vector of low double-precision floating-point numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 lowp_dvec3; /// 3 components vector of high precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 highp_ivec3; /// 3 components vector of medium precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 mediump_ivec3; /// 3 components vector of low precision signed integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 lowp_ivec3; /// 3 components vector of high precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 highp_uvec3; /// 3 components vector of medium precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 mediump_uvec3; /// 3 components vector of low precision unsigned integer numbers. /// There is no guarantee on the actual precision. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 lowp_uvec3; /// 3 components vector of high precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 highp_bvec3; /// 3 components vector of medium precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 mediump_bvec3; /// 3 components vector of low precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec3 lowp_bvec3; /// @} /// @addtogroup core_precision /// @{ /// 4 components vector of high single-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 highp_vec4; /// 4 components vector of medium single-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 mediump_vec4; /// 4 components vector of low single-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 lowp_vec4; /// 4 components vector of high double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 highp_dvec4; /// 4 components vector of medium double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 mediump_dvec4; /// 4 components vector of low double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 lowp_dvec4; /// 4 components vector of high precision signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 highp_ivec4; /// 4 components vector of medium precision signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 mediump_ivec4; /// 4 components vector of low precision signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 lowp_ivec4; /// 4 components vector of high precision unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 highp_uvec4; /// 4 components vector of medium precision unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 mediump_uvec4; /// 4 components vector of low precision unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 lowp_uvec4; /// 4 components vector of high precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 highp_bvec4; /// 4 components vector of medium precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 mediump_bvec4; /// 4 components vector of low precision bool numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef detail::tvec4 lowp_bvec4; /// @} /// @addtogroup core_types /// @{ ////////////////////////// // Default float definition #if(defined(GLM_PRECISION_LOWP_FLOAT)) typedef lowp_vec2 vec2; typedef lowp_vec3 vec3; typedef lowp_vec4 vec4; #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) typedef mediump_vec2 vec2; typedef mediump_vec3 vec3; typedef mediump_vec4 vec4; #else //defined(GLM_PRECISION_HIGHP_FLOAT) /// 2 components vector of floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_vec2 vec2; //! 3 components vector of floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_vec3 vec3; //! 4 components vector of floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_vec4 vec4; #endif//GLM_PRECISION ////////////////////////// // Default double definition #if(defined(GLM_PRECISION_LOWP_DOUBLE)) typedef lowp_dvec2 dvec2; typedef lowp_dvec3 dvec3; typedef lowp_dvec4 dvec4; #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) typedef mediump_dvec2 dvec2; typedef mediump_dvec3 dvec3; typedef mediump_dvec4 dvec4; #else //defined(GLM_PRECISION_HIGHP_DOUBLE) /// 2 components vector of double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec2 dvec2; //! 3 components vector of double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec3 dvec3; //! 4 components vector of double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec4 dvec4; #endif//GLM_PRECISION ////////////////////////// // Signed integer definition #if(defined(GLM_PRECISION_LOWP_INT)) typedef lowp_ivec2 ivec2; typedef lowp_ivec3 ivec3; typedef lowp_ivec4 ivec4; #elif(defined(GLM_PRECISION_MEDIUMP_INT)) typedef mediump_ivec2 ivec2; typedef mediump_ivec3 ivec3; typedef mediump_ivec4 ivec4; #else //defined(GLM_PRECISION_HIGHP_INT) //! 2 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec2 ivec2; //! 3 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec3 ivec3; //! 4 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec4 ivec4; #endif//GLM_PRECISION ////////////////////////// // Unsigned integer definition #if(defined(GLM_PRECISION_LOWP_UINT)) typedef lowp_uvec2 uvec2; typedef lowp_uvec3 uvec3; typedef lowp_uvec4 uvec4; #elif(defined(GLM_PRECISION_MEDIUMP_UINT)) typedef mediump_uvec2 uvec2; typedef mediump_uvec3 uvec3; typedef mediump_uvec4 uvec4; #else //defined(GLM_PRECISION_HIGHP_UINT) /// 2 components vector of unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec2 uvec2; /// 3 components vector of unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec3 uvec3; /// 4 components vector of unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec4 uvec4; #endif//GLM_PRECISION ////////////////////////// // Boolean definition #if(defined(GLM_PRECISION_LOWP_BOOL)) typedef lowp_bvec2 bvec2; typedef lowp_bvec3 bvec3; typedef lowp_bvec4 bvec4; #elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) typedef mediump_bvec2 bvec2; typedef mediump_bvec3 bvec3; typedef mediump_bvec4 bvec4; #else //defined(GLM_PRECISION_HIGHP_BOOL) //! 2 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec2 bvec2; //! 3 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec3 bvec3; //! 4 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec4 bvec4; #endif//GLM_PRECISION /// @} }//namespace glm #endif//glm_core_type_vec