[][src]Struct matmath::game::vec3::Vector3

pub struct Vector3<T> {
    pub x: T,
    pub y: T,
    pub z: T,
}

Fields

x: Ty: Tz: T

Methods

impl<T> Vector3<T>[src]

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

pub fn scaled<U, O>(self, scalar: U) -> Vector3<O> where
    T: Mul<U, Output = O>,
    U: Clone
[src]

Multiplies the vector with a scalar

pub fn cross_product<U, O>(self, other: Vector3<U>) -> Vector3<O> where
    T: Mul<U, Output = O> + Clone,
    U: Clone,
    O: Sub<Output = O>, 
[src]

pub fn homogenous(self) -> Vector4<T> where
    T: MatrixElement
[src]

Creates a Vector4 where the w coordinate is 1. For more info, see Homogeneous Coordinates

pub fn normalize_homogeneous(self) -> Vector3<T> where
    T: Div<Output = T> + Clone + MatrixElement
[src]

Normalizes self so the z coordinate is 1. For more info, see Homogeneous Coordinates

pub fn map<F, U>(self, f: F) -> Vector3<U> where
    F: Fn(T) -> U, 
[src]

Applies a function to every element of the vector

Trait Implementations

impl<T> Into<Matrix<T>> for Vector3<T>[src]

impl<T> Into<Vector<T>> for Vector3<T>[src]

impl<T> Into<(T, T, T)> for Vector3<T>[src]

impl<T: Eq> Eq for Vector3<T>[src]

impl<T: PartialEq> PartialEq<Vector3<T>> for Vector3<T>[src]

impl<T> From<Matrix<T>> for Vector3<T> where
    T: Clone
[src]

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

impl<T> From<(T, T, T)> for Vector3<T>[src]

impl<T: Clone> Clone for Vector3<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Display for Vector3<T> where
    T: Display + Clone
[src]

impl<T: Debug> Debug for Vector3<T>[src]

impl<T, U, O> Add<Vector3<U>> for Vector3<T> where
    T: Add<U, Output = O>, 
[src]

Adds two vectors element by element

type Output = Vector3<O>

The resulting type after applying the + operator.

impl<T, U, O> Sub<Vector3<U>> for Vector3<T> where
    T: Sub<U, Output = O>, 
[src]

Subtracts two vectors element by element

type Output = Vector3<O>

The resulting type after applying the - operator.

impl<T, O> Neg for Vector3<T> where
    T: Neg<Output = O>, 
[src]

type Output = Vector3<O>

The resulting type after applying the - operator.

Auto Trait Implementations

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

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

Blanket Implementations

impl<T, U> Into 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> From for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.