Offroad Racing (C++, SDL, OpenGL)
Loading...
1,487
Loading...
Uploader Comments (mtimko83)
see all
All Comments (13)
-
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...
How did you do terrain collisions? I mean that car drives uphill
Tasaq313 2 months ago
@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 2 months ago
@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 2 months ago
@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).
mtimko83 2 months ago
Do you use SAT for collision or just spheres?
staticVoid2 3 months ago
@staticVoid2
Just spheres. But I'll definitely use convex components (and SAT) next time, it's much more handy for cars.
mtimko83 3 months ago