/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2006-11-02 // Updated : 2009-02-19 // Licence : This source is under MIT License // File : glm/gtx/rotate_vector.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// // Dependency: // - GLM core /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_rotate_vector #define glm_gtx_rotate_vector // Dependency: #include "../glm.hpp" #include "../gtx/transform.hpp" #if(defined(GLM_MESSAGES) && !defined(glm_ext)) # pragma message("GLM: GLM_GTX_rotate_vector extension included") #endif namespace glm{ namespace gtx{ namespace rotate_vector ///< GLM_GTX_rotate_vector extension: Function to directly rotate a vector { using namespace transform; /// \addtogroup gtx_rotate_vector /// @{ //! Rotate a two dimensional vector. //! From GLM_GTX_rotate_vector extension. template detail::tvec2 rotate( detail::tvec2 const & v, T const & angle); //! Rotate a three dimensional vector around an axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec3 rotate( detail::tvec3 const & v, T const & angle, detail::tvec3 const & normal); //! Rotate a four dimensional vector around an axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec4 rotate( detail::tvec4 const & v, T const & angle, detail::tvec3 const & normal); //! Rotate a three dimensional vector around the X axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec3 rotateX( detail::tvec3 const & v, T const & angle); //! Rotate a three dimensional vector around the Y axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec3 rotateY( detail::tvec3 const & v, T const & angle); //! Rotate a three dimensional vector around the Z axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec3 rotateZ( detail::tvec3 const & v, T const & angle); //! Rotate a four dimentionnals vector around the X axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec4 rotateX( detail::tvec4 const & v, T const & angle); //! Rotate a four dimensional vector around the X axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec4 rotateY( detail::tvec4 const & v, T const & angle); //! Rotate a four dimensional vector around the X axis. //! From GLM_GTX_rotate_vector extension. template detail::tvec4 rotateZ( detail::tvec4 const & v, T const & angle); //! Build a rotation matrix from a normal and a up vector. //! From GLM_GTX_rotate_vector extension. template detail::tmat4x4 orientation( detail::tvec3 const & Normal, detail::tvec3 const & Up); /// @} }//namespace rotate_vector }//namespace gtx }//namespace glm #include "rotate_vector.inl" namespace glm{using namespace gtx::rotate_vector;} #endif//glm_gtx_rotate_vector