quaternion.hpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 #pragma once
00041 
00042 // Dependency:
00043 #include "../mat3x3.hpp"
00044 #include "../mat4x4.hpp"
00045 #include "../vec3.hpp"
00046 #include "../vec4.hpp"
00047 #include "../gtc/constants.hpp"
00048 
00049 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
00050 #       pragma message("GLM: GLM_GTC_quaternion extension included")
00051 #endif
00052 
00053 namespace glm{
00054 namespace detail
00055 {
00056         template <typename T, precision P>
00057         struct tquat
00058         {
00059                 enum ctor{null};
00060 
00061                 typedef T value_type;
00062                 typedef tvec4<bool, P> bool_type;
00063 
00064         public:
00065                 T x, y, z, w;
00066 
00067                 GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
00068 
00069                 // Constructors
00070                 GLM_FUNC_DECL tquat();
00071                 template <typename U, precision Q>
00072                 GLM_FUNC_DECL explicit tquat(
00073                         tquat<U, Q> const & q);
00074                 GLM_FUNC_DECL tquat(
00075                         T const & s,
00076                         tvec3<T, P> const & v);
00077                 GLM_FUNC_DECL tquat(
00078                         T const & w,
00079                         T const & x,
00080                         T const & y,
00081                         T const & z);
00082 
00083                 // Convertions
00084 
00091                 GLM_FUNC_DECL explicit tquat(
00092                         detail::tvec3<T, P> const & u,
00093                         detail::tvec3<T, P> const & v);
00095                 GLM_FUNC_DECL explicit tquat(
00096                         tvec3<T, P> const & eulerAngles);
00097                 GLM_FUNC_DECL explicit tquat(
00098                         tmat3x3<T, P> const & m);
00099                 GLM_FUNC_DECL explicit tquat(
00100                         tmat4x4<T, P> const & m);
00101 
00102                 // Accesses
00103                 GLM_FUNC_DECL T & operator[](length_t i);
00104                 GLM_FUNC_DECL T const & operator[](length_t i) const;
00105 
00106                 // Operators
00107                 GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<T, P> const & q);
00108                 GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<T, P> const & q);
00109                 GLM_FUNC_DECL tquat<T, P> & operator*=(T const & s);
00110                 GLM_FUNC_DECL tquat<T, P> & operator/=(T const & s);
00111         };
00112 
00113         template <typename T, precision P>
00114         GLM_FUNC_DECL detail::tquat<T, P> operator- (
00115                 detail::tquat<T, P> const & q);
00116 
00117         template <typename T, precision P>
00118         GLM_FUNC_DECL detail::tquat<T, P> operator+ (
00119                 detail::tquat<T, P> const & q,
00120                 detail::tquat<T, P> const & p);
00121 
00122         template <typename T, precision P>
00123         GLM_FUNC_DECL detail::tquat<T, P> operator* (
00124                 detail::tquat<T, P> const & q,
00125                 detail::tquat<T, P> const & p);
00126 
00127         template <typename T, precision P>
00128         GLM_FUNC_DECL detail::tvec3<T, P> operator* (
00129                 detail::tquat<T, P> const & q,
00130                 detail::tvec3<T, P> const & v);
00131 
00132         template <typename T, precision P>
00133         GLM_FUNC_DECL detail::tvec3<T, P> operator* (
00134                 detail::tvec3<T, P> const & v,
00135                 detail::tquat<T, P> const & q);
00136 
00137         template <typename T, precision P>
00138         GLM_FUNC_DECL detail::tvec4<T, P> operator* (
00139                 detail::tquat<T, P> const & q, 
00140                 detail::tvec4<T, P> const & v);
00141 
00142         template <typename T, precision P>
00143         GLM_FUNC_DECL detail::tvec4<T, P> operator* (
00144                 detail::tvec4<T, P> const & v,
00145                 detail::tquat<T, P> const & q);
00146 
00147         template <typename T, precision P>
00148         GLM_FUNC_DECL detail::tquat<T, P> operator* (
00149                 detail::tquat<T, P> const & q,
00150                 T const & s);
00151 
00152         template <typename T, precision P>
00153         GLM_FUNC_DECL detail::tquat<T, P> operator* (
00154                 T const & s,
00155                 detail::tquat<T, P> const & q);
00156 
00157         template <typename T, precision P>
00158         GLM_FUNC_DECL detail::tquat<T, P> operator/ (
00159                 detail::tquat<T, P> const & q,
00160                 T const & s);
00161 
00162 } //namespace detail
00163 
00166 
00170         template <typename T, precision P>
00171         GLM_FUNC_DECL T length(
00172                 detail::tquat<T, P> const & q);
00173 
00177         template <typename T, precision P>
00178         GLM_FUNC_DECL detail::tquat<T, P> normalize(
00179                 detail::tquat<T, P> const & q);
00180                 
00184         template <typename T, precision P, template <typename, precision> class quatType>
00185         GLM_FUNC_DECL T dot(
00186                 quatType<T, P> const & x,
00187                 quatType<T, P> const & y);
00188 
00199         template <typename T, precision P>
00200         GLM_FUNC_DECL detail::tquat<T, P> mix(
00201                 detail::tquat<T, P> const & x,
00202                 detail::tquat<T, P> const & y,
00203                 T const & a);
00204 
00213         template <typename T, precision P>
00214         GLM_FUNC_DECL detail::tquat<T, P> lerp(
00215                 detail::tquat<T, P> const & x,
00216                 detail::tquat<T, P> const & y,
00217                 T const & a);
00218 
00227         template <typename T, precision P>
00228         GLM_FUNC_DECL detail::tquat<T, P> slerp(
00229                 detail::tquat<T, P> const & x,
00230                 detail::tquat<T, P> const & y,
00231                 T const & a);
00232 
00236         template <typename T, precision P>
00237         GLM_FUNC_DECL detail::tquat<T, P> conjugate(
00238                 detail::tquat<T, P> const & q);
00239 
00243         template <typename T, precision P>
00244         GLM_FUNC_DECL detail::tquat<T, P> inverse(
00245                 detail::tquat<T, P> const & q);
00246 
00254         template <typename T, precision P>
00255         GLM_FUNC_DECL detail::tquat<T, P> rotate(
00256                 detail::tquat<T, P> const & q,
00257                 T const & angle,
00258                 detail::tvec3<T, P> const & axis);
00259 
00264         template <typename T, precision P>
00265         GLM_FUNC_DECL detail::tvec3<T, P> eulerAngles(
00266                 detail::tquat<T, P> const & x);
00267 
00271         template <typename T, precision P>
00272         GLM_FUNC_DECL T roll(detail::tquat<T, P> const & x);
00273 
00277         template <typename T, precision P>
00278         GLM_FUNC_DECL T pitch(detail::tquat<T, P> const & x);
00279 
00283         template <typename T, precision P>
00284         GLM_FUNC_DECL T yaw(detail::tquat<T, P> const & x);
00285 
00289         template <typename T, precision P>
00290         GLM_FUNC_DECL detail::tmat3x3<T, P> mat3_cast(
00291                 detail::tquat<T, P> const & x);
00292 
00296         template <typename T, precision P>
00297         GLM_FUNC_DECL detail::tmat4x4<T, P> mat4_cast(
00298                 detail::tquat<T, P> const & x);
00299 
00303         template <typename T, precision P>
00304         GLM_FUNC_DECL detail::tquat<T, P> quat_cast(
00305                 detail::tmat3x3<T, P> const & x);
00306 
00310         template <typename T, precision P>
00311         GLM_FUNC_DECL detail::tquat<T, P> quat_cast(
00312                 detail::tmat4x4<T, P> const & x);
00313 
00317         template <typename T, precision P>
00318         GLM_FUNC_DECL T angle(detail::tquat<T, P> const & x);
00319 
00323         template <typename T, precision P>
00324         GLM_FUNC_DECL detail::tvec3<T, P> axis(
00325                 detail::tquat<T, P> const & x);
00326 
00333         template <typename T, precision P>
00334         GLM_FUNC_DECL detail::tquat<T, P> angleAxis(
00335                 T const & angle,
00336                 detail::tvec3<T, P> const & axis);
00337 
00343         template <typename T, precision P>
00344         GLM_FUNC_DECL detail::tvec4<bool, P> lessThan(
00345                 detail::tquat<T, P> const & x, 
00346                 detail::tquat<T, P> const & y);
00347 
00353         template <typename T, precision P>
00354         GLM_FUNC_DECL detail::tvec4<bool, P> lessThanEqual(
00355                 detail::tquat<T, P> const & x, 
00356                 detail::tquat<T, P> const & y);
00357 
00363         template <typename T, precision P>
00364         GLM_FUNC_DECL detail::tvec4<bool, P> greaterThan(
00365                 detail::tquat<T, P> const & x, 
00366                 detail::tquat<T, P> const & y);
00367 
00373         template <typename T, precision P>
00374         GLM_FUNC_DECL detail::tvec4<bool, P> greaterThanEqual(
00375                 detail::tquat<T, P> const & x, 
00376                 detail::tquat<T, P> const & y);
00377 
00383         template <typename T, precision P>
00384         GLM_FUNC_DECL detail::tvec4<bool, P> equal(
00385                 detail::tquat<T, P> const & x, 
00386                 detail::tquat<T, P> const & y);
00387 
00393         template <typename T, precision P>
00394         GLM_FUNC_DECL detail::tvec4<bool, P> notEqual(
00395                 detail::tquat<T, P> const & x, 
00396                 detail::tquat<T, P> const & y);
00397 
00399 } //namespace glm
00400 
00401 #include "quaternion.inl"


rtabmap
Author(s): Mathieu Labbe
autogenerated on Sat Jul 23 2016 11:44:17