pub fn morton_encode_3d(ix: u32, iy: u32, iz: u32) -> u64Expand description
Encode three unsigned integer coordinates into a single 63-bit Morton code.
Each coordinate may use up to 21 bits (values 0..2^21-1). The bits are
interleaved: bit 0 of ix goes to bit 0, bit 0 of iy to bit 1, bit 0
of iz to bit 2, bit 1 of ix to bit 3, and so on.
ยงExamples
use oxiphysics_core::cache_layout::morton_encode_3d;
let code = morton_encode_3d(1, 2, 3);
assert_ne!(code, 0);