\hypertarget{class_ogre_1_1_quaternion}{}\section{Ogre\+:\+:Quaternion Class Reference}
\label{class_ogre_1_1_quaternion}\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}


Implementation of a \hyperlink{class_ogre_1_1_quaternion}{Quaternion}, i.\+e.  




{\ttfamily \#include $<$Ogre\+Quaternion.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_quaternion_ab58dc0c4c04d0579ce9321a719f10d5c}{Quaternion} ()
\begin{DoxyCompactList}\small\item\em Default constructor, initializes to identity rotation (aka 0°) \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_a9b45997a81d85662350808b7043d535d}{Quaternion} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fW, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fX, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fY, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fZ)
\begin{DoxyCompactList}\small\item\em Construct from an explicit list of values. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_acdcb70a4f122452b6fa70d7cf5ce3cf3}{Quaternion} (const \hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&rot)
\begin{DoxyCompactList}\small\item\em Construct a quaternion from a rotation matrix. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_a7f25c623d95186b58f6367dcd097a5ba}{Quaternion} (const \hyperlink{class_ogre_1_1_radian}{Radian} \&rf\+Angle, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&rk\+Axis)
\begin{DoxyCompactList}\small\item\em Construct a quaternion from an angle/axis. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_a1140011dc0793a81c55f2d078c8c964c}{Quaternion} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&xaxis, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&yaxis, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&zaxis)
\begin{DoxyCompactList}\small\item\em Construct a quaternion from 3 orthonormal local axes. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_a3ccc60338011887023b397a02a7f3336}{Quaternion} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$ak\+Axis)
\begin{DoxyCompactList}\small\item\em Construct a quaternion from 3 orthonormal local axes. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion_a1ca81bd9d57e43cf23582c898e5fdd34}{Quaternion} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} $\ast$valptr)
\begin{DoxyCompactList}\small\item\em Construct a quaternion from 4 manual w/x/y/z values. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a9e14e6aa96e714397b31929299ca681d}{Dot} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ) const
\begin{DoxyCompactList}\small\item\em Returns the dot product of the quaternion. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_quaternion_aaf249bc76b399f92c0c2f93377b032ab}{equals} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rhs, const \hyperlink{class_ogre_1_1_radian}{Radian} \&tolerance) const
\begin{DoxyCompactList}\small\item\em Equality with tolerance (tolerance is max angle difference) \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_ae9c8590b89ed8c8b48a5f188383aeadc}{Exp} () const
\begin{DoxyCompactList}\small\item\em Apply to unit-\/length quaternion. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_ac3328c1bb86d17e870c57d52720e2e32}{From\+Angle\+Axis} (const \hyperlink{class_ogre_1_1_radian}{Radian} \&rf\+Angle, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&rk\+Axis)
\begin{DoxyCompactList}\small\item\em Setups the quaternion using the supplied vector, and \char`\"{}roll\char`\"{} around that vector by the specified radians. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_a7ad7ad40e38bf351485c2a906c3949bb}{From\+Axes} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$ak\+Axis)
\begin{DoxyCompactList}\small\item\em Constructs the quaternion using 3 axes, the axes are assumed to be orthonormal. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_a365bc3b10308318721199a829db03887}{From\+Axes} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_a58a45c5dd46ceee8dbf81dfced570dbe}{x\+Axis}, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_aa4915f1a8047e3c8a0a9c380fe3ae695}{y\+Axis}, const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_a3c41f8bb4147db31ff9674a70de1aad5}{z\+Axis})
\item 
void \hyperlink{class_ogre_1_1_quaternion_ae6c3bfed7176355cf2461567f89a15b1}{From\+Rotation\+Matrix} (const \hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&k\+Rot)
\item 
\hyperlink{class_ogre_1_1_radian}{Radian} \hyperlink{class_ogre_1_1_quaternion_ae4ffd43e74b8b07ddfbc5810a9e6e7ad}{get\+Pitch} (bool reproject\+Axis=true) const
\begin{DoxyCompactList}\small\item\em Calculate the local pitch element of this quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_radian}{Radian} \hyperlink{class_ogre_1_1_quaternion_ae23d3f973fd0f8ac9f188cd513823e3e}{get\+Roll} (bool reproject\+Axis=true) const
\begin{DoxyCompactList}\small\item\em Calculate the local roll element of this quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_radian}{Radian} \hyperlink{class_ogre_1_1_quaternion_a15c912e62c9abcb3335de205cdf30c2d}{get\+Yaw} (bool reproject\+Axis=true) const
\begin{DoxyCompactList}\small\item\em Calculate the local yaw element of this quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_ae370a6b879cf4d03fb85d8ce510705c1}{Inverse} () const
\item 
bool \hyperlink{class_ogre_1_1_quaternion_ac566d9e46f5c1b6368047c132e82a829}{is\+NaN} () const
\begin{DoxyCompactList}\small\item\em Check whether this quaternion contains valid values. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a4f89136f9dcb79fef8c47dc418e3e55f}{Log} () const
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a353aafd21ec10c8c07f04472ae6c32b8}{Norm} () const
\begin{DoxyCompactList}\small\item\em Returns the normal length of this quaternion. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_aee94ec9c7de50fe7f774ae4c7e760b65}{normalise} (void)
\begin{DoxyCompactList}\small\item\em Normalises this quaternion, and returns the previous length. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_quaternion_aec199d4e6af6c82c4026d012eae570cb}{operator!=} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rhs) const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_af05da43b746cf5b9bc2dcaf3aa4db2b9}{operator$\ast$} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ) const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a2fd01476d5136662031156707b2b3879}{operator$\ast$} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} f\+Scalar) const
\item 
\hyperlink{class_ogre_1_1_vector3}{Vector3} \hyperlink{class_ogre_1_1_quaternion_a535ef1c199eee303753507a4a78ddf22}{operator$\ast$} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&rk\+Vector) const
\begin{DoxyCompactList}\small\item\em Rotation of a vector by a quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_aac3debd2245b0dcefff4ce2fda46eef1}{operator+} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ) const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a98993e6f63209a39149d132623bbf41b}{operator-\/} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ) const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a24b15dc994247753b7a8064b6a13e2d6}{operator-\/} () const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \& \hyperlink{class_ogre_1_1_quaternion_a6367b543cf0d073d893139dd503b4fbd}{operator=} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ)
\item 
bool \hyperlink{class_ogre_1_1_quaternion_af292a9ed18e3da0bda0fbe114f60cdec}{operator==} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rhs) const
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a390c026412bb0e687f20cfe1bc0ada66}{operator\mbox{[}$\,$\mbox{]}} (const size\+\_\+t i) const
\begin{DoxyCompactList}\small\item\em Array accessor operator. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \& \hyperlink{class_ogre_1_1_quaternion_a074aea0da7fabfde89d204a1f0f0121b}{operator\mbox{[}$\,$\mbox{]}} (const size\+\_\+t i)
\begin{DoxyCompactList}\small\item\em Array accessor operator. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_quaternion_a0528f264ccc686c5315981d19b75aa0e}{orientation\+Equals} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&other, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} tolerance=1e-\/3) const
\begin{DoxyCompactList}\small\item\em Compare two quaternions which are assumed to be used as orientations. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} $\ast$ \hyperlink{class_ogre_1_1_quaternion_aecce24dd0096766de0c96c13b195b197}{ptr} ()
\begin{DoxyCompactList}\small\item\em Pointer accessor for direct copying. \end{DoxyCompactList}\item 
const \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} $\ast$ \hyperlink{class_ogre_1_1_quaternion_a214b1811f4b821e4b616d64a51c26275}{ptr} () const
\begin{DoxyCompactList}\small\item\em Pointer accessor for direct copying. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_a54dcd575915c7b7ddb65b8cb249de521}{swap} (\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&other)
\begin{DoxyCompactList}\small\item\em Exchange the contents of this quaternion with another. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_a814829e953cbf810c80a8b87626f6324}{To\+Angle\+Axis} (\hyperlink{class_ogre_1_1_radian}{Radian} \&rf\+Angle, \hyperlink{class_ogre_1_1_vector3}{Vector3} \&rk\+Axis) const
\item 
void \hyperlink{class_ogre_1_1_quaternion_a2fb2913d70c7c4ea6e0799187746401b}{To\+Angle\+Axis} (\hyperlink{class_ogre_1_1_degree}{Degree} \&d\+Angle, \hyperlink{class_ogre_1_1_vector3}{Vector3} \&rk\+Axis) const
\item 
void \hyperlink{class_ogre_1_1_quaternion_ae8227891cf00d8fc35bcd455c584f7b0}{To\+Axes} (\hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$ak\+Axis) const
\begin{DoxyCompactList}\small\item\em Gets the 3 orthonormal axes defining the quaternion. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_quaternion_ad4e2661546b7ac4e40b77f38a35ba8d9}{To\+Axes} (\hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_a58a45c5dd46ceee8dbf81dfced570dbe}{x\+Axis}, \hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_aa4915f1a8047e3c8a0a9c380fe3ae695}{y\+Axis}, \hyperlink{class_ogre_1_1_vector3}{Vector3} \&\hyperlink{class_ogre_1_1_quaternion_a3c41f8bb4147db31ff9674a70de1aad5}{z\+Axis}) const
\item 
void \hyperlink{class_ogre_1_1_quaternion_a6005735392c9b07901b8fe160c959f46}{To\+Rotation\+Matrix} (\hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&k\+Rot) const
\item 
\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a821a464cce9a81d5d20c620025043851}{Unit\+Inverse} () const
\begin{DoxyCompactList}\small\item\em Apply to non-\/zero quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_vector3}{Vector3} \hyperlink{class_ogre_1_1_quaternion_a58a45c5dd46ceee8dbf81dfced570dbe}{x\+Axis} (void) const
\begin{DoxyCompactList}\small\item\em Returns the X orthonormal axis defining the quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_vector3}{Vector3} \hyperlink{class_ogre_1_1_quaternion_aa4915f1a8047e3c8a0a9c380fe3ae695}{y\+Axis} (void) const
\begin{DoxyCompactList}\small\item\em Returns the Y orthonormal axis defining the quaternion. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_vector3}{Vector3} \hyperlink{class_ogre_1_1_quaternion_a3c41f8bb4147db31ff9674a70de1aad5}{z\+Axis} (void) const
\begin{DoxyCompactList}\small\item\em Returns the Z orthonormal axis defining the quaternion. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{class_ogre_1_1_quaternion_a838d0736819d496073d99f3f74d0cac1}{Intermediate} (const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rk\+Q0, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rk\+Q1, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rk\+Q2, \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rka, \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkB)
\begin{DoxyCompactList}\small\item\em Setup for spherical quadratic interpolation. \end{DoxyCompactList}\item 
static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a16987149991882e148170fe3f1c7da4b}{nlerp} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fT, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkP, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ, bool shortest\+Path=false)
\begin{DoxyCompactList}\small\item\em Performs Normalised linear interpolation between two quaternions, and returns the result. \end{DoxyCompactList}\item 
static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}{Slerp} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fT, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkP, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ, bool shortest\+Path=false)
\begin{DoxyCompactList}\small\item\em Performs Spherical linear interpolation between two quaternions, and returns the result. \end{DoxyCompactList}\item 
static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a25fb3bc0f11e6a676fb5c47347a79579}{Slerp\+Extra\+Spins} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fT, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkP, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ, int i\+Extra\+Spins)
\item 
static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a5f43da8b8aa579e02035eecff89e16a5}{Squad} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} fT, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkP, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkA, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkB, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ, bool shortest\+Path=false)
\begin{DoxyCompactList}\small\item\em Spherical quadratic interpolation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_af3424f1e07092c0ffe293d18b277a04f}{w}
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a32c5680516b41bc4ba3159bf4d4abaf1}{x}
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_aa7328cd3883a92ee9c9322805d038f11}{y}
\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a31ec84a931236554c0c17e37bf5ace97}{z}
\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a441b8d52549e1dedec27420325a313ef}{I\+D\+E\+N\+T\+I\+TY}
\item 
static const \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_quaternion_a6b53296360cc166c62533cff8f1edcc2}{ms\+Epsilon}
\begin{DoxyCompactList}\small\item\em Cutoff for sine near zero. \end{DoxyCompactList}\item 
static const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_a44f3c000c8f1ea2759c2e724e04bf86b}{Z\+E\+RO}
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\+\_\+\+Ogre\+Export friend \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \hyperlink{class_ogre_1_1_quaternion_ab929010aac9fae8a14008a7213d9d419}{operator$\ast$} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} f\+Scalar, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&rkQ)
\item 
std\+::ostream \& \hyperlink{class_ogre_1_1_quaternion_a60829c0f8f2a36602ab5fdbb1a79b635}{operator$<$$<$} (std\+::ostream \&o, const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&q)
\begin{DoxyCompactList}\small\item\em Function for writing to a stream. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Implementation of a \hyperlink{class_ogre_1_1_quaternion}{Quaternion}, i.\+e. 

