• Advertisement
Sign in to follow this  

How To Write A Torque For Vehicles Like Bikes And Cars.

This topic is 624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi.

I need a realistic behavior for my vehicles in game. realistic change of speed velocity and accellerarion turning and rotation of wheels and... 

 

and some options like not to be able to move to high slopes and ....

 

as I searched for a while you have to write a torque and simulates behavior of movement of a car but I couldn't find so much. please give me information to how to make such code that simulates these things.

 

thank you for helping

Share this post


Link to post
Share on other sites
Advertisement
I need a realistic behavior for my vehicles in game. realistic change of speed velocity and accellerarion turning and rotation of wheels

 

In practice this type of thing is notoriously tricky to set up well.  It can be done, but it means everything in your world needs to be given values that match real-world physics values, and the physics systems need to be quite comprehensive.

 

When implementing them there are all kinds of quirky behaviors such as cars rolling along and suddenly crashing when hitting a pebble, or the physics system exploding on bad constraints -- if you have objects that deform it can cause a literal explosion when physics numbers fail. 

 

If you are using a real physics system such as PhysX, you'll need to look up real-world physics values for everything involved, including things like deformation of the wheels and rolling resistance of the type of tires used, the accurate masses of vehicles and the distribution of that mass, the accurate torques the vehicle's engine and drivetrain is able to produce, the friction values of various types of pavement, and much more.  You'll also need real values for the world around it, including things like proper friction values for your vehicle sliding along a guardrail. 

 

Very few games use such pure physics for vehicles. Instead most will build a custom locomotor that moves through the world and does custom collision response when there are impacts with the world.

 

 

 

please give me information to how to make such code that simulates these things.

I'll point you to physics engines like PhysX, Bullet, or ODE.  

 

Designing the systems requires an extensive background in physics and mathematics. Physics engine companies usually hire people with PhDs in physics and mathematics.  Making physics simulations that follow real-world math is not simple.

Share this post


Link to post
Share on other sites

Both Bullet and ODE actually has a torque system in place already that works very well for vehicles. Don't know about Physx because I never used it. The torque of a vehicle is nothing special to calculate as you're only concerned with all the external forces acting on the wheel. You don't need anything internal. That is unless you're trying to build some sort of build a car simulator... then you'll need to write your own physics add on. And good luck with that.

Edited by Tangletail

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement