Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Quaternion Class Reference

Implementation of a Quaternion, i.e. More...

#include <OgreQuaternion.h>

Collaboration diagram for Ogre::Quaternion:

Collaboration graph
[legend]
List of all members.

Public Methods

 Quaternion (Real fW=1.0, Real fX=0.0, Real fY=0.0, Real fZ=0.0)
 Quaternion (const Quaternion &rkQ)
void FromRotationMatrix (const Matrix3 &kRot)
void ToRotationMatrix (Matrix3 &kRot) const
void FromAngleAxis (const Real &rfAngle, const Vector3 &rkAxis)
void ToAngleAxis (Real &rfAngle, Vector3 &rkAxis) const
void FromAxes (const Vector3 *akAxis)
void FromAxes (const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis)
void ToAxes (Vector3 *akAxis) const
void ToAxes (Vector3 &xAxis, Vector3 &yAxis, Vector3 &zAxis) const
Vector3 xAxis (void)
 Get the local x-axis.

Vector3 yAxis (void)
 Get the local y-axis.

Vector3 zAxis (void)
 Get the local z-axis.

Quaternion & operator= (const Quaternion &rkQ)
Quaternion operator+ (const Quaternion &rkQ) const
Quaternion operator- (const Quaternion &rkQ) const
Quaternion operator * (const Quaternion &rkQ) const
Quaternion operator * (Real fScalar) const
Quaternion operator- () const
bool operator== (const Quaternion &rhs) const
Real Dot (const Quaternion &rkQ) const
Real Norm () const
Real normalise (void)
 Normalises this quaternion, and returns the previous length.

Quaternion Inverse () const
Quaternion UnitInverse () const
Quaternion Exp () const
Quaternion Log () const
Vector3 operator * (const Vector3 &rkVector) const

Static Public Methods

Quaternion Slerp (Real fT, const Quaternion &rkP, const Quaternion &rkQ, bool shortestPath=false)
Quaternion SlerpExtraSpins (Real fT, const Quaternion &rkP, const Quaternion &rkQ, int iExtraSpins)
void Intermediate (const Quaternion &rkQ0, const Quaternion &rkQ1, const Quaternion &rkQ2, Quaternion &rka, Quaternion &rkB)
Quaternion Squad (Real fT, const Quaternion &rkP, const Quaternion &rkA, const Quaternion &rkB, const Quaternion &rkQ, bool shortestPath=false)

Public Attributes

Real w
Real x
Real y
Real z

Static Public Attributes

const Real ms_fEpsilon = 1e-03
const Quaternion ZERO
const Quaternion IDENTITY

Friends

Quaternion operator * (Real fScalar, const Quaternion &rkQ)
_OgreExport friend std::ostream & operator<< (std::ostream &o, const Quaternion &q)
 Function for writing to a stream.


Detailed Description

Implementation of a Quaternion, i.e.

a rotation around an axis.

Definition at line 48 of file OgreQuaternion.h.


Constructor & Destructor Documentation

Ogre::Quaternion::Quaternion Real    fW = 1.0,
Real    fX = 0.0,
Real    fY = 0.0,
Real    fZ = 0.0
 

Definition at line 51 of file OgreQuaternion.h.

References Ogre::Real.

Referenced by Inverse(), operator *(), operator+(), operator-(), and UnitInverse().

Ogre::Quaternion::Quaternion const Quaternion &    rkQ
 

Definition at line 60 of file OgreQuaternion.h.

References w, x, y, and z.


Member Function Documentation

Real Ogre::Quaternion::Dot const Quaternion &    rkQ const
 

Definition at line 312 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Referenced by Slerp(), and SlerpExtraSpins().

Quaternion Ogre::Quaternion::Exp   const
 

Definition at line 343 of file OgreQuaternion.cpp.

References ms_fEpsilon, Ogre::Real, w, x, y, and z.

Referenced by Intermediate(), and Ogre::RotationalSpline::recalcTangents().

void Ogre::Quaternion::FromAngleAxis const Real   rfAngle,
const Vector3   rkAxis
 

Definition at line 119 of file OgreQuaternion.cpp.

References Ogre::Real, w, Ogre::Vector3::x, x, Ogre::Vector3::y, y, Ogre::Vector3::z, and z.

Referenced by Ogre::Quake3Shader::createAsMaterial(), Ogre::BspLevel::loadEntities(), Ogre::Vector3::randomDeviant(), Ogre::Node::rotate(), Ogre::Camera::rotate(), and Ogre::Camera::setDirection().

void Ogre::Quaternion::FromAxes const Vector3   xAxis,
const Vector3   yAxis,
const Vector3   zAxis
 

Definition at line 173 of file OgreQuaternion.cpp.

