[ODE] Lo/Hi Stops for ball-sockets?

Mattias Fagerlund mattias at cambrianlabs.com
Sun Nov 17 03:44:01 2002


 
> It would help to see an example or something that uses the AMotorJoint
> (prefably with limits and everything) - can anybody point me to some
> simple
> program that makes use of it? None of the examples seem to make use of
> it (I'm using the DelphiODE).

I was going to say "I have some examples, but they're built using 
delphi", but now that's not a problem;

  // Create a AMotor
  AMotor := dJointCreateAMotor(world, 0);
  dJointAttach(AMotor, MainBody, UpperLeg);

  BallLimit := pi*0.15;
  dJointSetAMotorNumAxes (AMotor,2);
  dJointSetAMotorAxis (AMotor, 0, 1, 1,0,0);
  dJointSetAMotorAxis (AMotor, 1, 1, 0,0,1); // AUTO AXIS BY EULER MOTOR
  dJointSetAMotorAxis (AMotor, 2, 2, 0,1,0);

  dJointSetAMotorParam (AMotor, dParamLoStop, -BallLimit);
  dJointSetAMotorParam (AMotor, dParamHiStop, BallLimit);
  dJointSetAMotorParam (AMotor, dParamFudgeFactor, 0.01);//}

  // This axis of the motor isn't used with EULER (?)
  dJointSetAMotorParam (AMotor, dParamLoStop2, -0.01);
  dJointSetAMotorParam (AMotor, dParamHiStop2, 0.01);
  dJointSetAMotorParam (AMotor, dParamFudgeFactor2, 0.01);//}

  dJointSetAMotorParam (AMotor, dParamLoStop3, -BallLimit);
  dJointSetAMotorParam (AMotor, dParamHiStop3, BallLimit);
  dJointSetAMotorParam (AMotor, dParamFudgeFactor3, 0.01);//}

  dJointSetAMotorMode (AMotor, dAMotorEuler);

cheers,
m