Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Protected Attributes
btQuaternion Class Reference

#include <btQuaternion.h>

Inheritance diagram for btQuaternion:
Inheritance graph
[legend]
Collaboration diagram for btQuaternion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 btQuaternion ()
 btQuaternion (const btScalar &x, const btScalar &y, const btScalar &z, const btScalar &w)
 btQuaternion (const btVector3 &axis, const btScalar &angle)
 btQuaternion (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
void setRotation (const btVector3 &axis, const btScalar &angle)
void setEuler (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
btQuaternionoperator+= (const btQuaternion &q)
btQuaternionoperator-= (const btQuaternion &q)
btQuaternionoperator*= (const btScalar &s)
btQuaternionoperator*= (const btQuaternion &q)
btScalar dot (const btQuaternion &q) const
btScalar length2 () const
btScalar length () const
btQuaternionnormalize ()
SIMD_FORCE_INLINE btQuaternion operator* (const btScalar &s) const
btQuaternion operator/ (const btScalar &s) const
btQuaternionoperator/= (const btScalar &s)
btQuaternion normalized () const
btScalar angle (const btQuaternion &q) const
btScalar getAngle () const
btQuaternion inverse () const
SIMD_FORCE_INLINE btQuaternion operator+ (const btQuaternion &q2) const
SIMD_FORCE_INLINE btQuaternion operator- (const btQuaternion &q2) const
SIMD_FORCE_INLINE btQuaternion operator- () const
SIMD_FORCE_INLINE btQuaternion farthest (const btQuaternion &qd) const
btQuaternion slerp (const btQuaternion &q, const btScalar &t) const
SIMD_FORCE_INLINE const btScalargetW () const
SIMD_FORCE_INLINE const btScalargetX () const
SIMD_FORCE_INLINE const btScalargetY () const
SIMD_FORCE_INLINE const btScalargetZ () const
SIMD_FORCE_INLINE void setX (btScalar x)
SIMD_FORCE_INLINE void setY (btScalar y)
SIMD_FORCE_INLINE void setZ (btScalar z)
SIMD_FORCE_INLINE void setW (btScalar w)
SIMD_FORCE_INLINE const btScalarx () const
SIMD_FORCE_INLINE const btScalary () const
SIMD_FORCE_INLINE const btScalarz () const
SIMD_FORCE_INLINE const btScalarw () const
SIMD_FORCE_INLINE operator btScalar * ()
SIMD_FORCE_INLINE operator const btScalar * () const
SIMD_FORCE_INLINE void setValue (const btScalar &x, const btScalar &y, const btScalar &z)
SIMD_FORCE_INLINE void setValue (const btScalar &x, const btScalar &y, const btScalar &z, const btScalar &w)
SIMD_FORCE_INLINE void setMax (const btQuadWord &other)
SIMD_FORCE_INLINE void setMin (const btQuadWord &other)

Protected Attributes

btScalar m_x
btScalar m_y
btScalar m_z
btScalar m_unusedW

Detailed Description

Definition at line 22 of file btQuaternion.h.


Constructor & Destructor Documentation

Definition at line 24 of file btQuaternion.h.

{}

Here is the caller graph for this function:

btQuaternion::btQuaternion ( const btScalar x,
const btScalar y,
const btScalar z,
const btScalar w 
) [inline]

Definition at line 29 of file btQuaternion.h.

              : btQuadWord(x, y, z, w) 
       {}
btQuaternion::btQuaternion ( const btVector3 axis,
const btScalar angle 
) [inline]

Definition at line 33 of file btQuaternion.h.

       { 
              setRotation(axis, angle); 
       }

Here is the call graph for this function:

btQuaternion::btQuaternion ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
) [inline]

Definition at line 38 of file btQuaternion.h.

       { 
              setEuler(yaw, pitch, roll); 
       }

Here is the call graph for this function:


Member Function Documentation

btScalar btQuaternion::angle ( const btQuaternion q) const [inline]

Definition at line 144 of file btQuaternion.h.

       {
              btScalar s = btSqrt(length2() * q.length2());
              assert(s != btScalar(0.0));
              return btAcos(dot(q) / s);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

btScalar btQuaternion::dot ( const btQuaternion q) const [inline]

Definition at line 97 of file btQuaternion.h.

       {
              return m_x * q.x() + m_y * q.y() + m_z * q.z() + m_unusedW * q.m_unusedW;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 184 of file btQuaternion.h.

       {
              btQuaternion diff,sum;
              diff = *this - qd;
              sum = *this + qd;
              if( diff.dot(diff) > sum.dot(sum) )
                     return qd;
              return (-qd);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

btScalar btQuaternion::getAngle ( ) const [inline]

Definition at line 151 of file btQuaternion.h.

       {
              btScalar s = btScalar(2.) * btAcos(m_unusedW);
              return s;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuaternion::getW ( ) const [inline]

Definition at line 213 of file btQuaternion.h.

{ return m_unusedW; }

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::getX ( ) const [inline, inherited]

Definition at line 43 of file btQuadWord.h.

{ return m_x; }

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::getY ( ) const [inline, inherited]

Definition at line 45 of file btQuadWord.h.

{ return m_y; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::getZ ( ) const [inline, inherited]

Definition at line 47 of file btQuadWord.h.

{ return m_z; }

Here is the caller graph for this function:

btQuaternion btQuaternion::inverse ( ) const [inline]

Definition at line 159 of file btQuaternion.h.

       {
              return btQuaternion(-m_x, -m_y, -m_z, m_unusedW);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

btScalar btQuaternion::length ( ) const [inline]

Definition at line 107 of file btQuaternion.h.

       {
              return btSqrt(length2());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

btScalar btQuaternion::length2 ( ) const [inline]

Definition at line 102 of file btQuaternion.h.

       {
              return dot(*this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file btQuaternion.h.

       {
              return *this /= length();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 139 of file btQuaternion.h.

       {
              return *this / length();
       } 

Here is the call graph for this function:

SIMD_FORCE_INLINE btQuadWord::operator btScalar * ( ) [inline, inherited]

Definition at line 66 of file btQuadWord.h.

{ return &m_x; }
SIMD_FORCE_INLINE btQuadWord::operator const btScalar * ( ) const [inline, inherited]

Definition at line 67 of file btQuadWord.h.

{ return &m_x; }
SIMD_FORCE_INLINE btQuaternion btQuaternion::operator* ( const btScalar s) const [inline]

Definition at line 118 of file btQuaternion.h.

       {
              return btQuaternion(x() * s, y() * s, z() * s, m_unusedW * s);
       }

Here is the call graph for this function:

btQuaternion& btQuaternion::operator*= ( const btScalar s) [inline]

Definition at line 81 of file btQuaternion.h.

       {
              m_x *= s; m_y *= s; m_z *= s; m_unusedW *= s;
              return *this;
       }
btQuaternion& btQuaternion::operator*= ( const btQuaternion q) [inline]

Definition at line 88 of file btQuaternion.h.

       {
              setValue(m_unusedW * q.x() + m_x * q.m_unusedW + m_y * q.z() - m_z * q.y(),
                     m_unusedW * q.y() + m_y * q.m_unusedW + m_z * q.x() - m_x * q.z(),
                     m_unusedW * q.z() + m_z * q.m_unusedW + m_x * q.y() - m_y * q.x(),
                     m_unusedW * q.m_unusedW - m_x * q.x() - m_y * q.y() - m_z * q.z());
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btQuaternion btQuaternion::operator+ ( const btQuaternion q2) const [inline]

Definition at line 165 of file btQuaternion.h.

       {
              const btQuaternion& q1 = *this;
              return btQuaternion(q1.x() + q2.x(), q1.y() + q2.y(), q1.z() + q2.z(), q1.m_unusedW + q2.m_unusedW);
       }

Here is the call graph for this function:

btQuaternion& btQuaternion::operator+= ( const btQuaternion q) [inline]

Definition at line 69 of file btQuaternion.h.

       {
              m_x += q.x(); m_y += q.y(); m_z += q.z(); m_unusedW += q.m_unusedW;
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btQuaternion btQuaternion::operator- ( const btQuaternion q2) const [inline]

Definition at line 172 of file btQuaternion.h.

       {
              const btQuaternion& q1 = *this;
              return btQuaternion(q1.x() - q2.x(), q1.y() - q2.y(), q1.z() - q2.z(), q1.m_unusedW - q2.m_unusedW);
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btQuaternion btQuaternion::operator- ( ) const [inline]

Definition at line 178 of file btQuaternion.h.

       {
              const btQuaternion& q2 = *this;
              return btQuaternion( - q2.x(), - q2.y(),  - q2.z(),  - q2.m_unusedW);
       }

Here is the call graph for this function:

btQuaternion& btQuaternion::operator-= ( const btQuaternion q) [inline]

Definition at line 75 of file btQuaternion.h.

       {
              m_x -= q.x(); m_y -= q.y(); m_z -= q.z(); m_unusedW -= q.m_unusedW;
              return *this;
       }

Here is the call graph for this function:

btQuaternion btQuaternion::operator/ ( const btScalar s) const [inline]

Definition at line 125 of file btQuaternion.h.

       {
              assert(s != btScalar(0.0));
              return *this * (btScalar(1.0) / s);
       }
btQuaternion& btQuaternion::operator/= ( const btScalar s) [inline]

Definition at line 132 of file btQuaternion.h.

       {
              assert(s != btScalar(0.0));
              return *this *= btScalar(1.0) / s;
       }
void btQuaternion::setEuler ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
) [inline]

Definition at line 52 of file btQuaternion.h.

       {
              btScalar halfYaw = btScalar(yaw) * btScalar(0.5);  
              btScalar halfPitch = btScalar(pitch) * btScalar(0.5);  
              btScalar halfRoll = btScalar(roll) * btScalar(0.5);  
              btScalar cosYaw = btCos(halfYaw);
              btScalar sinYaw = btSin(halfYaw);
              btScalar cosPitch = btCos(halfPitch);
              btScalar sinPitch = btSin(halfPitch);
              btScalar cosRoll = btCos(halfRoll);
              btScalar sinRoll = btSin(halfRoll);
              setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
                     cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
                     sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
                     cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setMax ( const btQuadWord other) [inline, inherited]

Definition at line 115 of file btQuadWord.h.

              {
                     btSetMax(m_x, other.m_x);
                     btSetMax(m_y, other.m_y);
                     btSetMax(m_z, other.m_z);
                     btSetMax(m_unusedW, other.m_unusedW);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setMin ( const btQuadWord other) [inline, inherited]

Definition at line 123 of file btQuadWord.h.

              {
                     btSetMin(m_x, other.m_x);
                     btSetMin(m_y, other.m_y);
                     btSetMin(m_z, other.m_z);
                     btSetMin(m_unusedW, other.m_unusedW);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

void btQuaternion::setRotation ( const btVector3 axis,
const btScalar angle 
) [inline]

Definition at line 43 of file btQuaternion.h.

       {
              btScalar d = axis.length();
              assert(d != btScalar(0.0));
              btScalar s = btSin(angle * btScalar(0.5)) / d;
              setValue(axis.x() * s, axis.y() * s, axis.z() * s, 
                     btCos(angle * btScalar(0.5)));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setValue ( const btScalar x,
const btScalar y,
const btScalar z 
) [inline, inherited]

Definition at line 71 of file btQuadWord.h.

              {
                     m_x=x;
                     m_y=y;
                     m_z=z;
                     m_unusedW = 0.f;
              }

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setValue ( const btScalar x,
const btScalar y,
const btScalar z,
const btScalar w 
) [inline, inherited]

Definition at line 86 of file btQuadWord.h.

              {
                     m_x=x;
                     m_y=y;
                     m_z=z;
                     m_unusedW=w;
              }

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setW ( btScalar  w) [inline, inherited]

Definition at line 55 of file btQuadWord.h.

{ m_unusedW = w;};

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setX ( btScalar  x) [inline, inherited]

Definition at line 49 of file btQuadWord.h.

{ m_x = x;};

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setY ( btScalar  y) [inline, inherited]

Definition at line 51 of file btQuadWord.h.

{ m_y = y;};

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setZ ( btScalar  z) [inline, inherited]

Definition at line 53 of file btQuadWord.h.

{ m_z = z;};

Here is the call graph for this function:

Here is the caller graph for this function:

btQuaternion btQuaternion::slerp ( const btQuaternion q,
const btScalar t 
) const [inline]

Definition at line 194 of file btQuaternion.h.

       {
              btScalar theta = angle(q);
              if (theta != btScalar(0.0))
              {
                     btScalar d = btScalar(1.0) / btSin(theta);
                     btScalar s0 = btSin((btScalar(1.0) - t) * theta);
                     btScalar s1 = btSin(t * theta);   
                     return btQuaternion((m_x * s0 + q.x() * s1) * d,
                            (m_y * s0 + q.y() * s1) * d,
                            (m_z * s0 + q.z() * s1) * d,
                            (m_unusedW * s0 + q.m_unusedW * s1) * d);
              }
              else
              {
                     return *this;
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::w ( ) const [inline, inherited]

Definition at line 63 of file btQuadWord.h.

{ return m_unusedW; }

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::x ( ) const [inline, inherited]

Definition at line 57 of file btQuadWord.h.

{ return m_x; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::y ( ) const [inline, inherited]

Definition at line 59 of file btQuadWord.h.

{ return m_y; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::z ( ) const [inline, inherited]

Definition at line 61 of file btQuadWord.h.

{ return m_z; }

Member Data Documentation

btScalar btQuadWordStorage::m_unusedW [protected, inherited]

Definition at line 31 of file btQuadWord.h.

btScalar btQuadWordStorage::m_x [protected, inherited]

Definition at line 28 of file btQuadWord.h.

btScalar btQuadWordStorage::m_y [protected, inherited]

Definition at line 29 of file btQuadWord.h.

btScalar btQuadWordStorage::m_z [protected, inherited]

Definition at line 30 of file btQuadWord.h.


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