Share this post

Link to post

Share on other sites

instead of allowing your car to move in the direction it's facing, you can take in account that it still has momentum going in the direction it used to be facing? Ie just because you turn the wheel doesn't mean you're going to go in that direction.

Your car has an angle that it is facing, and an angle that it is moving. So gradually alter the cars moving angle to match the facing angle. Hopefully that makes sense... I'm currently in the middle of a dumb aurgument and yes as I write this they are getting even angrier and my smile is getting bigger... so I'm having a hard time concentrating.

0

Share this post

Link to post

Share on other sites

instead of allowing your car to move in the direction it's facing, you can take in account that it still has momentum going in the direction it used to be facing? Ie just because you turn the wheel doesn't mean you're going to go in that direction.

That sounds like spaceship physics rather than car physics. Cars DO go in the direction they face unless you turn so fast the momentum is enough to lose friction. Once that happens the above method should be fine enough. But mostly it boils down to switching between the two types of friction.

0

Share this post

Link to post

Share on other sites

That sounds like spaceship physics rather than car physics. Cars DO go in the direction they face unless you turn so fast the momentum is enough to lose friction. Once that happens the above method should be fine enough. But mostly it boils down to switching between the two types of friction.

"Spaceship physics" is still what's required to make it act like a real car. Cars go in the direction they're facing because there is friction constantly pushing back against 'slide' movements. So if you create a slippery 'spaceship' and then add tire friction, you've got a car.
e.g. quick idea of basic physics, this time starting with force, not velocitycar.force = (0,0)

car.acceleration = car.force / car.mass
car.velocity += car.acceleration * deltaTime
car.position += car.velocity * deltaTimeThat said, the friction behaviour of rubber tires is quite complex, and the above model will require a lot of tweaking to get something 'fun'... Just cheating by switching between two 'modes', like Trienco suggested, may be a lot easier to achieve a result with More complex car games simply use magic.