[−][src]Struct duku::Vector4
4-component Vector.
Used mostly as columns of Matrix4
Fields
x: f32
the X component
y: f32
the Y component
z: f32
the Z component
w: f32
the W component
Implementations
impl Vector4
[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) -> Vector2
[src]
Get the Vector2 made from this vectors x and y
pub const fn xyz(self) -> Vector3
[src]
Get the Vector3 made from this vectors x, y and z
pub fn floor(self) -> Vector4
[src]
Floor every component of the vector
pub fn ceil(self) -> Vector4
[src]
Ceil every component of the vector
pub fn round(self) -> Vector4
[src]
Round every component of the vector
Trait Implementations
impl Add<Vector4> for Vector4
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self
[src]
impl AddAssign<Vector4> for Vector4
[src]
pub fn add_assign(&mut self, rhs: Self)
[src]
impl Clone for Vector4
[src]
impl Copy for Vector4
[src]
impl Debug for Vector4
[src]
impl Default for Vector4
[src]
impl Div<f32> for Vector4
[src]
type Output = Self
The resulting type after applying the /
operator.
pub fn div(self, rhs: f32) -> Self
[src]
impl DivAssign<f32> for Vector4
[src]
pub fn div_assign(&mut self, rhs: f32)
[src]
impl From<[f32; 4]> for Vector4
[src]
impl From<(Vector3, f32)> for Vector4
[src]
impl From<Color> for Vector4
[src]
impl Index<usize> for Vector4
[src]
impl IndexMut<usize> for Vector4
[src]
impl Mul<Vector4> for Matrix4
[src]
type Output = Vector4
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Vector4) -> Self::Output
[src]
impl Mul<f32> for Vector4
[src]
type Output = Self
The resulting type after applying the *
operator.
pub fn mul(self, rhs: f32) -> Self
[src]
impl MulAssign<f32> for Vector4
[src]
pub fn mul_assign(&mut self, rhs: f32)
[src]
impl Neg for Vector4
[src]
impl PartialEq<Vector4> for Vector4
[src]
impl StructuralPartialEq for Vector4
[src]
impl Sub<Vector4> for Vector4
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Self) -> Self
[src]
impl SubAssign<Vector4> for Vector4
[src]
pub fn sub_assign(&mut self, rhs: Self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector4
impl Send for Vector4
impl Sync for Vector4
impl Unpin for Vector4
impl UnwindSafe for Vector4
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> 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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,