[][src]Struct rask_engine::math::vec3::Vec3

pub struct Vec3 { /* fields omitted */ }

A 3-dimensional euclidean vector with f32 elements.

Implementations

impl Vec3[src]

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

Creates a new Vec3 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 const fn z(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.

pub fn into_vec2(self) -> Vec2[src]

Returns this Vec3 as a Vec2, disregarding the z component.

Trait Implementations

impl Add<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Vec3> for Vec3[src]

impl Clone for Vec3[src]

impl Copy for Vec3[src]

impl Debug for Vec3[src]

impl Default for Vec3[src]

impl Div<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f32> for Vec3[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<Vec3> for Vec3[src]

impl DivAssign<f32> for Vec3[src]

impl Eq for Vec3[src]

impl From<[f32; 3]> for Vec3[src]

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

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

impl From<Vec3> for [f32; 3][src]

impl IntoIterator for Vec3[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<Vec3> for Mat3[src]

type Output = Vec3

The resulting type after applying the * operator.

impl Mul<Vec3> for f32[src]

type Output = Vec3

The resulting type after applying the * operator.

impl Mul<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f32> for Vec3[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Vec3> for Vec3[src]

impl MulAssign<f32> for Vec3[src]

impl Neg for Vec3[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Vec3> for Vec3[src]

impl Sub<Vec3> for Vec3[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Vec3> for Vec3[src]

Auto Trait Implementations

impl RefUnwindSafe for Vec3

impl Send for Vec3

impl Sync for Vec3

impl Unpin for Vec3

impl UnwindSafe for Vec3

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.