Back to index

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

#include <btMatrix3x3.h>

Collaboration diagram for btMatrix3x3:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 btMatrix3x3 ()
 btMatrix3x3 (const btQuaternion &q)
 btMatrix3x3 (const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz)
SIMD_FORCE_INLINE btMatrix3x3 (const btMatrix3x3 &other)
SIMD_FORCE_INLINE btMatrix3x3operator= (const btMatrix3x3 &other)
SIMD_FORCE_INLINE btVector3 getColumn (int i) const
SIMD_FORCE_INLINE const btVector3getRow (int i) const
SIMD_FORCE_INLINE btVector3operator[] (int i)
SIMD_FORCE_INLINE const btVector3operator[] (int i) const
btMatrix3x3operator*= (const btMatrix3x3 &m)
void setFromOpenGLSubMatrix (const btScalar *m)
void setValue (const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz)
void setRotation (const btQuaternion &q)
void setEulerYPR (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
void setEulerZYX (btScalar eulerX, btScalar eulerY, btScalar eulerZ)
 setEulerZYX
void setIdentity ()
void getOpenGLSubMatrix (btScalar *m) const
void getRotation (btQuaternion &q) const
void getEuler (btScalar &yaw, btScalar &pitch, btScalar &roll) const
btMatrix3x3 scaled (const btVector3 &s) const
btScalar determinant () const
btMatrix3x3 adjoint () const
btMatrix3x3 absolute () const
btMatrix3x3 transpose () const
btMatrix3x3 inverse () const
btMatrix3x3 transposeTimes (const btMatrix3x3 &m) const
btMatrix3x3 timesTranspose (const btMatrix3x3 &m) const
SIMD_FORCE_INLINE btScalar tdotx (const btVector3 &v) const
SIMD_FORCE_INLINE btScalar tdoty (const btVector3 &v) const
SIMD_FORCE_INLINE btScalar tdotz (const btVector3 &v) const

Protected Member Functions

btScalar cofac (int r1, int c1, int r2, int c2) const

Protected Attributes

btVector3 m_el [3]

Detailed Description

Definition at line 25 of file btMatrix3x3.h.


Constructor & Destructor Documentation

Definition at line 27 of file btMatrix3x3.h.

{}

Here is the caller graph for this function:

btMatrix3x3::btMatrix3x3 ( const btQuaternion q) [inline, explicit]

Definition at line 31 of file btMatrix3x3.h.

{ setRotation(q); }

Here is the call graph for this function:

btMatrix3x3::btMatrix3x3 ( const btScalar xx,
const btScalar xy,
const btScalar xz,
const btScalar yx,
const btScalar yy,
const btScalar yz,
const btScalar zx,
const btScalar zy,
const btScalar zz 
) [inline]

Definition at line 39 of file btMatrix3x3.h.

              { 
                     setValue(xx, xy, xz, 
                                    yx, yy, yz, 
                                    zx, zy, zz);
              }

Here is the call graph for this function:

Definition at line 48 of file btMatrix3x3.h.

              {
                     m_el[0] = other.m_el[0];
                     m_el[1] = other.m_el[1];
                     m_el[2] = other.m_el[2];
              }

Member Function Documentation

Definition at line 311 of file btMatrix3x3.h.

       {
              return btMatrix3x3(
                     btFabs(m_el[0].x()), btFabs(m_el[0].y()), btFabs(m_el[0].z()),
                     btFabs(m_el[1].x()), btFabs(m_el[1].y()), btFabs(m_el[1].z()),
                     btFabs(m_el[2].x()), btFabs(m_el[2].y()), btFabs(m_el[2].z()));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 328 of file btMatrix3x3.h.

       {
              return btMatrix3x3(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2),
                                                         cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0),
                                                         cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1));
       }

Here is the call graph for this function:

btScalar btMatrix3x3::cofac ( int  r1,
int  c1,
int  r2,
int  c2 
) const [inline, protected]

Definition at line 286 of file btMatrix3x3.h.

              {
                     return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1];
              }

Here is the caller graph for this function:

Definition at line 304 of file btMatrix3x3.h.

       { 
              return triple((*this)[0], (*this)[1], (*this)[2]);
       }

Here is the call graph for this function:

Definition at line 63 of file btMatrix3x3.h.

              {
                     return btVector3(m_el[0][i],m_el[1][i],m_el[2][i]);
              }

Here is the caller graph for this function:

void btMatrix3x3::getEuler ( btScalar yaw,
btScalar pitch,
btScalar roll 
) const [inline]

Definition at line 225 of file btMatrix3x3.h.

              {
                     
                     if (btScalar(m_el[1].z()) < btScalar(1))
                     {
                            if (btScalar(m_el[1].z()) > -btScalar(1))
                            {
                                   yaw = btScalar(btAtan2(m_el[1].x(), m_el[0].x()));
                                   pitch = btScalar(btAsin(-m_el[1].y()));
                                   roll = btScalar(btAtan2(m_el[2].y(), m_el[2].z()));
                            }
                            else 
                            {
                                   yaw = btScalar(-btAtan2(-m_el[0].y(), m_el[0].z()));
                                   pitch = SIMD_HALF_PI;
                                   roll = btScalar(0.0);
                            }
                     }
                     else
                     {
                            yaw = btScalar(btAtan2(-m_el[0].y(), m_el[0].z()));
                            pitch = -SIMD_HALF_PI;
                            roll = btScalar(0.0);
                     }
              }

Here is the call graph for this function:

void btMatrix3x3::getOpenGLSubMatrix ( btScalar m) const [inline]

Definition at line 175 of file btMatrix3x3.h.

              {
                     m[0]  = btScalar(m_el[0].x()); 
                     m[1]  = btScalar(m_el[1].x());
                     m[2]  = btScalar(m_el[2].x());
                     m[3]  = btScalar(0.0); 
                     m[4]  = btScalar(m_el[0].y());
                     m[5]  = btScalar(m_el[1].y());
                     m[6]  = btScalar(m_el[2].y());
                     m[7]  = btScalar(0.0); 
                     m[8]  = btScalar(m_el[0].z()); 
                     m[9]  = btScalar(m_el[1].z());
                     m[10] = btScalar(m_el[2].z());
                     m[11] = btScalar(0.0); 
              }

Here is the caller graph for this function:

void btMatrix3x3::getRotation ( btQuaternion q) const [inline]

Definition at line 191 of file btMatrix3x3.h.

              {
                     btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
                     btScalar temp[4];
                     
                     if (trace > btScalar(0.0)) 
                     {
                            btScalar s = btSqrt(trace + btScalar(1.0));
                            temp[3]=(s * btScalar(0.5));
                            s = btScalar(0.5) / s;
                            
                            temp[0]=((m_el[2].y() - m_el[1].z()) * s);
                            temp[1]=((m_el[0].z() - m_el[2].x()) * s);
                            temp[2]=((m_el[1].x() - m_el[0].y()) * s);
                     } 
                     else 
                     {
                            int i = m_el[0].x() < m_el[1].y() ? 
                                   (m_el[1].y() < m_el[2].z() ? 2 : 1) :
                                   (m_el[0].x() < m_el[2].z() ? 2 : 0); 
                            int j = (i + 1) % 3;  
                            int k = (i + 2) % 3;
                            
                            btScalar s = btSqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + btScalar(1.0));
                            temp[i] = s * btScalar(0.5);
                            s = btScalar(0.5) / s;
                            
                            temp[3] = (m_el[k][j] - m_el[j][k]) * s;
                            temp[j] = (m_el[j][i] + m_el[i][j]) * s;
                            temp[k] = (m_el[k][i] + m_el[i][k]) * s;
                     }
                     q.setValue(temp[0],temp[1],temp[2],temp[3]);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btVector3& btMatrix3x3::getRow ( int  i) const [inline]

Definition at line 70 of file btMatrix3x3.h.

              {
                     return m_el[i];
              }

