From 6dc32bbd63543d9a575e48c98601f8b75c44e598 Mon Sep 17 00:00:00 2001 From: Finn Bear Date: Tue, 7 Jan 2025 12:41:50 -0800 Subject: [PATCH] Point-AABB intersection, too. --- src/aabb.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/aabb.rs b/src/aabb.rs index 6852853..5fdc639 100644 --- a/src/aabb.rs +++ b/src/aabb.rs @@ -62,6 +62,12 @@ impl AabbIntersection for Aabb { } } +impl AabbIntersection for Point { + fn intersects_aabb(&self, aabb: &Aabb) -> bool { + aabb.contains(self) + } +} + /// In 2D, a circle. In 3D, a sphere. This can be used for traversing BVH's. pub struct Ball { /// The center of the ball.