LOS in leaf based trees is very simillar. you send the line down the bsp tree the same as you would the node tree (using the planes stored in the bsp node), then when it reaches a leaf, check if the two points against all the polygons in the leaf. both of them are either in front or behind all the polygons, no intersection has occured at that point. if one is in front and the other behind, then you have an intersection. find the plane that actually seperates the two points, and find where the line intersects the plane. you can then see if that point is inside the polygon (i dont think you need this step if its a convex hull, but im not the best at non-solid leaf bsp trees)
BSP collision detection in DX9
One thing I am a little confused about, BSP is not a file format, it stands for "Binary Space Partitioning" It is a method.
Is there a BSP file format aside from BSP?
Are they 2 different things?
Is there a BSP file format aside from BSP?
Are they 2 different things?
quote:Original post by madman_k
i was wondering if anyone knew of a good place to get some information on this, if possible, specifically on BSP tree collisions with the camera.
Using a line of site algo, you can clearly test where the camera will hit.
I would recommend if you start this whole camera hitting a wall thing you just work on your entire collision detection system. I have some really good source for Dx9 I might be able to share. It uses sphere-triangle (actually cylinder-triangle so you can have object move great distances at a time and still pick up on it if it was inbetween frames - such as a bullet) collision. So your camera is a sphere and check it against the triangles in the world. The problem with line of sight is, you can run through a wall by reversing into it. This way you can''t go into any wall or object for that matter.
There is many forms to use with collision decection.
Box-Sphere
Sphere-Box
Cylinder-Trianlge
I find Sphere-Sphere Sphere-Triangle to be where it is at
Although, I don''t deal with vehicles yet. Which some sort of Box-Box method might produce more desirable results.
There is many forms to use with collision decection.
Box-Sphere
Sphere-Box
Cylinder-Trianlge
I find Sphere-Sphere Sphere-Triangle to be where it is at
Although, I don''t deal with vehicles yet. Which some sort of Box-Box method might produce more desirable results.
Madman, did you implement an working collision detection? I think I sent you an email with some source code, were you able to implement it? I had some problems getting it work :/
I use D3DXIntersect to see where my camera ray intersects with the terrain, works great, tells you the exact place of intersection, then you can move the camera in a bit and you are all set
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement