Back to index

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

#include <btOdeTypedJoint.h>

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

List of all members.

Public Member Functions

 OdeP2PJoint ()
 OdeP2PJoint (btTypedConstraint *constraint, int index, bool swap, btOdeSolverBody *body0, btOdeSolverBody *body1)
virtual void GetInfo1 (Info1 *info)
virtual void GetInfo2 (Info2 *info)

Public Attributes

btTypedConstraintm_constraint
int m_index
bool m_swapBodies
btOdeSolverBodym_body0
btOdeSolverBodym_body1
int flags
BU_ContactJointNode node [2]
btScalar lambda [6]

Protected Member Functions

btPoint2PointConstraintgetP2PConstraint ()

Detailed Description

Definition at line 58 of file btOdeTypedJoint.h.


Constructor & Destructor Documentation

Definition at line 67 of file btOdeTypedJoint.h.

{};
OdeP2PJoint::OdeP2PJoint ( btTypedConstraint constraint,
int  index,
bool  swap,
btOdeSolverBody body0,
btOdeSolverBody body1 
)

Definition at line 61 of file btOdeTypedJoint.cpp.

                                                                      :
        btOdeTypedJoint(constraint,index,swap,body0,body1)
{
}

Member Function Documentation

void OdeP2PJoint::GetInfo1 ( Info1 info) [virtual]

Reimplemented from btOdeTypedJoint.

Definition at line 69 of file btOdeTypedJoint.cpp.

{
    info->m = 3;
    info->nub = 3;
}

Here is the caller graph for this function:

void OdeP2PJoint::GetInfo2 ( Info2 info) [virtual]

Reimplemented from btOdeTypedJoint.

Definition at line 76 of file btOdeTypedJoint.cpp.

{

    btPoint2PointConstraint * p2pconstraint = this->getP2PConstraint();

    //retrieve matrices
    btTransform body0_trans;
    if (m_body0)
    {
        body0_trans = m_body0->m_originalBody->getCenterOfMassTransform();
    }
//    btScalar body0_mat[12];
//    body0_mat[0] = body0_trans.getBasis()[0][0];
//    body0_mat[1] = body0_trans.getBasis()[0][1];
//    body0_mat[2] = body0_trans.getBasis()[0][2];
//    body0_mat[4] = body0_trans.getBasis()[1][0];
//    body0_mat[5] = body0_trans.getBasis()[1][1];
//    body0_mat[6] = body0_trans.getBasis()[1][2];
//    body0_mat[8] = body0_trans.getBasis()[2][0];
//    body0_mat[9] = body0_trans.getBasis()[2][1];
//    body0_mat[10] = body0_trans.getBasis()[2][2];

    btTransform body1_trans;

    if (m_body1)
    {
        body1_trans = m_body1->m_originalBody->getCenterOfMassTransform();
    }
//    btScalar body1_mat[12];
//    body1_mat[0] = body1_trans.getBasis()[0][0];
//    body1_mat[1] = body1_trans.getBasis()[0][1];
//    body1_mat[2] = body1_trans.getBasis()[0][2];
//    body1_mat[4] = body1_trans.getBasis()[1][0];
//    body1_mat[5] = body1_trans.getBasis()[1][1];
//    body1_mat[6] = body1_trans.getBasis()[1][2];
//    body1_mat[8] = body1_trans.getBasis()[2][0];
//    body1_mat[9] = body1_trans.getBasis()[2][1];
//    body1_mat[10] = body1_trans.getBasis()[2][2];




    // anchor points in global coordinates with respect to body PORs.


    int s = info->rowskip;

    // set jacobian
    info->J1l[0] = 1;
    info->J1l[s+1] = 1;
    info->J1l[2*s+2] = 1;


    btVector3 a1,a2;

    a1 = body0_trans.getBasis()*p2pconstraint->getPivotInA();
    //dMULTIPLY0_331 (a1, body0_mat,m_constraint->m_pivotInA);
    dCROSSMAT (info->J1a,a1,s,-,+);
    if (m_body1)
    {
        info->J2l[0] = -1;
        info->J2l[s+1] = -1;
        info->J2l[2*s+2] = -1;
        a2 = body1_trans.getBasis()*p2pconstraint->getPivotInB();
        //dMULTIPLY0_331 (a2,body1_mat,m_constraint->m_pivotInB);
        dCROSSMAT (info->J2a,a2,s,+,-);
    }


    // set right hand side
    btScalar k = info->fps * info->erp;
    if (m_body1)
    {
        for (int j=0; j<3; j++)
        {
            info->c[j] = k * (a2[j] + body1_trans.getOrigin()[j] -
                              a1[j] - body0_trans.getOrigin()[j]);
        }
    }
    else
    {
        for (int j=0; j<3; j++)
        {
            info->c[j] = k * (p2pconstraint->getPivotInB()[j] - a1[j] -
                              body0_trans.getOrigin()[j]);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 61 of file btOdeTypedJoint.h.

       {
              return static_cast<btPoint2PointConstraint * >(m_constraint);
       }

Here is the caller graph for this function:


Member Data Documentation

int btOdeJoint::flags [inherited]

Definition at line 88 of file btOdeJoint.h.

btScalar btOdeJoint::lambda[6] [inherited]

Definition at line 90 of file btOdeJoint.h.

Definition at line 37 of file btOdeTypedJoint.h.

Definition at line 38 of file btOdeTypedJoint.h.

Definition at line 34 of file btOdeTypedJoint.h.

int btOdeTypedJoint::m_index [inherited]

Definition at line 35 of file btOdeTypedJoint.h.

Definition at line 36 of file btOdeTypedJoint.h.

Definition at line 89 of file btOdeJoint.h.


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