a rotation around an axis. For more information about Quaternions and the theory behind it, we recommend reading\+: \href{http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer}{\tt http\+://www.\+ogre3d.\+org/tikiwiki/\+Quaternion+and+\+Rotation+\+Primer} and \href{http://www.cprogramming.com/tutorial/3d/quaternions.html}{\tt http\+://www.\+cprogramming.\+com/tutorial/3d/quaternions.\+html} and \href{http://www.gamedev.net/page/resources/_/reference/programming/math-and-physics/quaternions/quaternion-powers-r1095}{\tt http\+://www.\+gamedev.\+net/page/resources/\+\_\+/reference/programming/math-\/and-\/physics/quaternions/quaternion-\/powers-\/r1095} 

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ab58dc0c4c04d0579ce9321a719f10d5c}\label{class_ogre_1_1_quaternion_ab58dc0c4c04d0579ce9321a719f10d5c}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [1/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Default constructor, initializes to identity rotation (aka 0°) 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a9b45997a81d85662350808b7043d535d}\label{class_ogre_1_1_quaternion_a9b45997a81d85662350808b7043d535d}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [2/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fW,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fX,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fY,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fZ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct from an explicit list of values. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_acdcb70a4f122452b6fa70d7cf5ce3cf3}\label{class_ogre_1_1_quaternion_acdcb70a4f122452b6fa70d7cf5ce3cf3}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [3/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&}]{rot }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a quaternion from a rotation matrix. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a7f25c623d95186b58f6367dcd097a5ba}\label{class_ogre_1_1_quaternion_a7f25c623d95186b58f6367dcd097a5ba}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [4/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_radian}{Radian} \&}]{rf\+Angle,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{rk\+Axis }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a quaternion from an angle/axis. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a1140011dc0793a81c55f2d078c8c964c}\label{class_ogre_1_1_quaternion_a1140011dc0793a81c55f2d078c8c964c}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [5/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{xaxis,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{yaxis,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{zaxis }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a quaternion from 3 orthonormal local axes. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a3ccc60338011887023b397a02a7f3336}\label{class_ogre_1_1_quaternion_a3ccc60338011887023b397a02a7f3336}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [6/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$}]{ak\+Axis }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a quaternion from 3 orthonormal local axes. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a1ca81bd9d57e43cf23582c898e5fdd34}\label{class_ogre_1_1_quaternion_a1ca81bd9d57e43cf23582c898e5fdd34}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Quaternion@{Quaternion}}
\index{Quaternion@{Quaternion}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Quaternion()}{Quaternion()}\hspace{0.1cm}{\footnotesize\ttfamily [7/7]}}
{\footnotesize\ttfamily Ogre\+::\+Quaternion\+::\+Quaternion (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} $\ast$}]{valptr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a quaternion from 4 manual w/x/y/z values. 



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a54dcd575915c7b7ddb65b8cb249de521}\label{class_ogre_1_1_quaternion_a54dcd575915c7b7ddb65b8cb249de521}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!swap@{swap}}
\index{swap@{swap}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{swap()}{swap()}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::swap (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{other }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Exchange the contents of this quaternion with another. 



References std\+::swap(), w, x, y, and z.

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a390c026412bb0e687f20cfe1bc0ada66}\label{class_ogre_1_1_quaternion_a390c026412bb0e687f20cfe1bc0ada66}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator\mbox{[}\mbox{]}@{operator[]}}
\index{operator\mbox{[}\mbox{]}@{operator[]}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator[]()}{operator[]()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::operator\mbox{[}$\,$\mbox{]} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{i }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Array accessor operator. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a074aea0da7fabfde89d204a1f0f0121b}\label{class_ogre_1_1_quaternion_a074aea0da7fabfde89d204a1f0f0121b}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator\mbox{[}\mbox{]}@{operator[]}}
\index{operator\mbox{[}\mbox{]}@{operator[]}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator[]()}{operator[]()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}\& Ogre\+::\+Quaternion\+::operator\mbox{[}$\,$\mbox{]} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{i }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Array accessor operator. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_aecce24dd0096766de0c96c13b195b197}\label{class_ogre_1_1_quaternion_aecce24dd0096766de0c96c13b195b197}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!ptr@{ptr}}
\index{ptr@{ptr}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{ptr()}{ptr()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}$\ast$ Ogre\+::\+Quaternion\+::ptr (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Pointer accessor for direct copying. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a214b1811f4b821e4b616d64a51c26275}\label{class_ogre_1_1_quaternion_a214b1811f4b821e4b616d64a51c26275}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!ptr@{ptr}}
\index{ptr@{ptr}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{ptr()}{ptr()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}$\ast$ Ogre\+::\+Quaternion\+::ptr (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Pointer accessor for direct copying. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae6c3bfed7176355cf2461567f89a15b1}\label{class_ogre_1_1_quaternion_ae6c3bfed7176355cf2461567f89a15b1}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!From\+Rotation\+Matrix@{From\+Rotation\+Matrix}}
\index{From\+Rotation\+Matrix@{From\+Rotation\+Matrix}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{From\+Rotation\+Matrix()}{FromRotationMatrix()}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+From\+Rotation\+Matrix (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&}]{k\+Rot }\end{DoxyParamCaption})}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a6005735392c9b07901b8fe160c959f46}\label{class_ogre_1_1_quaternion_a6005735392c9b07901b8fe160c959f46}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!To\+Rotation\+Matrix@{To\+Rotation\+Matrix}}
\index{To\+Rotation\+Matrix@{To\+Rotation\+Matrix}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{To\+Rotation\+Matrix()}{ToRotationMatrix()}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+To\+Rotation\+Matrix (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_matrix3}{Matrix3} \&}]{k\+Rot }\end{DoxyParamCaption}) const}



