Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Yuri Kilochek
2018-01-07 00:02:24 +03:00
11 changed files with 53 additions and 16 deletions

View File

@@ -508,6 +508,22 @@
# define GLM_HAS_OPENMP 0
#endif
///////////////////////////////////////////////////////////////////////////////////
// nullptr
//
#if GLM_LANG & GLM_LANG_CXX0X_FLAG
# define GLM_HAS_NULLPTR 1
#else
# define GLM_HAS_NULLPTR 0
#endif
#if GLM_HAS_NULLPTR
# define GLM_NULLPTR nullptr
#else
# define GLM_NULLPTR 0
#endif
///////////////////////////////////////////////////////////////////////////////////
// Static assert

View File

@@ -142,6 +142,9 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator+(tquat<T, Q> const& q, tquat<T, Q> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator-(tquat<T, Q> const& q, tquat<T, Q> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator*(tquat<T, Q> const& q, tquat<T, Q> const& p);

View File

@@ -200,7 +200,7 @@ namespace detail
return mat3_cast(*this);
}
template<typename T, qualifier Q>
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::operator mat<4, 4, T, Q>()
{
return mat4_cast(*this);
@@ -308,6 +308,12 @@ namespace detail
return tquat<T, Q>(q) += p;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator-(tquat<T, Q> const& q, tquat<T, Q> const& p)
{
return tquat<T, Q>(q) -= p;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator*(tquat<T, Q> const& q, tquat<T, Q> const& p)
{

View File

@@ -340,13 +340,12 @@ namespace detail
template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius)
{
T z = linearRand(T(-1), T(1));
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
T theta = linearRand(T(0), T(6.283185307179586476925286766559f));
T phi = std::acos(linearRand(T(-1.0f), T(1.0f)));
T r = sqrt(T(1) - z * z);
T x = r * std::cos(a);
T y = r * std::sin(a);
T x = std::sin(phi) * std::cos(theta);
T y = std::sin(phi) * std::sin(theta);
T z = std::cos(phi);
return vec<3, T, defaultp>(x, y, z) * Radius;
}

View File

@@ -44,13 +44,13 @@ namespace glm
typename genType::value_type & intersectionDistance);
//! Compute the intersection of a ray and a triangle.
/// Based om Tomas M<EFBFBD>ller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/
/// Based om Tomas Möller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/
//! From GLM_GTX_intersect extension.
template<typename T, qualifier Q>
GLM_FUNC_DECL bool intersectRayTriangle(
vec<3, T, Q> const& orig, vec<3, T, Q> const& dir,
vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, vec<3, T, Q> const& v2,
vec<3, T, Q>& baryPosition, T& distance);
vec<2, T, Q>& baryPosition, T& distance);
//! Compute the intersection of a line and a triangle.
//! From GLM_GTX_intersect extension.

View File

@@ -9,7 +9,7 @@
///
/// Include <glm/gtx/matrix_interpolation.hpp> to use the features of this extension.
///
/// Allows to directly interpolate two exiciting matrices.
/// Allows to directly interpolate two matrices.
#pragma once

View File

@@ -25,7 +25,7 @@ namespace detail
char text[STRING_BUFFER];
va_list list;
if(msg == 0)
if(msg == GLM_NULLPTR)
return std::string();
va_start(list, msg);