[−][src]Enum line_drawing::VoxelOrigin
Whether the center or corner of a voxel is aligned with the "grid".
If the origin point of your world is at the corner of 8 voxels, use Corner. This is likely the case if you're using [gfx_voxel]
.
[gfx_voxel]: https://crates.io/crates/piston3d-gfx_voxel
use line_drawing::{VoxelOrigin, WalkVoxels}; let a = (-0.1, -0.1, -0.1); let b = (0.1, 0.1, 0.1); let center_length = WalkVoxels::<f32, i8>::new(a, b, &VoxelOrigin::Center).count(); assert_eq!(center_length, 1); let corner_length = WalkVoxels::<f32, i8>::new(a, b, &VoxelOrigin::Corner).count(); assert_eq!(corner_length, 4);
Variants
Corner
Center
Methods
impl VoxelOrigin
[src]
pub fn round<I: FloatNum, O: SignedNum>(&self, voxel: Voxel<I>) -> Voxel<O>
[src]
Round a voxel's position based on the origin.
Auto Trait Implementations
impl Sync for VoxelOrigin
impl Send for VoxelOrigin
impl Unpin for VoxelOrigin
impl RefUnwindSafe for VoxelOrigin
impl UnwindSafe for VoxelOrigin
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,