mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-07 09:13:22 +08:00
Updated GLM version w/ now standard radians as angles.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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
|
||||
@@ -12,6 +12,10 @@
|
||||
/// 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
|
||||
@@ -36,14 +40,13 @@
|
||||
/// <glm/gtx/transform2.hpp> need to be included to use these functionalities.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GLM_GTX_transform2
|
||||
#define GLM_GTX_transform2 GLM_VERSION
|
||||
#pragma once
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
#include "../gtx/transform.hpp"
|
||||
|
||||
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
|
||||
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
|
||||
# pragma message("GLM: GLM_GTX_transform2 extension included")
|
||||
#endif
|
||||
|
||||
@@ -54,76 +57,76 @@ namespace glm
|
||||
|
||||
//! Transforms a matrix with a shearing on X axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat3x3<T> shearX2D(
|
||||
detail::tmat3x3<T> const & m,
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> shearX2D(
|
||||
tmat3x3<T, P> const & m,
|
||||
T y);
|
||||
|
||||
//! Transforms a matrix with a shearing on Y axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat3x3<T> shearY2D(
|
||||
detail::tmat3x3<T> const & m,
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> shearY2D(
|
||||
tmat3x3<T, P> const & m,
|
||||
T x);
|
||||
|
||||
//! Transforms a matrix with a shearing on X axis
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat4x4<T> shearX3D(
|
||||
const detail::tmat4x4<T> & m,
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> shearX3D(
|
||||
const tmat4x4<T, P> & m,
|
||||
T y,
|
||||
T z);
|
||||
|
||||
|
||||
//! Transforms a matrix with a shearing on Y axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat4x4<T> shearY3D(
|
||||
const detail::tmat4x4<T> & m,
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> shearY3D(
|
||||
const tmat4x4<T, P> & m,
|
||||
T x,
|
||||
T z);
|
||||
|
||||
|
||||
//! Transforms a matrix with a shearing on Z axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat4x4<T> shearZ3D(
|
||||
const detail::tmat4x4<T> & m,
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> shearZ3D(
|
||||
const tmat4x4<T, P> & m,
|
||||
T x,
|
||||
T y);
|
||||
|
||||
//template <typename T> GLM_FUNC_QUALIFIER detail::tmat4x4<T> shear(const detail::tmat4x4<T> & m, shearPlane, planePoint, angle)
|
||||
//template <typename T> GLM_FUNC_QUALIFIER tmat4x4<T, P> shear(const tmat4x4<T, P> & m, shearPlane, planePoint, angle)
|
||||
// Identity + tan(angle) * cross(Normal, OnPlaneVector) 0
|
||||
// - dot(PointOnPlane, normal) * OnPlaneVector 1
|
||||
|
||||
// Reflect functions seem to don't work
|
||||
//template <typename T> detail::tmat3x3<T> reflect2D(const detail::tmat3x3<T> & m, const detail::tvec3<T>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
|
||||
//template <typename T> detail::tmat4x4<T> reflect3D(const detail::tmat4x4<T> & m, const detail::tvec3<T>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
|
||||
//template <typename T> tmat3x3<T, P> reflect2D(const tmat3x3<T, P> & m, const tvec3<T, P>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
|
||||
//template <typename T> tmat4x4<T, P> reflect3D(const tmat4x4<T, P> & m, const tvec3<T, P>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)
|
||||
|
||||
//! Build planar projection matrix along normal axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat3x3<T> proj2D(
|
||||
const detail::tmat3x3<T> & m,
|
||||
const detail::tvec3<T>& normal);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> proj2D(
|
||||
const tmat3x3<T, P> & m,
|
||||
const tvec3<T, P>& normal);
|
||||
|
||||
//! Build planar projection matrix along normal axis.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename T>
|
||||
detail::tmat4x4<T> proj3D(
|
||||
const detail::tmat4x4<T> & m,
|
||||
const detail::tvec3<T>& normal);
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> proj3D(
|
||||
const tmat4x4<T, P> & m,
|
||||
const tvec3<T, P>& normal);
|
||||
|
||||
//! Build a scale bias matrix.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename valType>
|
||||
detail::tmat4x4<valType> scaleBias(
|
||||
template <typename valType, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<valType, P> scaleBias(
|
||||
valType scale,
|
||||
valType bias);
|
||||
|
||||
//! Build a scale bias matrix.
|
||||
//! From GLM_GTX_transform2 extension.
|
||||
template <typename valType>
|
||||
detail::tmat4x4<valType> scaleBias(
|
||||
detail::tmat4x4<valType> const & m,
|
||||
template <typename valType, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<valType, P> scaleBias(
|
||||
tmat4x4<valType, P> const & m,
|
||||
valType scale,
|
||||
valType bias);
|
||||
|
||||
@@ -131,5 +134,3 @@ namespace glm
|
||||
}// namespace glm
|
||||
|
||||
#include "transform2.inl"
|
||||
|
||||
#endif//GLM_GTX_transform2
|
||||
|
||||
Reference in New Issue
Block a user