pub struct HighResolutionVoxelIndex {
    pub cell: TransitionCellIndex,
    pub delta: HighResolutionVoxelDelta,
}
Expand description

Index of a high resolution voxel within a block

Fields§

§cell: TransitionCellIndex

Cell within the block

§delta: HighResolutionVoxelDelta

Voxel within the cell

Implementations§

source§

impl HighResolutionVoxelIndex

source

pub fn from( side: TransitionSide, cell_u: usize, cell_v: usize, u: isize, v: isize, w: isize ) -> Self

Shorthand constructor

source

pub fn on_regular_grid(&self) -> bool

Whether the voxel coincides with a voxel on the “regular” grid

source

pub fn as_regular_index( &self, rotation: &Rotation, block_subdivisions: usize ) -> RegularVoxelIndex

Convert to the coinciding regular voxel index. Only valid if self.on_regular_grid()

source

pub fn to_position_in_block<F>(&self, block: &Block<F>) -> Position<F>where F: Coordinate,

Convert to a relative x, y, z position within the block (0,0,0 being at the block origin, 1,1,1 at the opposite max end)

source

pub fn to_higher_res_neighbour_block_index( &self, this_block_size: usize ) -> RegularVoxelIndex

self being a double-resolution voxel on a transition face in this block, it coincides with a regular voxel on the neighbouring block at that face. This gives that voxel’s index within that block

Trait Implementations§

source§

impl Add<&HighResolutionVoxelDelta> for &HighResolutionVoxelIndex

§

type Output = HighResolutionVoxelIndex

The resulting type after applying the + operator.
source§

fn add(self, rhs: &HighResolutionVoxelDelta) -> Self::Output

Performs the + operation. Read more
source§

impl Debug for HighResolutionVoxelIndex

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sub<&HighResolutionVoxelDelta> for &HighResolutionVoxelIndex

§

type Output = HighResolutionVoxelIndex

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &HighResolutionVoxelDelta) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.