0
\$\begingroup\$

I wrote a BSP tree generation that takes a level mesh (basically a few thousand triangles), and creates a BSP tree. The generation seems to work, but when I traverse the tree, some splitting planes are placed such that I cannot collide with certain faces unless I'm literally inside those faces.

This means that there are some faces which are effectively collision-proof. How should I properly structure my tree generation/traversal for collisions? For reference, I have a position and I would like to get all leaf nodes I could possibly collide with.

Some images below show my problem more clearly, red faces are the ones currently in my players partition.

enter image description here

Rightmost wall is the one I am attempting to collide with. It is not colored red, so it is not being detected for collision, and I can go straight through.

enter image description here

It's a small bit difficult to see, but when I'm inside the face it does color red, so when I am in the face (or extremely close) it does register me in the face's partition.

enter image description here

Viewed from above (same partition as above image, from a spectating camera) to show the faces highlighted. Excuse the small bit of Z-fighting.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Can you edit to include more detail about how you're using the BSP for collisions? My experience with BSPs is that for any given point & heading, they quickly tell you what's in front what's behind & in what order. That pretty directly lends itself to ray collisions, but from your description it sounds more like you're using volume collisions. That can still work, but you might need to guide us through your calculations. \$\endgroup\$ Commented Mar 14 at 16:14
  • \$\begingroup\$ @Pikalek I'm basically just using the BSP to cull faces, to speed up collisions. I then do a Moller Trumbore raycast on each of those faces, and if the distance of the ray upon collision is less than some threshold I disallow movement. \$\endgroup\$ Commented Mar 15 at 23:57

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.