aboutsummaryrefslogtreecommitdiff
path: root/src/core/mod.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-21 18:01:56 +0100
committerJulian T <julian@jtle.dk>2021-02-21 18:01:56 +0100
commitda1c3949a449f3fafe579c62ff6b14ffd993a197 (patch)
tree754df5c9b5e9f0fa0a8bb7a8cd3dd4b12fe5ad89 /src/core/mod.rs
parentc695da871a75bb6786c08c3546ef71ed032bd61d (diff)
Add 3d bounding box and merged SceneIntersection and Intersection
Diffstat (limited to 'src/core/mod.rs')
-rw-r--r--src/core/mod.rs31
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
+}
+