Page 1 of 1

3D collision question

Posted: Fri Aug 31, 2012 9:32 pm
by like80ninjas
Sup Bros, I'm interested on your opinions on my situation.

I'm making a 3D platformer in the same vein of the N64 greats. All of the art assets are low poly to achieve the
style of the N64 games ( banjo, mario, conker etc )

I'm using a .obj model as my map, they aren't very high poly, but I want the player to collide with them on a triangle bases ( I think ). What would be the best way to do so? or the most common? I'm going to use a bounding object for the characters, either a sphere or an OBB/ABB, so I'd like to know if you guys would suggest just testing the bounding object against the triangle mesh? some other method? or just get a physics library and call it a day?

Re: 3D collision question

Posted: Sat Sep 01, 2012 1:33 pm
by superLED
1: Make the world mesh
2: Place cubes/spheres over collidable objects and give it's material's name "collide_cube"/"collide_sphere".
3: When loading in the .obj, if the material is "collide_cube", store it in a std::vector (or what you chose to keep em stored). (Don't put it in the rendering part of the .obj object.)
4: Check if the player is colliding with the world's collide_cubes/collide_spheres.

Now you don't have to check for every triangle or whatever, which would take a long, long time to process.