diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68e2e637..e0a1d33e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,8 @@ if (WIN32)
set(libserialport_LIBRARY ${LIBSERIALPORT_LIBRARY} "${DEPS_DIR}/libserialport/lib/${ARCH}/libserialport-0.lib")
endif()
+set(GLM_INCLUDE_DIR ${GLM_INCLUDE_DIR} "${DEPS_DIR}/glm/")
+
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set(SOURCES ${SOURCES} "eu07.rc")
set(SOURCES ${SOURCES} "eu07.ico")
diff --git a/ref/glm/glm/CMakeLists.txt b/ref/glm/glm/CMakeLists.txt
index d60a8877..01c594f4 100644
--- a/ref/glm/glm/CMakeLists.txt
+++ b/ref/glm/glm/CMakeLists.txt
@@ -9,6 +9,10 @@ file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
+file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp)
+file(GLOB_RECURSE EXT_INLINE ./ext/*.inl)
+file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp)
+
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
@@ -25,6 +29,9 @@ source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD})
source_group("Core Files" FILES ${CORE_SOURCE})
source_group("Core Files" FILES ${CORE_INLINE})
source_group("Core Files" FILES ${CORE_HEADER})
+source_group("EXT Files" FILES ${EXT_SOURCE})
+source_group("EXT Files" FILES ${EXT_INLINE})
+source_group("EXT Files" FILES ${EXT_HEADER})
source_group("GTC Files" FILES ${GTC_SOURCE})
source_group("GTC Files" FILES ${GTC_INLINE})
source_group("GTC Files" FILES ${GTC_HEADER})
@@ -37,31 +44,19 @@ source_group("SIMD Files" FILES ${SIMD_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
-if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
- if(GLM_STATIC_LIBRARY_ENABLE)
- add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
- ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
- ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
- ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
- ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
- ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
- endif(GLM_STATIC_LIBRARY_ENABLE)
+add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
+ ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
+ ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
+ ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
+ ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
+ ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
+ ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
- if(GLM_DYNAMIC_LIBRARY_ENABLE)
- add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
- ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
- ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
- ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
- ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
- ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
- endif(GLM_DYNAMIC_LIBRARY_ENABLE)
+add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
+ ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
+ ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
+ ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
+ ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
+ ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
+ ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
-else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
- add_executable(glm_dummy ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
- ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
- ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
- ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
- ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
- ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
-
-endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
diff --git a/ref/glm/glm/common.hpp b/ref/glm/glm/common.hpp
index ac8af6e7..dbafb295 100644
--- a/ref/glm/glm/common.hpp
+++ b/ref/glm/glm/common.hpp
@@ -1,6 +1,533 @@
/// @ref core
/// @file glm/common.hpp
+///
+/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+///
+/// @defgroup core_func_common Common functions
+/// @ingroup core
+///
+/// Provides GLSL common functions
+///
+/// These all operate component-wise. The description is per component.
+///
+/// Include to use these core features.
#pragma once
-#include "detail/func_common.hpp"
+#include "detail/qualifier.hpp"
+#include "detail/_fixes.hpp"
+
+namespace glm
+{
+ /// @addtogroup core_func_common
+ /// @{
+
+ /// Returns x if x >= 0; otherwise, it returns -x.
+ ///
+ /// @tparam genType floating-point or signed integer; scalar or vector types.
+ ///
+ /// @see GLSL abs man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x);
+
+ /// Returns x if x >= 0; otherwise, it returns -x.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point or signed integer scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL abs man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec abs(vec const& x);
+
+ /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL sign man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec sign(vec const& x);
+
+ /// Returns a value equal to the nearest integer that is less then or equal to x.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL floor man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec floor(vec const& x);
+
+ /// Returns a value equal to the nearest integer to x
+ /// whose absolute value is not larger than the absolute value of x.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL trunc man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec trunc(vec const& x);
+
+ /// Returns a value equal to the nearest integer to x.
+ /// The fraction 0.5 will round in a direction chosen by the
+ /// implementation, presumably the direction that is fastest.
+ /// This includes the possibility that round(x) returns the
+ /// same value as roundEven(x) for all values of x.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL round man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec round(vec const& x);
+
+ /// Returns a value equal to the nearest integer to x.
+ /// A fractional part of 0.5 will round toward the nearest even
+ /// integer. (Both 3.5 and 4.5 for x will return 4.0.)
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL roundEven man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ /// @see New round to even technique
+ template
+ GLM_FUNC_DECL vec roundEven(vec const& x);
+
+ /// Returns a value equal to the nearest integer
+ /// that is greater than or equal to x.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL ceil man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec ceil(vec const& x);
+
+ /// Return x - floor(x).
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL fract man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType fract(genType x);
+
+ /// Return x - floor(x).
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL fract man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec fract(vec const& x);
+
+ template
+ GLM_FUNC_DECL genType mod(genType x, genType y);
+
+ template
+ GLM_FUNC_DECL vec mod(vec const& x, T y);
+
+ /// Modulus. Returns x - y * floor(x / y)
+ /// for each component in x using the floating point value y.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL mod man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec mod(vec const& x, vec const& y);
+
+ /// Returns the fractional part of x and sets i to the integer
+ /// part (as a whole number floating point value). Both the
+ /// return value and the output parameter will have the same
+ /// sign as x.
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL modf man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType modf(genType x, genType& i);
+
+ /// Returns y if y < x; otherwise, it returns x.
+ ///
+ /// @tparam genType Floating-point or integer; scalar or vector types.
+ ///
+ /// @see GLSL min man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y);
+
+ /// Returns y if y < x; otherwise, it returns x.
+ ///
+ /// @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 GLSL min man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, T y);
+
+ /// Returns y if y < x; otherwise, it returns x.
+ ///
+ /// @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 GLSL min man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, vec const& y);
+
+ /// Returns y if x < y; otherwise, it returns x.
+ ///
+ /// @tparam genType Floating-point or integer; scalar or vector types.
+ ///
+ /// @see GLSL max man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y);
+
+ /// Returns y if x < y; otherwise, it returns x.
+ ///
+ /// @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 GLSL max man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, T y);
+
+ /// Returns y if x < y; otherwise, it returns x.
+ ///
+ /// @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 GLSL max man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y);
+
+ /// Returns min(max(x, minVal), maxVal) for each component in x
+ /// using the floating-point values minVal and maxVal.
+ ///
+ /// @tparam genType Floating-point or integer; scalar or vector types.
+ ///
+ /// @see GLSL clamp man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal);
+
+ /// Returns min(max(x, minVal), maxVal) for each component in x
+ /// using the floating-point values minVal and maxVal.
+ ///
+ /// @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 GLSL clamp man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal);
+
+ /// Returns min(max(x, minVal), maxVal) for each component in x
+ /// using the floating-point values minVal and maxVal.
+ ///
+ /// @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 GLSL clamp man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal);
+
+ /// If genTypeU is a floating scalar or vector:
+ /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
+ /// x and y using the floating-point value a.
+ /// The value for a is not restricted to the range [0, 1].
+ ///
+ /// If genTypeU is a boolean scalar or vector:
+ /// Selects which vector each returned component comes
+ /// from. For a component of 'a' that is false, the
+ /// corresponding component of 'x' is returned. For a
+ /// component of 'a' that is true, the corresponding
+ /// component of 'y' is returned. Components of 'x' and 'y' that
+ /// are not selected are allowed to be invalid floating point
+ /// values and will have no effect on the results. Thus, this
+ /// provides different functionality than
+ /// genType mix(genType x, genType y, genType(a))
+ /// where a is a Boolean vector.
+ ///
+ /// @see GLSL mix man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ ///
+ /// @param[in] x Value to interpolate.
+ /// @param[in] y Value to interpolate.
+ /// @param[in] a Interpolant.
+ ///
+ /// @tparam genTypeT Floating point scalar or vector.
+ /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
+ ///
+ /// @code
+ /// #include
+ /// ...
+ /// float a;
+ /// bool b;
+ /// glm::dvec3 e;
+ /// glm::dvec3 f;
+ /// glm::vec4 g;
+ /// glm::vec4 h;
+ /// ...
+ /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
+ /// glm::vec4 s = glm::mix(g, h, b); // Returns g or h;
+ /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
+ /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
+ /// @endcode
+ template
+ GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
+
+ template
+ GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a);
+
+ template
+ GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a);
+
+ /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
+ ///
+ /// @see GLSL step man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType step(genType edge, genType x);
+
+ /// Returns 0.0 if x < edge, otherwise it returns 1.0.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL step man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec step(T edge, vec const& x);
+
+ /// Returns 0.0 if x < edge, otherwise it returns 1.0.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL step man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec step(vec const& edge, vec const& x);
+
+ /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
+ /// performs smooth Hermite interpolation between 0 and 1
+ /// when edge0 < x < edge1. This is useful in cases where
+ /// you would want a threshold function with a smooth
+ /// transition. This is equivalent to:
+ /// genType t;
+ /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
+ /// return t * t * (3 - 2 * t);
+ /// Results are undefined if edge0 >= edge1.
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL smoothstep man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
+
+ template
+ GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x);
+
+ template
+ GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x);
+
+ /// Returns true if x holds a NaN (not a number)
+ /// representation in the underlying implementation's set of
+ /// floating point representations. Returns false otherwise,
+ /// including for implementations with no NaN
+ /// representations.
+ ///
+ /// /!\ When using compiler fast math, this function may fail.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL isnan man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec isnan(vec const& x);
+
+ /// Returns true if x holds a positive infinity or negative
+ /// infinity representation in the underlying implementation's
+ /// set of floating point representations. Returns false
+ /// otherwise, including for implementations with no infinity
+ /// representations.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam T Floating-point scalar types
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL isinf man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec isinf(vec const& x);
+
+ /// Returns a signed integer value representing
+ /// the encoding of a floating-point value. The floating-point
+ /// value's bit-level representation is preserved.
+ ///
+ /// @see GLSL floatBitsToInt man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ GLM_FUNC_DECL int floatBitsToInt(float const& v);
+
+ /// Returns a signed integer value representing
+ /// the encoding of a floating-point value. The floatingpoint
+ /// value's bit-level representation is preserved.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL floatBitsToInt man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec floatBitsToInt(vec const& v);
+
+ /// Returns a unsigned integer value representing
+ /// the encoding of a floating-point value. The floatingpoint
+ /// value's bit-level representation is preserved.
+ ///
+ /// @see GLSL floatBitsToUint man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ GLM_FUNC_DECL uint floatBitsToUint(float const& v);
+
+ /// Returns a unsigned integer value representing
+ /// the encoding of a floating-point value. The floatingpoint
+ /// value's bit-level representation is preserved.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL floatBitsToUint man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec floatBitsToUint(vec const& v);
+
+ /// Returns a floating-point value corresponding to a signed
+ /// integer encoding of a floating-point value.
+ /// If an inf or NaN is passed in, it will not signal, and the
+ /// resulting floating point value is unspecified. Otherwise,
+ /// the bit-level representation is preserved.
+ ///
+ /// @see GLSL intBitsToFloat man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ GLM_FUNC_DECL float intBitsToFloat(int const& v);
+
+ /// Returns a floating-point value corresponding to a signed
+ /// integer encoding of a floating-point value.
+ /// If an inf or NaN is passed in, it will not signal, and the
+ /// resulting floating point value is unspecified. Otherwise,
+ /// the bit-level representation is preserved.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL intBitsToFloat man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec intBitsToFloat(vec const& v);
+
+ /// Returns a floating-point value corresponding to a
+ /// unsigned integer encoding of a floating-point value.
+ /// If an inf or NaN is passed in, it will not signal, and the
+ /// resulting floating point value is unspecified. Otherwise,
+ /// the bit-level representation is preserved.
+ ///
+ /// @see GLSL uintBitsToFloat man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
+
+ /// Returns a floating-point value corresponding to a
+ /// unsigned integer encoding of a floating-point value.
+ /// If an inf or NaN is passed in, it will not signal, and the
+ /// resulting floating point value is unspecified. Otherwise,
+ /// the bit-level representation is preserved.
+ ///
+ /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
+ /// @tparam Q Value from qualifier enum
+ ///
+ /// @see GLSL uintBitsToFloat man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL vec uintBitsToFloat(vec const& v);
+
+ /// Computes and returns a * b + c.
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL fma man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c);
+
+ /// Splits x into a floating-point significand in the range
+ /// [0.5, 1.0) and an integral exponent of two, such that:
+ /// x = significand * exp(2, exponent)
+ ///
+ /// The significand is returned by the function and the
+ /// exponent is returned in the parameter exp. For a
+ /// floating-point value of zero, the significant and exponent
+ /// are both zero. For a floating-point value that is an
+ /// infinity or is not a number, the results are undefined.
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL frexp man page
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType frexp(genType const& x, genIType& exp);
+
+ /// Builds a floating-point number from x and the
+ /// corresponding integral exponent of two in exp, returning:
+ /// significand * exp(2, exponent)
+ ///
+ /// If this product is too large to be represented in the
+ /// floating-point type, the result is undefined.
+ ///
+ /// @tparam genType Floating-point scalar or vector types.
+ ///
+ /// @see GLSL ldexp man page;
+ /// @see GLSL 4.20.8 specification, section 8.3 Common Functions
+ template
+ GLM_FUNC_DECL genType ldexp(genType const& x, genIType const& exp);
+
+ /// @}
+}//namespace glm
+
+#include "detail/func_common.inl"
+
diff --git a/ref/glm/glm/detail/_features.hpp b/ref/glm/glm/detail/_features.hpp
index d47eef69..43069514 100644
--- a/ref/glm/glm/detail/_features.hpp
+++ b/ref/glm/glm/detail/_features.hpp
@@ -1,6 +1,3 @@
-/// @ref core
-/// @file glm/detail/_features.hpp
-
#pragma once
// #define GLM_CXX98_EXCEPTIONS
@@ -26,7 +23,7 @@
// Variadic templates - GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
-//
+//
// Extending variadic template template parameters - GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
@@ -34,7 +31,7 @@
// Initializer lists - GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
-// #define GLM_CXX11_STATIC_ASSERT
+// #define GLM_CXX11_STATIC_ASSERT
// Static assertions - GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
@@ -62,15 +59,15 @@
// Declared type of an expression - GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
-//
+//
// Right angle brackets - GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
-//
+//
// Default template arguments for function templates DR226 GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
-//
+//
// Solving the SFINAE problem for expressions DR339 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html
@@ -78,7 +75,7 @@
// Template aliases N2258 GCC 4.7
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
-//
+//
// Extern templates N1987 Yes
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
@@ -90,19 +87,19 @@
// Strongly-typed enums N2347 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
-//
+//
// Forward declarations for enums N2764 GCC 4.6
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
-//
+//
// Generalized attributes N2761 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
-//
+//
// Generalized constant expressions N2235 GCC 4.6
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
-//
+//
// Alignment support N2341 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
@@ -110,7 +107,7 @@
// Delegating constructors N1986 GCC 4.7
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
-//
+//
// Inheriting constructors N2540 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
@@ -118,19 +115,19 @@
// Explicit conversion operators N2437 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
-//
+//
// New character types N2249 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html
-//
+//
// Unicode string literals N2442 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
-//
+//
// Raw string literals N2442 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
-//
+//
// Universal character name literals N2170 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
@@ -138,7 +135,7 @@
// User-defined literals N2765 GCC 4.7
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
-//
+//
// Standard Layout Types N2342 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
@@ -147,11 +144,11 @@
// Defaulted and deleted functions N2346 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
-//
+//
// Extended friend declarations N1791 GCC 4.7
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
-//
+//
// Extending sizeof N2253 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
@@ -177,7 +174,7 @@
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
-//
+//
// Minimal support for garbage collection and reachability-based leak detection N2670 No
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
@@ -185,75 +182,73 @@
// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only)
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
-//
+//
// Defining move special member functions N3053 GCC 4.6
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
-//
+//
// Sequence points N2239 Yes
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
-//
+//
// Atomic operations N2427 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
-//
+//
// Strong Compare and Exchange N2748 GCC 4.5
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
-//
+//
// Bidirectional Fences N2752 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm
-//
+//
// Memory model N2429 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm
-//
+//
// Data-dependency ordering: atomics and memory model N2664 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm
-//
+//
// Propagating exceptions N2179 GCC 4.4
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
-//
+//
// Abandoning a process and at_quick_exit N2440 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm
-//
+//
// Allow atomics use in signal handlers N2547 Yes
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm
-//
+//
// Thread-local storage N2659 GCC 4.8
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
-//
+//
// Dynamic initialization and destruction with concurrency N2660 GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm
-//
+//
// __func__ predefined identifier N2340 GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
-//
+//
// C99 preprocessor N1653 GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
-//
+//
// long long N1811 GCC 4.3
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
-//
+//
// Extended integral types N1988 Yes
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf
#if(GLM_COMPILER & GLM_COMPILER_GCC)
-# if(GLM_COMPILER >= GLM_COMPILER_GCC43)
-# define GLM_CXX11_STATIC_ASSERT
-# endif
+# define GLM_CXX11_STATIC_ASSERT
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
# if(__has_feature(cxx_exceptions))
diff --git a/ref/glm/glm/detail/_fixes.hpp b/ref/glm/glm/detail/_fixes.hpp
index 38c210c3..b1f06c2d 100644
--- a/ref/glm/glm/detail/_fixes.hpp
+++ b/ref/glm/glm/detail/_fixes.hpp
@@ -1,6 +1,3 @@
-/// @ref core
-/// @file glm/detail/_fixes.hpp
-
#include
//! Workaround for compatibility with other libraries
diff --git a/ref/glm/glm/detail/_noise.hpp b/ref/glm/glm/detail/_noise.hpp
index 3e5913d9..2a1285f0 100644
--- a/ref/glm/glm/detail/_noise.hpp
+++ b/ref/glm/glm/detail/_noise.hpp
@@ -1,107 +1,81 @@
-/// @ref core
-/// @file glm/detail/_noise.hpp
-
#pragma once
-#include "../vec2.hpp"
-#include "../vec3.hpp"
-#include "../vec4.hpp"
#include "../common.hpp"
namespace glm{
namespace detail
{
- template
- GLM_FUNC_QUALIFIER T mod289(T const & x)
+ template
+ GLM_FUNC_QUALIFIER T mod289(T const& x)
{
- return x - floor(x * static_cast(1.0) / static_cast(289.0)) * static_cast(289.0);
+ return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0);
}
- template
- GLM_FUNC_QUALIFIER T permute(T const & x)
+ template
+ GLM_FUNC_QUALIFIER T permute(T const& x)
{
return mod289(((x * static_cast(34)) + static_cast(1)) * x);
}
- template
- GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x)
+ template
+ GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
{
return mod289(((x * static_cast(34)) + static_cast(1)) * x);
}
-
- template
- GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x)
+
+ template
+ GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
{
return mod289(((x * static_cast(34)) + static_cast(1)) * x);
}
-
- template
- GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x)
+
+ template
+ GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
{
return mod289(((x * static_cast(34)) + static_cast(1)) * x);
}
-/*
- template class vecType>
- GLM_FUNC_QUALIFIER vecType permute(vecType const & x)
+
+ template
+ GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r)
{
- return mod289(((x * T(34)) + T(1)) * x);
+ return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r;
}
-*/
- template
- GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
+
+ template
+ GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
{
- return T(1.79284291400159) - T(0.85373472095314) * r;
+ return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r;
}
-
- template
- GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r)
+
+ template
+ GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
{
- return T(1.79284291400159) - T(0.85373472095314) * r;
+ return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r;
}
-
- template
- GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r)
+
+ template
+ GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
{
- return T(1.79284291400159) - T(0.85373472095314) * r;
+ return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r;
}
-
- template
- GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r)
+
+ template
+ GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
{
- return T(1.79284291400159) - T(0.85373472095314) * r;
+ return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10));
}
-/*
- template class vecType>
- GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r)
+
+ template
+ GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
{
- return T(1.79284291400159) - T(0.85373472095314) * r;
+ return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10));
}
-*/
-
- template
- GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t)
+
+ template
+ GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
{
- return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
+ return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10));
}
-
- template
- GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t)
- {
- return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
- }
-
- template
- GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t)
- {
- return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
- }
-/*
- template class vecType>
- GLM_FUNC_QUALIFIER vecType fade(vecType const & t)
- {
- return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
- }
-*/
}//namespace detail
}//namespace glm
diff --git a/ref/glm/glm/detail/_swizzle.hpp b/ref/glm/glm/detail/_swizzle.hpp
index 670e2690..67c66b14 100644
--- a/ref/glm/glm/detail/_swizzle.hpp
+++ b/ref/glm/glm/detail/_swizzle.hpp
@@ -1,13 +1,10 @@
-/// @ref core
-/// @file glm/detail/_swizzle.hpp
-
#pragma once
namespace glm{
namespace detail
{
// Internal class for implementing swizzle operators
- template
+ template
struct _swizzle_base0
{
protected:
@@ -16,48 +13,73 @@ namespace detail
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
// The size 1 buffer is assumed to aligned to the actual members so that the
- // elem()
+ // elem()
char _buffer[1];
};
- template class vecType, int E0, int E1, int E2, int E3, bool Aligned>
+ template
struct _swizzle_base1 : public _swizzle_base0
{
};
- template class vecType, int E0, int E1, bool Aligned>
- struct _swizzle_base1<2, T, P, vecType, E0,E1,-1,-2, Aligned> : public _swizzle_base0
+ template
+ struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0
{
- GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1)); }
+ GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); }
};
- template class vecType, int E0, int E1, int E2, bool Aligned>
- struct _swizzle_base1<3, T, P, vecType, E0,E1,E2,-1, Aligned> : public _swizzle_base0
+ template
+ struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0
{
- GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2)); }
+ GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); }
};
- template class vecType, int E0, int E1, int E2, int E3, bool Aligned>
- struct _swizzle_base1<4, T, P, vecType, E0,E1,E2,E3, Aligned> : public _swizzle_base0
- {
- GLM_FUNC_QUALIFIER vecType operator ()() const { return vecType(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
+ template
+ struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0
+ {
+ GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
};
// Internal class for implementing swizzle operators
/*
Template parameters:
- ValueType = type of scalar values (e.g. float, double)
- VecType = class the swizzle is applies to (e.g. tvec3)
- N = number of components in the vector (e.g. 3)
- E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec
+ T = type of scalar values (e.g. float, double)
+ N = number of components in the vector (e.g. 3)
+ E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec
DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles
- containing duplicate elements so that they cannot be used as r-values).
+ containing duplicate elements so that they cannot be used as r-values).
*/
- template class vecType, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS>
- struct _swizzle_base2 : public _swizzle_base1::value>
+ template
+ struct _swizzle_base2 : public _swizzle_base1::value>
{
+ struct op_equal
+ {
+ GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; }
+ };
+
+ struct op_minus
+ {
+ GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; }
+ };
+
+ struct op_plus
+ {
+ GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; }
+ };
+
+ struct op_mul
+ {
+ GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; }
+ };
+
+ struct op_div
+ {
+ GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; }
+ };
+
+ public:
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t)
{
for (int i = 0; i < N; ++i)
@@ -65,45 +87,30 @@ namespace detail
return *this;
}
- GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vecType const& that)
+ GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that)
{
- struct op {
- GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; }
- };
- _apply_op(that, op());
+ _apply_op(that, op_equal());
return *this;
}
- GLM_FUNC_QUALIFIER void operator -= (vecType const& that)
+ GLM_FUNC_QUALIFIER void operator -= (vec const& that)
{
- struct op {
- GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; }
- };
- _apply_op(that, op());
+ _apply_op(that, op_minus());
}
- GLM_FUNC_QUALIFIER void operator += (vecType const& that)
+ GLM_FUNC_QUALIFIER void operator += (vec const& that)
{
- struct op {
- GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; }
- };
- _apply_op(that, op());
+ _apply_op(that, op_plus());
}
- GLM_FUNC_QUALIFIER void operator *= (vecType const& that)
+ GLM_FUNC_QUALIFIER void operator *= (vec const& that)
{
- struct op {
- GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; }
- };
- _apply_op(that, op());
+ _apply_op(that, op_mul());
}
- GLM_FUNC_QUALIFIER void operator /= (vecType const& that)
+ GLM_FUNC_QUALIFIER void operator /= (vec const& that)
{
- struct op {
- GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; }
- };
- _apply_op(that, op());
+ _apply_op(that, op_div());
}
GLM_FUNC_QUALIFIER T& operator[](size_t i)
@@ -118,8 +125,8 @@ namespace detail
}
protected:
- template
- GLM_FUNC_QUALIFIER void _apply_op(vecType const& that, U op)
+ template
+ GLM_FUNC_QUALIFIER void _apply_op(vec const& that, const U& op)
{
// Make a copy of the data in this == &that.
// The copier should optimize out the copy in cases where the function is
@@ -133,12 +140,12 @@ namespace detail
};
// Specialization for swizzles containing duplicate elements. These cannot be modified.
- template class vecType, int E0, int E1, int E2, int E3>
- struct _swizzle_base2 : public _swizzle_base1::value>
+ template
+ struct _swizzle_base2 : public _swizzle_base1::value>
{
struct Stub {};
- GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; }
+ GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
GLM_FUNC_QUALIFIER T operator[] (size_t i) const
{
@@ -147,40 +154,40 @@ namespace detail
}
};
- template class vecType, int E0, int E1, int E2, int E3>
- struct _swizzle : public _swizzle_base2
+ template
+ struct _swizzle : public _swizzle_base2
{
- typedef _swizzle_base2 base_type;
+ typedef _swizzle_base2 base_type;
using base_type::operator=;
- GLM_FUNC_QUALIFIER operator vecType () const { return (*this)(); }
+ GLM_FUNC_QUALIFIER operator vec () const { return (*this)(); }
};
//
// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros
//
-#define _GLM_SWIZZLE_TEMPLATE1 template class vecType, int E0, int E1, int E2, int E3>
-#define _GLM_SWIZZLE_TEMPLATE2 template class vecType, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3>
-#define _GLM_SWIZZLE_TYPE1 _swizzle
-#define _GLM_SWIZZLE_TYPE2 _swizzle
+#define GLM_SWIZZLE_TEMPLATE1 template
+#define GLM_SWIZZLE_TEMPLATE2 template