Rating : ⭐⭐⭐⭐⭐
Price : \$10.99
Language:EN
Pages: 2

# Ray test determined that the ray spans the node

In Figure 16.75 we show two positions that exist in empty space labeled J and K. Position J is located in leaf 1, where the wall polygon pA could be viewed. Position K is also in empty space (leaf 3) and from this position the wall polygon pC can be viewed. However, position J cannot see position K because the wall polygons are in the way.

Usually, to determine if

As shown in Figure 16.80, the ray is sent in at the root node. A ray/plane test determined that the ray spans the node, so the intersection point with the plane is calculated. That ray is then split such that this intersection point becomes the end point for the child in one halfspace and the start point of the child in the other. In this example, the front split of the ray is sent down the front of node A where it arrives in Leaf 1, which is empty space. This is the section of the ray shown in Figure 16.80 between point J and the red dot on the plane of node A. The back split of the ray is passed down the back of node A where it is classified against node B. The ray fragment is completely behind node B so is passed down the back into node C. At node C the ray is found to span the plane and is split, creating two child rays. The ray fragment in the front halfspace of node C is shown in the diagram as the segment starting at the red dot on node C and ending at point K. This is sent down the front of node C where it lands in leaf 3 which is empty space. The ray fragment that was found to lie in the back space of node C can be seen in the diagram as the line that joins the two red dots on nodes A and C. This is passed down the back of node C where it arrives at node D. It is found to lay in node D’s back halfspace and is passed down the back of node D into a back leaf. Since the ray has entered a back leaf this must mean that this fragment is in solid space (as we can clearly see in the top down view of the cube). Therefore, we return false from this node, and eventually the function, indicating that no line of sight exists between these two points.

It is important to understand that just because we want to have a solid BSP tree does not mean that every wall, floor or ceiling in the level has to be constructed using six sided cubes. It simply means that the geometry must be constructed such that empty space is always bounded by front facing polygons and

which creates only one empty leaf. Now, there are four back leaves behind nodes A, B, C and D which combined solid space around the outside of the cube. This represent the result of compiling the
same polygons but with
negated normals. Now the
polygon normals all face
into the center of the cube Figure 16.82

How It Works      