Struct maglio::Vec3[][src]

pub struct Vec3<T: Copy> {
    pub t: [T; 3],
}

Fields

t: [T; 3]

Implementations

impl<T: Copy> Vec3<T>[src]

pub fn new(x: T, y: T, z: T) -> Self[src]

impl<T: Add<T, Output = T> + Mul<T, Output = T> + Clone + Copy> Vec3<T>[src]

pub fn squared_length(self: &Vec3<T>) -> T[src]

impl<T: Add<T, Output = T> + Mul<T, Output = T> + Clone + Copy> Vec3<T>[src]

pub fn dot(self: &Vec3<T>, other: &Vec3<T>) -> T[src]

impl<T: Sub<T, Output = T> + Mul<T, Output = T> + Clone + Copy> Vec3<T>[src]

pub fn cross(self: &Vec3<T>, other: &Vec3<T>) -> Vec3<T>[src]

impl<T> Vec3<T> where
    T: Copy,
    Vec3<T>: Norm<Length = T> + DivAssign<T>, 
[src]

pub fn get_normalized(&self) -> Self[src]

impl<T> Vec3<T> where
    T: Copy,
    Vec3<T>: Norm<Length = T> + DivAssign<T>, 
[src]

pub fn normalize(&mut self)[src]

impl Vec3<f64>[src]

pub fn is_almost_zero(&self) -> bool[src]

pub fn reflect(&self, n: &Vec3d) -> Vec3d[src]

pub fn refract(&self, n: &Vec3d, etai_over_etat: f64) -> Vec3d[src]

Trait Implementations

impl<T: Add<T, Output = T> + Copy> Add<&'_ Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the + operator.

impl<T: Add<T, Output = T> + Copy> Add<&'_ Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the + operator.

impl<T: Add<T, Output = T> + Copy> Add<Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the + operator.

impl<T: Add<T, Output = T> + Copy> Add<Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the + operator.

impl<T: AddAssign<T> + Copy> AddAssign<&'_ Vec3<T>> for Vec3<T>[src]

impl<T: Clone + Copy> Clone for Vec3<T>[src]

impl<T: Copy> Copy for Vec3<T>[src]

impl<T: Debug + Copy> Debug for Vec3<T>[src]

impl<T: Div<T, Output = T> + Copy> Div<&'_ Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the / operator.

impl<T: Div<T, Output = T> + Copy> Div<T> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the / operator.

impl<T: DivAssign<T> + Copy> DivAssign<&'_ Vec3<T>> for Vec3<T>[src]

impl<T: DivAssign<T> + Copy> DivAssign<T> for Vec3<T>[src]

impl<T: Mul<T, Output = T> + Copy> Mul<&'_ Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: Mul<T, Output = T> + Copy> Mul<&'_ Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: Mul<T, Output = T> + Copy> Mul<T> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: Mul<T, Output = T> + Copy> Mul<T> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: Mul<T, Output = T> + Copy> Mul<Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: Mul<T, Output = T> + Copy> Mul<Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the * operator.

impl<T: MulAssign<T> + Copy> MulAssign<&'_ Vec3<T>> for Vec3<T>[src]

impl<T: MulAssign<T> + Copy> MulAssign<T> for Vec3<T>[src]

impl<T: Neg<Output = T> + Copy> Neg for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl<T: Neg<Output = T> + Copy> Neg for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl Norm for Vec3<f32>[src]

type Length = f32

impl Norm for Vec3<f64>[src]

type Length = f64

impl<T: Sub<T, Output = T> + Copy> Sub<&'_ Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl<T: Sub<T, Output = T> + Copy> Sub<&'_ Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl<T: Sub<T, Output = T> + Copy> Sub<Vec3<T>> for Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl<T: Sub<T, Output = T> + Copy> Sub<Vec3<T>> for &Vec3<T>[src]

type Output = Vec3<T>

The resulting type after applying the - operator.

impl<T: SubAssign<T> + Copy> SubAssign<&'_ Vec3<T>> for Vec3<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Vec3<T> where
    T: RefUnwindSafe

impl<T> Send for Vec3<T> where
    T: Send

impl<T> Sync for Vec3<T> where
    T: Sync

impl<T> Unpin for Vec3<T> where
    T: Unpin

impl<T> UnwindSafe for Vec3<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.