mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-07 09:13:22 +08:00
Updated GLM version w/ now standard radians as angles.
This commit is contained in:
@@ -1,95 +1,118 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2009-08-29
|
||||
// Updated : 2009-08-29
|
||||
// Licence : This source is under MIT License
|
||||
// File : glm/gtx/matrix_operation.inl
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2015 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.
|
||||
///
|
||||
/// Restrictions:
|
||||
/// By making use of the Software for military purposes, you choose to make
|
||||
/// a Bunny unhappy.
|
||||
///
|
||||
/// 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 gtx_matrix_operation
|
||||
/// @file glm/gtx/matrix_operation.inl
|
||||
/// @date 2009-08-29 / 2009-08-29
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat2x2<valType> diagonal2x2
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> diagonal2x2
|
||||
(
|
||||
detail::tvec2<valType> const & v
|
||||
tvec2<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat2x2<valType> Result(valType(1));
|
||||
tmat2x2<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat2x3<valType> diagonal2x3
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> diagonal2x3
|
||||
(
|
||||
detail::tvec2<valType> const & v
|
||||
tvec2<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat2x3<valType> Result(valType(1));
|
||||
tmat2x3<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat2x4<valType> diagonal2x4
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> diagonal2x4
|
||||
(
|
||||
detail::tvec2<valType> const & v
|
||||
tvec2<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat2x4<valType> Result(valType(1));
|
||||
tmat2x4<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat3x2<valType> diagonal3x2
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> diagonal3x2
|
||||
(
|
||||
detail::tvec2<valType> const & v
|
||||
tvec2<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat3x2<valType> Result(valType(1));
|
||||
tmat3x2<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat3x3<valType> diagonal3x3
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> diagonal3x3
|
||||
(
|
||||
detail::tvec3<valType> const & v
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat3x3<valType> Result(valType(1));
|
||||
tmat3x3<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
Result[2][2] = v[2];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat3x4<valType> diagonal3x4
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> diagonal3x4
|
||||
(
|
||||
detail::tvec3<valType> const & v
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat3x4<valType> Result(valType(1));
|
||||
tmat3x4<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
Result[2][2] = v[2];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> diagonal4x4
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> diagonal4x4
|
||||
(
|
||||
detail::tvec4<valType> const & v
|
||||
tvec4<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat4x4<valType> Result(valType(1));
|
||||
tmat4x4<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
Result[2][2] = v[2];
|
||||
@@ -97,26 +120,26 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat4x3<valType> diagonal4x3
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> diagonal4x3
|
||||
(
|
||||
detail::tvec3<valType> const & v
|
||||
tvec3<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat4x3<valType> Result(valType(1));
|
||||
tmat4x3<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
Result[2][2] = v[2];
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename valType>
|
||||
GLM_FUNC_QUALIFIER detail::tmat4x2<valType> diagonal4x2
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> diagonal4x2
|
||||
(
|
||||
detail::tvec2<valType> const & v
|
||||
tvec2<T, P> const & v
|
||||
)
|
||||
{
|
||||
detail::tmat4x2<valType> Result(valType(1));
|
||||
tmat4x2<T, P> Result(static_cast<T>(1));
|
||||
Result[0][0] = v[0];
|
||||
Result[1][1] = v[1];
|
||||
return Result;
|
||||
|
||||
Reference in New Issue
Block a user