References FromRotationMatrix(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

void Ogre::Quaternion::FromAxes const Vector3   akAxis
 

Definition at line 159 of file OgreQuaternion.cpp.

References FromRotationMatrix(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by Ogre::Camera::setDirection().

void Ogre::Quaternion::FromRotationMatrix const Matrix3   kRot
 

Definition at line 53 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Referenced by FromAxes().

void Ogre::Quaternion::Intermediate const Quaternion &    rkQ0,
const Quaternion &    rkQ1,
const Quaternion &    rkQ2,
Quaternion &    rka,
Quaternion &    rkB
[static]
 

Definition at line 461 of file OgreQuaternion.cpp.

References Exp(), Log(), and UnitInverse().

Quaternion Ogre::Quaternion::Inverse   const
 

Definition at line 322 of file OgreQuaternion.cpp.

References Quaternion(), Ogre::Real, w, x, y, z, and ZERO.

Referenced by Ogre::ParticleSystem::_updateBounds(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::BillboardSet::genBillboardAxes(), Ogre::Node::makeInverseTransform(), and Ogre::RotationalSpline::recalcTangents().

Quaternion Ogre::Quaternion::Log   const
 

Definition at line 372 of file OgreQuaternion.cpp.

References ms_fEpsilon, Ogre::Real, w, x, y, and z.

Referenced by Intermediate(), and Ogre::RotationalSpline::recalcTangents().

Real Ogre::Quaternion::Norm   const
 

Definition at line 317 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Referenced by normalise().

Real Ogre::Quaternion::normalise void   
 

Normalises this quaternion, and returns the previous length.

Definition at line 494 of file OgreQuaternion.cpp.

References Norm(), and Ogre::Real.

Referenced by Slerp().

Vector3 Ogre::Quaternion::operator * const Vector3   rkVector const
 

Definition at line 402 of file OgreQuaternion.cpp.

References Ogre::Vector3::crossProduct(), w, x, y, and z.

Quaternion Ogre::Quaternion::operator * Real    fScalar const
 

Definition at line 296 of file OgreQuaternion.cpp.

References Quaternion(), Ogre::Real, w, x, y, and z.

Quaternion Ogre::Quaternion::operator * const Quaternion &    rkQ const
 

Definition at line 282 of file OgreQuaternion.cpp.

References w, x, y, and z.

Quaternion Ogre::Quaternion::operator+ const Quaternion &    rkQ const
 

Definition at line 272 of file OgreQuaternion.cpp.

References Quaternion(), w, x, y, and z.

Quaternion Ogre::Quaternion::operator-   const
 

Definition at line 307 of file OgreQuaternion.cpp.

References Quaternion(), w, x, y, and z.

Quaternion Ogre::Quaternion::operator- const Quaternion &    rkQ const
 

Definition at line 277 of file OgreQuaternion.cpp.

References Quaternion(), w, x, y, and z.

Quaternion& Ogre::Quaternion::operator= const Quaternion &    rkQ
 

Definition at line 83 of file OgreQuaternion.h.

References w, x, y, and z.

bool Ogre::Quaternion::operator== const Quaternion &    rhs const
 

Definition at line 488 of file OgreQuaternion.cpp.

References w, x, y, and z.

Quaternion Ogre::Quaternion::Slerp Real    fT,
const Quaternion &    rkP,
const Quaternion &    rkQ,
bool    shortestPath = false
[static]
 

Definition at line 416 of file OgreQuaternion.cpp.

References Dot(), ms_fEpsilon, normalise(), and Ogre::Real.

Referenced by Squad().

Quaternion Ogre::Quaternion::SlerpExtraSpins Real    fT,
const Quaternion &    rkP,
const Quaternion &    rkQ,
int    iExtraSpins
[static]
 

Definition at line 444 of file OgreQuaternion.cpp.

References Dot(), ms_fEpsilon, and Ogre::Real.

Quaternion Ogre::Quaternion::Squad Real    fT,
const Quaternion &    rkP,
const Quaternion &    rkA,
const Quaternion &    rkB,
const Quaternion &    rkQ,
bool    shortestPath = false
[static]
 

Definition at line 478 of file OgreQuaternion.cpp.

References Ogre::Real, and Slerp().

void Ogre::Quaternion::ToAngleAxis Real   rfAngle,
Vector3   rkAxis
const
 

Definition at line 135 of file OgreQuaternion.cpp.

References Ogre::Real, w, Ogre::Vector3::x, x, Ogre::Vector3::y, y, Ogre::Vector3::z, and z.

Referenced by Ogre::Skeleton::_dumpContents().

void Ogre::Quaternion::ToAxes Vector3   xAxis,
Vector3   yAxis,
Vector3   zAxis
const
 

Definition at line 252 of file OgreQuaternion.cpp.

References ToRotationMatrix(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

void Ogre::Quaternion::ToAxes Vector3   akAxis const
 

Definition at line 193 of file OgreQuaternion.cpp.

References ToRotationMatrix(), Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

Referenced by Ogre::Camera::setDirection().

void Ogre::Quaternion::ToRotationMatrix Matrix3   kRot const
 

Definition at line 93 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Referenced by Ogre::Node::makeInverseTransform(), Ogre::Node::makeTransform(), ToAxes(), Ogre::Frustum::updateView(), and Ogre::Camera::updateView().

Quaternion Ogre::Quaternion::UnitInverse   const
 

Definition at line 337 of file OgreQuaternion.cpp.

References Quaternion(), w, x, y, and z.

Referenced by Intermediate().

Vector3 Ogre::Quaternion::xAxis void   
 

Get the local x-axis.

Definition at line 207 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Vector3 Ogre::Quaternion::yAxis void   
 

Get the local y-axis.

Definition at line 222 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.

Vector3 Ogre::Quaternion::zAxis void   
 

Get the local z-axis.

Definition at line 237 of file OgreQuaternion.cpp.

References Ogre::Real, w, x, y, and z.


Friends And Related Function Documentation

Quaternion operator * Real    fScalar,
const Quaternion &    rkQ
[friend]
 

Definition at line 301 of file OgreQuaternion.cpp.

_OgreExport friend std::ostream& operator<< std::ostream &    o,
const Quaternion &    q
[friend]
 

Function for writing to a stream.

Definition at line 143 of file OgreQuaternion.h.


Member Data Documentation

const Quaternion Ogre::Quaternion::IDENTITY [static]
 

const Real Ogre::Quaternion::ms_fEpsilon = 1e-03 [static]
 

Definition at line 48 of file OgreQuaternion.cpp.

Referenced by Exp(), Log(), Slerp(), and SlerpExtraSpins().

Real Ogre::Quaternion::w
 

Definition at line 138 of file OgreQuaternion.h.

Referenced by Dot(), Exp(), FromAngleAxis(), FromRotationMatrix(), Ogre::Vector3::getRotationTo(), Inverse(), Log(), Norm(), Ogre::operator *(), operator *(), operator+(), operator-(), operator=(), operator==(), Quaternion(), Ogre::Serializer::readObject(), Ogre::Node::setOrientation(), ToAngleAxis(), ToRotationMatrix(), Ogre::StringConverter::toString(), UnitInverse(), Ogre::Serializer::writeObject(), xAxis(), yAxis(), and zAxis().

Real Ogre::Quaternion::x
 

Definition at line 138 of file OgreQuaternion.h.

Referenced by Dot(), Exp(), FromAngleAxis(), FromRotationMatrix(), Ogre::Vector3::getRotationTo(), Inverse(), Log(), Norm(), Ogre::operator *(), operator *(), operator+(), operator-(), operator=(), operator==(), Quaternion(), Ogre::Serializer::readObject(), Ogre::Node::setOrientation(), ToAngleAxis(), ToRotationMatrix(), Ogre::StringConverter::toString(), UnitInverse(), Ogre::Serializer::writeObject(), xAxis(), yAxis(), and zAxis().

Real Ogre::Quaternion::y
 

Definition at line 138 of file OgreQuaternion.h.

Referenced by Dot(), Exp(), FromAngleAxis(), FromRotationMatrix(), Ogre::Vector3::getRotationTo(), Inverse(), Log(), Norm(), Ogre::operator *(), operator *(), operator+(), operator-(), operator=(), operator==(), Quaternion(), Ogre::Serializer::readObject(), Ogre::Node::setOrientation(), ToAngleAxis(), ToRotationMatrix(), Ogre::StringConverter::toString(), UnitInverse(), Ogre::Serializer::writeObject(), xAxis(), yAxis(), and zAxis().

Real Ogre::Quaternion::z
 

Definition at line 138 of file OgreQuaternion.h.

Referenced by Dot(), Exp(), FromAngleAxis(), FromRotationMatrix(), Ogre::Vector3::getRotationTo(), Inverse(), Log(), Norm(), Ogre::operator *(), operator *(), operator+(), operator-(), operator=(), operator==(), Quaternion(), Ogre::Serializer::readObject(), Ogre::Node::setOrientation(), ToAngleAxis(), ToRotationMatrix(), Ogre::StringConverter::toString(), UnitInverse(), Ogre::Serializer::writeObject(), xAxis(), yAxis(), and zAxis().

const Quaternion Ogre::Quaternion::ZERO [static]
 

Referenced by Inverse().


The documentation for this class was generated from the following files:

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:19:19 2004