Referenced by Ogre\+::\+Matrix4\+::\+Matrix4().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ac3328c1bb86d17e870c57d52720e2e32}\label{class_ogre_1_1_quaternion_ac3328c1bb86d17e870c57d52720e2e32}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!From\+Angle\+Axis@{From\+Angle\+Axis}}
\index{From\+Angle\+Axis@{From\+Angle\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{From\+Angle\+Axis()}{FromAngleAxis()}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+From\+Angle\+Axis (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_radian}{Radian} \&}]{rf\+Angle,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{rk\+Axis }\end{DoxyParamCaption})}



Setups the quaternion using the supplied vector, and \char`\"{}roll\char`\"{} around that vector by the specified radians. 



Referenced by Ogre\+::\+Vector3\+::random\+Deviant().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a814829e953cbf810c80a8b87626f6324}\label{class_ogre_1_1_quaternion_a814829e953cbf810c80a8b87626f6324}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!To\+Angle\+Axis@{To\+Angle\+Axis}}
\index{To\+Angle\+Axis@{To\+Angle\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{To\+Angle\+Axis()}{ToAngleAxis()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+To\+Angle\+Axis (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_radian}{Radian} \&}]{rf\+Angle,  }\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{rk\+Axis }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a2fb2913d70c7c4ea6e0799187746401b}\label{class_ogre_1_1_quaternion_a2fb2913d70c7c4ea6e0799187746401b}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!To\+Angle\+Axis@{To\+Angle\+Axis}}
\index{To\+Angle\+Axis@{To\+Angle\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{To\+Angle\+Axis()}{ToAngleAxis()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+To\+Angle\+Axis (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_degree}{Degree} \&}]{d\+Angle,  }\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{rk\+Axis }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a7ad7ad40e38bf351485c2a906c3949bb}\label{class_ogre_1_1_quaternion_a7ad7ad40e38bf351485c2a906c3949bb}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!From\+Axes@{From\+Axes}}
\index{From\+Axes@{From\+Axes}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{From\+Axes()}{FromAxes()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+From\+Axes (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$}]{ak\+Axis }\end{DoxyParamCaption})}



