split_aabbs_preset

Function split_aabbs_preset 

Source
pub fn split_aabbs_preset(
    aabbs: &mut Vec<Aabb>,
    indices: &mut Vec<u32>,
    triangles: &[Triangle],
    avg_half_area: f32,
    largest_half_area: f32,
)
Expand description

Splits large triangles into multiple smaller Aabbs. Fits the new aabbs tightly to the triangle. Note: This will result in more aabbs than triangles. The indices Vec will have grow with the added Aabb’s with the respective mapping back to the initial list of triangles.

§Arguments

  • avg_half_area - The average half area of the Triangles
  • largest_half_area - The largest half area of the Triangles This is tuned to try to create splits conservatively enough that it generally wont result in lower traversal performance across a variety of scenes. (Naive splitting can result in lower traversal performance in some scenes)