Trait transvoxel::voxel_source::VoxelSource [−][src]
pub trait VoxelSource<D: Density> { fn get_density(&mut self, voxel_index: &RegularVoxelIndex) -> D; fn get_transition_density(&mut self, index: &HighResolutionVoxelIndex) -> D; }
Expand description
Wrapper used to retrieve density values for a Block (typically from an underlying ScalarField) This source is accessed through voxel_coordinates structs
Required methods
fn get_density(&mut self, voxel_index: &RegularVoxelIndex) -> D
[src]
Expand description
This method will be called by the extraction algorithm, for regular voxels
It should return the density, at the “base” (lowest corner) of the cell identified by the given voxel index
Note that, when computing gradients, this may be queried for cells outside of the extracted block:
- an index of 0 indicates the base of the block
- an index of
subdivisions
indicates the end of the block - the function can be called for index values between -1 and
subdivisions
+ 1 (both included)
fn get_transition_density(&mut self, index: &HighResolutionVoxelIndex) -> D
[src]
Expand description
If the extraction needs to handle some transition faces, this method will be called to get density for non regular voxels
It will only get called for non-regular voxels (ie odd u/v and/or non-zero w): For example for U=2,V=0,W=0 the algorithm
will try to call get_density
instead
Implementations on Foreign Types
impl<D, F: ?Sized> VoxelSource<D> for &mut F where
D: Density,
F: VoxelSource<D>,
[src]
impl<D, F: ?Sized> VoxelSource<D> for &mut F where
D: Density,
F: VoxelSource<D>,
[src]VoxelSource implementation for references
fn get_density(&mut self, voxel_index: &RegularVoxelIndex) -> D
[src]
fn get_transition_density(&mut self, index: &HighResolutionVoxelIndex) -> D
[src]
Implementors
impl<'a, 'b, S, D> VoxelSource<D> for WorldMappingVoxelSource<'b, S> where
D: Density,
S: ScalarField<D>,
[src]
impl<'a, 'b, S, D> VoxelSource<D> for WorldMappingVoxelSource<'b, S> where
D: Density,
S: ScalarField<D>,
[src]