Vec

Trait Vec 

Source
pub trait Vec {
Show 18 methods // Required methods fn get_component_count(&self) -> usize; fn get_component(&self, index: usize) -> f32; fn set_component(&mut self, index: usize, value: f32); // Provided methods fn abs(&mut self) -> &mut Self { ... } fn add(&mut self, other: &impl Vec) -> &mut Self { ... } fn sub(&mut self, other: &impl Vec) -> &mut Self { ... } fn mul(&mut self, other: &impl Vec) -> &mut Self { ... } fn div(&mut self, other: &impl Vec) -> &mut Self { ... } fn modulo(&mut self, other: &impl Vec) -> &mut Self { ... } fn min(&mut self, other: &impl Vec) -> &mut Self { ... } fn max(&mut self, other: &impl Vec) -> &mut Self { ... } fn len(&self) -> f32 { ... } fn neg(&mut self) -> &mut Self { ... } fn scale(&mut self, f: f32) -> &mut Self { ... } fn normal(&mut self) -> &mut Self { ... } fn dist(&self, other: &impl Vec) -> f32 { ... } fn dot(&self, other: &impl Vec) -> f32 { ... } fn angle(&self, other: &impl Vec) -> f32 { ... }
}

Required Methods§

Source

fn get_component_count(&self) -> usize

Source

fn get_component(&self, index: usize) -> f32

Source

fn set_component(&mut self, index: usize, value: f32)

Provided Methods§

Source

fn abs(&mut self) -> &mut Self

Source

fn add(&mut self, other: &impl Vec) -> &mut Self

Source

fn sub(&mut self, other: &impl Vec) -> &mut Self

Source

fn mul(&mut self, other: &impl Vec) -> &mut Self

Source

fn div(&mut self, other: &impl Vec) -> &mut Self

Source

fn modulo(&mut self, other: &impl Vec) -> &mut Self

Source

fn min(&mut self, other: &impl Vec) -> &mut Self

Source

fn max(&mut self, other: &impl Vec) -> &mut Self

Source

fn len(&self) -> f32

Source

fn neg(&mut self) -> &mut Self

Source

fn scale(&mut self, f: f32) -> &mut Self

Source

fn normal(&mut self) -> &mut Self

Source

fn dist(&self, other: &impl Vec) -> f32

Source

fn dot(&self, other: &impl Vec) -> f32

Source

fn angle(&self, other: &impl Vec) -> f32

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.

Implementors§

Source§

impl Vec for Vec2

Source§

impl Vec for Vec3

Source§

impl Vec for Vec4