[][src]Struct fluff::vector::vector3::Vector3

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

A vector with x, y and z components derives traits: Default, Debug, PartialEq, Eq, Copy, Clone, Hash

Fields

x: Ty: Tz: T

Trait Implementations

impl<T: Component> Add<Vector3<T>> for Vector3<T>[src]

type Output = Vector3<T>

The resulting type after applying the + operator.

fn add(self, rhs: Vector3<T>) -> Vector3<T>[src]

Add a Vector3 to another Vector3

impl<T: Component> Base<T> for Vector3<T>[src]

fn magnitude(&self) -> T[src]

Return the magnitude of the vector, sqrt(x^2 + y^2 + z^2)

fn normalize(&mut self) -> Vector3<T>[src]

Shrink vector to have magnitude of 1

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

impl<T: Copy + Component> Copy for Vector3<T>[src]

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

impl<T: Default + Component> Default for Vector3<T>[src]

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

impl<T: Component> Div<T> for Vector3<T>[src]

type Output = Vector3<T>

The resulting type after applying the / operator.

fn div(self, rhs: T) -> Vector3<T>[src]

Divide a Vector3 by a scalar

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

impl<T: Hash + Component> Hash for Vector3<T>[src]

impl<T: Component> Mul<T> for Vector3<T>[src]

type Output = Vector3<T>

The resulting type after applying the * operator.

fn mul(self, rhs: T) -> Vector3<T>[src]

Multiply a Vector3 by a scalar

impl<T: Component + Neg<Output = T>> Neg for Vector3<T>[src]

type Output = Vector3<T>

The resulting type after applying the - operator.

fn neg(self) -> Vector3<T>[src]

Reverse the sign of the vector's components

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

impl<T: Component> StructuralEq for Vector3<T>[src]

impl<T: Component> StructuralPartialEq for Vector3<T>[src]

impl<T: Component> Sub<Vector3<T>> for Vector3<T>[src]

type Output = Vector3<T>

The resulting type after applying the - operator.

fn sub(self, rhs: Vector3<T>) -> Vector3<T>[src]

Subtract a Vector3 from another Vector3

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Vector3<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> ToString for T where
    T: Display + ?Sized
[src]

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.