Skip to content

Commit

Permalink
Make struct generic over dimensionality
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Aug 5, 2022
1 parent d24d1e4 commit dd8a32b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/fj-kernel/src/algorithms/ray_cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use fj_math::{Point, Segment};
///
/// For in-kernel use, we don't need anything more flexible, and being exactly
/// horizontal simplifies some calculations.
pub struct HorizontalRayToTheRight {
pub struct HorizontalRayToTheRight<const D: usize> {
/// The point where the ray originates
pub origin: Point<2>,
pub origin: Point<D>,
}

impl HorizontalRayToTheRight {
impl HorizontalRayToTheRight<2> {
/// Determine whether the ray hits the given line segment
pub fn hits_segment(
&self,
Expand Down Expand Up @@ -70,9 +70,9 @@ impl HorizontalRayToTheRight {
}
}

impl<P> From<P> for HorizontalRayToTheRight
impl<P, const D: usize> From<P> for HorizontalRayToTheRight<D>
where
P: Into<Point<2>>,
P: Into<Point<D>>,
{
fn from(point: P) -> Self {
Self {
Expand Down

0 comments on commit dd8a32b

Please sign in to comment.