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
impl HighResolutionVoxelIndex
sourcepub fn from(
side: TransitionSide,
cell_u: usize,
cell_v: usize,
u: isize,
v: isize,
w: isize
) -> Self
pub fn from( side: TransitionSide, cell_u: usize, cell_v: usize, u: isize, v: isize, w: isize ) -> Self
Shorthand constructor
sourcepub fn on_regular_grid(&self) -> bool
pub fn on_regular_grid(&self) -> bool
Whether the voxel coincides with a voxel on the “regular” grid
sourcepub fn as_regular_index(
&self,
rotation: &Rotation,
block_subdivisions: usize
) -> RegularVoxelIndex
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()
sourcepub fn to_position_in_block<F>(&self, block: &Block<F>) -> Position<F>where
F: Coordinate,
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)
sourcepub fn to_higher_res_neighbour_block_index(
&self,
this_block_size: usize
) -> RegularVoxelIndex
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
impl Add<&HighResolutionVoxelDelta> for &HighResolutionVoxelIndex
§type Output = HighResolutionVoxelIndex
type Output = HighResolutionVoxelIndex
The resulting type after applying the
+
operator.source§impl Debug for HighResolutionVoxelIndex
impl Debug for HighResolutionVoxelIndex
source§impl Sub<&HighResolutionVoxelDelta> for &HighResolutionVoxelIndex
impl Sub<&HighResolutionVoxelDelta> for &HighResolutionVoxelIndex
§type Output = HighResolutionVoxelIndex
type Output = HighResolutionVoxelIndex
The resulting type after applying the
-
operator.Auto Trait Implementations§
impl RefUnwindSafe for HighResolutionVoxelIndex
impl Send for HighResolutionVoxelIndex
impl Sync for HighResolutionVoxelIndex
impl Unpin for HighResolutionVoxelIndex
impl UnwindSafe for HighResolutionVoxelIndex
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