Constructs the quaternion using 3 axes, the axes are assumed to be orthonormal. 

\begin{DoxySeeAlso}{See also}
\hyperlink{class_ogre_1_1_quaternion_a7ad7ad40e38bf351485c2a906c3949bb}{From\+Axes} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a365bc3b10308318721199a829db03887}\label{class_ogre_1_1_quaternion_a365bc3b10308318721199a829db03887}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!From\+Axes@{From\+Axes}}
\index{From\+Axes@{From\+Axes}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{From\+Axes()}{FromAxes()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+From\+Axes (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{x\+Axis,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{y\+Axis,  }\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{z\+Axis }\end{DoxyParamCaption})}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae8227891cf00d8fc35bcd455c584f7b0}\label{class_ogre_1_1_quaternion_ae8227891cf00d8fc35bcd455c584f7b0}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!To\+Axes@{To\+Axes}}
\index{To\+Axes@{To\+Axes}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{To\+Axes()}{ToAxes()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+To\+Axes (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} $\ast$}]{ak\+Axis }\end{DoxyParamCaption}) const}



Gets the 3 orthonormal axes defining the quaternion. 

\begin{DoxySeeAlso}{See also}
\hyperlink{class_ogre_1_1_quaternion_a7ad7ad40e38bf351485c2a906c3949bb}{From\+Axes} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ad4e2661546b7ac4e40b77f38a35ba8d9}\label{class_ogre_1_1_quaternion_ad4e2661546b7ac4e40b77f38a35ba8d9}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!To\+Axes@{To\+Axes}}
\index{To\+Axes@{To\+Axes}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{To\+Axes()}{ToAxes()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Quaternion\+::\+To\+Axes (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{x\+Axis,  }\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{y\+Axis,  }\item[{\hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{z\+Axis }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a58a45c5dd46ceee8dbf81dfced570dbe}\label{class_ogre_1_1_quaternion_a58a45c5dd46ceee8dbf81dfced570dbe}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!x\+Axis@{x\+Axis}}
\index{x\+Axis@{x\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{x\+Axis()}{xAxis()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Quaternion\+::x\+Axis (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Returns the X orthonormal axis defining the quaternion. 

Same as doing x\+Axis = \hyperlink{class_ogre_1_1_vector3_a0c21d1f120c5eab83aa966e5de1df311}{Vector3\+::\+U\+N\+I\+T\+\_\+X} $\ast$ this. Also called the local X-\/axis \mbox{\Hypertarget{class_ogre_1_1_quaternion_aa4915f1a8047e3c8a0a9c380fe3ae695}\label{class_ogre_1_1_quaternion_aa4915f1a8047e3c8a0a9c380fe3ae695}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!y\+Axis@{y\+Axis}}
\index{y\+Axis@{y\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{y\+Axis()}{yAxis()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Quaternion\+::y\+Axis (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Returns the Y orthonormal axis defining the quaternion. 

Same as doing y\+Axis = \hyperlink{class_ogre_1_1_vector3_a8d1a1f7af535bcc8d9c78b1732bc1b90}{Vector3\+::\+U\+N\+I\+T\+\_\+Y} $\ast$ this. Also called the local Y-\/axis \mbox{\Hypertarget{class_ogre_1_1_quaternion_a3c41f8bb4147db31ff9674a70de1aad5}\label{class_ogre_1_1_quaternion_a3c41f8bb4147db31ff9674a70de1aad5}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!z\+Axis@{z\+Axis}}
\index{z\+Axis@{z\+Axis}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{z\+Axis()}{zAxis()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Quaternion\+::z\+Axis (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Returns the Z orthonormal axis defining the quaternion. 

Same as doing z\+Axis = \hyperlink{class_ogre_1_1_vector3_ad25aed2e9367cfa879d3e3c231c5a136}{Vector3\+::\+U\+N\+I\+T\+\_\+Z} $\ast$ this. Also called the local Z-\/axis \mbox{\Hypertarget{class_ogre_1_1_quaternion_a6367b543cf0d073d893139dd503b4fbd}\label{class_ogre_1_1_quaternion_a6367b543cf0d073d893139dd503b4fbd}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator=@{operator=}}
\index{operator=@{operator=}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator=()}{operator=()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion}\& Ogre\+::\+Quaternion\+::operator= (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References Ogre\+::operator$\ast$(), Ogre\+::operator+(), Ogre\+::operator-\/(), w, x, y, and z.

\mbox{\Hypertarget{class_ogre_1_1_quaternion_aac3debd2245b0dcefff4ce2fda46eef1}\label{class_ogre_1_1_quaternion_aac3debd2245b0dcefff4ce2fda46eef1}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator+@{operator+}}
\index{operator+@{operator+}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator+()}{operator+()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::operator+ (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a98993e6f63209a39149d132623bbf41b}\label{class_ogre_1_1_quaternion_a98993e6f63209a39149d132623bbf41b}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator-\/@{operator-\/}}
\index{operator-\/@{operator-\/}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator-\/()}{operator-()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::operator-\/ (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_af05da43b746cf5b9bc2dcaf3aa4db2b9}\label{class_ogre_1_1_quaternion_af05da43b746cf5b9bc2dcaf3aa4db2b9}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator$\ast$()}{operator*()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::operator$\ast$ (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a2fd01476d5136662031156707b2b3879}\label{class_ogre_1_1_quaternion_a2fd01476d5136662031156707b2b3879}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator$\ast$()}{operator*()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::operator$\ast$ (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{f\+Scalar }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a24b15dc994247753b7a8064b6a13e2d6}\label{class_ogre_1_1_quaternion_a24b15dc994247753b7a8064b6a13e2d6}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator-\/@{operator-\/}}
\index{operator-\/@{operator-\/}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator-\/()}{operator-()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::operator-\/ (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_af292a9ed18e3da0bda0fbe114f60cdec}\label{class_ogre_1_1_quaternion_af292a9ed18e3da0bda0fbe114f60cdec}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator==@{operator==}}
\index{operator==@{operator==}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator==()}{operator==()}}
{\footnotesize\ttfamily bool Ogre\+::\+Quaternion\+::operator== (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rhs }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



References w, x, y, and z.

\mbox{\Hypertarget{class_ogre_1_1_quaternion_aec199d4e6af6c82c4026d012eae570cb}\label{class_ogre_1_1_quaternion_aec199d4e6af6c82c4026d012eae570cb}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator"!=()}{operator!=()}}
{\footnotesize\ttfamily bool Ogre\+::\+Quaternion\+::operator!= (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rhs }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



References Ogre\+::operator$\ast$(), and Ogre\+::operator==().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a9e14e6aa96e714397b31929299ca681d}\label{class_ogre_1_1_quaternion_a9e14e6aa96e714397b31929299ca681d}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Dot@{Dot}}
\index{Dot@{Dot}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Dot()}{Dot()}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::\+Dot (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption}) const}



Returns the dot product of the quaternion. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a353aafd21ec10c8c07f04472ae6c32b8}\label{class_ogre_1_1_quaternion_a353aafd21ec10c8c07f04472ae6c32b8}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Norm@{Norm}}
\index{Norm@{Norm}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Norm()}{Norm()}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::\+Norm (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Returns the normal length of this quaternion. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_aee94ec9c7de50fe7f774ae4c7e760b65}\label{class_ogre_1_1_quaternion_aee94ec9c7de50fe7f774ae4c7e760b65}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!normalise@{normalise}}
\index{normalise@{normalise}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{normalise()}{normalise()}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::normalise (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Normalises this quaternion, and returns the previous length. 



Referenced by Ogre\+::\+Vector3\+::get\+Rotation\+To().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae370a6b879cf4d03fb85d8ce510705c1}\label{class_ogre_1_1_quaternion_ae370a6b879cf4d03fb85d8ce510705c1}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Inverse@{Inverse}}
\index{Inverse@{Inverse}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Inverse()}{Inverse()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Inverse (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a821a464cce9a81d5d20c620025043851}\label{class_ogre_1_1_quaternion_a821a464cce9a81d5d20c620025043851}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Unit\+Inverse@{Unit\+Inverse}}
\index{Unit\+Inverse@{Unit\+Inverse}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Unit\+Inverse()}{UnitInverse()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Unit\+Inverse (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Apply to non-\/zero quaternion. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae9c8590b89ed8c8b48a5f188383aeadc}\label{class_ogre_1_1_quaternion_ae9c8590b89ed8c8b48a5f188383aeadc}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Exp@{Exp}}
\index{Exp@{Exp}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Exp()}{Exp()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Exp (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Apply to unit-\/length quaternion. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a4f89136f9dcb79fef8c47dc418e3e55f}\label{class_ogre_1_1_quaternion_a4f89136f9dcb79fef8c47dc418e3e55f}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Log@{Log}}
\index{Log@{Log}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Log()}{Log()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Log (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a535ef1c199eee303753507a4a78ddf22}\label{class_ogre_1_1_quaternion_a535ef1c199eee303753507a4a78ddf22}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator$\ast$()}{operator*()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_vector3}{Vector3} Ogre\+::\+Quaternion\+::operator$\ast$ (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{rk\+Vector }\end{DoxyParamCaption}) const}



Rotation of a vector by a quaternion. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae23d3f973fd0f8ac9f188cd513823e3e}\label{class_ogre_1_1_quaternion_ae23d3f973fd0f8ac9f188cd513823e3e}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!get\+Roll@{get\+Roll}}
\index{get\+Roll@{get\+Roll}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{get\+Roll()}{getRoll()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_radian}{Radian} Ogre\+::\+Quaternion\+::get\+Roll (\begin{DoxyParamCaption}\item[{bool}]{reproject\+Axis = {\ttfamily true} }\end{DoxyParamCaption}) const}



Calculate the local roll element of this quaternion. 


\begin{DoxyParams}{Parameters}
{\em reproject\+Axis} & By default the method returns the \textquotesingle{}intuitive\textquotesingle{} result that is, if you projected the local X of the quaternion onto the XY plane, the angle between it and global X is returned. The co-\/domain of the returned value is from -\/180 to 180 degrees. If set to false though, the result is the rotation around Z axis that could be used to implement the quaternion using some non-\/intuitive order of rotations. This behavior is preserved for backward compatibility, to decompose quaternion into yaw, pitch and roll use q.\+To\+Rotation\+Matrix().To\+Euler\+Angles\+Y\+X\+Z(yaw, pitch, roll) instead. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ae4ffd43e74b8b07ddfbc5810a9e6e7ad}\label{class_ogre_1_1_quaternion_ae4ffd43e74b8b07ddfbc5810a9e6e7ad}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!get\+Pitch@{get\+Pitch}}
\index{get\+Pitch@{get\+Pitch}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{get\+Pitch()}{getPitch()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_radian}{Radian} Ogre\+::\+Quaternion\+::get\+Pitch (\begin{DoxyParamCaption}\item[{bool}]{reproject\+Axis = {\ttfamily true} }\end{DoxyParamCaption}) const}



Calculate the local pitch element of this quaternion. 


\begin{DoxyParams}{Parameters}
{\em reproject\+Axis} & By default the method returns the \textquotesingle{}intuitive\textquotesingle{} result that is, if you projected the local Y of the quaternion onto the YZ plane, the angle between it and global Y is returned. The co-\/domain of the returned value is from -\/180 to 180 degrees. If set to false though, the result is the rotation around X axis that could be used to implement the quaternion using some non-\/intuitive order of rotations. This behavior is preserved for backward compatibility, to decompose quaternion into yaw, pitch and roll use q.\+To\+Rotation\+Matrix().To\+Euler\+Angles\+Y\+X\+Z(yaw, pitch, roll) instead. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a15c912e62c9abcb3335de205cdf30c2d}\label{class_ogre_1_1_quaternion_a15c912e62c9abcb3335de205cdf30c2d}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!get\+Yaw@{get\+Yaw}}
\index{get\+Yaw@{get\+Yaw}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{get\+Yaw()}{getYaw()}}
{\footnotesize\ttfamily \hyperlink{class_ogre_1_1_radian}{Radian} Ogre\+::\+Quaternion\+::get\+Yaw (\begin{DoxyParamCaption}\item[{bool}]{reproject\+Axis = {\ttfamily true} }\end{DoxyParamCaption}) const}



Calculate the local yaw element of this quaternion. 


\begin{DoxyParams}{Parameters}
{\em reproject\+Axis} & By default the method returns the \textquotesingle{}intuitive\textquotesingle{} result that is, if you projected the local Z of the quaternion onto the ZX plane, the angle between it and global Z is returned. The co-\/domain of the returned value is from -\/180 to 180 degrees. If set to false though, the result is the rotation around Y axis that could be used to implement the quaternion using some non-\/intuitive order of rotations. This behavior is preserved for backward compatibility, to decompose quaternion into yaw, pitch and roll use q.\+To\+Rotation\+Matrix().To\+Euler\+Angles\+Y\+X\+Z(yaw, pitch, roll) instead. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_aaf249bc76b399f92c0c2f93377b032ab}\label{class_ogre_1_1_quaternion_aaf249bc76b399f92c0c2f93377b032ab}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!equals@{equals}}
\index{equals@{equals}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{equals()}{equals()}}
{\footnotesize\ttfamily bool Ogre\+::\+Quaternion\+::equals (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rhs,  }\item[{const \hyperlink{class_ogre_1_1_radian}{Radian} \&}]{tolerance }\end{DoxyParamCaption}) const}



