Skip to content

Commit

Permalink
Improve RayIntersection normal comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf authored and sebcrozet committed Mar 24, 2024
1 parent 32adee4 commit 49d2d07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/query/ray/ray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vector> instead.
pub normal: Vector<Real>,
Expand Down

0 comments on commit 49d2d07

Please sign in to comment.