You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
5.5 KiB

4 years ago
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref core
  24. /// @file glm/glm.hpp
  25. /// @date 2005-01-14 / 2011-10-24
  26. /// @author Christophe Riccio
  27. ///
  28. /// @defgroup core GLM Core
  29. ///
  30. /// @brief The core of GLM, which implements exactly and only the GLSL specification to the degree possible.
  31. ///
  32. /// The GLM core consists of @ref core_types "C++ types that mirror GLSL types" and
  33. /// C++ functions that mirror the GLSL functions. It also includes
  34. /// @ref core_precision "a set of precision-based types" that can be used in the appropriate
  35. /// functions. The C++ types are all based on a basic set of @ref core_template "template types".
  36. ///
  37. /// The best documentation for GLM Core is the current GLSL specification,
  38. /// <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.clean.pdf">version 4.2
  39. /// (pdf file)</a>.
  40. /// There are a few @ref pg_differences "differences" between GLM core and GLSL.
  41. ///
  42. /// GLM core functionnalities require <glm/glm.hpp> to be included to be used.
  43. ///
  44. /// @defgroup core_types Types
  45. ///
  46. /// @brief The standard types defined by the specification.
  47. ///
  48. /// These types are all typedefs of more generalized, template types. To see the definiton
  49. /// of these template types, go to @ref core_template.
  50. ///
  51. /// @ingroup core
  52. ///
  53. /// @defgroup core_precision Precision types
  54. ///
  55. /// @brief Non-GLSL types that are used to define precision-based types.
  56. ///
  57. /// The GLSL language allows the user to define the precision of a particular variable.
  58. /// In OpenGL's GLSL, these precision qualifiers have no effect; they are there for compatibility
  59. /// with OpenGL ES's precision qualifiers, where they @em do have an effect.
  60. ///
  61. /// C++ has no language equivalent to precision qualifiers. So GLM provides the next-best thing:
  62. /// a number of typedefs of the @ref core_template that use a particular precision.
  63. ///
  64. /// None of these types make any guarantees about the actual precision used.
  65. ///
  66. /// @ingroup core
  67. ///
  68. /// @defgroup core_template Template types
  69. ///
  70. /// @brief The generic template types used as the basis for the core types.
  71. ///
  72. /// These types are all templates used to define the actual @ref core_types.
  73. /// These templetes are implementation details of GLM types and should not be used explicitly.
  74. ///
  75. /// @ingroup core
  76. ///////////////////////////////////////////////////////////////////////////////////
  77. #include "core/_fixes.hpp"
  78. #ifndef glm_glm
  79. #define glm_glm
  80. #include <cmath>
  81. #include <climits>
  82. #include <cfloat>
  83. #include <limits>
  84. #include <cstdio>
  85. //#include <type_traits>
  86. #include "core/setup.hpp"
  87. #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
  88. # define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
  89. # pragma message("GLM: Core library included")
  90. #endif//GLM_MESSAGE
  91. #include "./core/_detail.hpp"
  92. #include "./core/_vectorize.hpp"
  93. #include "./core/type.hpp"
  94. #include "./core/func_trigonometric.hpp"
  95. #include "./core/func_exponential.hpp"
  96. #include "./core/func_common.hpp"
  97. #include "./core/func_packing.hpp"
  98. #include "./core/func_geometric.hpp"
  99. #include "./core/func_matrix.hpp"
  100. #include "./core/func_vector_relational.hpp"
  101. #include "./core/func_integer.hpp"
  102. #include "./core/func_noise.hpp"
  103. #include "./core/_swizzle.hpp"
  104. ////////////////////
  105. // check type sizes
  106. #ifndef GLM_STATIC_ASSERT_NULL
  107. GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
  108. GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
  109. GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
  110. GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
  111. GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
  112. GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
  113. GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
  114. GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
  115. GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
  116. GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
  117. GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
  118. #endif//GLM_STATIC_ASSERT_NULL
  119. #endif//glm_glm