[][src]Struct rask_engine::math::vec2::Vec2

pub struct Vec2 { /* fields omitted */ }

A 2-dimensional euclidean vector with f32 elements.

Implementations

impl Vec2[src]

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

Creates a new Vec2 from x and y coordinates.

pub const fn zero() -> Self[src]

Returns the zero vector.

pub const fn x(self) -> f32[src]

Returns the x coordinate.

pub const fn y(self) -> f32[src]

Returns the y coordinate.

pub fn dot(self, other: Self) -> f32[src]

Returns the dot product.

pub fn norm2(self) -> f32[src]

Returns the square of the euclidean norm of the vector.

pub fn norm(self) -> f32[src]

Returns the euclidean norm of the vector.

pub fn normalized(self) -> Self[src]

Returns a normalized version of the vector, that is, a vector that points in the same direction, but has norm 1.

Trait Implementations

impl Add<Vec2> for AABox[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Vec2> for RBox[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Vec2> for Vec2[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Vec2> for AABox[src]

impl AddAssign<Vec2> for RBox[src]

impl AddAssign<Vec2> for Vec2[src]

impl Clone for Vec2[src]

impl Collidable for Vec2[src]

impl Collide<AABox> for Vec2[src]

impl Collide<RBox> for Vec2[src]

impl Collide<SRT> for Vec2[src]

impl Collide<Vec2> for Vec2[src]

impl Collide<Vec2> for AABox[src]

impl Collide<Vec2> for RBox[src]

impl Collide<Vec2> for SRT[src]

impl Copy for Vec2[src]

impl Debug for Vec2[src]

impl Default for Vec2[src]

impl Div<Vec2> for Vec2[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f32> for Vec2[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<Vec2> for Vec2[src]

impl DivAssign<f32> for Vec2[src]

impl Eq for Vec2[src]

impl From<[f32; 2]> for Vec2[src]

impl From<(f32, f32)> for Vec2[src]

impl From<Vec2> for (f32, f32)[src]

impl From<Vec2> for [f32; 2][src]

impl IntoIterator for Vec2[src]

type Item = f32

The type of the elements being iterated over.

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

impl Mul<Vec2> for Mat2[src]

type Output = Vec2

The resulting type after applying the * operator.

impl Mul<Vec2> for f32[src]

type Output = Vec2

The resulting type after applying the * operator.

impl Mul<Vec2> for Vec2[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f32> for Vec2[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Vec2> for Vec2[src]

impl MulAssign<f32> for Vec2[src]

impl Neg for Vec2[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Vec2> for Vec2[src]

impl Sub<Vec2> for AABox[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Vec2> for RBox[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Vec2> for Vec2[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Vec2> for AABox[src]

impl SubAssign<Vec2> for RBox[src]

impl SubAssign<Vec2> for Vec2[src]

Auto Trait Implementations

impl RefUnwindSafe for Vec2

impl Send for Vec2

impl Sync for Vec2

impl Unpin for Vec2

impl UnwindSafe for Vec2

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<S, T> Collide<[T]> for S where
    T: Collide<S>, 
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Resource for T where
    T: Any + Send + Sync

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryDefault for T where
    T: Default

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.