[ODE] initializing Hinge joint with a given angle that is not zero by default

Sean S Cullen Sean at blackscreen.org
Thu Apr 22 07:04:44 MST 2004


The simple solution is:

1.  Rotate by 90 degrees to put object at 0 degree ref
2.  Set the joint
3.  Rotate the object back by 90 degrees.

> Hello,
>
> I have a little problem with initializing a Hinge Anchor.
>
> When I create a hinge joint between two objects, the initial angle is
> considered as reference (by default, angle = 0). Does anyone
> know how to set this initial angle to a different value *without*
> moving anything? (I would like the initial position of the hinge
> to be considered as -PI/2 or PI/2 angle - is there a way to do this
> without hacking into ODE  code?).
>
> Thanks!
>
> -nicolas
>
>
> ps: here is a piece of code, if it can be of any help...
>
> --- begin code
>
> 	anchorJoint[0] = dJointCreateHinge (world,0);
> 	dJointAttach (anchorJoint[0],wallbrick[0],wallbrick[1]);   // attach
> two neighboring cubes. dJointSetHingeAnchor
> (anchorJoint[0],x0+BOXSIZE/2,y0,z0+BOXSIZE/2); // connected at the
> middle of the two upper facing edges dJointSetHingeAxis
> (anchorJoint[0],0,1,0);
>  	(...)
> 	dJointSetHingeParam (anchorJoint[0],dParamLoStop,-M_PI/2);	// what I
> would like to have : initially, the hinge angle *is* -M_PI/2
> dJointSetHingeParam (anchorJoint[0],dParamHiStop,M_PI/2);
> 	dJointSetHingeParam (anchorJoint[0],dParamBounce,0);
> 	dJointSetHingeParam (anchorJoint[0],dParamFMax,10);
> 	dJointSetHingeParam (anchorJoint[0],dParamFudgeFactor,0);
>     	dJointSetHingeParam (anchorJoint[0],dParamVel,freeParam);  //
> freeParam is user-controlled ( ~[-1,+1] )
>
> --- end code
> ------------------------------------------
>
>
> ps2: I *may* have sent this message twice - if this is the case, sorry
> for the inconvenience :-/
>
> ------------------------------------------
>
> Faites un voeu et puis Voila ! www.voila.fr
>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode





More information about the ODE mailing list