[ODE] Bug in slider joint, sliderGetInfo2()?

David Black dblack at fastmail.fm
Fri May 13 17:22:54 MST 2005


Hi,

I was browsing joint.cpp and I think I noticed a small problem with 
sliderGetInfo2(), ie in

  // remaining two rows. we want: vel2 = vel1 + w1 x c ... but this would
  // result in three equations, so we project along the planespace vectors
  // so that sliding along the slider axis is disregarded. for symmetry we
  // also substitute (w1+w2)/2 for w1, as w1 is supposed to equal w2.

  [SNIP]

    dCROSS (tmp, = REAL(0.5) * ,c,p);
    for (i=0; i<3; i++) info->J2a[s3+i] = tmp[i];
    for (i=0; i<3; i++) info->J2a[s3+i] = tmp[i];
    dCROSS (tmp, = REAL(0.5) * ,c,q);
    for (i=0; i<3; i++) info->J2a[s4+i] = tmp[i];
    for (i=0; i<3; i++) info->J2a[s4+i] = tmp[i];
    for (i=0; i<3; i++) info->J2l[s3+i] = -p[i];
    for (i=0; i<3; i++) info->J2l[s4+i] = -q[i];
  }

Shouldnt:
    dCROSS (tmp, = REAL(0.5) * ,c,p);
    for (i=0; i<3; i++) info->J2a[s3+i] = tmp[i];
    for (i=0; i<3; i++) info->J2a[s3+i] = tmp[i];
    dCROSS (tmp, = REAL(0.5) * ,c,q);
    for (i=0; i<3; i++) info->J2a[s4+i] = tmp[i];
    for (i=0; i<3; i++) info->J2a[s4+i] = tmp[i];

be (if the comment is to be believed and we are "substitute (w1+w2)/2 
for w1")
   
    dCROSS (tmp, = REAL(0.5) * ,c,p);
    for (i=0; i<3; i++) info->J1a[s3+i] = tmp[i];/*<<<<<<<<<<<<*/
    for (i=0; i<3; i++) info->J2a[s3+i] = tmp[i];
    dCROSS (tmp, = REAL(0.5) * ,c,q);
    for (i=0; i<3; i++) info->J1a[s4+i] = tmp[i];/*<<<<<<<<<<<<*/
    for (i=0; i<3; i++) info->J2a[s4+i] = tmp[i];

Hope this helps someone with there slider2 joints a little... Or am I 
misunderstanding this bit?

David



More information about the ODE mailing list