Definition at line 336 of file btMatrix3x3.h.

       {
              btVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
              btScalar det = (*this)[0].dot(co);
              btFullAssert(det != btScalar(0.0));
              btScalar s = btScalar(1.0) / det;
              return btMatrix3x3(co.x() * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
                                                         co.y() * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
                                                         co.z() * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btMatrix3x3 & btMatrix3x3::operator*= ( const btMatrix3x3 m)

Definition at line 295 of file btMatrix3x3.h.

       {
              setValue(m.tdotx(m_el[0]), m.tdoty(m_el[0]), m.tdotz(m_el[0]),
                             m.tdotx(m_el[1]), m.tdoty(m_el[1]), m.tdotz(m_el[1]),
                             m.tdotx(m_el[2]), m.tdoty(m_el[2]), m.tdotz(m_el[2]));
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btMatrix3x3& btMatrix3x3::operator= ( const btMatrix3x3 other) [inline]

Definition at line 55 of file btMatrix3x3.h.

              {
                     m_el[0] = other.m_el[0];
                     m_el[1] = other.m_el[1];
                     m_el[2] = other.m_el[2];
                     return *this;
              }
SIMD_FORCE_INLINE btVector3& btMatrix3x3::operator[] ( int  i) [inline]

Definition at line 76 of file btMatrix3x3.h.

              { 
                     btFullAssert(0 <= i && i < 3);
                     return m_el[i]; 
              }
SIMD_FORCE_INLINE const btVector3& btMatrix3x3::operator[] ( int  i) const [inline]

Definition at line 82 of file btMatrix3x3.h.

              {
                     btFullAssert(0 <= i && i < 3);
                     return m_el[i]; 
              }
btMatrix3x3 btMatrix3x3::scaled ( const btVector3 s) const [inline]

Definition at line 254 of file btMatrix3x3.h.

              {
                     return btMatrix3x3(m_el[0].x() * s.x(), m_el[0].y() * s.y(), m_el[0].z() * s.z(),
                                                                m_el[1].x() * s.x(), m_el[1].y() * s.y(), m_el[1].z() * s.z(),
                                                                m_el[2].x() * s.x(), m_el[2].y() * s.y(), m_el[2].z() * s.z());
              }

Here is the call graph for this function:

Here is the caller graph for this function:

void btMatrix3x3::setEulerYPR ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
) [inline]

Definition at line 124 of file btMatrix3x3.h.

              {

                     btScalar cy(btCos(yaw)); 
                     btScalar  sy(btSin(yaw)); 
                     btScalar  cp(btCos(pitch)); 
                     btScalar  sp(btSin(pitch)); 
                     btScalar  cr(btCos(roll));
                     btScalar  sr(btSin(roll));
                     btScalar  cc = cy * cr; 
                     btScalar  cs = cy * sr; 
                     btScalar  sc = sy * cr; 
                     btScalar  ss = sy * sr;
                     setValue(cc - sp * ss, -cs - sp * sc, -sy * cp,
                     cp * sr,       cp * cr,      -sp,
                                    sc + sp * cs, -ss + sp * cc,  cy * cp);
              
              }

Here is the call graph for this function:

void btMatrix3x3::setEulerZYX ( btScalar  eulerX,
btScalar  eulerY,
btScalar  eulerZ 
) [inline]

setEulerZYX

Parameters:
eulera const reference to a btVector3 of euler angles These angles are used to produce a rotation matrix. The euler angles are applied in ZYX order. I.e a vector is first rotated about X then Y and then Z

Definition at line 151 of file btMatrix3x3.h.

                                                                         {
              btScalar ci ( btCos(eulerX)); 
              btScalar cj ( btCos(eulerY)); 
              btScalar ch ( btCos(eulerZ)); 
              btScalar si ( btSin(eulerX)); 
              btScalar sj ( btSin(eulerY)); 
              btScalar sh ( btSin(eulerZ)); 
              btScalar cc = ci * ch; 
              btScalar cs = ci * sh; 
              btScalar sc = si * ch; 
              btScalar ss = si * sh;
              
              setValue(cj * ch, sj * sc - cs, sj * cc + ss,
                             cj * sh, sj * ss + cc, sj * cs - sc, 
                                    -sj,      cj * si,      cj * ci);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void btMatrix3x3::setFromOpenGLSubMatrix ( const btScalar m) [inline]

Definition at line 91 of file btMatrix3x3.h.

              {
                     m_el[0].setValue(m[0],m[4],m[8]);
                     m_el[1].setValue(m[1],m[5],m[9]);
                     m_el[2].setValue(m[2],m[6],m[10]);

              }

Here is the call graph for this function:

Here is the caller graph for this function:

void btMatrix3x3::setIdentity ( ) [inline]

Definition at line 168 of file btMatrix3x3.h.

              { 
                     setValue(btScalar(1.0), btScalar(0.0), btScalar(0.0), 
                                    btScalar(0.0), btScalar(1.0), btScalar(0.0), 
                                    btScalar(0.0), btScalar(0.0), btScalar(1.0)); 
              }

Here is the call graph for this function:

Here is the caller graph for this function:

void btMatrix3x3::setRotation ( const btQuaternion q) [inline]

Definition at line 108 of file btMatrix3x3.h.

              {
                     btScalar d = q.length2();
                     btFullAssert(d != btScalar(0.0));
                     btScalar s = btScalar(2.0) / d;
                     btScalar xs = q.x() * s,   ys = q.y() * s,   zs = q.z() * s;
                     btScalar wx = q.w() * xs,  wy = q.w() * ys,  wz = q.w() * zs;
                     btScalar xx = q.x() * xs,  xy = q.x() * ys,  xz = q.x() * zs;
                     btScalar yy = q.y() * ys,  yz = q.y() * zs,  zz = q.z() * zs;
                     setValue(btScalar(1.0) - (yy + zz), xy - wz, xz + wy,
                                    xy + wz, btScalar(1.0) - (xx + zz), yz - wx,
                                    xz - wy, yz + wx, btScalar(1.0) - (xx + yy));
              }

Here is the call graph for this function:

Here is the caller graph for this function:

void btMatrix3x3::setValue ( const btScalar xx,
const btScalar xy,
const btScalar xz,
const btScalar yx,
const btScalar yy,
const btScalar yz,
const btScalar zx,
const btScalar zy,
const btScalar zz 
) [inline]

Definition at line 99 of file btMatrix3x3.h.

              {
                     m_el[0].setValue(xx,xy,xz);
                     m_el[1].setValue(yx,yy,yz);
                     m_el[2].setValue(zx,zy,zz);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotx ( const btVector3 v) const [inline]

Definition at line 270 of file btMatrix3x3.h.

              {
                     return m_el[0].x() * v.x() + m_el[1].x() * v.y() + m_el[2].x() * v.z();
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btMatrix3x3::tdoty ( const btVector3 v) const [inline]

Definition at line 274 of file btMatrix3x3.h.

              {
                     return m_el[0].y() * v.x() + m_el[1].y() * v.y() + m_el[2].y() * v.z();
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotz ( const btVector3 v) const [inline]

Definition at line 278 of file btMatrix3x3.h.

              {
                     return m_el[0].z() * v.x() + m_el[1].z() * v.y() + m_el[2].z() * v.z();
              }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 363 of file btMatrix3x3.h.

       {
              return btMatrix3x3(
                     m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]),
                     m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]),
                     m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2]));
              
       }

