[][src]Struct nova_math::vector::TVec2

pub struct TVec2<T: Real> { /* fields omitted */ }

A generic 2 component vector

Methods

impl<T: Real> TVec2<T>[src]

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

Construct a new Vec2

pub fn zero() -> Self[src]

Return a vector with all zeroes

pub fn one() -> Self[src]

Return a vector with all ones

pub fn up() -> Self[src]

Return a unit vector that points in the up direction

pub fn down() -> Self[src]

Return a unit vector that points in the down direction

pub fn right() -> Self[src]

Return a unit vector that points in the right direction

pub fn left() -> Self[src]

Return a unit vector that points in the left direction

Trait Implementations

impl<T: Real> Lerp<T> for TVec2<T>[src]

impl<T: Real> DotProduct<T> for TVec2<T>[src]

impl<T: Real> IntoSTD140 for TVec2<T>[src]

type Output = TVec2P<T>

impl<T: Real> Length for TVec2<T>[src]

type Output = T

impl<T: Real> LengthSquared for TVec2<T>[src]

type Output = T

impl<T: Real> Normalize for TVec2<T>[src]

impl<T: Real> NormalizeAssign for TVec2<T>[src]

impl<T: Real> From<T> for TVec2<T>[src]

fn from(other: T) -> Self[src]

Take a value as the x component of a Vec2 and leave the y component as 0

impl<T: Real> From<TVec3<T>> for TVec2<T>[src]

fn from(other: TVec3<T>) -> Self[src]

Take the xy components of a Vec3 and produce a Vec2

impl<T: Real> From<TVec4<T>> for TVec2<T>[src]

fn from(other: TVec4<T>) -> Self[src]

Take the xy components of a Vec4 and produce a Vec2

impl<T: Real> From<[T; 2]> for TVec2<T>[src]

fn from(other: [T; 2]) -> Self[src]

Take the array as a vector

impl<T: Real> From<(T, T)> for TVec2<T>[src]

fn from(other: (T, T)) -> Self[src]

Take the array as a vector

impl<T: Real> From<TVec2<T>> for TVec3<T>[src]

impl<T: Real> From<TVec2<T>> for TVec4<T>[src]

impl<T: Real> From<TVec2<T>> for TVec2P<T>[src]

impl<T: Real> Display for TVec2<T>[src]

impl<T: Debug + Real> Debug for TVec2<T>[src]

impl<T: Real> Div<TVec2<T>> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the / operator.

impl<T: Real> Div<T> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the / operator.

impl<T: Real> Sub<TVec2<T>> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the - operator.

impl<T: Real> Sub<T> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the - operator.

impl<T: Real> PartialEq<TVec2<T>> for TVec2<T>[src]

impl<T: Real> Add<TVec2<T>> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the + operator.

impl<T: Real> Add<T> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the + operator.

impl<T: Real> Mul<TVec2<T>> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the * operator.

impl<T: Real> Mul<T> for TVec2<T>[src]

type Output = TVec2<T>

The resulting type after applying the * operator.

impl<T: Real> Neg for TVec2<T>[src]

type Output = Self

The resulting type after applying the - operator.

impl<T: Real> AddAssign<TVec2<T>> for TVec2<T>[src]

impl<T: Real> AddAssign<T> for TVec2<T>[src]

impl<T: Real> SubAssign<TVec2<T>> for TVec2<T>[src]

impl<T: Real> SubAssign<T> for TVec2<T>[src]

impl<T: Real> MulAssign<TVec2<T>> for TVec2<T>[src]

impl<T: Real> MulAssign<T> for TVec2<T>[src]

impl<T: Real> DivAssign<TVec2<T>> for TVec2<T>[src]

impl<T: Real> DivAssign<T> for TVec2<T>[src]

impl<T: Real> Index<usize> for TVec2<T>[src]

type Output = T

The returned type after indexing.

impl<T: Real> IndexMut<usize> for TVec2<T>[src]

impl<T: Copy + Real> Copy for TVec2<T>[src]

impl<T: Real> Into<[T; 2]> for TVec2<T>[src]

impl<T: Real> Into<(T, T)> for TVec2<T>[src]

impl<T: Clone + Real> Clone for TVec2<T>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[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]