Module ilattice::morton[][src]

Expand description

Morton Codes (Z curve)

The canonical encoding scheme is 0b...zyxzyx because this is similar to the order in which we would traverse an array (x first, then y, then z).

assert_eq!(Morton3u32::from(UVec3::new(1, 0, 0)), Morton3u32(0b0001));
assert_eq!(Morton3u32::from(UVec3::new(0, 1, 0)), Morton3u32(0b0010));
assert_eq!(Morton3u32::from(UVec3::new(0, 0, 1)), Morton3u32(0b0100));

Structs

Traits