mirror of
https://github.com/g-truc/glm.git
synced 2024-11-27 02:34:35 +00:00
Reorder slow functions... still to be tested.
This commit is contained in:
parent
cc02b86fb1
commit
fadbc78307
@ -40,6 +40,27 @@ namespace glm
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate_slow
|
||||||
|
(
|
||||||
|
detail::tmat4x4<T, P> const & m,
|
||||||
|
detail::tvec3<T, P> const & v
|
||||||
|
)
|
||||||
|
{
|
||||||
|
detail::tmat4x4<T, P> Result(T(1));
|
||||||
|
Result[3] = detail::tvec4<T, P>(v, T(1));
|
||||||
|
return m * Result;
|
||||||
|
|
||||||
|
//detail::tmat4x4<valType> Result(m);
|
||||||
|
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
|
||||||
|
//Result[3][0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0];
|
||||||
|
//Result[3][1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1];
|
||||||
|
//Result[3][2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2];
|
||||||
|
//Result[3][3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3];
|
||||||
|
//return Result;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate
|
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate
|
||||||
(
|
(
|
||||||
@ -81,41 +102,6 @@ namespace glm
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale
|
|
||||||
(
|
|
||||||
detail::tmat4x4<T, P> const & m,
|
|
||||||
detail::tvec3<T, P> const & v
|
|
||||||
)
|
|
||||||
{
|
|
||||||
detail::tmat4x4<T, P> Result(detail::tmat4x4<T, P>::_null);
|
|
||||||
Result[0] = m[0] * v[0];
|
|
||||||
Result[1] = m[1] * v[1];
|
|
||||||
Result[2] = m[2] * v[2];
|
|
||||||
Result[3] = m[3];
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate_slow
|
|
||||||
(
|
|
||||||
detail::tmat4x4<T, P> const & m,
|
|
||||||
detail::tvec3<T, P> const & v
|
|
||||||
)
|
|
||||||
{
|
|
||||||
detail::tmat4x4<T, P> Result(T(1));
|
|
||||||
Result[3] = detail::tvec4<T, P>(v, T(1));
|
|
||||||
return m * Result;
|
|
||||||
|
|
||||||
//detail::tmat4x4<valType> Result(m);
|
|
||||||
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
|
|
||||||
//Result[3][0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0];
|
|
||||||
//Result[3][1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1];
|
|
||||||
//Result[3][2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2];
|
|
||||||
//Result[3][3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3];
|
|
||||||
//return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate_slow
|
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate_slow
|
||||||
(
|
(
|
||||||
@ -154,6 +140,21 @@ namespace glm
|
|||||||
return m * Result;
|
return m * Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T, precision P>
|
||||||
|
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale
|
||||||
|
(
|
||||||
|
detail::tmat4x4<T, P> const & m,
|
||||||
|
detail::tvec3<T, P> const & v
|
||||||
|
)
|
||||||
|
{
|
||||||
|
detail::tmat4x4<T, P> Result(detail::tmat4x4<T, P>::_null);
|
||||||
|
Result[0] = m[0] * v[0];
|
||||||
|
Result[1] = m[1] * v[1];
|
||||||
|
Result[2] = m[2] * v[2];
|
||||||
|
Result[3] = m[3];
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale_slow
|
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale_slow
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user