Skip to main content

morton_sort_3d

Function morton_sort_3d 

Source
pub fn morton_sort_3d(points: &mut Vec<[f32; 3]>)
Expand description

Sort 3-D f32 points by their Morton Z-order (space-filling curve) code.

Coordinates are quantised to 10-bit integers before interleaving, which gives 30-bit Morton codes that fit in a u32.