Skip to main content

VectorOps

Trait VectorOps 

Source
pub trait VectorOps:
    Copy
    + Add<Output = Self>
    + Sub<Output = Self>
    + Neg<Output = Self>
    + Mul<f32, Output = Self>
    + PartialEq {
    // Required methods
    fn zero() -> Self;
    fn dot(self, rhs: Self) -> f32;
    fn is_finite(self) -> bool;

    // Provided methods
    fn length_squared(self) -> f32 { ... }
    fn length(self) -> f32 { ... }
    fn normalize_or(self, fallback: Self) -> Self { ... }
}

Required Methods§

Source

fn zero() -> Self

Source

fn dot(self, rhs: Self) -> f32

Source

fn is_finite(self) -> bool

Provided Methods§

Source

fn length_squared(self) -> f32

Source

fn length(self) -> f32

Source

fn normalize_or(self, fallback: Self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl VectorOps for Vec4

Source§

fn zero() -> Self

Source§

fn dot(self, rhs: Self) -> f32

Source§

fn is_finite(self) -> bool

Source§

impl VectorOps for Vec2

Source§

fn zero() -> Self

Source§

fn dot(self, rhs: Self) -> f32

Source§

fn is_finite(self) -> bool

Source§

impl VectorOps for Vec3

Source§

fn zero() -> Self

Source§

fn dot(self, rhs: Self) -> f32

Source§

fn is_finite(self) -> bool

Implementors§