Here is the call graph for this function:

Definition at line 320 of file btMatrix3x3.h.

       {
              return btMatrix3x3(m_el[0].x(), m_el[1].x(), m_el[2].x(),
                                                         m_el[0].y(), m_el[1].y(), m_el[2].y(),
                                                         m_el[0].z(), m_el[1].z(), m_el[2].z());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 348 of file btMatrix3x3.h.

       {
              return btMatrix3x3(
                     m_el[0].x() * m[0].x() + m_el[1].x() * m[1].x() + m_el[2].x() * m[2].x(),
                     m_el[0].x() * m[0].y() + m_el[1].x() * m[1].y() + m_el[2].x() * m[2].y(),
                     m_el[0].x() * m[0].z() + m_el[1].x() * m[1].z() + m_el[2].x() * m[2].z(),
                     m_el[0].y() * m[0].x() + m_el[1].y() * m[1].x() + m_el[2].y() * m[2].x(),
                     m_el[0].y() * m[0].y() + m_el[1].y() * m[1].y() + m_el[2].y() * m[2].y(),
                     m_el[0].y() * m[0].z() + m_el[1].y() * m[1].z() + m_el[2].y() * m[2].z(),
                     m_el[0].z() * m[0].x() + m_el[1].z() * m[1].x() + m_el[2].z() * m[2].x(),
                     m_el[0].z() * m[0].y() + m_el[1].z() * m[1].y() + m_el[2].z() * m[2].y(),
                     m_el[0].z() * m[0].z() + m_el[1].z() * m[1].z() + m_el[2].z() * m[2].z());
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

btVector3 btMatrix3x3::m_el[3] [protected]

Definition at line 291 of file btMatrix3x3.h.


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