Skip to content

Commit

Permalink
Make Point trait impl a blanket impl
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheCoolingFan committed Dec 2, 2023
1 parent 004a72c commit ae63196
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions crates/bevy_math/src/cubic_splines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,20 @@ pub trait Point:
+ Copy
{
}
impl Point for Vec3 {}
impl Point for Vec3A {}
impl Point for Vec2 {}
impl Point for f32 {}

impl<T> Point for T where
T: Mul<f32, Output = Self>
+ Add<Self, Output = Self>
+ Sub<Self, Output = Self>
+ Add<f32, Output = Self>
+ Sum
+ Default
+ Debug
+ Clone
+ PartialEq
+ Copy
{
}

/// A spline composed of a single cubic Bezier curve.
///
Expand Down

0 comments on commit ae63196

Please sign in to comment.