diff --git a/glm/CMakeLists.txt b/glm/CMakeLists.txt index a52d336a..1b9ac8e1 100644 --- a/glm/CMakeLists.txt +++ b/glm/CMakeLists.txt @@ -1,4 +1,4 @@ -set(NAME glm) +set(NAME glm_dummy) file(GLOB ROOT_SOURCE *.cpp) file(GLOB ROOT_INLINE *.inl) @@ -38,8 +38,11 @@ source_group("VIRTREV Files" FILES ${VIRTREV_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) add_executable(${NAME} ${ROOT_TEXT} - ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} - ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${VIRTREV_SOURCE} ${VIRTREV_INLINE} ${VIRTREV_HEADER}) + +add_library(glm STATIC glm.cpp) +add_library(glm_shared SHARED glm.cpp) diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index f409cdf8..0cdd070b 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -562,11 +562,11 @@ namespace detail - this->value[0][0] * SubFactor14 + this->value[0][1] * SubFactor16 - this->value[0][3] * SubFactor18, + this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18); - value_type Determinant = + T Determinant = T( + this->value[0][0] * Inverse[0][0] + this->value[0][1] * Inverse[1][0] + this->value[0][2] * Inverse[2][0] - + this->value[0][3] * Inverse[3][0]; + + this->value[0][3] * Inverse[3][0]); Inverse /= Determinant; return Inverse; diff --git a/glm/glm.cpp b/glm/glm.cpp new file mode 100644 index 00000000..23a1dbd7 --- /dev/null +++ b/glm/glm.cpp @@ -0,0 +1,546 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2013 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/glm.cpp +/// @date 2013-04-22 / 2013-04-22 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +namespace glm{ +namespace detail +{ +// tvec1 type explicit instantiation +/* +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; + +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; + +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +template struct tvec1; +*/ +// tvec2 type explicit instantiation +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; + +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; + +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; + +// tvec3 type explicit instantiation +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; + +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; + +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; + +// tvec4 type explicit instantiation +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; + +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; + +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; + +// tmat2x2 type explicit instantiation +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; + +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; + +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; + +// tmat2x3 type explicit instantiation +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; + +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; + +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; + +// tmat2x4 type explicit instantiation +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; + +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; + +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; + +// tmat3x2 type explicit instantiation +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; + +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; + +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; + +// tmat3x3 type explicit instantiation +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; + +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; + +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; + +// tmat3x4 type explicit instantiation +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; + +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; + +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; + +// tmat4x2 type explicit instantiation +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; + +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; + +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; + +// tmat4x3 type explicit instantiation +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; + +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; + +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; + +// tmat4x4 type explicit instantiation +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; + +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; + +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; + +// tquat type explicit instantiation +template struct tquat; +template struct tquat; +template struct tquat; + +template struct tquat; +template struct tquat; +template struct tquat; + +template struct tquat; +template struct tquat; +template struct tquat; + +//tdualquat type explicit instantiation +template struct tdualquat; +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; +template struct tdualquat; + +}//namespace detail +}//namespace glm + diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index ed430ee1..6c2e7ffe 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -70,10 +70,10 @@ namespace detail ) : real(q), dual( - -0.5f*( p.x*q.x + p.y*q.y + p.z*q.z), - 0.5f*( p.x*q.w + p.y*q.z - p.z*q.y), - 0.5f*(-p.x*q.z + p.y*q.w + p.z*q.x), - 0.5f*( p.x*q.y - p.y*q.x + p.z*q.w)) + T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), + T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), + T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), + T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) {} ////////////////////////////////////////////////////////////// @@ -378,20 +378,20 @@ namespace detail detail::tquat real; T const trace = x[0].x + x[1].y + x[2].z; - if(trace > detail::tdualquat::value_type(0)) + if(trace > T(0)) { - T const r = sqrt(detail::tdualquat::value_type(1) + trace); - T const invr = detail::tdualquat::value_type(0.5) / r; - real.w = detail::tdualquat::value_type(0.5) * r; + T const r = sqrt(T(1) + trace); + T const invr = T(0.5) / r; + real.w = T(0.5) * r; real.x = (x[2].y - x[1].z) * invr; real.y = (x[0].z - x[2].x) * invr; real.z = (x[1].x - x[0].y) * invr; } else if(x[0].x > x[1].y && x[0].x > x[2].z) { - T const r = sqrt(detail::tdualquat::value_type(1) + x[0].x - x[1].y - x[2].z); - T const invr = detail::tdualquat::value_type(0.5) / r; - real.x = detail::tdualquat::value_type(0.5)*r; + T const r = sqrt(T(1) + x[0].x - x[1].y - x[2].z); + T const invr = T(0.5) / r; + real.x = T(0.5)*r; real.y = (x[1].x + x[0].y) * invr; real.z = (x[0].z + x[2].x) * invr; real.w = (x[2].y - x[1].z) * invr;