[][src]Struct duku::Vec4

#[repr(C)]pub struct Vec4 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
    pub w: f32,
}

4-component Vector.

Used mostly as columns of Mat4

Fields

x: f32

the X component

y: f32

the Y component

z: f32

the Z component

w: f32

the W component

Implementations

impl Vec4[src]

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

Create a new vector

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

Calculate the dot-product of the vector

pub const fn xy(self) -> Vec2[src]

Get the Vec2 made from this vectors x and y

pub const fn xyz(self) -> Vec3[src]

Get the Vec3 made from this vectors x, y and z

pub fn floor(self) -> Vec4[src]

Floor every component of the vector

pub fn ceil(self) -> Vec4[src]

Ceil every component of the vector

pub fn round(self) -> Vec4[src]

Round every component of the vector

Trait Implementations

impl Add<Vec4> for Vec4[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Vec4> for Vec4[src]

impl Clone for Vec4[src]

impl Copy for Vec4[src]

impl Debug for Vec4[src]

impl Default for Vec4[src]

impl Div<f32> for Vec4[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<f32> for Vec4[src]

impl From<[f32; 4]> for Vec4[src]

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

impl From<Rgbf> for Vec4[src]

impl Index<usize> for Vec4[src]

type Output = f32

The returned type after indexing.

impl IndexMut<usize> for Vec4[src]

impl Mul<Vec4> for Mat4[src]

type Output = Vec4

The resulting type after applying the * operator.

impl Mul<f32> for Vec4[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<f32> for Vec4[src]

impl Neg for Vec4[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Vec4> for Vec4[src]

impl StructuralPartialEq for Vec4[src]

impl Sub<Vec4> for Vec4[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Vec4> for Vec4[src]

Auto Trait Implementations

impl RefUnwindSafe for Vec4

impl Send for Vec4

impl Sync for Vec4

impl Unpin for Vec4

impl UnwindSafe for Vec4

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, 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.