Original Post
I''m writing my collision detection routines at the moment and wanted some feedback on how i am doing it.
Firstly i calculate a bounding box around every model in the scene. My first collision detection then checks the players new position against every bounding box.
If a bounding box collision occurs i am going to use a ray tracing routine using the players last position and potential new position to check against every triangle in the box collision model. If there are no intersections (the player has walked through a door way in a house etc) then the player is moved else he isn''t.
I also intend to use the same ray tracing algorithm to check for floor collisions but in this case i will allow some flexibilty. Ie if a collision occurs with the floor but the collision is only a small amount below the surface of the floor then the player will be moved upward slightly to the floor level. This will allow players to walk up hills and stairs.
Does the above sound reasonable? My only worry is that checking every model''s polygons when the player enters the bounding box may kill performance. Any thoughts on this would be much appreciated. Cheers.