diff options
Diffstat (limited to 'src/core/mod.rs')
-rw-r--r-- | src/core/mod.rs | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/core/mod.rs b/src/core/mod.rs index c2b3771..07793ec 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -2,16 +2,33 @@ //! //! Also creates a shortcut for some common types -pub mod vector2; -pub mod vector3; -pub mod bound; -pub mod spectrum; -pub mod hittable; +mod vector2; +mod vector3; +mod bound2; +mod bound3; +mod spectrum; mod ray; pub use vector2::{Vector2i, Vector2f}; pub use vector3::Vector3f; -pub use bound::{Bound2i, Bound2f}; +pub use bound2::{Bound2i, Bound2f}; +pub use bound3::Bound3f; pub use spectrum::Spectrum; pub use ray::Ray; -pub use hittable::{Hittable, Intersection}; + +use crate::Number; + +fn min<T: Number> (a: T, b: T) -> T { + if b < a { + return b; + } + a +} + +fn max<T: Number> (a: T, b: T) -> T { + if b > a { + return b; + } + a +} + |