Back to index

supertuxkart  0.5+dfsg1
Defines | Functions | Variables
btGeneric6DofConstraint.cpp File Reference
#include "btGeneric6DofConstraint.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "LinearMath/btTransformUtil.h"
#include <new>

Go to the source code of this file.

Defines

#define GENERIC_D6_DISABLE_WARMSTARTING   1

Functions

btScalar btGetMatrixElem (const btMatrix3x3 &mat, int index)
bool matrixToEulerXYZ (const btMatrix3x3 &mat, btVector3 &xyz)
 MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html.

Variables

static const btScalar kSign [] = { btScalar(1.0), btScalar(-1.0), btScalar(1.0) }
static const int kAxisA [] = { 1, 0, 0 }
static const int kAxisB [] = { 2, 2, 1 }

Define Documentation

Definition at line 32 of file btGeneric6DofConstraint.cpp.


Function Documentation

btScalar btGetMatrixElem ( const btMatrix3x3 mat,
int  index 
)

Definition at line 34 of file btGeneric6DofConstraint.cpp.

{
       int i = index%3;
       int j = index/3;
       return mat[i][j];
}

Here is the caller graph for this function:

bool matrixToEulerXYZ ( const btMatrix3x3 mat,
btVector3 xyz 
)

MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html.

Definition at line 42 of file btGeneric6DofConstraint.cpp.

{
//     // rot =  cy*cz          -cy*sz           sy
//     //        cz*sx*sy+cx*sz  cx*cz-sx*sy*sz -cy*sx
//     //       -cx*cz*sy+sx*sz  cz*sx+cx*sy*sz  cx*cy
//

              if (btGetMatrixElem(mat,2) < btScalar(1.0))
              {
                     if (btGetMatrixElem(mat,2) > btScalar(-1.0))
                     {
                            xyz[0] = btAtan2(-btGetMatrixElem(mat,5),btGetMatrixElem(mat,8));
                            xyz[1] = btAsin(btGetMatrixElem(mat,2));
                            xyz[2] = btAtan2(-btGetMatrixElem(mat,1),btGetMatrixElem(mat,0));
                            return true;
                     }
                     else
                     {
                            // WARNING.  Not unique.  XA - ZA = -atan2(r10,r11)
                            xyz[0] = -btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
                            xyz[1] = -SIMD_HALF_PI;
                            xyz[2] = btScalar(0.0);
                            return false;
                     }
              }
              else
              {
                     // WARNING.  Not unique.  XAngle + ZAngle = atan2(r10,r11)
                     xyz[0] = btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
                     xyz[1] = SIMD_HALF_PI;
                     xyz[2] = 0.0;

              }


       return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const int kAxisA[] = { 1, 0, 0 } [static]

Definition at line 30 of file btGeneric6DofConstraint.cpp.

const int kAxisB[] = { 2, 2, 1 } [static]

Definition at line 31 of file btGeneric6DofConstraint.cpp.

const btScalar kSign[] = { btScalar(1.0), btScalar(-1.0), btScalar(1.0) } [static]

Definition at line 29 of file btGeneric6DofConstraint.cpp.