Jump to content
  • Advertisement
Sign in to follow this  
RobMaddison

Physics engine or DIY?

This topic is 2129 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

I'm working on a racing game with realistic racing car physics that's all custom written, however I still use off the shelf physics engines for everything except for the tyres/sprints/aerodynamics wink.png The rigid body simulation and collision detection frameworks from existing engines are still extremely handy, meaning I just have to add some extra forces into the sim and it all works out of the box.

 

Do you mind if I briefly hijack this thread to ask what sort of collision resolution methods work well for racing games? Particularly given you need incredibly smooth movement over terrain...

Share this post


Link to post
Share on other sites
Advertisement


Do you mind if I briefly hijack this thread to ask what sort of collision resolution methods work well for racing games? Particularly given you need incredibly smooth movement over terrain...

 

I don't know about Hodgman's approach, but the most widely used and easiest to implement seems to be the raycasting model. Shoot a ray from the wheel hub downwards to find the contact point, compute forces based on the suspension spring/dampening, steering, wheel rpm, slip angle, tire model, etc. you can get as crazy as you like. 

Share this post


Link to post
Share on other sites

Sorry I forgot to reply, but yeah, what Madhed said ^^^ biggrin.png

 

I use a trimesh for the race track, even though curves would be ideal, just because the art packages and the physics middleware support them. In areas where the slope of the track changes, if you use a decent number of polygons then it feels smooth.

 

The body of the car itself is a regular rigid body as supported by the physics middleware. The results of the raycasting are used to do all the wheel/tyre/suspension/transmission/engine/etc calculations, which then apply forces to the body. Soft tyres and suspension will absorb the small bumps from the trimesh, just like in real life wink.png If your tri-mesh is too bumpy though, it also affects the handling/traction of the car though, also just like real life.

Edited by Hodgman

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!