[ODE] Angular Motor, Anchor Axis?
Steffen Wischmann
steffen.wischmann at ais.fraunhofer.de
Wed Mar 5 10:20:02 2003
Below is my example Code,
I have a CappedCylinder on the top of a box with a HingeJoint.
I added a Angular Motor, and I want the CappedCylinder to be moved
forward/backward.
void dJointSetAMotorAxis (dJointID, int anum, int rel,
dReal x, dReal y, dReal z);
Always the box is rotating around the CappedCylinder (int rel=1 or rel=2
doesn't change anything)
What do I wrong?
Here is my Code:
...
joints.trunk2hip = dJointCreateHinge(*world, 0);
dJointAttach(joints.trunk2hip, trunk.body, hip.body);
dJointSetHingeAxis(joints.trunk2hip, 0, 1, 0);
dJointSetHingeParam(joints.trunk2hip, dParamHiStop, PI/4);
dJointSetHingeParam(joints.trunk2hip, dParamLoStop, -PI/4);
dJointSetHingeAnchor(joints.trunk2hip, x, y, z+TRUNK_RADIUS);
motor = dJointCreateAMotor(*world, 0);
dJointAttach(motor, hip.body, trunk.body);
dJointSetAMotorNumAxes(motor, 1);
dJointSetAMotorAxis (motor, 0, 2,
0, 1, 0);
dJointSetAMotorParam(motor, dParamVel, 0.6);
dJointSetAMotorParam(motor, dParamFMax, 5);
...
Thanx for help.