From bac87e9c4c61a69c5d315f331031d0745ee9d8d2 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 16 Apr 2022 14:30:48 +0800 Subject: Add object::is_on to check whether a point is on the object's surface. --- object.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'object.h') diff --git a/object.h b/object.h index 26548c5..c679d83 100644 --- a/object.h +++ b/object.h @@ -28,6 +28,9 @@ public: return hit(r, t, t1, std::numeric_limits::infinity()); } + // If given position is on the object's surface. + virtual bool is_on(const vec3d &p) const = 0; + // Given a point on the surface, returns the normalized outer normal vector on that point. virtual vec3d normal_vector(const vec3d &where) const = 0; -- cgit v1.2.3