summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ray.h3
1 files changed, 3 insertions, 0 deletions
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<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;