Skip to main content
GameDev.net gamedev.net
🔒 Locked

Why?

Started by PsycoBlade Jul 28, 2001 at 4:01 PM 0 replies 350+ views
Original Post
PsycoBlade
PsycoBlade
the function PRBSP_CollisionCheck (BSPEntity, &start, &end, PlayerBBox, 20) is really useful, obviously. What I want to know is what is it with BSPs that make it so easy to do collision? Why can''t there be a PR_PROCollisionCheck (PROEntity, &start, &end, PlayerBBox, 20)? I''m just curious, I don''t know much about the inner workings of this stuff and I''m very interested. Thanks. -Rich
ChrisE
ChrisE
The simple answer is that BSP''s subdivide space, making it fast to check collision. You only have to check collision with a few shapes rather than the entire level.

A regular PRO file has no such organization. It''s just a big list of triangles. It would be possible to check against every triangle in the list but it wouldn''t be fast enough for a game.

The BSP collision actually checks against the convex brushes that you create in the editor. These are shapes defined by planes similar to the polytope routines I have in PR, and aren''t the actual polygons drawn on the screen.

To get technical about it, the brush/polytope method stores sides of the convex shapes using the plane equation (Ax+By+Cz=d) and uses dot products to find the distance from the plane. This different representation is much faster to find collisions than using a ray/triangle intersection test.

Author of Power Render (http:/www.powerrender.com)

Topic Locked

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

Sign in to reply to this topic.