void dxJointLMotor::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int row = 0; dVector3 ax[3]; computeGlobalAxes( ax ); for ( int i = 0;i < num;i++ ) { row += limot[i].addLimot( this, worldFPS, info, row, ax[i], 0 ); } }
void dxJointAMotor::getInfo2( dxJoint::Info2 *info ) { int i; // compute the axes (if not global) dVector3 ax[3]; computeGlobalAxes( ax ); // in euler angle mode we do not actually constrain the angular velocity // along the axes axis[0] and axis[2] (although we do use axis[1]) : // // to get constrain w2-w1 along ...not // ------ --------------------- ------ // d(angle[0])/dt = 0 ax[1] x ax[2] ax[0] // d(angle[1])/dt = 0 ax[1] // d(angle[2])/dt = 0 ax[0] x ax[1] ax[2] // // constraining w2-w1 along an axis 'a' means that a'*(w2-w1)=0. // to prove the result for angle[0], write the expression for angle[0] from // GetInfo1 then take the derivative. to prove this for angle[2] it is // easier to take the euler rate expression for d(angle[2])/dt with respect // to the components of w and set that to 0. dVector3 *axptr[3]; axptr[0] = &ax[0]; axptr[1] = &ax[1]; axptr[2] = &ax[2]; dVector3 ax0_cross_ax1; dVector3 ax1_cross_ax2; if ( mode == dAMotorEuler ) { dCalcVectorCross3( ax0_cross_ax1, ax[0], ax[1] ); axptr[2] = &ax0_cross_ax1; dCalcVectorCross3( ax1_cross_ax2, ax[1], ax[2] ); axptr[0] = &ax1_cross_ax2; } int row = 0; for ( i = 0; i < num; i++ ) { row += limot[i].addLimot( this, info, row, *( axptr[i] ), 1 ); } }
void dxJointAMotor::getInfo1( dxJoint::Info1 *info ) { info->m = 0; info->nub = 0; // compute the axes and angles, if in Euler mode if ( mode == dAMotorEuler ) { dVector3 ax[3]; computeGlobalAxes( ax ); computeEulerAngles( ax ); } // see if we're powered or at a joint limit for each axis for ( int i = 0; i < num; i++ ) { if ( limot[i].testRotationalLimit( angle[i] ) || limot[i].fmax > 0 ) { info->m++; } } }