pub enum LightAxisDirection {
PositiveX,
NegativeX,
PositiveZ,
NegativeZ,
PositiveY,
NegativeY,
}Expand description
ScalableLux axis direction order used by packed light propagation queues.
This intentionally differs from vanilla’s Direction.ordinal() order.
ScalableLux stores direction bitsets as +X, -X, +Z, -Z, +Y, -Y and relies on
positive directions being even so index ^ 1 gives the opposite direction.
Variants§
PositiveX
Positive X / east.
NegativeX
Negative X / west.
PositiveZ
Positive Z / south.
NegativeZ
Negative Z / north.
PositiveY
Positive Y / up.
NegativeY
Negative Y / down.
Implementations§
Source§impl LightAxisDirection
impl LightAxisDirection
Sourcepub const HORIZONTAL: [Self; 4]
pub const HORIZONTAL: [Self; 4]
Horizontal directions in ScalableLux propagation order.
Sourcepub const fn from_direction(direction: Direction) -> Self
pub const fn from_direction(direction: Direction) -> Self
Converts a vanilla direction into ScalableLux’s axis-direction order.
Sourcepub const fn from_bit_index(bit_index: u8) -> Option<Self>
pub const fn from_bit_index(bit_index: u8) -> Option<Self>
Returns the ScalableLux axis direction for a direction-bit index.
Sourcepub const fn direction(self) -> Direction
pub const fn direction(self) -> Direction
Returns the vanilla direction represented by this axis direction.
Sourcepub const fn offset(self) -> (i32, i32, i32)
pub const fn offset(self) -> (i32, i32, i32)
Returns the block-coordinate offset for this axis direction.
const fn bit(self) -> u8
Trait Implementations§
Source§impl Clone for LightAxisDirection
impl Clone for LightAxisDirection
Source§fn clone(&self) -> LightAxisDirection
fn clone(&self) -> LightAxisDirection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LightAxisDirection
Source§impl Debug for LightAxisDirection
impl Debug for LightAxisDirection
impl Eq for LightAxisDirection
Source§impl Hash for LightAxisDirection
impl Hash for LightAxisDirection
Source§impl PartialEq for LightAxisDirection
impl PartialEq for LightAxisDirection
impl StructuralPartialEq for LightAxisDirection
Auto Trait Implementations§
impl Freeze for LightAxisDirection
impl RefUnwindSafe for LightAxisDirection
impl Send for LightAxisDirection
impl Sync for LightAxisDirection
impl Unpin for LightAxisDirection
impl UnsafeUnpin for LightAxisDirection
impl UnwindSafe for LightAxisDirection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>