1b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/////////////////////////////////////////////////////////////////////////////////// 2b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// OpenGL Mathematics (glm.g-truc.net) 3b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 4b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) 5b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// Permission is hereby granted, free of charge, to any person obtaining a copy 6b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// of this software and associated documentation files (the "Software"), to deal 7b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// in the Software without restriction, including without limitation the rights 8b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// copies of the Software, and to permit persons to whom the Software is 10b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// furnished to do so, subject to the following conditions: 11b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 12b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// The above copyright notice and this permission notice shall be included in 13b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// all copies or substantial portions of the Software. 14b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 15b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// THE SOFTWARE. 22b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 23b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @ref gtc_matrix_transform 24b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @file glm/gtc/matrix_transform.hpp 25b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @date 2009-04-29 / 2011-05-16 26b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @author Christophe Riccio 27b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 28b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @see core (dependence) 29b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @see gtx_transform 30b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @see gtx_transform2 31b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 32b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform 33b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @ingroup gtc 34b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 35b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @brief Defines functions that generate common transformation matrices. 36b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 37b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// The matrices generated by this extension use standard OpenGL fixed-function 38b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// conventions. For example, the lookAt function generates a transform from world 39b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// space into the specific eye space that the projective matrix functions 40b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility 41b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// specifications defines the particular layout of this eye space. 42b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 43b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// <glm/gtc/matrix_transform.hpp> need to be included to use these functionalities. 44b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/////////////////////////////////////////////////////////////////////////////////// 45b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 46b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#ifndef GLM_GTC_matrix_transform 47b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#define GLM_GTC_matrix_transform 48b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 49b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG// Dependency: 50b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "../mat4x4.hpp" 51b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "../vec2.hpp" 52b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "../vec3.hpp" 53b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "../vec4.hpp" 54b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 55b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 56b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG# pragma message("GLM: GLM_GTC_matrix_transform extension included") 57b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#endif 58b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 59b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarGnamespace glm 60b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG{ 61b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @addtogroup gtc_matrix_transform 62b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @{ 63b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 64b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Builds a translation 4 * 4 matrix created from a vector of 3 components. 65b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 66b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param m Input matrix multiplied by this translation matrix. 67b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param v Coordinates of a translation vector. 68b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 69b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @code 70b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// #include <glm/glm.hpp> 71b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// #include <glm/gtc/matrix_transform.hpp> 72b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// ... 73b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); 74b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f 75b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f 76b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f 77b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f 78b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @endcode 79b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 80b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtx_transform 81b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - translate(T x, T y, T z) 82b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - translate(detail::tmat4x4<T, P> const & m, T x, T y, T z) 83b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - translate(detail::tvec3<T, P> const & v) 84b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 85b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> translate( 86b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & m, 87b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & v); 88b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 89b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. 90b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 91b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param m Input matrix multiplied by this rotation matrix. 92b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 93b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param axis Rotation axis, recommanded to be normalized. 94b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Supported: half, float or double. 95b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 96b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtx_transform 97b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - rotate(T angle, T x, T y, T z) 98b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - rotate(detail::tmat4x4<T, P> const & m, T angle, T x, T y, T z) 99b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - rotate(T angle, detail::tvec3<T, P> const & v) 100b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 101b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> rotate( 102b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & m, 103b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & angle, 104b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & axis); 105b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 106b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Builds a scale 4 * 4 matrix created from 3 scalars. 107b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 108b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param m Input matrix multiplied by this scale matrix. 109b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param v Ratio of scaling for each axis. 110b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 111b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 112b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtx_transform 113b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - scale(T x, T y, T z) scale(T const & x, T const & y, T const & z) 114b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - scale(detail::tmat4x4<T, P> const & m, T x, T y, T z) 115b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - scale(detail::tvec3<T, P> const & v) 116b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 117b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> scale( 118b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & m, 119b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & v); 120b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 121b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a matrix for an orthographic parallel viewing volume. 122b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 123b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param left 124b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param right 125b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param bottom 126b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param top 127b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param zNear 128b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param zFar 129b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 130b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 131b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top) 132b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T> 133b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, defaultp> ortho( 134b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & left, 135b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & right, 136b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & bottom, 137b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & top, 138b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & zNear, 139b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & zFar); 140b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 141b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a matrix for projecting two-dimensional coordinates onto the screen. 142b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 143b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param left 144b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param right 145b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param bottom 146b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param top 147b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 148b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 149b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) 150b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T> 151b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, defaultp> ortho( 152b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & left, 153b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & right, 154b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & bottom, 155b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & top); 156b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 157b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a frustum matrix. 158b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 159b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param left 160b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param right 161b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param bottom 162b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param top 163b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param near 164b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param far 165b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 166b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 167b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 168b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> frustum( 169b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & left, 170b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & right, 171b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & bottom, 172b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & top, 173b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & near, 174b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & far); 175b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 176b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a matrix for a symetric perspective-view frustum. 177b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 178b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 179b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param aspect 180b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param near 181b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param far 182b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 183b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 184b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 185b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> perspective( 186b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & fovy, 187b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & aspect, 188b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & near, 189b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & far); 190b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 191b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Builds a perspective projection matrix based on a field of view. 192b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 193b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param fov Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 194b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param width 195b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param height 196b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param near 197b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param far 198b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 199b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 200b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 201b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> perspectiveFov( 202b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & fov, 203b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & width, 204b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & height, 205b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & near, 206b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T const & far); 207b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 208b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite. 209b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 210b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 211b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param aspect 212b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param near 213b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 214b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 215b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 216b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> infinitePerspective( 217b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T fovy, T aspect, T near); 218b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 219b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. 220b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 221b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param fovy Expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 222b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param aspect 223b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param near 224b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 225b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 226b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 227b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> tweakedInfinitePerspective( 228b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG T fovy, T aspect, T near); 229b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 230b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. 231b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 232b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param obj 233b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param model 234b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param proj 235b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param viewport 236b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. 237b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam U Currently supported: Floating-point types and integer types. 238b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 239b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, typename U, precision P> 240b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tvec3<T, P> project( 241b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & obj, 242b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & model, 243b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & proj, 244b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec4<U, P> const & viewport); 245b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 246b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. 247b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 248b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param win 249b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param model 250b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param proj 251b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param viewport 252b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. 253b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam U Currently supported: Floating-point types and integer types. 254b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 255b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, typename U, precision P> 256b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tvec3<T, P> unProject( 257b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & win, 258b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & model, 259b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tmat4x4<T, P> const & proj, 260b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec4<U, P> const & viewport); 261b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 262b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Define a picking region 263b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 264b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param center 265b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param delta 266b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param viewport 267b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. 268b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam U Currently supported: Floating-point types and integer types. 269b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 270b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P, typename U> 271b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> pickMatrix( 272b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec2<T, P> const & center, 273b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec2<T, P> const & delta, 274b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec4<U, P> const & viewport); 275b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 276b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Build a look at view matrix. 277b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 278b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param eye Position of the camera 279b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param center Position where the camera is looking at 280b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) 281b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see gtc_matrix_transform 282b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) 283b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P> 284b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL detail::tmat4x4<T, P> lookAt( 285b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & eye, 286b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & center, 287b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG detail::tvec3<T, P> const & up); 288b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 289b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @} 290b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG}//namespace glm 291b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 292b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "matrix_transform.inl" 293b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 294b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#endif//GLM_GTC_matrix_transform 295