Merge branch '0.9.2' into 0.9.3

This commit is contained in:
Christophe Riccio 2011-05-27 00:38:58 +01:00
commit fc8a5d4c0a
5 changed files with 24 additions and 7 deletions

View file

@ -149,13 +149,10 @@
// G++
#elif defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
# if defined (__llvm__)
# pragma message("LLVM")
# define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_LLVM
# elif defined (__clang__)
# pragma message("CLANG")
# define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_CLANG
# else
# pragma message("GCC")
# define GLM_COMPILER_GCC_EXTRA 0
# endif
#

View file

@ -80,6 +80,11 @@ namespace detail
detail::tquat<T> operator- (
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> operator+ (
detail::tquat<T> const & q,
detail::tquat<T> const & p);
template <typename T>
detail::tquat<T> operator* (
detail::tquat<T> const & q,
@ -160,7 +165,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
detail::tquat<T> mix(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
typename detail::tquat<T>::value_type const & a);
T const & a);
//! Returns the q conjugate.
//! From GLM_GTC_quaternion extension.

View file

@ -156,6 +156,20 @@ namespace detail{
return detail::tquat<T>(-q.w, -q.x, -q.y, -q.z);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator+
(
detail::tquat<T> const & q,
detail::tquat<T> const & p
)
{
return detail::tquat<T>(
q.w + p.w,
q.x + p.x,
q.y + p.y,
q.z + p.z);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator*
(

View file

@ -49,9 +49,10 @@ namespace integer
template <typename genType>
GLM_FUNC_QUALIFIER genType factorial(genType const & x)
{
genType Temp = x;
genType Result;
for(Result = 1; x > 1; --x)
Result *= x;
for(Result = 1; Temp > 1; --Temp)
Result *= Temp;
return Result;
}

View file

@ -27,7 +27,7 @@ int test_quat_slerp()
glm::quat B(90.0f, glm::vec3(0, 0, 1));
glm::quat C = glm::mix(A, B, 0.5f);
Error += C != glm::quat(45.f, glm::vec3(0, 0, 1)) ? 0 : 1;
Error += C == glm::quat(45.f, glm::vec3(0, 0, 1)) ? 0 : 1;
return Error;
}