Equality with tolerance (tolerance is max angle difference) 

\begin{DoxyRemark}{Remarks}
Both \hyperlink{class_ogre_1_1_quaternion_aaf249bc76b399f92c0c2f93377b032ab}{equals()} and \hyperlink{class_ogre_1_1_quaternion_a0528f264ccc686c5315981d19b75aa0e}{orientation\+Equals()} measure the exact same thing. One measures the difference by angle, the other by a different, non-\/linear metric. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a0528f264ccc686c5315981d19b75aa0e}\label{class_ogre_1_1_quaternion_a0528f264ccc686c5315981d19b75aa0e}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!orientation\+Equals@{orientation\+Equals}}
\index{orientation\+Equals@{orientation\+Equals}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{orientation\+Equals()}{orientationEquals()}}
{\footnotesize\ttfamily bool Ogre\+::\+Quaternion\+::orientation\+Equals (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{other,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{tolerance = {\ttfamily 1e-\/3} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Compare two quaternions which are assumed to be used as orientations. 

\begin{DoxyRemark}{Remarks}
Both \hyperlink{class_ogre_1_1_quaternion_aaf249bc76b399f92c0c2f93377b032ab}{equals()} and \hyperlink{class_ogre_1_1_quaternion_a0528f264ccc686c5315981d19b75aa0e}{orientation\+Equals()} measure the exact same thing. One measures the difference by angle, the other by a different, non-\/linear metric. 
\end{DoxyRemark}
\begin{DoxyReturn}{Returns}
true if the two orientations are the same or very close, relative to the given tolerance. Slerp ( 0.\+75f, A, B ) != Slerp ( 0.\+25f, B, A ); therefore be careful if your code relies in the order of the operands. This is specially important in IK animation. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}\label{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Slerp@{Slerp}}
\index{Slerp@{Slerp}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Slerp()}{Slerp()}}
{\footnotesize\ttfamily static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Slerp (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fT,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkP,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ,  }\item[{bool}]{shortest\+Path = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Performs Spherical linear interpolation between two quaternions, and returns the result. 

Slerp ( 0.\+0f, A, B ) = A Slerp ( 1.\+0f, A, B ) = B \begin{DoxyReturn}{Returns}
Interpolated quaternion 
\end{DoxyReturn}
\begin{DoxyRemark}{Remarks}
Slerp has the proprieties of performing the interpolation at constant velocity, and being torque-\/minimal (unless shortest\+Path=false). However, it\textquotesingle{}s N\+OT commutative, which means Slerp ( 0.\+75f, A, B ) != Slerp ( 0.\+25f, B, A ); therefore be careful if your code relies in the order of the operands. This is specially important in IK animation. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a25fb3bc0f11e6a676fb5c47347a79579}\label{class_ogre_1_1_quaternion_a25fb3bc0f11e6a676fb5c47347a79579}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Slerp\+Extra\+Spins@{Slerp\+Extra\+Spins}}
\index{Slerp\+Extra\+Spins@{Slerp\+Extra\+Spins}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Slerp\+Extra\+Spins()}{SlerpExtraSpins()}}
{\footnotesize\ttfamily static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Slerp\+Extra\+Spins (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fT,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkP,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ,  }\item[{int}]{i\+Extra\+Spins }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

\begin{DoxySeeAlso}{See also}
\hyperlink{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}{Slerp}. It adds extra \char`\"{}spins\char`\"{} (i.\+e. rotates several times) specified by parameter \textquotesingle{}i\+Extra\+Spins\textquotesingle{} while interpolating before arriving to the final values 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a838d0736819d496073d99f3f74d0cac1}\label{class_ogre_1_1_quaternion_a838d0736819d496073d99f3f74d0cac1}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Intermediate@{Intermediate}}
\index{Intermediate@{Intermediate}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Intermediate()}{Intermediate()}}
{\footnotesize\ttfamily static void Ogre\+::\+Quaternion\+::\+Intermediate (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rk\+Q0,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rk\+Q1,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rk\+Q2,  }\item[{\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rka,  }\item[{\hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkB }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Setup for spherical quadratic interpolation. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a5f43da8b8aa579e02035eecff89e16a5}\label{class_ogre_1_1_quaternion_a5f43da8b8aa579e02035eecff89e16a5}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Squad@{Squad}}
\index{Squad@{Squad}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Squad()}{Squad()}}
{\footnotesize\ttfamily static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Squad (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fT,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkP,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkA,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkB,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ,  }\item[{bool}]{shortest\+Path = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Spherical quadratic interpolation. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a16987149991882e148170fe3f1c7da4b}\label{class_ogre_1_1_quaternion_a16987149991882e148170fe3f1c7da4b}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!nlerp@{nlerp}}
\index{nlerp@{nlerp}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{nlerp()}{nlerp()}}
{\footnotesize\ttfamily static \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::nlerp (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{fT,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkP,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ,  }\item[{bool}]{shortest\+Path = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Performs Normalised linear interpolation between two quaternions, and returns the result. 

nlerp ( 0.\+0f, A, B ) = A nlerp ( 1.\+0f, A, B ) = B \begin{DoxyRemark}{Remarks}
Nlerp is faster than Slerp. Nlerp has the proprieties of being commutative (
\end{DoxyRemark}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}{Slerp}; commutativity is desired in certain places, like IK animation), and being torque-\/minimal (unless shortest\+Path=false). However, it\textquotesingle{}s performing the interpolation at non-\/constant velocity; sometimes this is desired, sometimes it is not. Having a non-\/constant velocity can produce a more natural rotation feeling without the need of tweaking the weights; however if your scene relies on the timing of the rotation or assumes it will point at a specific angle at a specific weight value, \hyperlink{class_ogre_1_1_quaternion_ab0c47f1a7308ac4c17db9f9ddb6e4a72}{Slerp} is a better choice. 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ac566d9e46f5c1b6368047c132e82a829}\label{class_ogre_1_1_quaternion_ac566d9e46f5c1b6368047c132e82a829}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!is\+NaN@{is\+NaN}}
\index{is\+NaN@{is\+NaN}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{is\+Na\+N()}{isNaN()}}
{\footnotesize\ttfamily bool Ogre\+::\+Quaternion\+::is\+NaN (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Check whether this quaternion contains valid values. 



References Ogre\+::\+Math\+::is\+Na\+N().



\subsection{Friends And Related Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_ab929010aac9fae8a14008a7213d9d419}\label{class_ogre_1_1_quaternion_ab929010aac9fae8a14008a7213d9d419}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator$\ast$}{operator*}}
{\footnotesize\ttfamily \+\_\+\+Ogre\+Export friend \hyperlink{class_ogre_1_1_quaternion}{Quaternion} operator$\ast$ (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{f\+Scalar,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{rkQ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a60829c0f8f2a36602ab5fdbb1a79b635}\label{class_ogre_1_1_quaternion_a60829c0f8f2a36602ab5fdbb1a79b635}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{operator$<$$<$}{operator<<}}
{\footnotesize\ttfamily std\+::ostream\& operator$<$$<$ (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{o,  }\item[{const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} \&}]{q }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



Function for writing to a stream. 

Outputs \char`\"{}\+Quaternion(w, x, y, z)\char`\"{} with w,x,y,z being the member values of the quaternion. 

\subsection{Member Data Documentation}
\mbox{\Hypertarget{class_ogre_1_1_quaternion_a6b53296360cc166c62533cff8f1edcc2}\label{class_ogre_1_1_quaternion_a6b53296360cc166c62533cff8f1edcc2}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!ms\+Epsilon@{ms\+Epsilon}}
\index{ms\+Epsilon@{ms\+Epsilon}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{ms\+Epsilon}{msEpsilon}}
{\footnotesize\ttfamily const \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::ms\+Epsilon\hspace{0.3cm}{\ttfamily [static]}}



Cutoff for sine near zero. 

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a44f3c000c8f1ea2759c2e724e04bf86b}\label{class_ogre_1_1_quaternion_a44f3c000c8f1ea2759c2e724e04bf86b}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!Z\+E\+RO@{Z\+E\+RO}}
\index{Z\+E\+RO@{Z\+E\+RO}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{Z\+E\+RO}{ZERO}}
{\footnotesize\ttfamily const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+Z\+E\+RO\hspace{0.3cm}{\ttfamily [static]}}

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a441b8d52549e1dedec27420325a313ef}\label{class_ogre_1_1_quaternion_a441b8d52549e1dedec27420325a313ef}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!I\+D\+E\+N\+T\+I\+TY@{I\+D\+E\+N\+T\+I\+TY}}
\index{I\+D\+E\+N\+T\+I\+TY@{I\+D\+E\+N\+T\+I\+TY}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{I\+D\+E\+N\+T\+I\+TY}{IDENTITY}}
{\footnotesize\ttfamily const \hyperlink{class_ogre_1_1_quaternion}{Quaternion} Ogre\+::\+Quaternion\+::\+I\+D\+E\+N\+T\+I\+TY\hspace{0.3cm}{\ttfamily [static]}}



