split_aabbs_precise

Function split_aabbs_precise 

Source
pub fn split_aabbs_precise(
    aabbs: &mut Vec<Aabb>,
    indices: &mut Vec<u32>,
    triangles: &[Triangle],
    area_thresh_low: f32,
    area_thresh_high: f32,
    split_factor_low: f32,
    split_factor_high: f32,
    max_iterations: u32,
    split_tests: u32,
)
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

  • area_thresh_low - Triangles with aabb half areas below this will not be considered for splitting.
  • area_thresh_high - If the low split factor condition is not met then area_thresh_high > old_cost must be met in addition to best_cost * split_factor_high < old_cost in order for the split to occur
  • split_factor_low - If the resulting smallest aabb half area (best_cost) multiplied by this factor is lower than the original cost the best split will be used (best_cost * split_factor_low < old_cost) (area_thresh_high > old_cost && best_cost * split_factor_high < old_cost)
  • max_iterations - Number of times to evaluate the entire set of aabbs/triangles (including the newly added splits)
  • split_tests - Number of places try splitting the triangle at.