Trait transvoxel::density::Density[][src]

pub trait Density: Float {
    fn to_normal(a: &Self, b: &Self, c: &Self) -> [f32; 3];
fn interp(a: &Self, b: &Self, threshold: &Self) -> Self;
fn as_f32(&self) -> f32; }
Expand description

Trait that must be implemented for a type to be used as a density by the algorithm For the moment, it has to be a Float

Required methods

fn to_normal(a: &Self, b: &Self, c: &Self) -> [f32; 3][src]

Expand description

Given: a, b, c gradients of the density over the 3 space directions Return: [x, y, z] a unit vector in space representing the surface normal

fn interp(a: &Self, b: &Self, threshold: &Self) -> Self[src]

Expand description

Returns the interpolation between a and b where threshold is crossed Ex: a = 0, b = 5, threshold = 1 => 0.2

fn as_f32(&self) -> f32[src]

Expand description

Convert to a f32, for scaling world positions

Implementations on Foreign Types

impl Density for f32[src]

fn interp(a: &Self, b: &Self, threshold: &Self) -> f32[src]

fn as_f32(&self) -> f32[src]

fn to_normal(a: &Self, b: &Self, c: &Self) -> [f32; 3][src]

Implementors