Referenced by Ogre\+::\+Entity\+::get\+Current\+Lod\+Index(), Ogre\+::\+Node\+::get\+Inherit\+Scale(), Ogre\+::\+Static\+Geometry\+::get\+Name(), Ogre\+::\+Scene\+Node\+::get\+Show\+Bounding\+Box(), Ogre\+::\+Scene\+Manager\+::get\+Sky\+Box\+Gen\+Parameters(), and Ogre\+::\+Scene\+Manager\+::get\+Sky\+Plane\+Gen\+Parameters().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_af3424f1e07092c0ffe293d18b277a04f}\label{class_ogre_1_1_quaternion_af3424f1e07092c0ffe293d18b277a04f}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!w@{w}}
\index{w@{w}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{w}{w}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::w}



Referenced by operator=(), operator==(), and swap().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a32c5680516b41bc4ba3159bf4d4abaf1}\label{class_ogre_1_1_quaternion_a32c5680516b41bc4ba3159bf4d4abaf1}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!x@{x}}
\index{x@{x}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{x}{x}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::x}



Referenced by operator=(), operator==(), and swap().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_aa7328cd3883a92ee9c9322805d038f11}\label{class_ogre_1_1_quaternion_aa7328cd3883a92ee9c9322805d038f11}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!y@{y}}
\index{y@{y}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{y}{y}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::y}



Referenced by operator=(), operator==(), and swap().

\mbox{\Hypertarget{class_ogre_1_1_quaternion_a31ec84a931236554c0c17e37bf5ace97}\label{class_ogre_1_1_quaternion_a31ec84a931236554c0c17e37bf5ace97}} 
\index{Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}!z@{z}}
\index{z@{z}!Ogre\+::\+Quaternion@{Ogre\+::\+Quaternion}}
\subsubsection{\texorpdfstring{z}{z}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Quaternion\+::z}



Referenced by operator=(), operator==(), and swap().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_quaternion_8h}{Ogre\+Quaternion.\+h}\end{DoxyCompactItemize}
