summaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-16 14:30:48 +0800
committerKeuin <[email protected]>2022-04-16 14:30:48 +0800
commitbac87e9c4c61a69c5d315f331031d0745ee9d8d2 (patch)
tree7d7093b3517b9c4956b80632a48a1ab608d47f96 /object.h
parent8d39a453c515b18cd10079ec4b7e45f315f466da (diff)
Add object::is_on to check whether a point is on the object's surface.
Diffstat (limited to 'object.h')
-rw-r--r--object.h3
1 files changed, 3 insertions, 0 deletions
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<double>::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;