From 0832c783fa9124177a53f50214d9dffe402a0925 Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Fri, 22 Mar 2024 19:38:27 +0200 Subject: [PATCH] Improve `RayIntersection` normal comment --- src/query/ray/ray.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/query/ray/ray.rs b/src/query/ray/ray.rs index a38baf1c..7efe94ac 100644 --- a/src/query/ray/ray.rs +++ b/src/query/ray/ray.rs @@ -68,13 +68,17 @@ impl Ray { archive(as = "Self") )] pub struct RayIntersection { - /// The time of impact of the ray with the object. The exact contact point can be computed + /// The time of impact of the ray with the object. The exact contact point can be computed /// with: `ray.point_at(toi)` or equivalently `origin + dir * toi` where `origin` is the origin of the ray; /// `dir` is its direction and `toi` is the value of this field. pub toi: Real, /// The normal at the intersection point. /// + /// If the origin of the ray is inside of the shape and the shape is not solid, + /// the normal will point towards the interior of the shape. + /// Otherwise, the normal points outward. + /// /// If the `toi` is exactly zero, the normal might not be reliable. // XXX: use a Unit instead. pub normal: Vector,