[ODE] Car Simulation(Lots of problems)

Pawel S unixbird at yahoo.se
Fri Aug 6 11:00:24 MST 2004


Hi
Set this at start of your program:

// front left
dJointSetHinge2Param( JointFL, dParamFMax, 100.0 ); // max torque on the
steering axis
dJointSetHinge2Param( JointFL, dParamLoStop, -0.785 ); // limit angle
dJointSetHinge2Param( JointFL, dParamHiStop, 0.785 ); // limit angle
// front right
dJointSetHinge2Param( JointFR, dParamFMax, 100.0 );
dJointSetHinge2Param( JointFR, dParamLoStop, -0.785 );
dJointSetHinge2Param( JointFR, dParamHiStop, 0.785 );

use this in every step:
// front left
dJointSetHinge2Param( JointFL, dParamVel, 10.0 * (
-MyVehicle.fSteeringWheel*45.0*DEG2RAD - dJointGetHinge2Angle1( JointFL )
) );
// front right
dJointSetHinge2Param( JointFR, dParamVel, 10.0 * (
-MyVehicle.fSteeringWheel*45.0*DEG2RAD - dJointGetHinge2Angle1( JointFR )
) );

10.0 is desired velocity
45.0 is max angle of the front wheels
MyVehicle.fSteeringWheel is the current angle of the steering wheel.

Pawel


Höstrusk och grå moln - köp en resa till solen på Yahoo! Resor på adressen http://se.docs.yahoo.com/travel/index.html


More information about the ODE mailing list