Trait spherical_cow::Container
[−]
[src]
pub trait Container { fn contains(&self, sphere: &Sphere) -> bool; fn volume(&self) -> f32; }
The Container
trait must be implemented for all shapes you wish to pack spheres into.
Standard shapes such as spheres and cuboids already derrive this trait. More complicated
shapes such as a triangular mesh are also straightforward to implement, examples
of such can be seen in the
show_in_emerald
and show_in_cow files.
Required Methods
fn contains(&self, sphere: &Sphere) -> bool
Checks if a sphere exists inside some bounding geometry.
fn volume(&self) -> f32
Calculates the volume of this container in normalised units.