72 lines
2.2 KiB
C++
72 lines
2.2 KiB
C++
/// @ref ext_quaternion_transform
|
|
/// @file glm/ext/quaternion_transform.hpp
|
|
///
|
|
/// @see core (dependence)
|
|
///
|
|
/// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform
|
|
/// @ingroup ext
|
|
///
|
|
/// Include <glm/ext/quaternion_transform.hpp> 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<typename T, qualifier Q>
|
|
GLM_FUNC_DECL qua<T, Q> rotate(qua<T, Q> 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<typename T, qualifier Q>
|
|
GLM_FUNC_DECL qua<T, Q> 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<typename T, qualifier Q>
|
|
GLM_FUNC_DECL qua<T, Q> 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<typename T, qualifier Q>
|
|
GLM_FUNC_DECL qua<T, Q> quatLookAtLH(
|
|
vec<3, T, Q> const& direction,
|
|
vec<3, T, Q> const& up);
|
|
/// @}
|
|
} //namespace glm
|
|
|
|
#include "quaternion_transform.inl"
|