0
\$\begingroup\$

i'm building a car game, and currently working on the steering.

i would like to change the motion of Z rotation so that the car rotates around the Z axis when the wheels are turned. I can't set the rotational motion to equal the steering angle as the car should be able to spin out of control in the game.

This works until the car has an external rotational force put onto it:

Car_Z_rotation_Motion = Car_Steering_Angle; 

i was going along the lines of this:

Car_Z_rotation_Motion = Car_Z_rotation_Motion + Car_Steering_Angle;

but this obviously, this causes the turning circle to increase as over time.

What is the best way to control the cars Z rotation with the car steering angle given the possibility of the car spinning out due to external forces that set the Car_Z_rotation_Motion.

sorry if this doesn't make much sense...

\$\endgroup\$
  • \$\begingroup\$ Is it correct to say that you rotate the car not physically correct while rotating around a fixed point? \$\endgroup\$ – Sebastian Barth Jan 28 '15 at 12:46
  • \$\begingroup\$ the rotation of the car is determined by 'Car_RotationZ += Car_Z_rotation_Motion' and Car_RotationZ rotates around the center of the car, is this correct? \$\endgroup\$ – Frank_Vr Jan 28 '15 at 13:15
  • \$\begingroup\$ So this is not physically correct as long you're not driving a car with only one wheel in the center of it. But for a simple game its certainly enough. :) \$\endgroup\$ – Sebastian Barth Jan 28 '15 at 13:18
  • 2
    \$\begingroup\$ For a more accurate movement read this. \$\endgroup\$ – Sebastian Barth Jan 28 '15 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.