Skip to content

Commit

Permalink
Point-AABB intersection, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Jan 7, 2025
1 parent 3b650f9 commit 6dc32bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ impl<T: BHValue, const D: usize> AabbIntersection<T, D> for Aabb<T, D> {
}
}

impl<T: BHValue, const D: usize> AabbIntersection<T, D> for Point<T, D> {
fn intersects_aabb(&self, aabb: &Aabb<T, D>) -> bool {
aabb.contains(self)
}
}

/// In 2D, a circle. In 3D, a sphere. This can be used for traversing BVH's.
pub struct Ball<T: BHValue, const D: usize> {
/// The center of the ball.
Expand Down

0 comments on commit 6dc32bb

Please sign in to comment.