LIBS: updated glm
parent
2c0caeb053
commit
21151c8acc
|
@ -18,9 +18,9 @@ namespace detail
|
|||
{
|
||||
mat<4, 4, float, Q> Result;
|
||||
glm_mat4_matrixCompMult(
|
||||
*static_cast<glm_vec4 const (*)[4]>(&x[0].data),
|
||||
*static_cast<glm_vec4 const (*)[4]>(&y[0].data),
|
||||
*static_cast<glm_vec4(*)[4]>(&Result[0].data));
|
||||
&x[0].data,
|
||||
&y[0].data,
|
||||
&Result[0].data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
@ -121,8 +121,10 @@ namespace glm {
|
|||
}
|
||||
#endif // CXX11
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<qualifier Q>
|
||||
struct detail::compute_inverse<4, 4, float, Q, true>
|
||||
struct compute_inverse<4, 4, float, Q, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m)
|
||||
{
|
||||
|
@ -245,5 +247,6 @@ namespace glm {
|
|||
return r;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
#endif
|
||||
|
|
|
@ -144,7 +144,6 @@ namespace detail
|
|||
typedef glm_u64vec2 type;
|
||||
};
|
||||
# endif
|
||||
|
||||
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)
|
||||
template<>
|
||||
struct storage<4, double, true>
|
||||
|
|
|
@ -434,7 +434,7 @@
|
|||
#if defined(GLM_FORCE_INLINE)
|
||||
# if GLM_COMPILER & GLM_COMPILER_VC
|
||||
# define GLM_INLINE __forceinline
|
||||
# define GLM_NEVER_INLINE __declspec((noinline))
|
||||
# define GLM_NEVER_INLINE __declspec(noinline)
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
|
||||
# define GLM_INLINE inline __attribute__((__always_inline__))
|
||||
# define GLM_NEVER_INLINE __attribute__((__noinline__))
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace glm
|
|||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m)
|
||||
# if GLM_HAS_INITIALIZER_LISTS
|
||||
: value{m[0], m[1]}
|
||||
: value{col_type(m[0]), col_type(m[1])}
|
||||
# endif
|
||||
{
|
||||
# if !GLM_HAS_INITIALIZER_LISTS
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace glm
|
|||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m)
|
||||
# if GLM_HAS_INITIALIZER_LISTS
|
||||
: value{m.value[0], m.value[1]}
|
||||
: value{col_type(m[0]), col_type(m[1])}
|
||||
# endif
|
||||
{
|
||||
# if !GLM_HAS_INITIALIZER_LISTS
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace glm
|
|||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m)
|
||||
# if GLM_HAS_INITIALIZER_LISTS
|
||||
: value{m[0], m[1]}
|
||||
: value{col_type(m[0]), col_type(m[1])}
|
||||
# endif
|
||||
{
|
||||
# if !GLM_HAS_INITIALIZER_LISTS
|
||||
|
|
|
@ -14,10 +14,10 @@ namespace detail
|
|||
// SSE2 STATS: 11 shuffle, 8 mul, 8 add
|
||||
// SSE4 STATS: 3 shuffle, 4 mul, 4 dpps
|
||||
|
||||
__m128 const mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3)));
|
||||
__m128 const mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2)));
|
||||
__m128 const mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1)));
|
||||
__m128 const mul3 = _mm_mul_ps(q1.Data, q2.Data);
|
||||
__m128 const mul0 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(0, 1, 2, 3)));
|
||||
__m128 const mul1 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(1, 0, 3, 2)));
|
||||
__m128 const mul2 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(2, 3, 0, 1)));
|
||||
__m128 const mul3 = _mm_mul_ps(q1.data, q2.data);
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
__m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff);
|
||||
|
@ -89,7 +89,7 @@ namespace detail
|
|||
{
|
||||
static qua<float, Q> call(qua<float, Q> const& q, qua<float, Q> const& p)
|
||||
{
|
||||
vec<4, float, Q> Result;
|
||||
qua<float, Q> Result;
|
||||
Result.data = _mm_sub_ps(q.data, p.data);
|
||||
return Result;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ namespace detail
|
|||
uuv = _mm_mul_ps(uuv, two);
|
||||
|
||||
vec<4, float, Q> Result;
|
||||
Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv));
|
||||
Result.data = _mm_add_ps(v.data, _mm_add_ps(uv, uuv));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
@ -185,4 +185,3 @@ namespace detail
|
|||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace glm
|
|||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v)
|
||||
{
|
||||
this->x |= U(v.x);
|
||||
this->x |= static_cast<T>(v.x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace glm
|
|||
template<typename X, typename Y, typename Z, typename W>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
|
||||
template<typename X, typename Y, typename Z, typename W>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
|
||||
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
|
|
|
@ -499,7 +499,7 @@ namespace detail {
|
|||
vec<4, int, Q>
|
||||
call(vec<4, int, Q> const& a, vec<4, int, Q> const& b)
|
||||
{
|
||||
vec<4, uint, Q> Result;
|
||||
vec<4, int, Q> Result;
|
||||
Result.data = vaddq_s32(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
|
@ -593,7 +593,7 @@ namespace detail {
|
|||
cmp = vpminq_u32(cmp, cmp);
|
||||
uint32_t r = cmp[0];
|
||||
#else
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp));
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp));
|
||||
cmpx2 = vpmin_u32(cmpx2, cmpx2);
|
||||
uint32_t r = cmpx2[0];
|
||||
#endif
|
||||
|
@ -612,7 +612,7 @@ namespace detail {
|
|||
cmp = vpminq_u32(cmp, cmp);
|
||||
uint32_t r = cmp[0];
|
||||
#else
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp));
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp));
|
||||
cmpx2 = vpmin_u32(cmpx2, cmpx2);
|
||||
uint32_t r = cmpx2[0];
|
||||
#endif
|
||||
|
@ -631,7 +631,7 @@ namespace detail {
|
|||
cmp = vpminq_u32(cmp, cmp);
|
||||
uint32_t r = cmp[0];
|
||||
#else
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp));
|
||||
uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp));
|
||||
cmpx2 = vpmin_u32(cmpx2, cmpx2);
|
||||
uint32_t r = cmpx2[0];
|
||||
#endif
|
||||
|
|
|
@ -125,8 +125,8 @@ namespace glm
|
|||
mat<4, 4, T, defaultp> Result(0);
|
||||
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
|
||||
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
|
||||
Result[2][0] = (right + left) / (right - left);
|
||||
Result[2][1] = (top + bottom) / (top - bottom);
|
||||
Result[2][0] = -(right + left) / (right - left);
|
||||
Result[2][1] = -(top + bottom) / (top - bottom);
|
||||
Result[2][2] = farVal / (farVal - nearVal);
|
||||
Result[2][3] = static_cast<T>(1);
|
||||
Result[3][2] = -(farVal * nearVal) / (farVal - nearVal);
|
||||
|
@ -139,8 +139,8 @@ namespace glm
|
|||
mat<4, 4, T, defaultp> Result(0);
|
||||
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
|
||||
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
|
||||
Result[2][0] = (right + left) / (right - left);
|
||||
Result[2][1] = (top + bottom) / (top - bottom);
|
||||
Result[2][0] = -(right + left) / (right - left);
|
||||
Result[2][1] = -(top + bottom) / (top - bottom);
|
||||
Result[2][2] = (farVal + nearVal) / (farVal - nearVal);
|
||||
Result[2][3] = static_cast<T>(1);
|
||||
Result[3][2] = - (static_cast<T>(2) * farVal * nearVal) / (farVal - nearVal);
|
||||
|
|
|
@ -95,7 +95,34 @@ namespace glm
|
|||
GLM_FUNC_DECL mat<4, 4, T, Q> scale(
|
||||
mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v);
|
||||
|
||||
/// Build a right handed look at view matrix.
|
||||
/// Builds a scale 4 * 4 matrix created from point referent 3 shearers.
|
||||
///
|
||||
/// @param m Input matrix multiplied by this shear matrix.
|
||||
/// @param p Point of shearing as reference.
|
||||
/// @param l_x Ratio of matrix.x projection in YZ plane relative to the y-axis/z-axis.
|
||||
/// @param l_y Ratio of matrix.y projection in XZ plane relative to the x-axis/z-axis.
|
||||
/// @param l_z Ratio of matrix.z projection in XY plane relative to the x-axis/y-axis.
|
||||
///
|
||||
/// as example:
|
||||
/// [1 , l_xy, l_xz, -(l_xy+l_xz) * p_x] [x] T
|
||||
/// [x`, y`, z`, w`] = [x`, y`, z`, w`] * [l_yx, 1 , l_yz, -(l_yx+l_yz) * p_y] [y]
|
||||
/// [l_zx, l_zy, 1 , -(l_zx+l_zy) * p_z] [z]
|
||||
/// [0 , 0 , 0 , 1 ] [w]
|
||||
///
|
||||
/// @tparam T A floating-point shear type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
///
|
||||
/// @see - shear(mat<4, 4, T, Q> const& m, T x, T y, T z)
|
||||
/// @see - shear(vec<3, T, Q> const& p)
|
||||
/// @see - shear(vec<2, T, Q> const& l_x)
|
||||
/// @see - shear(vec<2, T, Q> const& l_y)
|
||||
/// @see - shear(vec<2, T, Q> const& l_z)
|
||||
/// @see no resource...
|
||||
template <typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(
|
||||
mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z);
|
||||
|
||||
/// Build a right handed look at view matrix.
|
||||
///
|
||||
/// @param eye Position of the camera
|
||||
/// @param center Position where the camera is looking at
|
||||
|
|
|
@ -95,6 +95,60 @@ namespace glm
|
|||
return m * Result;
|
||||
}
|
||||
|
||||
template <typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z)
|
||||
{
|
||||
T const lambda_xy = l_x[0];
|
||||
T const lambda_xz = l_x[1];
|
||||
T const lambda_yx = l_y[0];
|
||||
T const lambda_yz = l_y[1];
|
||||
T const lambda_zx = l_z[0];
|
||||
T const lambda_zy = l_z[1];
|
||||
|
||||
vec<3, T, Q> point_lambda = vec<3, T, Q>(
|
||||
(lambda_xy + lambda_xz), (lambda_yx + lambda_yz), (lambda_zx + lambda_zy)
|
||||
);
|
||||
|
||||
mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>(
|
||||
1 , lambda_yx , lambda_zx , 0,
|
||||
lambda_xy , 1 , lambda_zy , 0,
|
||||
lambda_xz , lambda_yz , 1 , 0,
|
||||
-point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1
|
||||
);
|
||||
|
||||
mat<4, 4, T, Q> Result;
|
||||
Result[0] = Shear[0] * m[0][0] + Shear[1] * m[0][1] + Shear[2] * m[0][2] + Shear[3] * m[0][3];
|
||||
Result[1] = Shear[0] * m[1][0] + Shear[1] * m[1][1] + Shear[2] * m[1][2] + Shear[3] * m[1][3];
|
||||
Result[2] = Shear[0] * m[2][0] + Shear[1] * m[2][1] + Shear[2] * m[2][2] + Shear[3] * m[2][3];
|
||||
Result[3] = Shear[0] * m[3][0] + Shear[1] * m[3][1] + Shear[2] * m[3][2] + Shear[3] * m[3][3];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear_slow(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z)
|
||||
{
|
||||
T const lambda_xy = static_cast<T>(l_x[0]);
|
||||
T const lambda_xz = static_cast<T>(l_x[1]);
|
||||
T const lambda_yx = static_cast<T>(l_y[0]);
|
||||
T const lambda_yz = static_cast<T>(l_y[1]);
|
||||
T const lambda_zx = static_cast<T>(l_z[0]);
|
||||
T const lambda_zy = static_cast<T>(l_z[1]);
|
||||
|
||||
vec<3, T, Q> point_lambda = vec<3, T, Q>(
|
||||
static_cast<T>(lambda_xy + lambda_xz),
|
||||
static_cast<T>(lambda_yx + lambda_yz),
|
||||
static_cast<T>(lambda_zx + lambda_zy)
|
||||
);
|
||||
|
||||
mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>(
|
||||
1 , lambda_yx , lambda_zx , 0,
|
||||
lambda_xy , 1 , lambda_zy , 0,
|
||||
lambda_xz , lambda_yz , 1 , 0,
|
||||
-point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1
|
||||
);
|
||||
return m * Shear;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up)
|
||||
{
|
||||
|
|
|
@ -620,13 +620,13 @@ namespace glm
|
|||
typedef mat<4, 4, f32, highp> highp_mat4x4;
|
||||
|
||||
typedef mat<2, 2, f32, defaultp> mat2x2;
|
||||
typedef mat<3, 2, f32, defaultp> mat3x2;
|
||||
typedef mat<4, 2, f32, defaultp> mat4x2;
|
||||
typedef mat<2, 3, f32, defaultp> mat2x3;
|
||||
typedef mat<3, 3, f32, defaultp> mat3x3;
|
||||
typedef mat<4, 3, f32, defaultp> mat4x3;
|
||||
typedef mat<2, 4, f32, defaultp> mat2x4;
|
||||
typedef mat<3, 2, f32, defaultp> mat3x2;
|
||||
typedef mat<3, 3, f32, defaultp> mat3x3;
|
||||
typedef mat<3, 4, f32, defaultp> mat3x4;
|
||||
typedef mat<4, 2, f32, defaultp> mat4x2;
|
||||
typedef mat<4, 3, f32, defaultp> mat4x3;
|
||||
typedef mat<4, 4, f32, defaultp> mat4x4;
|
||||
|
||||
typedef mat<2, 2, f32, lowp> lowp_fmat2x2;
|
||||
|
@ -660,13 +660,13 @@ namespace glm
|
|||
typedef mat<4, 4, f32, highp> highp_fmat4x4;
|
||||
|
||||
typedef mat<2, 2, f32, defaultp> fmat2x2;
|
||||
typedef mat<3, 2, f32, defaultp> fmat3x2;
|
||||
typedef mat<4, 2, f32, defaultp> fmat4x2;
|
||||
typedef mat<2, 3, f32, defaultp> fmat2x3;
|
||||
typedef mat<3, 3, f32, defaultp> fmat3x3;
|
||||
typedef mat<4, 3, f32, defaultp> fmat4x3;
|
||||
typedef mat<2, 4, f32, defaultp> fmat2x4;
|
||||
typedef mat<3, 2, f32, defaultp> fmat3x2;
|
||||
typedef mat<3, 3, f32, defaultp> fmat3x3;
|
||||
typedef mat<3, 4, f32, defaultp> fmat3x4;
|
||||
typedef mat<4, 2, f32, defaultp> fmat4x2;
|
||||
typedef mat<4, 3, f32, defaultp> fmat4x3;
|
||||
typedef mat<4, 4, f32, defaultp> fmat4x4;
|
||||
|
||||
typedef mat<2, 2, f32, lowp> lowp_f32mat2x2;
|
||||
|
@ -700,13 +700,13 @@ namespace glm
|
|||
typedef mat<4, 4, f32, highp> highp_f32mat4x4;
|
||||
|
||||
typedef mat<2, 2, f32, defaultp> f32mat2x2;
|
||||
typedef mat<3, 2, f32, defaultp> f32mat3x2;
|
||||
typedef mat<4, 2, f32, defaultp> f32mat4x2;
|
||||
typedef mat<2, 3, f32, defaultp> f32mat2x3;
|
||||
typedef mat<3, 3, f32, defaultp> f32mat3x3;
|
||||
typedef mat<4, 3, f32, defaultp> f32mat4x3;
|
||||
typedef mat<2, 4, f32, defaultp> f32mat2x4;
|
||||
typedef mat<3, 2, f32, defaultp> f32mat3x2;
|
||||
typedef mat<3, 3, f32, defaultp> f32mat3x3;
|
||||
typedef mat<3, 4, f32, defaultp> f32mat3x4;
|
||||
typedef mat<4, 2, f32, defaultp> f32mat4x2;
|
||||
typedef mat<4, 3, f32, defaultp> f32mat4x3;
|
||||
typedef mat<4, 4, f32, defaultp> f32mat4x4;
|
||||
|
||||
typedef mat<2, 2, double, lowp> lowp_dmat2x2;
|
||||
|
@ -740,13 +740,13 @@ namespace glm
|
|||
typedef mat<4, 4, double, highp> highp_dmat4x4;
|
||||
|
||||
typedef mat<2, 2, double, defaultp> dmat2x2;
|
||||
typedef mat<3, 2, double, defaultp> dmat3x2;
|
||||
typedef mat<4, 2, double, defaultp> dmat4x2;
|
||||
typedef mat<2, 3, double, defaultp> dmat2x3;
|
||||
typedef mat<3, 3, double, defaultp> dmat3x3;
|
||||
typedef mat<4, 3, double, defaultp> dmat4x3;
|
||||
typedef mat<2, 4, double, defaultp> dmat2x4;
|
||||
typedef mat<3, 2, double, defaultp> dmat3x2;
|
||||
typedef mat<3, 3, double, defaultp> dmat3x3;
|
||||
typedef mat<3, 4, double, defaultp> dmat3x4;
|
||||
typedef mat<4, 2, double, defaultp> dmat4x2;
|
||||
typedef mat<4, 3, double, defaultp> dmat4x3;
|
||||
typedef mat<4, 4, double, defaultp> dmat4x4;
|
||||
|
||||
typedef mat<2, 2, f64, lowp> lowp_f64mat2x2;
|
||||
|
@ -780,13 +780,13 @@ namespace glm
|
|||
typedef mat<4, 4, f64, highp> highp_f64mat4x4;
|
||||
|
||||
typedef mat<2, 2, f64, defaultp> f64mat2x2;
|
||||
typedef mat<3, 2, f64, defaultp> f64mat3x2;
|
||||
typedef mat<4, 2, f64, defaultp> f64mat4x2;
|
||||
typedef mat<2, 3, f64, defaultp> f64mat2x3;
|
||||
typedef mat<3, 3, f64, defaultp> f64mat3x3;
|
||||
typedef mat<4, 3, f64, defaultp> f64mat4x3;
|
||||
typedef mat<2, 4, f64, defaultp> f64mat2x4;
|
||||
typedef mat<3, 2, f64, defaultp> f64mat3x2;
|
||||
typedef mat<3, 3, f64, defaultp> f64mat3x3;
|
||||
typedef mat<3, 4, f64, defaultp> f64mat3x4;
|
||||
typedef mat<4, 2, f64, defaultp> f64mat4x2;
|
||||
typedef mat<4, 3, f64, defaultp> f64mat4x3;
|
||||
typedef mat<4, 4, f64, defaultp> f64mat4x4;
|
||||
|
||||
// Signed integer matrix MxN
|
||||
|
@ -822,13 +822,13 @@ namespace glm
|
|||
typedef mat<4, 4, int, highp> highp_imat4x4;
|
||||
|
||||
typedef mat<2, 2, int, defaultp> imat2x2;
|
||||
typedef mat<3, 2, int, defaultp> imat3x2;
|
||||
typedef mat<4, 2, int, defaultp> imat4x2;
|
||||
typedef mat<2, 3, int, defaultp> imat2x3;
|
||||
typedef mat<3, 3, int, defaultp> imat3x3;
|
||||
typedef mat<4, 3, int, defaultp> imat4x3;
|
||||
typedef mat<2, 4, int, defaultp> imat2x4;
|
||||
typedef mat<3, 2, int, defaultp> imat3x2;
|
||||
typedef mat<3, 3, int, defaultp> imat3x3;
|
||||
typedef mat<3, 4, int, defaultp> imat3x4;
|
||||
typedef mat<4, 2, int, defaultp> imat4x2;
|
||||
typedef mat<4, 3, int, defaultp> imat4x3;
|
||||
typedef mat<4, 4, int, defaultp> imat4x4;
|
||||
|
||||
|
||||
|
@ -863,13 +863,13 @@ namespace glm
|
|||
typedef mat<4, 4, int8, highp> highp_i8mat4x4;
|
||||
|
||||
typedef mat<2, 2, int8, defaultp> i8mat2x2;
|
||||
typedef mat<3, 2, int8, defaultp> i8mat3x2;
|
||||
typedef mat<4, 2, int8, defaultp> i8mat4x2;
|
||||
typedef mat<2, 3, int8, defaultp> i8mat2x3;
|
||||
typedef mat<3, 3, int8, defaultp> i8mat3x3;
|
||||
typedef mat<4, 3, int8, defaultp> i8mat4x3;
|
||||
typedef mat<2, 4, int8, defaultp> i8mat2x4;
|
||||
typedef mat<3, 2, int8, defaultp> i8mat3x2;
|
||||
typedef mat<3, 3, int8, defaultp> i8mat3x3;
|
||||
typedef mat<3, 4, int8, defaultp> i8mat3x4;
|
||||
typedef mat<4, 2, int8, defaultp> i8mat4x2;
|
||||
typedef mat<4, 3, int8, defaultp> i8mat4x3;
|
||||
typedef mat<4, 4, int8, defaultp> i8mat4x4;
|
||||
|
||||
|
||||
|
@ -904,13 +904,13 @@ namespace glm
|
|||
typedef mat<4, 4, int16, highp> highp_i16mat4x4;
|
||||
|
||||
typedef mat<2, 2, int16, defaultp> i16mat2x2;
|
||||
typedef mat<3, 2, int16, defaultp> i16mat3x2;
|
||||
typedef mat<4, 2, int16, defaultp> i16mat4x2;
|
||||
typedef mat<2, 3, int16, defaultp> i16mat2x3;
|
||||
typedef mat<3, 3, int16, defaultp> i16mat3x3;
|
||||
typedef mat<4, 3, int16, defaultp> i16mat4x3;
|
||||
typedef mat<2, 4, int16, defaultp> i16mat2x4;
|
||||
typedef mat<3, 2, int16, defaultp> i16mat3x2;
|
||||
typedef mat<3, 3, int16, defaultp> i16mat3x3;
|
||||
typedef mat<3, 4, int16, defaultp> i16mat3x4;
|
||||
typedef mat<4, 2, int16, defaultp> i16mat4x2;
|
||||
typedef mat<4, 3, int16, defaultp> i16mat4x3;
|
||||
typedef mat<4, 4, int16, defaultp> i16mat4x4;
|
||||
|
||||
|
||||
|
@ -945,13 +945,13 @@ namespace glm
|
|||
typedef mat<4, 4, int32, highp> highp_i32mat4x4;
|
||||
|
||||
typedef mat<2, 2, int32, defaultp> i32mat2x2;
|
||||
typedef mat<3, 2, int32, defaultp> i32mat3x2;
|
||||
typedef mat<4, 2, int32, defaultp> i32mat4x2;
|
||||
typedef mat<2, 3, int32, defaultp> i32mat2x3;
|
||||
typedef mat<3, 3, int32, defaultp> i32mat3x3;
|
||||
typedef mat<4, 3, int32, defaultp> i32mat4x3;
|
||||
typedef mat<2, 4, int32, defaultp> i32mat2x4;
|
||||
typedef mat<3, 2, int32, defaultp> i32mat3x2;
|
||||
typedef mat<3, 3, int32, defaultp> i32mat3x3;
|
||||
typedef mat<3, 4, int32, defaultp> i32mat3x4;
|
||||
typedef mat<4, 2, int32, defaultp> i32mat4x2;
|
||||
typedef mat<4, 3, int32, defaultp> i32mat4x3;
|
||||
typedef mat<4, 4, int32, defaultp> i32mat4x4;
|
||||
|
||||
|
||||
|
@ -986,13 +986,13 @@ namespace glm
|
|||
typedef mat<4, 4, int64, highp> highp_i64mat4x4;
|
||||
|
||||
typedef mat<2, 2, int64, defaultp> i64mat2x2;
|
||||
typedef mat<3, 2, int64, defaultp> i64mat3x2;
|
||||
typedef mat<4, 2, int64, defaultp> i64mat4x2;
|
||||
typedef mat<2, 3, int64, defaultp> i64mat2x3;
|
||||
typedef mat<3, 3, int64, defaultp> i64mat3x3;
|
||||
typedef mat<4, 3, int64, defaultp> i64mat4x3;
|
||||
typedef mat<2, 4, int64, defaultp> i64mat2x4;
|
||||
typedef mat<3, 2, int64, defaultp> i64mat3x2;
|
||||
typedef mat<3, 3, int64, defaultp> i64mat3x3;
|
||||
typedef mat<3, 4, int64, defaultp> i64mat3x4;
|
||||
typedef mat<4, 2, int64, defaultp> i64mat4x2;
|
||||
typedef mat<4, 3, int64, defaultp> i64mat4x3;
|
||||
typedef mat<4, 4, int64, defaultp> i64mat4x4;
|
||||
|
||||
|
||||
|
@ -1029,13 +1029,13 @@ namespace glm
|
|||
typedef mat<4, 4, uint, highp> highp_umat4x4;
|
||||
|
||||
typedef mat<2, 2, uint, defaultp> umat2x2;
|
||||
typedef mat<3, 2, uint, defaultp> umat3x2;
|
||||
typedef mat<4, 2, uint, defaultp> umat4x2;
|
||||
typedef mat<2, 3, uint, defaultp> umat2x3;
|
||||
typedef mat<3, 3, uint, defaultp> umat3x3;
|
||||
typedef mat<4, 3, uint, defaultp> umat4x3;
|
||||
typedef mat<2, 4, uint, defaultp> umat2x4;
|
||||
typedef mat<3, 2, uint, defaultp> umat3x2;
|
||||
typedef mat<3, 3, uint, defaultp> umat3x3;
|
||||
typedef mat<3, 4, uint, defaultp> umat3x4;
|
||||
typedef mat<4, 2, uint, defaultp> umat4x2;
|
||||
typedef mat<4, 3, uint, defaultp> umat4x3;
|
||||
typedef mat<4, 4, uint, defaultp> umat4x4;
|
||||
|
||||
|
||||
|
@ -1070,13 +1070,13 @@ namespace glm
|
|||
typedef mat<4, 4, uint8, highp> highp_u8mat4x4;
|
||||
|
||||
typedef mat<2, 2, uint8, defaultp> u8mat2x2;
|
||||
typedef mat<3, 2, uint8, defaultp> u8mat3x2;
|
||||
typedef mat<4, 2, uint8, defaultp> u8mat4x2;
|
||||
typedef mat<2, 3, uint8, defaultp> u8mat2x3;
|
||||
typedef mat<3, 3, uint8, defaultp> u8mat3x3;
|
||||
typedef mat<4, 3, uint8, defaultp> u8mat4x3;
|
||||
typedef mat<2, 4, uint8, defaultp> u8mat2x4;
|
||||
typedef mat<3, 2, uint8, defaultp> u8mat3x2;
|
||||
typedef mat<3, 3, uint8, defaultp> u8mat3x3;
|
||||
typedef mat<3, 4, uint8, defaultp> u8mat3x4;
|
||||
typedef mat<4, 2, uint8, defaultp> u8mat4x2;
|
||||
typedef mat<4, 3, uint8, defaultp> u8mat4x3;
|
||||
typedef mat<4, 4, uint8, defaultp> u8mat4x4;
|
||||
|
||||
|
||||
|
@ -1111,13 +1111,13 @@ namespace glm
|
|||
typedef mat<4, 4, uint16, highp> highp_u16mat4x4;
|
||||
|
||||
typedef mat<2, 2, uint16, defaultp> u16mat2x2;
|
||||
typedef mat<3, 2, uint16, defaultp> u16mat3x2;
|
||||
typedef mat<4, 2, uint16, defaultp> u16mat4x2;
|
||||
typedef mat<2, 3, uint16, defaultp> u16mat2x3;
|
||||
typedef mat<3, 3, uint16, defaultp> u16mat3x3;
|
||||
typedef mat<4, 3, uint16, defaultp> u16mat4x3;
|
||||
typedef mat<2, 4, uint16, defaultp> u16mat2x4;
|
||||
typedef mat<3, 2, uint16, defaultp> u16mat3x2;
|
||||
typedef mat<3, 3, uint16, defaultp> u16mat3x3;
|
||||
typedef mat<3, 4, uint16, defaultp> u16mat3x4;
|
||||
typedef mat<4, 2, uint16, defaultp> u16mat4x2;
|
||||
typedef mat<4, 3, uint16, defaultp> u16mat4x3;
|
||||
typedef mat<4, 4, uint16, defaultp> u16mat4x4;
|
||||
|
||||
|
||||
|
@ -1152,13 +1152,13 @@ namespace glm
|
|||
typedef mat<4, 4, uint32, highp> highp_u32mat4x4;
|
||||
|
||||
typedef mat<2, 2, uint32, defaultp> u32mat2x2;
|
||||
typedef mat<3, 2, uint32, defaultp> u32mat3x2;
|
||||
typedef mat<4, 2, uint32, defaultp> u32mat4x2;
|
||||
typedef mat<2, 3, uint32, defaultp> u32mat2x3;
|
||||
typedef mat<3, 3, uint32, defaultp> u32mat3x3;
|
||||
typedef mat<4, 3, uint32, defaultp> u32mat4x3;
|
||||
typedef mat<2, 4, uint32, defaultp> u32mat2x4;
|
||||
typedef mat<3, 2, uint32, defaultp> u32mat3x2;
|
||||
typedef mat<3, 3, uint32, defaultp> u32mat3x3;
|
||||
typedef mat<3, 4, uint32, defaultp> u32mat3x4;
|
||||
typedef mat<4, 2, uint32, defaultp> u32mat4x2;
|
||||
typedef mat<4, 3, uint32, defaultp> u32mat4x3;
|
||||
typedef mat<4, 4, uint32, defaultp> u32mat4x4;
|
||||
|
||||
|
||||
|
@ -1193,13 +1193,13 @@ namespace glm
|
|||
typedef mat<4, 4, uint64, highp> highp_u64mat4x4;
|
||||
|
||||
typedef mat<2, 2, uint64, defaultp> u64mat2x2;
|
||||
typedef mat<3, 2, uint64, defaultp> u64mat3x2;
|
||||
typedef mat<4, 2, uint64, defaultp> u64mat4x2;
|
||||
typedef mat<2, 3, uint64, defaultp> u64mat2x3;
|
||||
typedef mat<3, 3, uint64, defaultp> u64mat3x3;
|
||||
typedef mat<4, 3, uint64, defaultp> u64mat4x3;
|
||||
typedef mat<2, 4, uint64, defaultp> u64mat2x4;
|
||||
typedef mat<3, 2, uint64, defaultp> u64mat3x2;
|
||||
typedef mat<3, 3, uint64, defaultp> u64mat3x3;
|
||||
typedef mat<3, 4, uint64, defaultp> u64mat3x4;
|
||||
typedef mat<4, 2, uint64, defaultp> u64mat4x2;
|
||||
typedef mat<4, 3, uint64, defaultp> u64mat4x3;
|
||||
typedef mat<4, 4, uint64, defaultp> u64mat4x4;
|
||||
|
||||
// Quaternion
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace glm
|
|||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_DECL T length(vec<L, T, Q> const& x);
|
||||
|
||||
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
|
||||
/// Returns the distance between p0 and p1, i.e., length(p0 - p1).
|
||||
///
|
||||
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector.
|
||||
/// @tparam T Floating-point scalar types.
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace detail
|
|||
GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
|
||||
{
|
||||
return vec<1, uint8, P>(
|
||||
std::rand() % std::numeric_limits<uint8>::max());
|
||||
static_cast<uint8>(std::rand() % std::numeric_limits<uint8>::max()));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ namespace glm
|
|||
|
||||
/// Minimum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<typename T, typename U, qualifier Q>
|
||||
template<typename T, typename U>
|
||||
GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b);
|
||||
|
||||
/// Minimum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier Q>
|
||||
GLM_FUNC_DECL vec<2, U, Q> associatedMin(
|
||||
GLM_FUNC_DECL vec<L, U, Q> associatedMin(
|
||||
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
|
||||
vec<L, T, Q> const& y, vec<L, U, Q> const& b);
|
||||
|
||||
|
@ -115,7 +115,7 @@ namespace glm
|
|||
/// Maximum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier Q>
|
||||
GLM_FUNC_DECL vec<2, U, Q> associatedMax(
|
||||
GLM_FUNC_DECL vec<L, U, Q> associatedMax(
|
||||
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
|
||||
vec<L, T, Q> const& y, vec<L, U, Q> const& b);
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
namespace glm{
|
||||
|
||||
// Min comparison between 2 variables
|
||||
template<typename T, typename U, qualifier Q>
|
||||
template<typename T, typename U>
|
||||
GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b)
|
||||
{
|
||||
return x < y ? a : b;
|
||||
}
|
||||
|
||||
template<length_t L, typename T, typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin
|
||||
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
|
||||
(
|
||||
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
|
||||
vec<L, T, Q> const& y, vec<L, U, Q> const& b
|
||||
|
@ -169,7 +169,7 @@ GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b)
|
|||
|
||||
// Max comparison between 2 variables
|
||||
template<length_t L, typename T, typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax
|
||||
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
|
||||
(
|
||||
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
|
||||
vec<L, T, Q> const& y, vec<L, U, Q> const& b
|
||||
|
|
|
@ -63,9 +63,9 @@ namespace glm
|
|||
GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor)
|
||||
{
|
||||
vec<3, T, Q> hsv = rgbColor;
|
||||
float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b);
|
||||
float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b);
|
||||
float Delta = Max - Min;
|
||||
T Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b);
|
||||
T Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b);
|
||||
T Delta = Max - Min;
|
||||
|
||||
hsv.z = Max;
|
||||
|
||||
|
|
|
@ -47,12 +47,12 @@ namespace glm
|
|||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
|
||||
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
|
||||
template<typename T> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
|
||||
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
template<typename T> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
|
|
|
@ -425,7 +425,7 @@ namespace glm{
|
|||
|
||||
if(a < static_cast<genType>(0.5))
|
||||
{
|
||||
return static_cast<genType>(0.5) * (one<genType>() - bounceEaseOut(a * static_cast<genType>(2)));
|
||||
return static_cast<genType>(0.5) * (one<genType>() - bounceEaseOut(one<genType>() - a * static_cast<genType>(2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -699,12 +699,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[2][1], M[2][2]);
|
||||
T T1 = glm::atan2(M[2][1], M[2][2]);
|
||||
T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]);
|
||||
T T2 = glm::atan2<T, defaultp>(-M[2][0], C2);
|
||||
T T2 = glm::atan2(-M[2][0], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]);
|
||||
T T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]);
|
||||
t1 = -T1;
|
||||
t2 = -T2;
|
||||
t3 = -T3;
|
||||
|
@ -716,12 +716,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[2][0], M[2][2]);
|
||||
T T1 = glm::atan2(M[2][0], M[2][2]);
|
||||
T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]);
|
||||
T T2 = glm::atan2<T, defaultp>(-M[2][1], C2);
|
||||
T T2 = glm::atan2(-M[2][1], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]);
|
||||
T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -733,12 +733,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[0][2], M[0][1]);
|
||||
T T1 = glm::atan2(M[0][2], M[0][1]);
|
||||
T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[0][0]);
|
||||
T T2 = glm::atan2(S2, M[0][0]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]);
|
||||
T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -750,12 +750,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[0][1], -M[0][2]);
|
||||
T T1 = glm::atan2(M[0][1], -M[0][2]);
|
||||
T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[0][0]);
|
||||
T T2 = glm::atan2(S2, M[0][0]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]);
|
||||
T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -767,12 +767,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[1][0], M[1][2]);
|
||||
T T1 = glm::atan2(M[1][0], M[1][2]);
|
||||
T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[1][1]);
|
||||
T T2 = glm::atan2(S2, M[1][1]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]);
|
||||
T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -784,12 +784,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[1][2], -M[1][0]);
|
||||
T T1 = glm::atan2(M[1][2], -M[1][0]);
|
||||
T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[1][1]);
|
||||
T T2 = glm::atan2(S2, M[1][1]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]);
|
||||
T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -801,12 +801,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[2][1], M[2][0]);
|
||||
T T1 = glm::atan2(M[2][1], M[2][0]);
|
||||
T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[2][2]);
|
||||
T T2 = glm::atan2(S2, M[2][2]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]);
|
||||
T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -818,12 +818,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[2][0], -M[2][1]);
|
||||
T T1 = glm::atan2(M[2][0], -M[2][1]);
|
||||
T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]);
|
||||
T T2 = glm::atan2<T, defaultp>(S2, M[2][2]);
|
||||
T T2 = glm::atan2(S2, M[2][2]);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]);
|
||||
T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -835,12 +835,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[1][2], M[1][1]);
|
||||
T T1 = glm::atan2(M[1][2], M[1][1]);
|
||||
T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]);
|
||||
T T2 = glm::atan2<T, defaultp>(-M[1][0], C2);
|
||||
T T2 = glm::atan2(-M[1][0], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]);
|
||||
T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -852,12 +852,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(-M[0][2], M[0][0]);
|
||||
T T1 = glm::atan2(-M[0][2], M[0][0]);
|
||||
T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]);
|
||||
T T2 = glm::atan2<T, defaultp>(M[0][1], C2);
|
||||
T T2 = glm::atan2(M[0][1], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]);
|
||||
T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -869,12 +869,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(M[0][1], M[0][0]);
|
||||
T T1 = glm::atan2(M[0][1], M[0][0]);
|
||||
T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]);
|
||||
T T2 = glm::atan2<T, defaultp>(-M[0][2], C2);
|
||||
T T2 = glm::atan2(-M[0][2], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]);
|
||||
T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
@ -886,12 +886,12 @@ namespace glm
|
|||
T & t2,
|
||||
T & t3)
|
||||
{
|
||||
T T1 = glm::atan2<T, defaultp>(-M[1][0], M[1][1]);
|
||||
T T1 = glm::atan2(-M[1][0], M[1][1]);
|
||||
T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]);
|
||||
T T2 = glm::atan2<T, defaultp>(M[1][2], C2);
|
||||
T T2 = glm::atan2(M[1][2], C2);
|
||||
T S1 = glm::sin(T1);
|
||||
T C1 = glm::cos(T1);
|
||||
T T3 = glm::atan2<T, defaultp>(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]);
|
||||
T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]);
|
||||
t1 = T1;
|
||||
t2 = T2;
|
||||
t3 = T3;
|
||||
|
|
|
@ -114,19 +114,19 @@ namespace glm
|
|||
return false;
|
||||
typename genType::value_type inv_det = typename genType::value_type(1) / det;
|
||||
|
||||
genType Tengant = orig - vert0;
|
||||
genType Tangent = orig - vert0;
|
||||
|
||||
position.y = dot(Tengant, Perpendicular) * inv_det;
|
||||
position.y = dot(Tangent, Perpendicular) * inv_det;
|
||||
if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1))
|
||||
return false;
|
||||
|
||||
genType Cotengant = cross(Tengant, edge1);
|
||||
genType Cotangent = cross(Tangent, edge1);
|
||||
|
||||
position.z = dot(dir, Cotengant) * inv_det;
|
||||
position.z = dot(dir, Cotangent) * inv_det;
|
||||
if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1))
|
||||
return false;
|
||||
|
||||
position.x = dot(edge2, Cotengant) * inv_det;
|
||||
position.x = dot(edge2, Cotangent) * inv_det;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue