[ODE] how to stopbody enabling by joint

Krystian Ligenza kxxl at poczta.onet.pl
Tue Oct 23 12:33:44 MST 2007

Hi again,

I have corrected that pull down of platform. It was problem with fixed 
joint and dJointSetFixed(...), becouse after I change position of 
platform small error was produced in fixed joint that hold my platform, 
and it tried to correct position of platform body, but when I call 
dJointSetFixed, that error was commited as correct position. Can I 
propose adding method to set fixed values from outside? I have written 
method that solved my problem:
void dJointSetFixedBodies (dJointID j,const dVector3 p1,const 
dQuaternion q1,const dVector3 p2,const dQuaternion q2)
  dxJointFixed* joint = (dxJointFixed*)j;
  dUASSERT(joint,"bad joint argument");
  dUASSERT(joint->vtable == &__dfixed_vtable,"joint is not fixed");
  int i;
  if (joint->node[0].body) {
    if (joint->node[1].body) {
      dQMultiply1 (joint->qrel,q1,q2);
      dReal ofs[4];
      for (i=0; i<4; i++) ofs[i] = p1[i];
      for (i=0; i<4; i++) ofs[i] -= p2[i];
      dMULTIPLY1_331 (joint->offset,q1,ofs);
    else {
      // set joint->qrel to the transpose of the first body's q
      joint->qrel[0] = q1[0];
      for (i=1; i<4; i++) joint->qrel[i] = -q1[i];
      for (i=0; i<4; i++) joint->offset[i] = p1[i];
it is same as dJointSetFixed(...) but takes values from user. What you 
think about it?

BTW. still haven't solve error in collision with platform that sticks 
rope inside of box, any help?


Krystian Ligenza pisze:
> here is how fixed joint behave:
> http://www.kxl.com.pl/ODE/KxL_Rope_platform_jointFixed.avi
> everything would be ok, except this pull down (I rotate, platform goes 
> down. I move side, same thing). Any idea to make it correct

More information about the ODE mailing list