From e83da6c36b39e6f8de35fc7e1c3caf8041cfe325 Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 12 Apr 2022 10:44:00 +0800 Subject: Add comments in class ray3. --- ray.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ray.h b/ray.h index 3281c6e..5a68557 100644 --- a/ray.h +++ b/ray.h @@ -17,14 +17,17 @@ public: ray3() = delete; ray3(const vec3 &source, const vec3 &direction) : source_(source), direction_(direction.unit_vec()) {} + // Get the source point from where the ray emits. vec3 source() const { return source_; } + // Get the unit vector along the ray's direction. vec3 direction() const { return direction_; } + // Compute the point this ray reaches at the time `t`. template vec3 at(U t) const { return source_ + direction_ * t; -- cgit v1.2.3