Trait Vec
sdfu::mathtypes
pub trait Vec<T>: Sized + Copy + Neg<Output = Self> + Mul<T, Output = Self> + Add<Self, Output = Self> + Sub<Self, Output = Self> + Mul<T, Output = Self> + Div<T, Output = Self> + MaxMin + Zero + One + Clamp { type Dimension: Dimension; type Vec2: Vec2<T>; type Vec3: Vec3<T>; fn dot(&self, other: Self) -> T; fn magnitude(&self) -> T; fn abs(&self) -> Self; fn normalized(&self) -> Self; }
Functionality that should be shared between all vector types.
type Dimension: Dimension
type Vec2: Vec2<T>
type Vec3: Vec3<T>
fn dot(&self, other: Self) -> T
fn magnitude(&self) -> T
fn abs(&self) -> Self
fn normalized(&self) -> Self