Struct transvoxel::voxel_coordinates::HighResolutionVoxelIndex[][src]

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

Index of a high resolution voxel within a block

Fields

cell: TransitionCellIndex
Expand description

Cell within the block

delta: HighResolutionVoxelDelta
Expand description

Voxel within the cell

Implementations

impl HighResolutionVoxelIndex[src]

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

Shorthand constructor

pub fn on_regular_grid(&self) -> bool[src]

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

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

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

pub fn to_position_in_block(&self, block: &Block) -> Position[src]

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)

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

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

impl Add<&'_ HighResolutionVoxelDelta> for &HighResolutionVoxelIndex[src]

type Output = HighResolutionVoxelIndex

The resulting type after applying the + operator.

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

Performs the + operation. Read more

impl Debug for HighResolutionVoxelIndex[src]

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

Formats the value using the given formatter. Read more

impl Sub<&'_ HighResolutionVoxelDelta> for &HighResolutionVoxelIndex[src]

type Output = HighResolutionVoxelIndex

The resulting type after applying the - operator.

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

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.