X-Git-Url: https://codewiz.org/gitweb?p=mandelwow.git;a=blobdiff_plain;f=cube.rs;h=916b8689d4ee5b8efc0072e9756a443e11d36b49;hp=de5315b80fa498404e6108d8e450732312488e32;hb=HEAD;hpb=4168a7f814e1ed23a2f6e93d312c87bb2cb3005a diff --git a/cube.rs b/cube.rs index de5315b..916b868 100644 --- a/cube.rs +++ b/cube.rs @@ -1,6 +1,6 @@ use std::f32; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug)] pub struct Cube { pub xmin: f32, pub ymin: f32, @@ -9,3 +9,10 @@ pub struct Cube { pub ymax: f32, pub zmax: f32, } + +// Returns a unit Cube centered in the origin. +impl Default for Cube { + fn default() -> Cube { + Cube { xmin: -0.5, ymin: -0.5, zmin: -0.5, xmax: 0.5, ymax: 0.5, zmax: 0.5f32 } + } +}