Skip to main content
gamedev.net
🔒 Locked

Vector / Triangle Collisions

Started by KenMasters47 0 replies 350+ views
Original Post
KenMasters47
KenMasters47
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.
v71
v71
Your implementation looks good, though i use ellipsoid, for the last step, once i''ve read a document about using an octree for a further test ,much like the visibility test for an octree, but i suppose this is usefull for static model , and when i say static i mean no animated models, or at least object cast from a single mesh.
byez and sorry for my english

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.