aboutsummaryrefslogtreecommitdiff
path: root/src/core/bound3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/bound3.rs')
-rw-r--r--src/core/bound3.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/bound3.rs b/src/core/bound3.rs
index ce6bb09..8c467c0 100644
--- a/src/core/bound3.rs
+++ b/src/core/bound3.rs
@@ -64,6 +64,13 @@ impl<T: Number> Bound3<T> {
let diag = self.max - self.min;
diag.x * diag.y * diag.z
}
+
+ pub fn offset(&self, offset: Vector3<T>) -> Self {
+ Self {
+ min: self.min + offset,
+ max: self.max + offset,
+ }
+ }
}
impl Bound3f {
@@ -86,7 +93,6 @@ impl Bound3f {
/// assert!(!b.intersect(&r3, 0.0, INFTY));
/// ```
pub fn intersect(&self, ray: &Ray, t_min: Float, t_max: Float) -> bool {
- println!("BIN: {} -> {}", self.min, self.max);
// Method stolen from Ray tracing the next week.
// They mention its from pixar
for i in 0..3 {