aboutsummaryrefslogtreecommitdiff
path: root/src/scene/shapes/sphere.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene/shapes/sphere.rs')
-rw-r--r--src/scene/shapes/sphere.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/scene/shapes/sphere.rs b/src/scene/shapes/sphere.rs
index e30c1ec..da7f321 100644
--- a/src/scene/shapes/sphere.rs
+++ b/src/scene/shapes/sphere.rs
@@ -35,6 +35,12 @@ impl Shape for Sphere {
}
}
+
+ fn norm_at(&self, point: &Vector3f) -> Vector3f {
+ let mut v = *point - self.center;
+ v /= self.radius;
+ v
+ }
}
#[cfg(test)]