Offroad Racing (C++, SDL, OpenGL)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,487
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 13, 2011

My bachelor project at Czech Technical University from year 2006. It's a simple linux game written in C++ (using SDL library) based on my own physics engine (spring systems and rigid body dynamic simulation) and large terrain rendering (heightmap has 2550x2550 pixels) imported from OpenTTD game. Collision detection is ensured by space grid subdivision and bounding sphere hierarchies. Collision response uses penalty force method. Tyre simulation is based on simplified Pacejka's method. Physics engine calculates transfer of forces from vehicle engine through clutch and gearbox to wheels. Renderer uses OpenGL and GLSL shaders. More details and download at my web pages: http://milantimko.info .

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (mtimko83)

  • How did you do terrain collisions? I mean that car drives uphill

  • @Tasaq313

    Collisions are done by penalty force method. Engine calculates how deep is wheel (or other car part) under the terrain and then applies appropriate force to push it up.

  • @mtimko83 hmmm, but how do you check that part is under terain? I am taking my terain from 3ds max, so i don't use heightmap... also i like your idea to cover a car with multiple colispheres :)

  • @Tasaq313 I think the simplest way is to implement triangle-point collision detection algorithm and test every point of vehicle geometry with every triangle of terrain mesh. This approach is of course very slow so you'll need some optimizations like bspheres or other simplified collision geometry to represent car model. Also subdividing terrain into smaller areas to limit number of triangles per one collision test is a good idea (using regular terrain grid, I can limit it to one).

  • Do you use SAT for collision or just spheres?

  • @staticVoid2

    Just spheres. But I'll definitely use convex components (and SAT) next time, it's much more handy for cars.

see all

All Comments (13)

Sign In or Sign Up now to post a comment!
  • this is awesome, i love the bus

  • really cool engine! love the physics keep it up!

  • @mtimko83 Thanks, I alread am trying to do that, but I have problems with geting triangles from my loader, I think it will take my some time to figure that out:)

  • lol you reused the same project..

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more