From: <ole...@us...> - 2012-12-18 22:34:13
|
Revision: 1916 http://opende.svn.sourceforge.net/opende/?rev=1916&view=rev Author: oleh_derevenko Date: 2012-12-18 22:34:05 +0000 (Tue, 18 Dec 2012) Log Message: ----------- Fixed issue with some kinds of joints (Ball, DBall, DHinge, Fixed) might overwrite world ERP value with their custom ERP during getInfo2() call and that inappropriate value would then be passed to subsequent joints in solver instead of world ERP. Modified Paths: -------------- trunk/CHANGELOG.txt trunk/ode/src/joints/amotor.cpp trunk/ode/src/joints/amotor.h trunk/ode/src/joints/ball.cpp trunk/ode/src/joints/ball.h trunk/ode/src/joints/contact.cpp trunk/ode/src/joints/contact.h trunk/ode/src/joints/dball.cpp trunk/ode/src/joints/dball.h trunk/ode/src/joints/dhinge.cpp trunk/ode/src/joints/dhinge.h trunk/ode/src/joints/fixed.cpp trunk/ode/src/joints/fixed.h trunk/ode/src/joints/hinge.cpp trunk/ode/src/joints/hinge.h trunk/ode/src/joints/hinge2.cpp trunk/ode/src/joints/hinge2.h trunk/ode/src/joints/joint.cpp trunk/ode/src/joints/joint.h trunk/ode/src/joints/joint_internal.h trunk/ode/src/joints/lmotor.cpp trunk/ode/src/joints/lmotor.h trunk/ode/src/joints/null.cpp trunk/ode/src/joints/null.h trunk/ode/src/joints/piston.cpp trunk/ode/src/joints/piston.h trunk/ode/src/joints/plane2d.cpp trunk/ode/src/joints/plane2d.h trunk/ode/src/joints/pr.cpp trunk/ode/src/joints/pr.h trunk/ode/src/joints/pu.cpp trunk/ode/src/joints/pu.h trunk/ode/src/joints/slider.cpp trunk/ode/src/joints/slider.h trunk/ode/src/joints/universal.cpp trunk/ode/src/joints/universal.h trunk/ode/src/quickstep.cpp trunk/ode/src/step.cpp Modified: trunk/CHANGELOG.txt =================================================================== --- trunk/CHANGELOG.txt 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/CHANGELOG.txt 2012-12-18 22:34:05 UTC (rev 1916) @@ -8,6 +8,11 @@ * keep the format consistent (79 char width, M/D/Y date format). ------------------------------------------------------------------------------ +12/18/12 Oleh_Derevenko + * Fixed issue with some kinds of joints (Ball, DBall, DHinge, Fixed) + might overwrite world ERP value with their custom ERP during + getInfo2() call and that inappropriate value would then be passed + to subsequent joints in solver instead of world ERP. 12/01/12 Oleh_Derevenko * Fixed issues reported in patches #151 and #22 (collisions with SAPSpace and QuadTreeSpace might not work because geometries list Modified: trunk/ode/src/joints/amotor.cpp =================================================================== --- trunk/ode/src/joints/amotor.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/amotor.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -215,7 +215,7 @@ void -dxJointAMotor::getInfo2( dxJoint::Info2 *info ) +dxJointAMotor::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ) { int i; @@ -256,7 +256,7 @@ int row = 0; for ( i = 0; i < num; i++ ) { - row += limot[i].addLimot( this, info, row, *( axptr[i] ), 1 ); + row += limot[i].addLimot( this, worldFPS, info, row, *( axptr[i] ), 1 ); } } Modified: trunk/ode/src/joints/amotor.h =================================================================== --- trunk/ode/src/joints/amotor.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/amotor.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -49,7 +49,7 @@ dxJointAMotor( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; }; Modified: trunk/ode/src/joints/ball.cpp =================================================================== --- trunk/ode/src/joints/ball.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/ball.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -55,13 +55,12 @@ void -dxJointBall::getInfo2( dxJoint::Info2 *info ) +dxJointBall::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ) { - info->erp = erp; info->cfm[0] = cfm; info->cfm[1] = cfm; info->cfm[2] = cfm; - setBall( this, info, anchor1, anchor2 ); + setBall( this, worldFPS, this->erp, info, anchor1, anchor2 ); } Modified: trunk/ode/src/joints/ball.h =================================================================== --- trunk/ode/src/joints/ball.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/ball.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -39,7 +39,7 @@ dxJointBall( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/contact.cpp =================================================================== --- trunk/ode/src/joints/contact.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/contact.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -72,7 +72,7 @@ void -dxJointContact::getInfo2( dxJoint::Info2 *info ) +dxJointContact::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int s = info->rowskip; int s2 = 2 * s; @@ -120,10 +120,10 @@ } // set right hand side and cfm value for normal - dReal erp = info->erp; + dReal erp = worldERP; if ( contact.surface.mode & dContactSoftERP ) erp = contact.surface.soft_erp; - dReal k = info->fps * erp; + dReal k = worldFPS * erp; dReal depth = contact.geom.depth - world->contactp.min_depth; if ( depth < 0 ) depth = 0; Modified: trunk/ode/src/joints/contact.h =================================================================== --- trunk/ode/src/joints/contact.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/contact.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -35,7 +35,7 @@ dxJointContact( dxWorld* w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; }; Modified: trunk/ode/src/joints/dball.cpp =================================================================== --- trunk/ode/src/joints/dball.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/dball.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -54,10 +54,9 @@ } void -dxJointDBall::getInfo2( dxJoint::Info2 *info ) +dxJointDBall::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { - info->erp = erp; - info->cfm[0] = cfm; + info->cfm[0] = this->cfm; dVector3 globalA1, globalA2; dBodyGetRelPointPos(node[0].body, anchor1[0], anchor1[1], anchor1[2], globalA1); @@ -125,9 +124,8 @@ dMultiply1_331(info->J2a, a2m, q); } - const dReal k = info->fps * info->erp; + const dReal k = worldFPS * this->erp; info->c[0] = k * (targetDistance - dCalcPointsDistance3(globalA1, globalA2)); - } Modified: trunk/ode/src/joints/dball.h =================================================================== --- trunk/ode/src/joints/dball.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/dball.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -43,7 +43,7 @@ dxJointDBall( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/dhinge.cpp =================================================================== --- trunk/ode/src/joints/dhinge.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/dhinge.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -54,9 +54,9 @@ void -dxJointDHinge::getInfo2( dxJoint::Info2* info ) +dxJointDHinge::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ) { - dxJointDBall::getInfo2( info ); // sets row0 + dxJointDBall::getInfo2( worldFPS, worldERP, info ); // sets row0 const int skip = info->rowskip; const int row1 = skip; @@ -94,7 +94,7 @@ // similar to the hinge joint dVector3 u; dCalcVectorCross3(u, globalAxis1, globalAxis2); - const dReal k = info->fps * info->erp; + const dReal k = worldFPS * this->erp; info->c[1] = k * dCalcVectorDot3( u, p ); info->c[2] = k * dCalcVectorDot3( u, q ); Modified: trunk/ode/src/joints/dhinge.h =================================================================== --- trunk/ode/src/joints/dhinge.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/dhinge.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -33,7 +33,7 @@ virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/fixed.cpp =================================================================== --- trunk/ode/src/joints/fixed.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/fixed.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -57,12 +57,12 @@ void -dxJointFixed::getInfo2 ( dxJoint::Info2 *info ) +dxJointFixed::getInfo2 ( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int s = info->rowskip; // Three rows for orientation - setFixedOrientation ( this, info, qrel, 3 ); + setFixedOrientation ( this, worldFPS, worldERP, info, qrel, 3 ); // Three rows for position. // set jacobian @@ -70,10 +70,9 @@ info->J1l[s+1] = 1; info->J1l[2*s+2] = 1; - info->erp = erp; - info->cfm[0] = cfm; - info->cfm[1] = cfm; - info->cfm[2] = cfm; + info->cfm[0] = this->cfm; + info->cfm[1] = this->cfm; + info->cfm[2] = this->cfm; dVector3 ofs; dMultiply0_331 ( ofs, node[0].body->posr.R, offset ); @@ -86,7 +85,7 @@ } // set right hand side for the first three rows (linear) - dReal k = info->fps * info->erp; + dReal k = worldFPS * this->erp; if ( node[1].body ) { for ( int j = 0; j < 3; j++ ) Modified: trunk/ode/src/joints/fixed.h =================================================================== --- trunk/ode/src/joints/fixed.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/fixed.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -40,7 +40,7 @@ dxJointFixed ( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1 ( Info1* info ); - virtual void getInfo2 ( Info2* info ); + virtual void getInfo2 ( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/hinge.cpp =================================================================== --- trunk/ode/src/joints/hinge.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/hinge.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -74,11 +74,10 @@ } -void -dxJointHinge::getInfo2( dxJoint::Info2 *info ) +void dxJointHinge::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ) { // set the three ball-and-socket rows - setBall( this, info, anchor1, anchor2 ); + setBall( this, worldFPS, worldERP, info, anchor1, anchor2 ); // set the two hinge rows. the hinge axis should be the only unconstrained // rotational axis, the angular velocity of the two bodies perpendicular to @@ -141,12 +140,12 @@ ax2[2] = axis2[2]; } dCalcVectorCross3( b, ax1, ax2 ); - dReal k = info->fps * info->erp; + dReal k = worldFPS * worldERP; info->c[3] = k * dCalcVectorDot3( b, p ); info->c[4] = k * dCalcVectorDot3( b, q ); // if the hinge is powered, or has joint limits, add in the stuff - limot.addLimot( this, info, 5, ax1, 1 ); + limot.addLimot( this, worldFPS, info, 5, ax1, 1 ); } Modified: trunk/ode/src/joints/hinge.h =================================================================== --- trunk/ode/src/joints/hinge.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/hinge.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -40,7 +40,7 @@ dxJointHinge( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/hinge2.cpp =================================================================== --- trunk/ode/src/joints/hinge2.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/hinge2.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -126,7 +126,7 @@ void -dxJointHinge2::getInfo2( dxJoint::Info2 *info ) +dxJointHinge2::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { // get information we need to set the hinge row dReal s, c; @@ -138,7 +138,7 @@ dNormalize3( q ); // @@@ quicker: divide q by s ? // set the three ball-and-socket rows (aligned to the suspension axis ax1) - setBall2( this, info, anchor1, anchor2, ax1, susp_erp ); + setBall2( this, worldFPS, worldERP, info, anchor1, anchor2, ax1, susp_erp ); // set the hinge row int s3 = 3 * info->rowskip; @@ -167,14 +167,14 @@ // where c = cos(theta), s = sin(theta) // c0 = cos(theta0), s0 = sin(theta0) - dReal k = info->fps * info->erp; + dReal k = worldFPS * worldERP; info->c[3] = k * ( c0 * s - joint->s0 * c ); // if the axis1 hinge is powered, or has joint limits, add in more stuff - int row = 4 + limot1.addLimot( this, info, 4, ax1, 1 ); + int row = 4 + limot1.addLimot( this, worldFPS, info, 4, ax1, 1 ); // if the axis2 hinge is powered, add in more stuff - limot2.addLimot( this, info, row, ax2, 1 ); + limot2.addLimot( this, worldFPS, info, row, ax2, 1 ); // set parameter for the suspension info->cfm[0] = susp_cfm; Modified: trunk/ode/src/joints/hinge2.h =================================================================== --- trunk/ode/src/joints/hinge2.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/hinge2.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -52,7 +52,7 @@ virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/joint.cpp =================================================================== --- trunk/ode/src/joints/joint.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/joint.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -101,7 +101,7 @@ // set three "ball-and-socket" rows in the constraint equation, and the // corresponding right hand side. -void setBall( dxJoint *joint, dxJoint::Info2 *info, +void setBall( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dVector3 anchor1, dVector3 anchor2 ) { // anchor points in global coordinates with respect to body PORs. @@ -125,7 +125,7 @@ } // set right hand side - dReal k = info->fps * info->erp; + dReal k = fps * erp; if ( joint->node[1].body ) { for ( int j = 0; j < 3; j++ ) @@ -150,7 +150,7 @@ // position row (the other two row vectors will be derived from this). // `erp1' is the erp value to use along the axis. -void setBall2( dxJoint *joint, dxJoint::Info2 *info, +void setBall2( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dVector3 anchor1, dVector3 anchor2, dVector3 axis, dReal erp1 ) { @@ -190,8 +190,8 @@ } // set right hand side - measure error along (axis,q1,q2) - dReal k1 = info->fps * erp1; - dReal k = info->fps * info->erp; + dReal k1 = fps * erp1; + dReal k = fps * erp; for ( i = 0; i < 3; i++ ) a1[i] += joint->node[0].body->posr.pos[i]; if ( joint->node[1].body ) @@ -218,7 +218,7 @@ // set three orientation rows in the constraint equation, and the // corresponding right hand side. -void setFixedOrientation( dxJoint *joint, dxJoint::Info2 *info, dQuaternion qrel, int start_row ) +void setFixedOrientation( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dQuaternion qrel, int start_row ) { int s = info->rowskip; int start_index = start_row * s; @@ -267,7 +267,7 @@ qerr[3] = -qerr[3]; } dMultiply0_331( e, joint->node[0].body->posr.R, qerr + 1 ); // @@@ bad SIMD padding! - dReal k = info->fps * info->erp; + dReal k = fps * erp; info->c[start_row] = 2 * k * e[0]; info->c[start_row+1] = 2 * k * e[1]; info->c[start_row+2] = 2 * k * e[2]; @@ -573,8 +573,8 @@ int dxJointLimitMotor::addLimot( dxJoint *joint, - dxJoint::Info2 *info, int row, - const dVector3 ax1, int rotational ) + dReal fps, const dxJoint::Info2Descr *info, int row, + const dVector3 ax1, int rotational ) { int srow = row * info->rowskip; @@ -680,7 +680,7 @@ if ( limit ) { - dReal k = info->fps * stop_erp; + dReal k = fps * stop_erp; info->c[row] = -k * limit_err; info->cfm[row] = stop_cfm; Modified: trunk/ode/src/joints/joint.h =================================================================== --- trunk/ode/src/joints/joint.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/joint.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -82,12 +82,8 @@ // info returned by getInfo2 function - struct Info2 + struct Info2Descr { - // integrator parameters: frames per second (1/stepsize), default error - // reduction parameter (0..1). - dReal fps, erp; - // for the first and second body, pointers to two (linear and angular) // n*3 jacobian sub matrices, stored by rows. these matrices will have // been initialized to 0 on entry. if the second body is zero then the @@ -141,7 +137,9 @@ virtual ~dxJoint(); virtual void getInfo1( Info1* info ) = 0; - virtual void getInfo2( Info2* info ) = 0; + + // integrator parameters: fps=frames per second (1/stepsize), erp=default error reduction parameter (0..1). + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ) = 0; // This call quickly!!! estimates maximum value of "m" that could be returned by getInfo1() // See comments at definition of SureMaxInfo for defails. virtual void getSureMaxInfo( SureMaxInfo* info ) = 0; @@ -207,7 +205,7 @@ void set( int num, dReal value ); dReal get( int num ); int testRotationalLimit( dReal angle ); - int addLimot( dxJoint *joint, dxJoint::Info2 *info, int row, + int addLimot( dxJoint *joint, dReal fps, const dxJoint::Info2Descr *info, int row, const dVector3 ax1, int rotational ); }; Modified: trunk/ode/src/joints/joint_internal.h =================================================================== --- trunk/ode/src/joints/joint_internal.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/joint_internal.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -35,9 +35,9 @@ "joint type is not " #t) -void setBall( dxJoint *joint, dxJoint::Info2 *info, +void setBall( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dVector3 anchor1, dVector3 anchor2 ); -void setBall2( dxJoint *joint, dxJoint::Info2 *info, +void setBall2( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dVector3 anchor1, dVector3 anchor2, dVector3 axis, dReal erp1 ); @@ -57,7 +57,7 @@ dReal getHingeAngle( dxBody *body1, dxBody *body2, dVector3 axis, dQuaternion q_initial ); dReal getHingeAngleFromRelativeQuat( dQuaternion qrel, dVector3 axis ); -void setFixedOrientation( dxJoint *joint, dxJoint::Info2 *info, dQuaternion qrel, int start_row ); +void setFixedOrientation( dxJoint *joint, dReal fps, dReal erp, const dxJoint::Info2Descr *info, dQuaternion qrel, int start_row ); #endif Modified: trunk/ode/src/joints/lmotor.cpp =================================================================== --- trunk/ode/src/joints/lmotor.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/lmotor.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -87,7 +87,7 @@ } void -dxJointLMotor::getInfo2( dxJoint::Info2 *info ) +dxJointLMotor::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int row = 0; dVector3 ax[3]; @@ -95,7 +95,7 @@ for ( int i = 0;i < num;i++ ) { - row += limot[i].addLimot( this, info, row, ax[i], 0 ); + row += limot[i].addLimot( this, worldFPS, info, row, ax[i], 0 ); } } Modified: trunk/ode/src/joints/lmotor.h =================================================================== --- trunk/ode/src/joints/lmotor.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/lmotor.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -38,7 +38,7 @@ dxJointLMotor( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; }; Modified: trunk/ode/src/joints/null.cpp =================================================================== --- trunk/ode/src/joints/null.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/null.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -51,7 +51,7 @@ void -dxJointNull::getInfo2( dxJoint::Info2 *info ) +dxJointNull::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { dDebug( 0, "this should never get called" ); } Modified: trunk/ode/src/joints/null.h =================================================================== --- trunk/ode/src/joints/null.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/null.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -34,7 +34,7 @@ dxJointNull( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; }; Modified: trunk/ode/src/joints/piston.cpp =================================================================== --- trunk/ode/src/joints/piston.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/piston.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -219,13 +219,13 @@ void -dxJointPiston::getInfo2 ( dxJoint::Info2 *info ) +dxJointPiston::getInfo2 ( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { const int s0 = 0; const int s1 = info->rowskip; const int s2 = 2 * s1, s3 = 3 * s1 /*, s4=4*s1*/; - const dReal k = info->fps * info->erp; + const dReal k = worldFPS * worldERP; // Pull out pos and R for both bodies. also get the `connection' @@ -406,7 +406,7 @@ int row = 4; if ( node[1].body ) { - row += limotP.addLimot ( this, info, 4, ax1, 0 ); + row += limotP.addLimot ( this, worldFPS, info, 4, ax1, 0 ); } else if (flags & dJOINT_REVERSE ) { @@ -414,12 +414,12 @@ rAx1[0] = -ax1[0]; rAx1[1] = -ax1[1]; rAx1[2] = -ax1[2]; - row += limotP.addLimot ( this, info, 4, rAx1, 0 ); + row += limotP.addLimot ( this, worldFPS, info, 4, rAx1, 0 ); } else - row += limotP.addLimot ( this, info, 4, ax1, 0 ); + row += limotP.addLimot ( this, worldFPS, info, 4, ax1, 0 ); - limotR.addLimot ( this, info, row, ax1, 1 ); + limotR.addLimot ( this, worldFPS, info, row, ax1, 1 ); } void dJointSetPistonAnchor ( dJointID j, dReal x, dReal y, dReal z ) Modified: trunk/ode/src/joints/piston.h =================================================================== --- trunk/ode/src/joints/piston.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/piston.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -94,7 +94,7 @@ dxJointPiston( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/plane2d.cpp =================================================================== --- trunk/ode/src/joints/plane2d.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/plane2d.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -93,12 +93,12 @@ void -dxJointPlane2D::getInfo2( dxJoint::Info2 *info ) +dxJointPlane2D::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int r0 = 0; int r1 = info->rowskip; int r2 = 2 * r1; - dReal eps = info->fps * info->erp; + dReal eps = worldFPS * worldERP; /* v = v1, w = omega1 @@ -140,13 +140,13 @@ // if the slider is powered, or has joint limits, add in the extra row: if ( row_motor_x > 0 ) - motor_x.addLimot( this, info, row_motor_x, Midentity[0], 0 ); + motor_x.addLimot( this, worldFPS, info, row_motor_x, Midentity[0], 0 ); if ( row_motor_y > 0 ) - motor_y.addLimot( this, info, row_motor_y, Midentity[1], 0 ); + motor_y.addLimot( this, worldFPS, info, row_motor_y, Midentity[1], 0 ); if ( row_motor_angle > 0 ) - motor_angle.addLimot( this, info, row_motor_angle, Midentity[2], 1 ); + motor_angle.addLimot( this, worldFPS, info, row_motor_angle, Midentity[2], 1 ); } Modified: trunk/ode/src/joints/plane2d.h =================================================================== --- trunk/ode/src/joints/plane2d.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/plane2d.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -41,7 +41,7 @@ dxJointPlane2D( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; }; Modified: trunk/ode/src/joints/pr.cpp =================================================================== --- trunk/ode/src/joints/pr.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/pr.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -225,14 +225,14 @@ void -dxJointPR::getInfo2( dxJoint::Info2 *info ) +dxJointPR::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int s = info->rowskip; int s2 = 2 * s; int s3 = 3 * s; //int s4= 4*s; - dReal k = info->fps * info->erp; + dReal k = worldFPS * worldERP; dVector3 q; // plane space of axP and after that axR @@ -430,7 +430,7 @@ int row = 4; if ( node[1].body || !(flags & dJOINT_REVERSE) ) { - row += limotP.addLimot ( this, info, 4, axP, 0 ); + row += limotP.addLimot ( this, worldFPS, info, 4, axP, 0 ); } else { @@ -438,10 +438,10 @@ rAxP[0] = -axP[0]; rAxP[1] = -axP[1]; rAxP[2] = -axP[2]; - row += limotP.addLimot ( this, info, 4, rAxP, 0 ); + row += limotP.addLimot ( this, worldFPS, info, 4, rAxP, 0 ); } - limotR.addLimot ( this, info, row, ax1, 1 ); + limotR.addLimot ( this, worldFPS, info, row, ax1, 1 ); } Modified: trunk/ode/src/joints/pr.h =================================================================== --- trunk/ode/src/joints/pr.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/pr.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -84,7 +84,7 @@ dxJointPR( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/pu.cpp =================================================================== --- trunk/ode/src/joints/pu.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/pu.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -261,13 +261,13 @@ void -dxJointPU::getInfo2( dxJoint::Info2 *info ) +dxJointPU::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { const int s0 = 0; const int s1 = info->rowskip; const int s2 = 2 * s1; - const dReal k = info->fps * info->erp; + const dReal k = worldFPS * worldERP; // pull out pos and R for both bodies. also get the `connection' // vector pos2-pos1. @@ -434,17 +434,17 @@ info->c[1] = k * dCalcVectorDot3( ax1, err ); info->c[2] = k * dCalcVectorDot3( q, err ); - int row = 3 + limot1.addLimot( this, info, 3, ax1, 1 ); - row += limot2.addLimot( this, info, row, ax2, 1 ); + int row = 3 + limot1.addLimot( this, worldFPS, info, 3, ax1, 1 ); + row += limot2.addLimot( this, worldFPS, info, row, ax2, 1 ); if ( node[1].body || !(flags & dJOINT_REVERSE) ) - limotP.addLimot( this, info, row, axP, 0 ); + limotP.addLimot( this, worldFPS, info, row, axP, 0 ); else { axP[0] = -axP[0]; axP[1] = -axP[1]; axP[2] = -axP[2]; - limotP.addLimot ( this, info, row, axP, 0 ); + limotP.addLimot ( this, worldFPS, info, row, axP, 0 ); } } Modified: trunk/ode/src/joints/pu.h =================================================================== --- trunk/ode/src/joints/pu.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/pu.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -72,7 +72,7 @@ dxJointPU( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/slider.cpp =================================================================== --- trunk/ode/src/joints/slider.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/slider.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -147,7 +147,7 @@ void -dxJointSlider::getInfo2 ( dxJoint::Info2 *info ) +dxJointSlider::getInfo2 ( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { int i, s = info->rowskip; int s3 = 3 * s, s4 = 4 * s; @@ -173,7 +173,7 @@ } // 3 rows to make body rotations equal - setFixedOrientation ( this, info, qrel, 0 ); + setFixedOrientation ( this, worldFPS, worldERP, info, qrel, 0 ); // remaining two rows. we want: vel2 = vel1 + w1 x c ... but this would // result in three equations, so we project along the planespace vectors @@ -203,7 +203,7 @@ // compute last two elements of right hand side. we want to align the offset // point (in body 2's frame) with the center of body 1. - dReal k = info->fps * info->erp; + dReal k = worldFPS * worldERP; if ( node[1].body ) { dVector3 ofs; // offset point in global coordinates @@ -224,7 +224,7 @@ } // if the slider is powered, or has joint limits, add in the extra row - limot.addLimot ( this, info, 5, ax1, 0 ); + limot.addLimot ( this, worldFPS, info, 5, ax1, 0 ); } Modified: trunk/ode/src/joints/slider.h =================================================================== --- trunk/ode/src/joints/slider.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/slider.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -40,7 +40,7 @@ dxJointSlider ( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1 ( Info1* info ); - virtual void getInfo2 ( Info2* info ); + virtual void getInfo2 ( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/joints/universal.cpp =================================================================== --- trunk/ode/src/joints/universal.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/universal.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -294,10 +294,10 @@ void -dxJointUniversal::getInfo2( dxJoint::Info2 *info ) +dxJointUniversal::getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr *info ) { // set the three ball-and-socket rows - setBall( this, info, anchor1, anchor2 ); + setBall( this, worldFPS, worldERP, info, anchor1, anchor2 ); // set the universal joint row. the angular velocity about an axis // perpendicular to both joint axes should be equal. thus the constraint @@ -352,13 +352,13 @@ // theta - Pi/2 ~= cos(theta), so // |angular_velocity| ~= (erp*fps) * (ax1 dot ax2) - info->c[3] = info->fps * info->erp * - k; + info->c[3] = worldFPS * worldERP * - k; // if the first angle is powered, or has joint limits, add in the stuff - int row = 4 + limot1.addLimot( this, info, 4, ax1, 1 ); + int row = 4 + limot1.addLimot( this, worldFPS, info, 4, ax1, 1 ); // if the second angle is powered, or has joint limits, add in more stuff - limot2.addLimot( this, info, row, ax2, 1 ); + limot2.addLimot( this, worldFPS, info, row, ax2, 1 ); } Modified: trunk/ode/src/joints/universal.h =================================================================== --- trunk/ode/src/joints/universal.h 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/joints/universal.h 2012-12-18 22:34:05 UTC (rev 1916) @@ -49,7 +49,7 @@ dxJointUniversal( dxWorld *w ); virtual void getSureMaxInfo( SureMaxInfo* info ); virtual void getInfo1( Info1* info ); - virtual void getInfo2( Info2* info ); + virtual void getInfo2( dReal worldFPS, dReal worldERP, const Info2Descr* info ); virtual dJointType type() const; virtual size_t size() const; Modified: trunk/ode/src/quickstep.cpp =================================================================== --- trunk/ode/src/quickstep.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/quickstep.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -933,10 +933,8 @@ // (lll) = linear jacobian data // (aaa) = angular jacobian data // - dxJoint::Info2 Jinfo; + dxJoint::Info2Descr Jinfo; Jinfo.rowskip = 12; - Jinfo.fps = stepsizeRecip; - Jinfo.erp = world->global_erp; dReal *Jcopyrow = Jcopy; unsigned ofsi = 0; @@ -955,7 +953,7 @@ Jinfo.findex = findex + ofsi; dxJoint *joint = jicurr->joint; - joint->getInfo2 (&Jinfo); + joint->getInfo2 (stepsizeRecip, world->global_erp, &Jinfo); const unsigned int infom = jicurr->info.m; Modified: trunk/ode/src/step.cpp =================================================================== --- trunk/ode/src/step.cpp 2012-12-16 09:55:39 UTC (rev 1915) +++ trunk/ode/src/step.cpp 2012-12-18 22:34:05 UTC (rev 1916) @@ -669,10 +669,8 @@ // (aaa) = angular jacobian data // - dxJoint::Info2 Jinfo; + dxJoint::Info2Descr Jinfo; Jinfo.rowskip = 8; - Jinfo.fps = stepsizeRecip; - Jinfo.erp = world->global_erp; unsigned ofsi = 0; const dJointWithInfo1 *jicurr = jointinfos; @@ -692,7 +690,7 @@ Jinfo.findex = findex + ofsi; dxJoint *joint = jicurr->joint; - joint->getInfo2 (&Jinfo); + joint->getInfo2 (stepsizeRecip, world->global_erp, &Jinfo); // adjust returned findex values for global index numbering int *findex_ofsi = findex + ofsi; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |