Commit 6e54b394 authored by Nianchen Deng's avatar Nianchen Deng
Browse files

paper committed

parent 90553bac
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat.hpp
/// @date 2010-01-26 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "precision.hpp"
namespace glm{
namespace detail
{
template <typename T, precision P, template <class, precision> class colType, template <class, precision> class rowType>
struct outerProduct_trait{};
}//namespace detail
template <typename T, precision P> struct tvec2;
template <typename T, precision P> struct tvec3;
template <typename T, precision P> struct tvec4;
template <typename T, precision P> struct tmat2x2;
template <typename T, precision P> struct tmat2x3;
template <typename T, precision P> struct tmat2x4;
template <typename T, precision P> struct tmat3x2;
template <typename T, precision P> struct tmat3x3;
template <typename T, precision P> struct tmat3x4;
template <typename T, precision P> struct tmat4x2;
template <typename T, precision P> struct tmat4x3;
template <typename T, precision P> struct tmat4x4;
/// @addtogroup core_precision
/// @{
/// 2 columns of 2 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, lowp> lowp_mat2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, mediump> mediump_mat2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, highp> highp_mat2;
/// 2 columns of 2 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, lowp> lowp_mat2x2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, mediump> mediump_mat2x2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, highp> highp_mat2x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 2 columns of 3 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, lowp> lowp_mat2x3;
/// 2 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, mediump> mediump_mat2x3;
/// 2 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, highp> highp_mat2x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 2 columns of 4 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, lowp> lowp_mat2x4;
/// 2 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, mediump> mediump_mat2x4;
/// 2 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, highp> highp_mat2x4;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 2 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, lowp> lowp_mat3x2;
/// 3 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, mediump> mediump_mat3x2;
/// 3 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, highp> highp_mat3x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 3 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_mat3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, mediump> mediump_mat3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, highp> highp_mat3;
/// 3 columns of 3 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_mat3x3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, mediump> mediump_mat3x3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, highp> highp_mat3x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 4 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, lowp> lowp_mat3x4;
/// 3 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, mediump> mediump_mat3x4;
/// 3 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, highp> highp_mat3x4;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 2 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, lowp> lowp_mat4x2;
/// 4 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, mediump> mediump_mat4x2;
/// 4 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, highp> highp_mat4x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 3 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, lowp> lowp_mat4x3;
/// 4 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, mediump> mediump_mat4x3;
/// 4 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, highp> highp_mat4x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 4 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, lowp> lowp_mat4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, mediump> mediump_mat4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, highp> highp_mat4;
/// 4 columns of 4 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, lowp> lowp_mat4x4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, mediump> mediump_mat4x4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, highp> highp_mat4x4;
/// @}
/// @addtogroup core_types
/// @{
//////////////////////////
// Float definition
#if(defined(GLM_PRECISION_LOWP_FLOAT))
typedef lowp_mat2x2 mat2x2;
typedef lowp_mat2x3 mat2x3;
typedef lowp_mat2x4 mat2x4;
typedef lowp_mat3x2 mat3x2;
typedef lowp_mat3x3 mat3x3;
typedef lowp_mat3x4 mat3x4;
typedef lowp_mat4x2 mat4x2;
typedef lowp_mat4x3 mat4x3;
typedef lowp_mat4x4 mat4x4;
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
typedef mediump_mat2x2 mat2x2;
typedef mediump_mat2x3 mat2x3;
typedef mediump_mat2x4 mat2x4;
typedef mediump_mat3x2 mat3x2;
typedef mediump_mat3x3 mat3x3;
typedef mediump_mat3x4 mat3x4;
typedef mediump_mat4x2 mat4x2;
typedef mediump_mat4x3 mat4x3;
typedef mediump_mat4x4 mat4x4;
#else
//! 2 columns of 2 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat2x2 mat2x2;
//! 2 columns of 3 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat2x3 mat2x3;
//! 2 columns of 4 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat2x4 mat2x4;
//! 3 columns of 2 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat3x2 mat3x2;
//! 3 columns of 3 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat3x3 mat3x3;
//! 3 columns of 4 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat3x4 mat3x4;
//! 4 columns of 2 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat4x2 mat4x2;
//! 4 columns of 3 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat4x3 mat4x3;
//! 4 columns of 4 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_mat4x4 mat4x4;
#endif//GLM_PRECISION
//! 2 columns of 2 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef mat2x2 mat2;
//! 3 columns of 3 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef mat3x3 mat3;
//! 4 columns of 4 components matrix of floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef mat4x4 mat4;
//////////////////////////
// Double definition
/// @addtogroup core_precision
/// @{
/// 2 columns of 2 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, lowp> lowp_dmat2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, mediump> mediump_dmat2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, highp> highp_dmat2;
/// 2 columns of 2 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, lowp> lowp_dmat2x2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, mediump> mediump_dmat2x2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, highp> highp_dmat2x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 2 columns of 3 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, lowp> lowp_dmat2x3;
/// 2 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, mediump> mediump_dmat2x3;
/// 2 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, highp> highp_dmat2x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 2 columns of 4 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, lowp> lowp_dmat2x4;
/// 2 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, mediump> mediump_dmat2x4;
/// 2 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, highp> highp_dmat2x4;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 2 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, lowp> lowp_dmat3x2;
/// 3 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, mediump> mediump_dmat3x2;
/// 3 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, highp> highp_dmat3x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 3 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_dmat3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, mediump> mediump_dmat3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, highp> highp_dmat3;
/// 3 columns of 3 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, lowp> lowp_dmat3x3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, mediump> mediump_dmat3x3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, highp> highp_dmat3x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 3 columns of 4 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, lowp> lowp_dmat3x4;
/// 3 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, mediump> mediump_dmat3x4;
/// 3 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, highp> highp_dmat3x4;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 2 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, lowp> lowp_dmat4x2;
/// 4 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, mediump> mediump_dmat4x2;
/// 4 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, highp> highp_dmat4x2;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 3 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, lowp> lowp_dmat4x3;
/// 4 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, mediump> mediump_dmat4x3;
/// 4 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, highp> highp_dmat4x3;
/// @}
/// @addtogroup core_precision
/// @{
/// 4 columns of 4 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, lowp> lowp_dmat4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, mediump> mediump_dmat4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, highp> highp_dmat4;
/// 4 columns of 4 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, lowp> lowp_dmat4x4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, mediump> mediump_dmat4x4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, highp> highp_dmat4x4;
/// @}
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
typedef lowp_dmat2x2 dmat2x2;
typedef lowp_dmat2x3 dmat2x3;
typedef lowp_dmat2x4 dmat2x4;
typedef lowp_dmat3x2 dmat3x2;
typedef lowp_dmat3x3 dmat3x3;
typedef lowp_dmat3x4 dmat3x4;
typedef lowp_dmat4x2 dmat4x2;
typedef lowp_dmat4x3 dmat4x3;
typedef lowp_dmat4x4 dmat4x4;
#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
typedef mediump_dmat2x2 dmat2x2;
typedef mediump_dmat2x3 dmat2x3;
typedef mediump_dmat2x4 dmat2x4;
typedef mediump_dmat3x2 dmat3x2;
typedef mediump_dmat3x3 dmat3x3;
typedef mediump_dmat3x4 dmat3x4;
typedef mediump_dmat4x2 dmat4x2;
typedef mediump_dmat4x3 dmat4x3;
typedef mediump_dmat4x4 dmat4x4;
#else //defined(GLM_PRECISION_HIGHP_DOUBLE)
//! 2 * 2 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat2x2 dmat2;
//! 3 * 3 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat3x3 dmat3;
//! 4 * 4 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat4x4 dmat4;
//! 2 * 2 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat2x2 dmat2x2;
//! 2 * 3 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat2x3 dmat2x3;
//! 2 * 4 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat2x4 dmat2x4;
//! 3 * 2 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat3x2 dmat3x2;
/// 3 * 3 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat3x3 dmat3x3;
/// 3 * 4 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat3x4 dmat3x4;
/// 4 * 2 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat4x2 dmat4x2;
/// 4 * 3 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat4x3 dmat4x3;
/// 4 * 4 matrix of double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
typedef highp_dmat4x4 dmat4x4;
#endif//GLM_PRECISION
/// @}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat.inl
/// @date 2011-06-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x2.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec2.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x2
{
typedef tvec2<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x2<T, P> type;
typedef tmat2x2<T, P> transpose_type;
typedef T value_type;
template <typename U, precision Q>
friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);
template <typename U, precision Q>
friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
private:
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
//////////////////////////////////////
// Constructors
GLM_FUNC_DECL tmat2x2();
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x2(ctor);
GLM_FUNC_DECL explicit tmat2x2(T const & x);
GLM_FUNC_DECL tmat2x2(
T const & x1, T const & y1,
T const & x2, T const & y2);
GLM_FUNC_DECL tmat2x2(
col_type const & v1,
col_type const & v2);
//////////////////////////////////////
// Conversions
template <typename U, typename V, typename M, typename N>
GLM_FUNC_DECL tmat2x2(
U const & x1, V const & y1,
M const & x2, N const & y2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x2(
tvec2<U, P> const & v1,
tvec2<V, P> const & v2);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m);
} //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat2x2.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x2.inl
/// @date 2005-01-16 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> compute_inverse(tmat2x2<T, P> const & m)
{
T OneOverDeterminant = static_cast<T>(1) / (
+ m[0][0] * m[1][1]
- m[1][0] * m[0][1]);
tmat2x2<T, P> Inverse(
+ m[1][1] * OneOverDeterminant,
- m[0][1] * OneOverDeterminant,
- m[1][0] * OneOverDeterminant,
+ m[0][0] * OneOverDeterminant);
return Inverse;
}
}//namespace detail
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T const & s)
{
this->value[0] = col_type(s, 0);
this->value[1] = col_type(0, s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
T const & x0, T const & y0,
T const & x1, T const & y1
)
{
this->value[0] = col_type(x0, y0);
this->value[1] = col_type(x1, y1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <typename X1, typename Y1, typename X2, typename Y2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
}
//////////////////////////////////////////////////////////////
// mat2x2 matrix conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::size_type tmat2x2<T, P>::size() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::length_type tmat2x2<T, P>::length() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(tmat2x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(tmat2x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(tmat2x2<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(tmat2x2<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator++(int)
{
tmat2x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator--(int)
{
tmat2x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] + s,
m[1] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
m[0] + s,
m[1] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] - s,
m[1] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
s - m[0],
s - m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator*
(
tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type const & v
)
{
return tvec2<T, P>(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator*
(
typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m
)
{
return tvec2<T, P>(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s)
{
return tmat2x2<T, P>(
m[0] / s,
m[1] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
s / m[0],
s / m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
tmat2x2<T, P> m1_copy(m1);
return m1_copy /= m2;
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m)
{
return tmat2x2<T, P>(
-m[0],
-m[1]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x3.hpp
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x3
{
typedef tvec3<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x3<T, P> type;
typedef tmat3x2<T, P> transpose_type;
typedef T value_type;
private:
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat2x3();
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x3(ctor);
GLM_FUNC_DECL explicit tmat2x3(T const & s);
GLM_FUNC_DECL tmat2x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1);
GLM_FUNC_DECL tmat2x3(
col_type const & v0,
col_type const & v1);
//////////////////////////////////////
// Conversions
template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
GLM_FUNC_DECL tmat2x3(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x3(
tvec3<U, P> const & v1,
tvec3<V, P> const & v2);
//////////////////////////////////////
// Matrix conversion
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x3<T, P> operator++(int);
GLM_FUNC_DECL tmat2x3<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat2x3.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x3.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T const & s)
{
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1
)
{
this->value[0] = col_type(x0, y0, z0);
this->value[1] = col_type(x1, y1, z1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
}
//////////////////////////////////////
// Matrix conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::size_type tmat2x3<T, P>::size() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::length_type tmat2x3<T, P>::length() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+=(tmat2x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(tmat2x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator++(int)
{
tmat2x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator--(int)
{
tmat2x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] + s,
m[1] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] - s,
m[1] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type operator*
(
tmat2x3<T, P> const & m,
typename tmat2x3<T, P>::row_type const & v)
{
return typename tmat2x3<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::row_type operator*
(
typename tmat2x3<T, P>::col_type const & v,
tmat2x3<T, P> const & m)
{
return typename tmat2x3<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
T SrcA02 = m1[0][2];
T SrcA10 = m1[1][0];
T SrcA11 = m1[1][1];
T SrcA12 = m1[1][2];
T SrcB00 = m2[0][0];
T SrcB01 = m2[0][1];
T SrcB10 = m2[1][0];
T SrcB11 = m2[1][1];
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
tmat3x3<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11;
Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11;
Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21;
Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21;
Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1],
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s)
{
return tmat2x3<T, P>(
m[0] / s,
m[1] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
s / m[0],
s / m[1]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m)
{
return tmat2x3<T, P>(
-m[0],
-m[1]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x4.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x4
{
typedef tvec4<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x4<T, P> type;
typedef tmat4x2<T, P> transpose_type;
typedef T value_type;
private:
/// @cond DETAIL
col_type value[2];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat2x4();
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat2x4(ctor);
GLM_FUNC_DECL explicit tmat2x4(T const & s);
GLM_FUNC_DECL tmat2x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1);
GLM_FUNC_DECL tmat2x4(
col_type const & v0,
col_type const & v1);
//////////////////////////////////////
// Conversions
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_DECL tmat2x4(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x4(
tvec4<U, P> const & v1,
tvec4<V, P> const & v2);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat2x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x4<T, P> operator++(int);
GLM_FUNC_DECL tmat2x4<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat2x4.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat2x4.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero, Zero);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1
)
{
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tvec4<V1, P> const & v1, tvec4<V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
}
//////////////////////////////////////
// Matrix conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::size_type tmat2x4<T, P>::size() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::length_type tmat2x4<T, P>::length() const
{
return 2;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(tmat2x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(tmat2x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P> & tmat2x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator++(int)
{
tmat2x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator--(int)
{
tmat2x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] + s,
m[1] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] - s,
m[1] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s)
{
return tmat2x4<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
m[0] * s,
m[1] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v)
{
return typename tmat2x4<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y,
m[0][3] * v.x + m[1][3] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m)
{
return typename tmat2x4<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
T SrcA02 = m1[0][2];
T SrcA03 = m1[0][3];
T SrcA10 = m1[1][0];
T SrcA11 = m1[1][1];
T SrcA12 = m1[1][2];
T SrcA13 = m1[1][3];
T SrcB00 = m2[0][0];
T SrcB01 = m2[0][1];
T SrcB10 = m2[1][0];
T SrcB11 = m2[1][1];
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
T SrcB30 = m2[3][0];
T SrcB31 = m2[3][1];
tmat4x4<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11;
Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11;
Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11;
Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21;
Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21;
Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21;
Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21;
Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31;
Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31;
Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31;
Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1],
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s)
{
return tmat2x4<T, P>(
m[0] / s,
m[1] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
s / m[0],
s / m[1]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m)
{
return tmat2x4<T, P>(
-m[0],
-m[1]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x2.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x2
{
typedef tvec2<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x2<T, P> type;
typedef tmat2x3<T, P> transpose_type;
typedef T value_type;
private:
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat3x2();
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x2(ctor);
GLM_FUNC_DECL explicit tmat3x2(T const & s);
GLM_FUNC_DECL tmat3x2(
T const & x0, T const & y0,
T const & x1, T const & y1,
T const & x2, T const & y2);
GLM_FUNC_DECL tmat3x2(
col_type const & v0,
col_type const & v1,
col_type const & v2);
//////////////////////////////////////
// Conversions
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3>
GLM_FUNC_DECL tmat3x2(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2,
X3 const & x3, Y3 const & y3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x2(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat3x2.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x2.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
this->value[2] = col_type(0, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T const & s)
{
this->value[0] = col_type(s, 0);
this->value[1] = col_type(0, s);
this->value[2] = col_type(0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
T const & x0, T const & y0,
T const & x1, T const & y1,
T const & x2, T const & y2
)
{
this->value[0] = col_type(x0, y0);
this->value[1] = col_type(x1, y1);
this->value[2] = col_type(x2, y2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
col_type const & v0,
col_type const & v1,
col_type const & v2
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2,
X3 const & x3, Y3 const & y3
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3
)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
}
//////////////////////////////////////////////////////////////
// mat3x2 matrix conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::size_type tmat3x2<T, P>::size() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::length_type tmat3x2<T, P>::length() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(tmat3x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(tmat3x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P> & tmat3x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator++(int)
{
tmat3x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator--(int)
{
tmat3x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] + s,
m[1] + s,
m[2] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] - s,
m[1] - s,
m[2] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v)
{
return typename tmat3x2<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m)
{
return typename tmat3x2<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
const T SrcA10 = m1[1][0];
const T SrcA11 = m1[1][1];
const T SrcA20 = m1[2][0];
const T SrcA21 = m1[2][1];
const T SrcB00 = m2[0][0];
const T SrcB01 = m2[0][1];
const T SrcB02 = m2[0][2];
const T SrcB10 = m2[1][0];
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
tmat2x2<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s)
{
return tmat3x2<T, P>(
m[0] / s,
m[1] / s,
m[2] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
s / m[0],
s / m[1],
s / m[2]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m)
{
return tmat3x2<T, P>(
-m[0],
-m[1],
-m[2]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x3.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x3
{
typedef tvec3<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x3<T, P> type;
typedef tmat3x3<T, P> transpose_type;
typedef T value_type;
template <typename U, precision Q>
friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
template <typename U, precision Q>
friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m);
private:
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat3x3();
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x3(ctor);
GLM_FUNC_DECL explicit tmat3x3(T const & s);
GLM_FUNC_DECL tmat3x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
T const & x2, T const & y2, T const & z2);
GLM_FUNC_DECL tmat3x3(
col_type const & v0,
col_type const & v1,
col_type const & v2);
//////////////////////////////////////
// Conversions
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3>
GLM_FUNC_DECL tmat3x3(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
X3 const & x3, Y3 const & y3, Z3 const & z3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x3(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(tmat3x3<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x3<T, P> & operator++();
GLM_FUNC_DECL tmat3x3<T, P> & operator--();
GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat3x3.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x3.inl
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> compute_inverse(tmat3x3<T, P> const & m)
{
T OneOverDeterminant = static_cast<T>(1) / (
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]));
tmat3x3<T, P> Inverse(uninitialize);
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant;
Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant;
Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant;
Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant;
Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant;
Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant;
Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant;
Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant;
Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant;
return Inverse;
}
}//namespace detail
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
this->value[2] = col_type(0, 0, 1);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s)
{
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
this->value[2] = col_type(0, 0, s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
T const & x2, T const & y2, T const & z2
)
{
this->value[0] = col_type(x0, y0, z0);
this->value[1] = col_type(x1, y1, z1);
this->value[2] = col_type(x2, y2, z2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
col_type const & v0,
col_type const & v1,
col_type const & v2
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
X3 const & x3, Y3 const & y3, Z3 const & z3
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3
)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
}
//////////////////////////////////////////////////////////////
// Conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::size_type tmat3x3<T, P>::size() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::length_type tmat3x3<T, P>::length() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(tmat3x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(tmat3x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(tmat3x3<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(tmat3x3<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator++(int)
{
tmat3x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator--(int)
{
tmat3x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] + s,
m[1] + s,
m[2] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
m[0] + s,
m[1] + s,
m[2] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x3<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] - s,
m[1] - s,
m[2] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
s - m[0],
s - m[1],
s - m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x3<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
{
return typename tmat3x3<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
{
return typename tmat3x3<T, P>::row_type(
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,
m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z,
m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA02 = m1[0][2];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA12 = m1[1][2];
T const SrcA20 = m1[2][0];
T const SrcA21 = m1[2][1];
T const SrcA22 = m1[2][2];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB02 = m2[0][2];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB12 = m2[1][2];
T const SrcB20 = m2[2][0];
T const SrcB21 = m2[2][1];
T const SrcB22 = m2[2][2];
tmat3x3<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;
Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12;
Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22;
Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22;
Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2],
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s)
{
return tmat3x3<T, P>(
m[0] / s,
m[1] / s,
m[2] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
s / m[0],
s / m[1],
s / m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
tmat3x3<T, P> m1_copy(m1);
return m1_copy /= m2;
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m)
{
return tmat3x3<T, P>(
-m[0],
-m[1],
-m[2]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x4.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x4
{
typedef tvec4<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x4<T, P> type;
typedef tmat4x3<T, P> transpose_type;
typedef T value_type;
private:
/// @cond DETAIL
col_type value[3];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat3x4();
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat3x4(ctor);
GLM_FUNC_DECL explicit tmat3x4(T const & s);
GLM_FUNC_DECL tmat3x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2);
GLM_FUNC_DECL tmat3x4(
col_type const & v0,
col_type const & v1,
col_type const & v2);
//////////////////////////////////////
// Conversions
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3>
GLM_FUNC_DECL tmat3x4(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x4(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3);
//////////////////////////////////////
// Matrix conversion
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat3x4<T, P> & operator++();
GLM_FUNC_DECL tmat3x4<T, P> & operator--();
GLM_FUNC_DECL tmat3x4<T, P> operator++(int);
GLM_FUNC_DECL tmat3x4<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator*(tmat3x4<T, P> const & m, typename tmat3x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator*(typename tmat3x4<T, P>::col_type const & v, tmat3x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat3x4.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat3x4.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero, Zero, Zero);
this->value[1] = col_type(Zero, s, Zero, Zero);
this->value[2] = col_type(Zero, Zero, s, Zero);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2
)
{
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
col_type const & v0,
col_type const & v1,
col_type const & v2
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3
)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
}
// Conversion
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::size_type tmat3x4<T, P>::size() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::length_type tmat3x4<T, P>::length() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(tmat3x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(tmat3x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P> & tmat3x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator++(int)
{
tmat3x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator--(int)
{
tmat3x4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] + s,
m[1] + s,
m[2] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] - s,
m[1] - s,
m[2] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
m[0] * s,
m[1] * s,
m[2] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type operator*
(
tmat3x4<T, P> const & m,
typename tmat3x4<T, P>::row_type const & v
)
{
return typename tmat3x4<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z,
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::row_type operator*
(
typename tmat3x4<T, P>::col_type const & v,
tmat3x4<T, P> const & m
)
{
return typename tmat3x4<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
const T SrcA02 = m1[0][2];
const T SrcA03 = m1[0][3];
const T SrcA10 = m1[1][0];
const T SrcA11 = m1[1][1];
const T SrcA12 = m1[1][2];
const T SrcA13 = m1[1][3];
const T SrcA20 = m1[2][0];
const T SrcA21 = m1[2][1];
const T SrcA22 = m1[2][2];
const T SrcA23 = m1[2][3];
const T SrcB00 = m2[0][0];
const T SrcB01 = m2[0][1];
const T SrcB02 = m2[0][2];
const T SrcB10 = m2[1][0];
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
const T SrcB20 = m2[2][0];
const T SrcB21 = m2[2][1];
const T SrcB22 = m2[2][2];
const T SrcB30 = m2[3][0];
const T SrcB31 = m2[3][1];
const T SrcB32 = m2[3][2];
tmat4x4<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;
Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12;
Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12;
Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22;
Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22;
Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22;
Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22;
Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32;
Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32;
Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32;
Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2],
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s)
{
return tmat3x4<T, P>(
m[0] / s,
m[1] / s,
m[2] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
s / m[0],
s / m[1],
s / m[2]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m)
{
return tmat3x4<T, P>(
-m[0],
-m[1],
-m[2]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x2.hpp
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x2
{
typedef tvec2<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x2<T, P> type;
typedef tmat2x4<T, P> transpose_type;
typedef T value_type;
private:
/// @cond DETAIL
col_type value[4];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat4x2();
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x2(ctor);
GLM_FUNC_DECL explicit tmat4x2(T const & x);
GLM_FUNC_DECL tmat4x2(
T const & x0, T const & y0,
T const & x1, T const & y1,
T const & x2, T const & y2,
T const & x3, T const & y3);
GLM_FUNC_DECL tmat4x2(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3);
//////////////////////////////////////
// Conversions
template <
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
typename X4, typename Y4>
GLM_FUNC_DECL tmat4x2(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2,
X3 const & x3, Y3 const & y3,
X4 const & x4, Y4 const & y4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x2(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3,
tvec2<V4, P> const & v4);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat4x2.inl"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x2.inl
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
this->value[2] = col_type(0, 0);
this->value[3] = col_type(0, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T const & s)
{
value_type const Zero(0);
this->value[0] = col_type(s, Zero);
this->value[1] = col_type(Zero, s);
this->value[2] = col_type(Zero, Zero);
this->value[3] = col_type(Zero, Zero);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
T const & x0, T const & y0,
T const & x1, T const & y1,
T const & x2, T const & y2,
T const & x3, T const & y3
)
{
this->value[0] = col_type(x0, y0);
this->value[1] = col_type(x1, y1);
this->value[2] = col_type(x2, y2);
this->value[3] = col_type(x3, y3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
this->value[3] = v3;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
typename X4, typename Y4>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2,
X3 const & x3, Y3 const & y3,
X4 const & x4, Y4 const & y4
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3));
this->value[3] = col_type(static_cast<T>(x4), value_type(y4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3,
tvec2<V4, P> const & v4
)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
this->value[3] = col_type(v4);
}
//////////////////////////////////////
// Conversion
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(0);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::size_type tmat4x2<T, P>::size() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::length_type tmat4x2<T, P>::length() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(tmat4x2<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(tmat4x2<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator++(int)
{
tmat4x2<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator--(int)
{
tmat4x2<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v)
{
return typename tmat4x2<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m)
{
return typename tmat4x2<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1],
v.x * m[3][0] + v.y * m[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA20 = m1[2][0];
T const SrcA21 = m1[2][1];
T const SrcA30 = m1[3][0];
T const SrcA31 = m1[3][1];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB02 = m2[0][2];
T const SrcB03 = m2[0][3];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB12 = m2[1][2];
T const SrcB13 = m2[1][3];
tmat2x2<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x2<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s)
{
return tmat4x2<T, P>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
s / m[0],
s / m[1],
s / m[2],
s / m[3]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m)
{
return tmat4x2<T, P>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x3.hpp
/// @date 2006-08-04 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x3
{
typedef tvec3<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x3<T, P> type;
typedef tmat3x4<T, P> transpose_type;
typedef T value_type;
private:
// Data
col_type value[4];
public:
// Constructors
GLM_FUNC_DECL tmat4x3();
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x3(ctor);
GLM_FUNC_DECL explicit tmat4x3(T const & x);
GLM_FUNC_DECL tmat4x3(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
T const & x2, T const & y2, T const & z2,
T const & x3, T const & y3, T const & z3);
GLM_FUNC_DECL tmat4x3(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3);
//////////////////////////////////////
// Conversions
template <
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3,
typename X4, typename Y4, typename Z4>
GLM_FUNC_DECL tmat4x3(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
X3 const & x3, Y3 const & y3, Z3 const & z3,
X4 const & x4, Y4 const & y4, Z4 const & z4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x3(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3,
tvec3<V4, P> const & v4);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator/=(U s);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x3<T, P> & operator++();
GLM_FUNC_DECL tmat4x3<T, P> & operator--();
GLM_FUNC_DECL tmat4x3<T, P> operator++(int);
GLM_FUNC_DECL tmat4x3<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::col_type operator*(tmat4x3<T, P> const & m, typename tmat4x3<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::row_type operator*(typename tmat4x3<T, P>::col_type const & v, tmat4x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat4x3.inl"
#endif //GLM_EXTERNAL_TEMPLATE
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x3.inl
/// @date 2006-04-17 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
this->value[2] = col_type(0, 0, 1);
this->value[3] = col_type(0, 0, 0);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
this->value[3] = m.value[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(T const & s)
{
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
this->value[2] = col_type(0, 0, s);
this->value[3] = col_type(0, 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
T const & x2, T const & y2, T const & z2,
T const & x3, T const & y3, T const & z3
)
{
this->value[0] = col_type(x0, y0, z0);
this->value[1] = col_type(x1, y1, z1);
this->value[2] = col_type(x2, y2, z2);
this->value[3] = col_type(x3, y3, z3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
this->value[3] = v3;
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3,
typename X4, typename Y4, typename Z4>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
X3 const & x3, Y3 const & y3, Z3 const & z3,
X4 const & x4, Y4 const & y4, Z4 const & z4
)
{
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3,
tvec3<V4, P> const & v4
)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
this->value[3] = col_type(v4);
}
//////////////////////////////////////////////////////////////
// Matrix conversions
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1);
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
this->value[3] = col_type(m[3], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x4<T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(0);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::size_type tmat4x3<T, P>::size() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::length_type tmat4x3<T, P>::length() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Unary updatable operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(tmat4x3<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(tmat4x3<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
//////////////////////////////////////////////////////////////
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type operator*
(
tmat4x3<T, P> const & m,
typename tmat4x3<T, P>::row_type const & v)
{
return typename tmat4x3<T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::row_type operator*
(
typename tmat4x3<T, P>::col_type const & v,
tmat4x3<T, P> const & m)
{
return typename tmat4x3<T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],
v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA02 = m1[0][2];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA12 = m1[1][2];
T const SrcA20 = m1[2][0];
T const SrcA21 = m1[2][1];
T const SrcA22 = m1[2][2];
T const SrcA30 = m1[3][0];
T const SrcA31 = m1[3][1];
T const SrcA32 = m1[3][2];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB02 = m2[0][2];
T const SrcB03 = m2[0][3];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB12 = m2[1][2];
T const SrcB13 = m2[1][3];
T const SrcB20 = m2[2][0];
T const SrcB21 = m2[2][1];
T const SrcB22 = m2[2][2];
T const SrcB23 = m2[2][3];
tmat3x3<T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13;
Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23;
Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23;
Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x3<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3],
m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3],
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
s / m[0],
s / m[1],
s / m[2],
s / m[3]);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m)
{
return tmat4x3<T, P>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++(tmat4x3<T, P> const & m, int)
{
return tmat4x3<T, P>(
m[0] + T(1),
m[1] + T(1),
m[2] + T(1),
m[3] + T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--(tmat4x3<T, P> const & m, int)
{
return tmat4x3<T, P>(
m[0] - T(1),
m[1] - T(1),
m[2] - T(1),
m[3] - T(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
{
tmat4x3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
{
tmat4x3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x4.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "../fwd.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#include <limits>
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x4
{
typedef tvec4<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x4<T, P> type;
typedef tmat4x4<T, P> transpose_type;
typedef T value_type;
template <typename U, precision Q>
friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);
template <typename U, precision Q>
friend tvec4<U, Q> operator/(tvec4<U, Q> const & v, tmat4x4<U, Q> const & m);
private:
/// @cond DETAIL
col_type value[4];
/// @endcond
public:
// Constructors
GLM_FUNC_DECL tmat4x4();
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x4(ctor);
GLM_FUNC_DECL explicit tmat4x4(T const & x);
GLM_FUNC_DECL tmat4x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2,
T const & x3, T const & y3, T const & z3, T const & w3);
GLM_FUNC_DECL tmat4x4(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3);
//////////////////////////////////////
// Conversions
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_DECL tmat4x4(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x4(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3,
tvec4<V4, P> const & v4);
//////////////////////////////////////
// Matrix conversions
# ifdef GLM_FORCE_EXPLICIT_CTOR
template <typename U, precision Q>
GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, Q> const & m);
# else
template <typename U, precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<U, Q> const & m);
# endif
GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
GLM_FUNC_DECL col_type & operator[](size_type i);
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
# else
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(tmat4x4<U, P> const & m);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tmat4x4<T, P> & operator++();
GLM_FUNC_DECL tmat4x4<T, P> & operator--();
GLM_FUNC_DECL tmat4x4<T, P> operator++(int);
GLM_FUNC_DECL tmat4x4<T, P> operator--(int);
};
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator*(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator*(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type & v, tmat4x4<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_mat4x4.inl"
#endif//GLM_EXTERNAL_TEMPLATE
///////////////////////////////////////////////////////////////////////////////////
/// 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 core
/// @file glm/detail/type_mat4x4.inl
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> compute_inverse(tmat4x4<T, P> const & m)
{
T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
tvec4<T, P> Fac0(Coef00, Coef00, Coef02, Coef03);
tvec4<T, P> Fac1(Coef04, Coef04, Coef06, Coef07);
tvec4<T, P> Fac2(Coef08, Coef08, Coef10, Coef11);
tvec4<T, P> Fac3(Coef12, Coef12, Coef14, Coef15);
tvec4<T, P> Fac4(Coef16, Coef16, Coef18, Coef19);
tvec4<T, P> Fac5(Coef20, Coef20, Coef22, Coef23);
tvec4<T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);
tvec4<T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);
tvec4<T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);
tvec4<T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);
tvec4<T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
tvec4<T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
tvec4<T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
tvec4<T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
tvec4<T, P> SignA(+1, -1, +1, -1);
tvec4<T, P> SignB(-1, +1, -1, +1);
tmat4x4<T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB);
tvec4<T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
tvec4<T, P> Dot0(m[0] * Row0);
T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w);
T OneOverDeterminant = static_cast<T>(1) / Dot1;
return Inverse * OneOverDeterminant;
}
}//namespace detail
//////////////////////////////////////////////////////////////
// Constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
this->value[3] = col_type(0, 0, 0, 1);
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, Q> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(T const & s)
{
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
this->value[2] = col_type(0, 0, s, 0);
this->value[3] = col_type(0, 0, 0, s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2,
T const & x3, T const & y3, T const & z3, T const & w3
)
{
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
this->value[3] = col_type(x3, y3, z3, w3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3
)
{
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
this->value[3] = v3;
}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tmat4x4<U, Q> const & m
)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[3] = col_type(m[3]);
}
//////////////////////////////////////
// Conversion constructors
template <typename T, precision P>
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4
)
{
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3));
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3,
tvec4<V4, P> const & v4
)
{
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
this->value[2] = col_type(v3);
this->value[3] = col_type(v4);
}
//////////////////////////////////////
// Matrix convertion constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 0, 0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x2<T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0);
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x4<T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x3<T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[3] = col_type(m[3], 1);
}
//////////////////////////////////////
// Accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::size_type tmat4x4<T, P>::size() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i)
{
assert(i < this->size());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i) const
{
assert(i < this->size());
return this->value[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::length_type tmat4x4<T, P>::length() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////////////////////////////
// Operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[3] = m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(tmat4x4<U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(tmat4x4<U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(tmat4x4<U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(tmat4x4<U, P> const & m)
{
return (*this = *this * detail::compute_inverse<T, P>(m));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator++(int)
{
tmat4x4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator--(int)
{
tmat4x4<T, P> Result(*this);
--*this;
return Result;
}
// Binary operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x4<T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
s - m[0],
s - m[1],
s - m[2],
s - m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return tmat4x4<T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator*
(
tmat4x4<T, P> const & m,
typename tmat4x4<T, P>::row_type const & v
)
{
/*
__m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0));
__m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1));
__m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2));
__m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 m0 = _mm_mul_ps(m[0].data, v0);
__m128 m1 = _mm_mul_ps(m[1].data, v1);
__m128 a0 = _mm_add_ps(m0, m1);
__m128 m2 = _mm_mul_ps(m[2].data, v2);
__m128 m3 = _mm_mul_ps(m[3].data, v3);
__m128 a1 = _mm_add_ps(m2, m3);
__m128 a2 = _mm_add_ps(a0, a1);
return typename tmat4x4<T, P>::col_type(a2);
*/
typename tmat4x4<T, P>::col_type const Mov0(v[0]);
typename tmat4x4<T, P>::col_type const Mov1(v[1]);
typename tmat4x4<T, P>::col_type const Mul0 = m[0] * Mov0;
typename tmat4x4<T, P>::col_type const Mul1 = m[1] * Mov1;
typename tmat4x4<T, P>::col_type const Add0 = Mul0 + Mul1;
typename tmat4x4<T, P>::col_type const Mov2(v[2]);
typename tmat4x4<T, P>::col_type const Mov3(v[3]);
typename tmat4x4<T, P>::col_type const Mul2 = m[2] * Mov2;
typename tmat4x4<T, P>::col_type const Mul3 = m[3] * Mov3;
typename tmat4x4<T, P>::col_type const Add1 = Mul2 + Mul3;
typename tmat4x4<T, P>::col_type const Add2 = Add0 + Add1;
return Add2;
/*
return typename tmat4x4<T, P>::col_type(
m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3],
m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3],
m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3],
m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]);
*/
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator*
(
typename tmat4x4<T, P>::col_type const & v,
tmat4x4<T, P> const & m
)
{
return typename tmat4x4<T, P>::row_type(
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3],
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3],
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3],
m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2)
{
return tmat2x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2)
{
return tmat3x4<T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3],
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3],
m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3],
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
typename tmat4x4<T, P>::col_type const SrcA0 = m1[0];
typename tmat4x4<T, P>::col_type const SrcA1 = m1[1];
typename tmat4x4<T, P>::col_type const SrcA2 = m1[2];
typename tmat4x4<T, P>::col_type const SrcA3 = m1[3];
typename tmat4x4<T, P>::col_type const SrcB0 = m2[0];
typename tmat4x4<T, P>::col_type const SrcB1 = m2[1];
typename tmat4x4<T, P>::col_type const SrcB2 = m2[2];
typename tmat4x4<T, P>::col_type const SrcB3 = m2[3];
tmat4x4<T, P> Result(uninitialize);
Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3];
Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3];
Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3];
Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
s / m[0],
s / m[1],
s / m[2],
s / m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v)
{
return detail::compute_inverse<T, P>(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m)
{
return v * detail::compute_inverse<T, P>(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
tmat4x4<T, P> m1_copy(m1);
return m1_copy /= m2;
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m)
{
return tmat4x4<T, P>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator++(tmat4x4<T, P> const & m, int)
{
return tmat4x4<T, P>(
m[0] + static_cast<T>(1),
m[1] + static_cast<T>(1),
m[2] + static_cast<T>(1),
m[3] + static_cast<T>(1));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator--(tmat4x4<T, P> const & m, int)
{
return tmat4x4<T, P>(
m[0] - static_cast<T>(1),
m[1] - static_cast<T>(1),
m[2] - static_cast<T>(1),
m[3] - static_cast<T>(1));
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
}//namespace glm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment