/// @ref ext_quaternion_transform /// @file glm/ext/quaternion_transform.hpp /// /// @see core (dependence) /// /// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform /// @ingroup ext /// /// Include to use the features of this extension. /// /// Defines a templated quaternion type and several quaternion operations. #pragma once // Dependency: #include "../common.hpp" #include "../trigonometric.hpp" #include "../geometric.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_quaternion_transform extension included") #endif namespace glm { /// @addtogroup ext_quaternion_transform /// @{ /// Rotates a quaternion from a vector of 3 components axis and an angle. /// /// @param q Source orientation /// @param angle Angle expressed in radians. /// @param axis Axis of the rotation /// /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see ext_quaternion_transform template GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); /// Build a look at quaternion based on the default handedness. /// /// @param direction Desired forward direction. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template GLM_FUNC_DECL qua quatLookAt( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// Build a right-handed look at quaternion. /// /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template GLM_FUNC_DECL qua quatLookAtRH( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// Build a left-handed look at quaternion. /// /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template GLM_FUNC_DECL qua quatLookAtLH( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// @} } //namespace glm #include "quaternion_transform.inl"