diff options
author | Keuin <[email protected]> | 2022-04-12 10:44:00 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-12 10:44:00 +0800 |
commit | e83da6c36b39e6f8de35fc7e1c3caf8041cfe325 (patch) | |
tree | a44063f61168465e411a6b0cde6f3d220f39b226 | |
parent | 78a65f44df3d0109eddb2d6835adda0ed4d36859 (diff) |
Add comments in class ray3.
-rw-r--r-- | ray.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -17,14 +17,17 @@ public: ray3() = delete; ray3(const vec3<T> &source, const vec3<T> &direction) : source_(source), direction_(direction.unit_vec()) {} + // Get the source point from where the ray emits. vec3<T> source() const { return source_; } + // Get the unit vector along the ray's direction. vec3<T> direction() const { return direction_; } + // Compute the point this ray reaches at the time `t`. template<typename U> vec3<T> at(U t) const { return source_ + direction_ * t; |