Struct dmc::octree::MortonKey [−][src]
A 64-bit integer that indicates a single node in a hashed octree. Its internal representation starts with 1 as the root node and appends 3 bits for each following child node, indicating its position in the X, Y and Z axis.
Implementations
impl MortonKey
[src]
pub const fn root() -> Self
[src]
Returns a Morton key pointing to the octree root node.
pub const fn none() -> Self
[src]
Returns a Morton key pointing to no node.
pub fn parent(self) -> Self
[src]
Returns the parent of this Morton key.
If this key is pointing to the root node, the node given will be equal to MortonKey::none()
.
pub fn child(self, index: OctreeIndex) -> Self
[src]
Returns a child of the node this key is pointing to.
Panics
Panics if the level of this key is equal to the maximum level possible.
pub fn level(self) -> u32
[src]
Returns the level or depth of this node, where 0 is the root node.
Panics
Panics if this is a Morton key pointing to no node.
pub const fn max_level() -> u32
[src]
Returns the maximum depth of the nodes that this type can point to.
pub fn position(self) -> Point3<f32>
[src]
Returns the position of the center of the node this key is pointing to. All axis are in the (0, 1) interval.
pub fn closest_to_position(position: Point3<f32>, level: u32) -> Self
[src]
Returns the Morton key with level level
of an octree of bounds [-1]³ to [1]³ which is
closest to the position position
.
Panics
Panics if level < Self::max_level()
.
pub fn until_level(self, level: u32) -> Self
[src]
Trait Implementations
impl Clone for MortonKey
[src]
impl Copy for MortonKey
[src]
impl Debug for MortonKey
[src]
impl Eq for MortonKey
[src]
impl Hash for MortonKey
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<MortonKey> for MortonKey
[src]
impl StructuralEq for MortonKey
[src]
impl StructuralPartialEq for MortonKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for MortonKey
impl Send for MortonKey
impl Sync for MortonKey
impl Unpin for MortonKey
impl UnwindSafe for MortonKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
B: BuildHasher,
H: Hash + ?Sized,
[src]
B: BuildHasher,
H: Hash + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,