Updated GLM version w/ now standard radians as angles.

This commit is contained in:
J. de Vries
2016-05-11 20:04:52 +02:00
parent 336df22af5
commit a4c2bb2498
321 changed files with 42426 additions and 35972 deletions

View File

@@ -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/rotate_vector.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_GTX_rotate_vector
#define GLM_GTX_rotate_vector 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_rotate_vector extension included")
#endif
@@ -52,81 +55,92 @@ namespace glm
/// @addtogroup gtx_rotate_vector
/// @{
/// Returns Spherical interpolation between two vectors
///
/// @param x A first vector
/// @param y A second vector
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
///
/// @see gtx_rotate_vector
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> slerp(
tvec3<T, P> const & x,
tvec3<T, P> const & y,
T const & a);
//! Rotate a two dimensional vector.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec2<T> rotate(
detail::tvec2<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> rotate(
tvec2<T, P> const & v,
T const & angle);
//! Rotate a three dimensional vector around an axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec3<T> rotate(
detail::tvec3<T> const & v,
T const & angle,
detail::tvec3<T> const & normal);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> rotate(
tvec3<T, P> const & v,
T const & angle,
tvec3<T, P> const & normal);
//! Rotate a four dimensional vector around an axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec4<T> rotate(
detail::tvec4<T> const & v,
T const & angle,
detail::tvec3<T> const & normal);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> rotate(
tvec4<T, P> const & v,
T const & angle,
tvec3<T, P> const & normal);
//! Rotate a three dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec3<T> rotateX(
detail::tvec3<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> rotateX(
tvec3<T, P> const & v,
T const & angle);
//! Rotate a three dimensional vector around the Y axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec3<T> rotateY(
detail::tvec3<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> rotateY(
tvec3<T, P> const & v,
T const & angle);
//! Rotate a three dimensional vector around the Z axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec3<T> rotateZ(
detail::tvec3<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> rotateZ(
tvec3<T, P> const & v,
T const & angle);
//! Rotate a four dimentionnals vector around the X axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec4<T> rotateX(
detail::tvec4<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> rotateX(
tvec4<T, P> const & v,
T const & angle);
//! Rotate a four dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec4<T> rotateY(
detail::tvec4<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> rotateY(
tvec4<T, P> const & v,
T const & angle);
//! Rotate a four dimensional vector around the X axis.
//! Rotate a four dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tvec4<T> rotateZ(
detail::tvec4<T> const & v,
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> rotateZ(
tvec4<T, P> const & v,
T const & angle);
//! Build a rotation matrix from a normal and a up vector.
//! From GLM_GTX_rotate_vector extension.
template <typename T>
detail::tmat4x4<T> orientation(
detail::tvec3<T> const & Normal,
detail::tvec3<T> const & Up);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> orientation(
tvec3<T, P> const & Normal,
tvec3<T, P> const & Up);
/// @}
}//namespace glm
#include "rotate_vector.inl"
#endif//GLM_GTX_rotate_vector