Update GLM to latest version (0.9.9.3). This includes GLM's change of matrices no longer default initializing to the identity matrix. This commit thus also includes the update of all of LearnOpenGL's code to reflect this: all matrices are now constructor-initialized to the identity matrix where relevant.

This commit is contained in:
Joey de Vries
2018-12-30 14:27:14 +01:00
parent 239c456ae9
commit f4b6763356
474 changed files with 38219 additions and 38025 deletions

View File

@@ -1,56 +1,27 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 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.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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 gtc_round
/// @file glm/gtc/round.hpp
/// @date 2014-11-03 / 2014-11-03
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_round (dependence)
///
/// @defgroup gtc_round GLM_GTC_round
/// @ingroup gtc
///
/// @brief rounding value to specific boundings
///
/// <glm/gtc/round.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
///
/// Include <glm/gtc/round.hpp> to use the features of this extension.
///
/// Rounding value to specific boundings
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#include "../detail/precision.hpp"
#include "../detail/qualifier.hpp"
#include "../detail/_vectorize.hpp"
#include "../vector_relational.hpp"
#include "../common.hpp"
#include <limits>
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTC_integer extension included")
#endif
@@ -62,140 +33,168 @@ namespace glm
/// Return true if the value is a power of two number.
///
/// @see gtc_round
template <typename genIUType>
GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value);
template<typename genIUType>
GLM_FUNC_DECL bool isPowerOfTwo(genIUType v);
/// Return true if the value is a power of two number.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& v);
/// Return the power of two number which value is just higher the input value,
/// round up to a power of two.
///
/// @see gtc_round
template <typename genIUType>
GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
template<typename genIUType>
GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v);
/// Return the power of two number which value is just higher the input value,
/// round up to a power of two.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& v);
/// Return the power of two number which value is just lower the input value,
/// round down to a power of two.
///
/// @see gtc_round
template <typename genIUType>
GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
template<typename genIUType>
GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v);
/// Return the power of two number which value is just lower the input value,
/// round down to a power of two.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& v);
/// Return the power of two number which value is the closet to the input value.
///
/// @see gtc_round
template <typename genIUType>
GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
template<typename genIUType>
GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v);
/// Return the power of two number which value is the closet to the input value.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& v);
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
/// @see gtc_round
template <typename genIUType>
GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
template<typename genIUType>
GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple);
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& v, T Multiple);
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
/// Higher multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
///
/// @param v Source value to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename genType>
GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
template<typename genType>
GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple);
/// Higher multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @param v Source values to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
///
/// @param v Source value to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename genType>
GLM_FUNC_DECL genType floorMultiple(
genType Source,
genType Multiple);
template<typename genType>
GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple);
/// Lower multiple number of Source.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @param v Source values to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floorMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
///
/// @param v Source value to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floorMultiple(
vecType<T, P> const & Source,
vecType<T, P> const & Multiple);
template<typename genType>
GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @param v Source values to which is applied the function
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename genType>
GLM_FUNC_DECL genType roundMultiple(
genType Source,
genType Multiple);
/// Lower multiple number of Source.
///
/// @tparam genType Floating-point or integer scalar or vector types.
/// @param Source
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundMultiple(
vecType<T, P> const & Source,
vecType<T, P> const & Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple);
/// @}
} //namespace glm