[−][src]Struct matmath::game::vec3::Vector3
Fields
x: T
y: T
z: 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]
T: Mul<U, Output = O>,
U: Clone,
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]
T: Mul<U, Output = O> + Clone,
U: Clone,
O: Sub<Output = O>,
pub fn homogenous(self) -> Vector4<T> where
T: MatrixElement,
[src]
T: MatrixElement,
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]
T: Div<Output = T> + Clone + MatrixElement,
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]
F: Fn(T) -> U,
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]
T: Clone,
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(&self) -> 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]
T: Display + Clone,
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]
T: Add<U, Output = O>,
Adds two vectors element by element
type Output = Vector3<O>
The resulting type after applying the +
operator.
fn add(self, rhs: Vector3<U>) -> Vector3<O>
[src]
impl<T, U, O> Sub<Vector3<U>> for Vector3<T> where
T: Sub<U, Output = O>,
[src]
T: Sub<U, Output = O>,
Subtracts two vectors element by element
type Output = Vector3<O>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector3<U>) -> Vector3<O>
[src]
impl<T, O> Neg for Vector3<T> where
T: Neg<Output = O>,
[src]
T: Neg<Output = O>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,