Trait veloren_common::vol::ReadVol
source · pub trait ReadVol: BaseVol {
// Required method
fn get(&self, pos: Vec3<i32>) -> Result<&Self::Vox, Self::Error>;
// Provided methods
fn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox { ... }
fn ray(
&self,
from: Vec3<f32>,
to: Vec3<f32>,
) -> Ray<'_, Self, fn(_: &Self::Vox) -> bool, fn(_: &Self::Vox, _: Vec3<i32>)>
where Self: Sized { ... }
fn for_each_in(&self, aabb: Aabb<i32>, f: impl FnMut(Vec3<i32>, Self::Vox))
where Self::Vox: Copy { ... }
}
Expand description
A volume that provides read access to its voxel data.
Required Methods§
Provided Methods§
sourcefn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox
fn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox
Get a reference to the voxel at the provided position in the volume. Many volumes provide a fast path, provided the position is always in-bounds. Note that this function is still safe.
Object Safety§
This trait is not object safe.