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).
@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:)
Well, it took me more than 2 years to finish it, but I used it as a final coursework on many occasions at university (including bachelor thesis) so I think it was worth it.
this is awesome, i love the bus
s5zone 1 week ago
really cool engine! love the physics keep it up!
kindofgameplay 1 month ago
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 1 month 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 1 month 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 1 month ago
@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:)
Tasaq313 1 month 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 2 months ago
lol you reused the same project..
JustJealouse514 3 months ago
great game
how many days does it took make this game
sharan01s 3 months ago
@sharan01s
Thanks!
Well, it took me more than 2 years to finish it, but I used it as a final coursework on many occasions at university (including bachelor thesis) so I think it was worth it.
mtimko83 3 months ago