Function rusty_tree::morton::find_key_in_direction[][src]

pub fn find_key_in_direction(key: usize, direction: &[i64; 3]) -> Option<usize>
Expand description

Find key in a given direction.

Returns the key obtained by moving direction[j] boxes into direction j starting from the anchor associated with the given key. Negative steps are possible. If the result is out of bounds, i.e. anchor[j] + direction[j] is negative or larger than the number of boxes across each dimension, None is returned. Otherwise, Some(new_key) is returned, where new_key is the Morton key after moving into the given direction.

Arguments

key - The starting key. direction - A vector describing how many boxes we move along each coordinate direction. Negative values are possible (meaning that we move backwards).