Skip to main content

morton_encode

Function morton_encode 

Source
pub fn morton_encode(x: u32, y: u32, z: u32) -> u64
Expand description

Compute the Morton code (Z-order curve index) for a 3D integer coordinate.

Interleaves the bits of (x, y, z) to form a single 64-bit Morton code. Each coordinate must be < 2^21 for 63-bit Morton codes.