Back to index

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

#include <btOdeTypedJoint.h>

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

List of all members.

Public Member Functions

 OdeD6Joint ()
 OdeD6Joint (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

btGeneric6DofConstraintgetD6Constraint ()
int setLinearLimits (Info2 *info)
int setAngularLimits (Info2 *info, int row_offset)

Detailed Description

Definition at line 79 of file btOdeTypedJoint.h.


Constructor & Destructor Documentation

OdeD6Joint::OdeD6Joint ( ) [inline]

Definition at line 92 of file btOdeTypedJoint.h.

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

Definition at line 327 of file btOdeTypedJoint.cpp.

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

Member Function Documentation

Definition at line 82 of file btOdeTypedJoint.h.

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

Here is the caller graph for this function:

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

Reimplemented from btOdeTypedJoint.

Definition at line 335 of file btOdeTypedJoint.cpp.

{
       btGeneric6DofConstraint * d6constraint = this->getD6Constraint();
       //prepare constraint
       d6constraint->calculateTransforms();
    info->m = 3;
    info->nub = 3;

    //test angular limits
    for (int i=0;i<3 ;i++ )
    {
       //if(i==2) continue;
              if(d6constraint->testAngularLimitMotor(i))
              {
                     info->m++;
              }
    }


}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from btOdeTypedJoint.

Definition at line 446 of file btOdeTypedJoint.cpp.

{
    int row = setLinearLimits(info);
    setAngularLimits(info, row);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int OdeD6Joint::setAngularLimits ( Info2 info,
int  row_offset 
) [protected]

Definition at line 426 of file btOdeTypedJoint.cpp.

{
       btGeneric6DofConstraint * d6constraint = this->getD6Constraint();
       int row = row_offset;
       //solve angular limits
    for (int i=0;i<3 ;i++ )
    {
       //if(i==2) continue;
              if(d6constraint->getRotationalLimitMotor(i)->needApplyTorques())
              {
                     btVector3 axis = d6constraint->getAxis(i);
                     row += bt_get_limit_motor_info2(
                            d6constraint->getRotationalLimitMotor(i),
                            m_body0->m_originalBody,m_body1->m_originalBody,info,row,axis,1);
              }
    }

    return row;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int OdeD6Joint::setLinearLimits ( Info2 info) [protected]

Definition at line 357 of file btOdeTypedJoint.cpp.

{

    btGeneric6DofConstraint * d6constraint = this->getD6Constraint();

    //retrieve matrices
    btTransform body0_trans;
    if (m_body0)
    {
        body0_trans = m_body0->m_originalBody->getCenterOfMassTransform();
    }

    btTransform body1_trans;

    if (m_body1)
    {
        body1_trans = m_body1->m_originalBody->getCenterOfMassTransform();
    }

    // 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()*d6constraint->getFrameOffsetA().getOrigin();
    //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()*d6constraint->getFrameOffsetB().getOrigin();

        //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 * (d6constraint->getCalculatedTransformB().getOrigin()[j] - a1[j] -
                              body0_trans.getOrigin()[j]);
        }
    }

    return 3;

}

Here is the call graph for this function:

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: