Struct glamour::Vector4

source ·
#[repr(C, align(16))]
pub struct Vector4<T: Unit = f32> { pub x: T::Scalar, pub y: T::Scalar, pub z: T::Scalar, pub w: T::Scalar, }
Expand description

4D vector.

Alignment: This is always 16-byte aligned. glam::DVec4 is only 8-byte aligned (for some reason), and integer vectors are only 4-byte aligned, which means that reference-casting from those glam types to Vector4 type will fail (but not the other way around - see Vector4::as_raw()).

Fields§

§x: T::Scalar

X coordinate

§y: T::Scalar

Y coordinate

§z: T::Scalar

Z coordinate

§w: T::Scalar

W coordinate

Implementations§

source§

impl<T: Unit> Vector4<T>

source

pub const ZERO: Self = _

All zeroes.

source

pub const ONE: Self = _

All ones.

source

pub const X: Self = _

Unit vector in the direction of the X axis.

source

pub const Y: Self = _

Unit vector in the direction of the Y axis.

source

pub const Z: Self = _

Unit vector in the direction of the Z axis.

source

pub const W: Self = _

Unit vector in the direction of the W axis.

source

pub const AXES: [Self; 4] = _

The unit axes.

source

pub const fn new(x: T::Scalar, y: T::Scalar, z: T::Scalar, w: T::Scalar) -> Self

New vector.

source

pub fn from_array(array: [T::Scalar; 4]) -> Self

Instantiate from array. See glam::Vec4::from_array().

source

pub fn to_array(self) -> [T::Scalar; 4]

Convert to array. See glam::Vec4::to_array().

source

pub fn splat(scalar: T::Scalar) -> Self

Instance with all components set to scalar. See glam::Vec4::splat().

source

pub fn write_to_slice(self, slice: &mut [T::Scalar])

Write all components to slice.

source

pub fn cmpeq(self, other: Self) -> BVec4

Return a mask with the result of a component-wise equals comparison. See glam::Vec4::cmpeq().

source

pub fn cmpne(self, other: Self) -> BVec4

Return a mask with the result of a component-wise not-equal comparison. See glam::Vec4::cmpne().

source

pub fn cmpge(self, other: Self) -> BVec4

Return a mask with the result of a component-wise greater-than-or-equal comparison. See glam::Vec4::cmpge().

source

pub fn cmpgt(self, other: Self) -> BVec4

Return a mask with the result of a component-wise greater-than comparison. See glam::Vec4::cmpgt().

source

pub fn cmple(self, other: Self) -> BVec4

Return a mask with the result of a component-wise less-than-or-equal comparison. See glam::Vec4::cmple().

source

pub fn cmplt(self, other: Self) -> BVec4

Return a mask with the result of a component-wise less-than comparison. See glam::Vec4::cmplt().

source

pub fn min(self, other: Self) -> Self

Minimum by component. See glam::Vec4::min().

source

pub fn max(self, other: Self) -> Self

Maximum by component. See glam::Vec4::max().

source

pub fn min_element(self) -> T::Scalar

Horizontal minimum (smallest component). See glam::Vec4::min_element().

source

pub fn max_element(self) -> T::Scalar

Horizontal maximum (largest component). See glam::Vec4::max_element().

source

pub fn clamp(self, min: Self, max: Self) -> Self

Component-wise clamp. See glam::Vec4::clamp().

source

pub fn select(mask: BVec4, a: Self, b: Self) -> Self

Select components from two instances based on a mask. See glam::Vec4::select().

source

pub fn from_untyped(untyped: Vector4<T::Scalar>) -> Vector4<T>

Bitcast an untyped instance to self.

source

pub fn to_untyped(self) -> Vector4<T::Scalar>

Bitcast self to an untyped instance.

source

pub fn as_untyped(&self) -> &Vector4<T::Scalar>

Reinterpret cast self as the untyped variant.

source

pub fn as_untyped_mut(&mut self) -> &mut Vector4<T::Scalar>

Reinterpret cast self as the untyped variant.

source

pub fn cast<T2>(self) -> Vector4<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn cast_ref<T2>(&self) -> &Vector4<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn cast_mut<T2>(&mut self) -> &mut Vector4<T2>
where T2: Unit<Scalar = T::Scalar>,

Cast to a different coordinate space with the same underlying scalar type.

source

pub fn try_cast<T2>(self) -> Option<Vector4<T2>>
where T2: Unit,

Cast to a different coordinate space with scalar type conversion. Returns None if any component could not be converted to the target scalar type.

source

pub const fn from_tuple( (x, y, z, w): (T::Scalar, T::Scalar, T::Scalar, T::Scalar) ) -> Self

Instantiate from tuple.

source

pub const fn to_tuple(self) -> (T::Scalar, T::Scalar, T::Scalar, T::Scalar)

Convert to tuple.

source

pub fn as_array(&self) -> &[T::Scalar; 4]

Reinterpret as array.

source

pub fn as_array_mut(&mut self) -> &mut [T::Scalar; 4]

Reinterpret as mutable array.

source

pub fn get(&self, index: usize) -> T::Scalar

Get component at index.

source

pub fn set(&mut self, index: usize, value: T::Scalar)

Set component at index.

source

pub fn const_get<const N: usize>(&self) -> T::Scalar

Get component at index N.

source

pub fn const_set<const N: usize>(&mut self, value: T::Scalar)

Set component at index N.

source

pub fn dot(self, other: Self) -> T::Scalar

Dot product See glam::Vec4::dot().

source

pub fn truncate(self) -> Vector3<T>

Truncate to Vector3. See glam::Vec4::truncate().

source

pub fn with_x(self, x: T::Scalar) -> Self

Replace the x-component with a new value. See glam::Vec4::with_x().

source

pub fn with_y(self, y: T::Scalar) -> Self

Replace the y-component with a new value. See glam::Vec4::with_y().

source

pub fn with_z(self, z: T::Scalar) -> Self

Replace the z-component with a new value. See glam::Vec4::with_z().

source

pub fn with_w(self, w: T::Scalar) -> Self

Replace the w-component with a new value. See glam::Vec4::with_w().

source

pub fn element_sum(self) -> T::Scalar

Returns the sum of all elements of self. See glam::Vec4::element_sum().

source

pub fn element_product(self) -> T::Scalar

Returns the product of all elements of self. See glam::Vec4::element_product().

source

pub fn swizzle<const X: usize, const Y: usize, const Z: usize, const W: usize>( &self ) -> Self

Select components of this vector and return a new vector containing those components.

source

pub fn from_point(point: Point4<T>) -> Self

Instantiate from point.

source

pub fn to_point(self) -> Point4<T>

Convert to point.

source

pub fn as_point(&self) -> &Point4<T>

Reinterpret as point.

source

pub fn as_point_mut(&mut self) -> &mut Point4<T>

Reinterpret as point.

source§

impl<T> Vector4<T>
where T: Unit, T::Scalar: FloatScalar,

source

pub const NAN: Self = _

All NaN.

source

pub const INFINITY: Self = _

All positive infinity.

source

pub const NEG_INFINITY: Self = _

All negative infinity.

source

pub fn is_finite(&self) -> bool

True if all components are non-infinity and non-NaN. See glam::Vec4::is_finite().

source

pub fn is_nan(&self) -> bool

True if any component is NaN. See glam::Vec4::is_nan().

source

pub fn is_nan_mask(&self) -> BVec4

Return a mask where each bit is set if the corresponding component is NaN. See glam::Vec4::is_nan_mask().

source

pub fn ceil(self) -> Self

Round all components up. See glam::Vec4::ceil().

source

pub fn floor(self) -> Self

Round all components down. See glam::Vec4::floor().

source

pub fn round(self) -> Self

Round all components. See glam::Vec4::round().

source

pub fn fract(self) -> Self

source

pub fn fract_gl(self) -> Self

source

pub fn lerp(self, other: Self, t: T::Scalar) -> Self

Linear interpolation. See glam::Vec4::lerp().

source

pub fn normalize(self) -> Self

Normalize the vector. Undefined results in the vector’s length is (very close to) zero. See glam::Vec4::normalize().

source

pub fn normalize_or_zero(self) -> Self

Normalize the vector, returning zero if the length was already (very close to) zero. See glam::Vec4::normalize_or_zero().

source

pub fn normalize_or(self, fallback: Self) -> Self

Returns self normalized to length 1.0 if possible, else returns a fallback value. See glam::Vec4::normalize_or().

source

pub fn try_normalize(self) -> Option<Self>

Normalize the vector, returning None if the length was already (very close to) zero. See glam::Vec4::try_normalize().

source

pub fn is_normalized(self) -> bool

True if the vector is normalized. See glam::Vec4::is_normalized().

source

pub fn length(self) -> T::Scalar

Length of the vector See glam::Vec4::length().

source

pub fn length_squared(self) -> T::Scalar

Squared length of the vector See glam::Vec4::length_squared().

source

pub fn length_recip(self) -> T::Scalar

Reciprocal length of the vector See glam::Vec4::length_recip().

source

pub fn exp(self) -> Self

e^self by component See glam::Vec4::exp().

source

pub fn powf(self, n: T::Scalar) -> Self

self^n by component See glam::Vec4::powf().

source

pub fn recip(self) -> Self

1.0/self by component See glam::Vec4::recip().

source

pub fn mul_add(self, a: Self, b: Self) -> Self

self * a + b See glam::Vec4::mul_add().

source

pub fn clamp_length(self, min: T::Scalar, max: T::Scalar) -> Self

Clamp length See glam::Vec4::clamp_length().

source

pub fn clamp_length_min(self, min: T::Scalar) -> Self

source

pub fn clamp_length_max(self, max: T::Scalar) -> Self

source

pub fn project_onto(self, other: Self) -> Self

source

pub fn reject_from(self, other: Self) -> Self

source

pub fn project_onto_normalized(self, other: Self) -> Self

source

pub fn reject_from_normalized(self, other: Self) -> Self

source§

impl<T> Vector4<T>
where T: Unit, T::Scalar: IntScalar,

source

pub fn saturating_add(self, rhs: Self) -> Self

Returns a vector containing the saturating addition of self and rhs. See glam::IVec4::saturating_add().

source

pub fn saturating_sub(self, rhs: Self) -> Self

Returns a vector containing the saturating subtraction of self and rhs. See glam::IVec4::saturating_sub().

source

pub fn saturating_mul(self, rhs: Self) -> Self

Returns a vector containing the saturating multiplication of self and rhs. See glam::IVec4::saturating_mul().

source

pub fn saturating_div(self, rhs: Self) -> Self

Returns a vector containing the saturating division of self and rhs. See glam::IVec4::saturating_div().

source

pub fn wrapping_add(self, rhs: Self) -> Self

Returns a vector containing the wrapping addition of self and rhs. See glam::IVec4::wrapping_add().

source

pub fn wrapping_sub(self, rhs: Self) -> Self

Returns a vector containing the wrapping subtraction of self and rhs. See glam::IVec4::wrapping_sub().

source

pub fn wrapping_mul(self, rhs: Self) -> Self

Returns a vector containing the wrapping multiplication of self and rhs. See glam::IVec4::wrapping_mul().

source

pub fn wrapping_div(self, rhs: Self) -> Self

Returns a vector containing the wrapping division of self and rhs. See glam::IVec4::wrapping_div().

source§

impl<T> Vector4<T>
where T: Unit, T::Scalar: SignedScalar,

source

pub const NEG_ONE: Self = _

All negative one.

source

pub const NEG_X: Self = _

(-1, 0, 0, 0)

source

pub const NEG_Y: Self = _

(0, -1, 0, 0)

source

pub const NEG_Z: Self = _

(0, 0, -1, 0)

source

pub const NEG_W: Self = _

(0, 0, 0, -1)

source

pub fn abs(self) -> Self

Turn all components positive. See glam::Vec4::abs().

source

pub fn signum(self) -> Self

Return a vector where each component is 1 or -1 depending on the sign of the input. See glam::Vec4::signum().

Trait Implementations§

source§

impl<T: Unit> AbsDiffEq for Vector4<T>

§

type Epsilon = <<T as Unit>::Scalar as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
source§

fn abs_diff_ne(&self, other: &Self, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
source§

impl<T: Unit> Add<Vector4<T>> for Point4<T>

§

type Output = Point4<T>

The resulting type after applying the + operator.
source§

fn add(self, other: Vector4<T>) -> Self

Performs the + operation. Read more
source§

impl<T: Unit> Add for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl<T: Unit> AddAssign<Vector4<T>> for Point4<T>

source§

fn add_assign(&mut self, other: Vector4<T>)

Performs the += operation. Read more
source§

impl<T: Unit<Scalar = f32>> AddAssign<f32> for Vector4<T>

source§

fn add_assign(&mut self, other: f32)

Performs the += operation. Read more
source§

impl<T: Unit<Scalar = f64>> AddAssign<f64> for Vector4<T>

source§

fn add_assign(&mut self, other: f64)

Performs the += operation. Read more
source§

impl<T: Unit<Scalar = i32>> AddAssign<i32> for Vector4<T>

source§

fn add_assign(&mut self, other: i32)

Performs the += operation. Read more
source§

impl<T: Unit<Scalar = u32>> AddAssign<u32> for Vector4<T>

source§

fn add_assign(&mut self, other: u32)

Performs the += operation. Read more
source§

impl<T: Unit> AddAssign for Vector4<T>

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl<T: Unit> AsMut<[<T as Unit>::Scalar]> for Vector4<T>

source§

fn as_mut(&mut self) -> &mut [T::Scalar]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T: Unit> AsMut<[<T as Unit>::Scalar; 4]> for Vector4<T>

source§

fn as_mut(&mut self) -> &mut [T::Scalar; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<DVec4> for Vector4<T>
where T: Unit<Scalar = f64>,

source§

fn as_mut(&mut self) -> &mut DVec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<I64Vec4> for Vector4<T>
where T: Unit<Scalar = i64>,

source§

fn as_mut(&mut self) -> &mut I64Vec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<IVec4> for Vector4<T>
where T: Unit<Scalar = i32>,

source§

fn as_mut(&mut self) -> &mut IVec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<U64Vec4> for Vector4<T>
where T: Unit<Scalar = u64>,

source§

fn as_mut(&mut self) -> &mut U64Vec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<UVec4> for Vector4<T>
where T: Unit<Scalar = u32>,

source§

fn as_mut(&mut self) -> &mut UVec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<Vec4> for Vector4<T>
where T: Unit<Scalar = f32>,

source§

fn as_mut(&mut self) -> &mut Vec4

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T: Unit> AsRaw for Vector4<T>

source§

fn as_raw(&self) -> &Self::Raw

By-ref conversion to Self::Raw.
source§

fn as_raw_mut(&mut self) -> &mut Self::Raw

By-ref mutable conversion to Self::Raw.
source§

impl<T: Unit> AsRef<[<T as Unit>::Scalar]> for Vector4<T>

source§

fn as_ref(&self) -> &[T::Scalar]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Unit> AsRef<[<T as Unit>::Scalar; 4]> for Vector4<T>

source§

fn as_ref(&self) -> &[T::Scalar; 4]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<DVec4> for Vector4<T>
where T: Unit<Scalar = f64>,

source§

fn as_ref(&self) -> &DVec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<I64Vec4> for Vector4<T>
where T: Unit<Scalar = i64>,

source§

fn as_ref(&self) -> &I64Vec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<IVec4> for Vector4<T>
where T: Unit<Scalar = i32>,

source§

fn as_ref(&self) -> &IVec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<U64Vec4> for Vector4<T>
where T: Unit<Scalar = u64>,

source§

fn as_ref(&self) -> &U64Vec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<UVec4> for Vector4<T>
where T: Unit<Scalar = u32>,

source§

fn as_ref(&self) -> &UVec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Vec4> for Vector4<T>
where T: Unit<Scalar = f32>,

source§

fn as_ref(&self) -> &Vec4

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Borrow<DVec4> for Vector4<T>
where T: Unit<Scalar = f64>,

source§

fn borrow(&self) -> &DVec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<I64Vec4> for Vector4<T>
where T: Unit<Scalar = i64>,

source§

fn borrow(&self) -> &I64Vec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<IVec4> for Vector4<T>
where T: Unit<Scalar = i32>,

source§

fn borrow(&self) -> &IVec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<U64Vec4> for Vector4<T>
where T: Unit<Scalar = u64>,

source§

fn borrow(&self) -> &U64Vec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<UVec4> for Vector4<T>
where T: Unit<Scalar = u32>,

source§

fn borrow(&self) -> &UVec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vec4> for Vector4<T>
where T: Unit<Scalar = f32>,

source§

fn borrow(&self) -> &Vec4

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for DVec4
where T: Unit<Scalar = f64>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for I64Vec4
where T: Unit<Scalar = i64>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for IVec4
where T: Unit<Scalar = i32>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for U64Vec4
where T: Unit<Scalar = u64>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for UVec4
where T: Unit<Scalar = u32>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<Vector4<T>> for Vec4
where T: Unit<Scalar = f32>,

source§

fn borrow(&self) -> &Vector4<T>

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<DVec4> for Vector4<T>
where T: Unit<Scalar = f64>,

source§

fn borrow_mut(&mut self) -> &mut DVec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<I64Vec4> for Vector4<T>
where T: Unit<Scalar = i64>,

source§

fn borrow_mut(&mut self) -> &mut I64Vec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<IVec4> for Vector4<T>
where T: Unit<Scalar = i32>,

source§

fn borrow_mut(&mut self) -> &mut IVec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<U64Vec4> for Vector4<T>
where T: Unit<Scalar = u64>,

source§

fn borrow_mut(&mut self) -> &mut U64Vec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<UVec4> for Vector4<T>
where T: Unit<Scalar = u32>,

source§

fn borrow_mut(&mut self) -> &mut UVec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vec4> for Vector4<T>
where T: Unit<Scalar = f32>,

source§

fn borrow_mut(&mut self) -> &mut Vec4

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for DVec4
where T: Unit<Scalar = f64>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for I64Vec4
where T: Unit<Scalar = i64>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for IVec4
where T: Unit<Scalar = i32>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for U64Vec4
where T: Unit<Scalar = u64>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for UVec4
where T: Unit<Scalar = u32>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<Vector4<T>> for Vec4
where T: Unit<Scalar = f32>,

source§

fn borrow_mut(&mut self) -> &mut Vector4<T>

Mutably borrows from an owned value. Read more
source§

impl<T: Unit> Clone for Vector4<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Unit> Debug for Vector4<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Unit> Default for Vector4<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: Unit<Scalar = f32>> Div<f32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

fn div(self, other: f32) -> Self

Performs the / operation. Read more
source§

impl<T: Unit<Scalar = f64>> Div<f64> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

fn div(self, other: f64) -> Self

Performs the / operation. Read more
source§

impl<T: Unit<Scalar = i32>> Div<i32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

fn div(self, other: i32) -> Self

Performs the / operation. Read more
source§

impl<T: Unit<Scalar = u32>> Div<u32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

fn div(self, other: u32) -> Self

Performs the / operation. Read more
source§

impl<T: Unit> Div for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
source§

impl<T: Unit<Scalar = f32>> DivAssign<f32> for Vector4<T>

source§

fn div_assign(&mut self, other: f32)

Performs the /= operation. Read more
source§

impl<T: Unit<Scalar = f64>> DivAssign<f64> for Vector4<T>

source§

fn div_assign(&mut self, other: f64)

Performs the /= operation. Read more
source§

impl<T: Unit<Scalar = i32>> DivAssign<i32> for Vector4<T>

source§

fn div_assign(&mut self, other: i32)

Performs the /= operation. Read more
source§

impl<T: Unit<Scalar = u32>> DivAssign<u32> for Vector4<T>

source§

fn div_assign(&mut self, other: u32)

Performs the /= operation. Read more
source§

impl<T: Unit> DivAssign for Vector4<T>

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl<T: Unit> From<[<T as Unit>::Scalar; 4]> for Vector4<T>

source§

fn from(arr: [T::Scalar; 4]) -> Self

Converts to this type from the input type.
source§

impl<T: Unit> From<(<T as Unit>::Scalar, <T as Unit>::Scalar, <T as Unit>::Scalar, <T as Unit>::Scalar)> for Vector4<T>

source§

fn from(tuple: (T::Scalar, T::Scalar, T::Scalar, T::Scalar)) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T: Unit> From<BVec4> for Vector4<T>

source§

fn from(v: BVec4) -> Self

Converts to this type from the input type.
source§

impl<T> From<DVec4> for Vector4<T>
where T: Unit<Scalar = f64>,

source§

fn from(vec: DVec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T> From<I64Vec4> for Vector4<T>
where T: Unit<Scalar = i64>,

source§

fn from(vec: I64Vec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T> From<IVec4> for Vector4<T>
where T: Unit<Scalar = i32>,

source§

fn from(vec: IVec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T: Unit> From<Point4<T>> for Vector4<T>

source§

fn from(point: Point4<T>) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T> From<U64Vec4> for Vector4<T>
where T: Unit<Scalar = u64>,

source§

fn from(vec: U64Vec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T> From<UVec4> for Vector4<T>
where T: Unit<Scalar = u32>,

source§

fn from(vec: UVec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T> From<Vec4> for Vector4<T>
where T: Unit<Scalar = f32>,

source§

fn from(vec: Vec4) -> Vector4<T>

Converts to this type from the input type.
source§

impl<T: Unit> From<Vector4<T>> for [T::Scalar; 4]

source§

fn from(v: Vector4<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Unit> From<Vector4<T>> for (T::Scalar, T::Scalar, T::Scalar, T::Scalar)

source§

fn from(value: Vector4<T>) -> (T::Scalar, T::Scalar, T::Scalar, T::Scalar)

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for DVec4
where T: Unit<Scalar = f64>,

source§

fn from(vec: Vector4<T>) -> DVec4

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for I64Vec4
where T: Unit<Scalar = i64>,

source§

fn from(vec: Vector4<T>) -> I64Vec4

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for IVec4
where T: Unit<Scalar = i32>,

source§

fn from(vec: Vector4<T>) -> IVec4

Converts to this type from the input type.
source§

impl<T: Unit> From<Vector4<T>> for Point4<T>

source§

fn from(vec: Vector4<T>) -> Point4<T>

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for U64Vec4
where T: Unit<Scalar = u64>,

source§

fn from(vec: Vector4<T>) -> U64Vec4

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for UVec4
where T: Unit<Scalar = u32>,

source§

fn from(vec: Vector4<T>) -> UVec4

Converts to this type from the input type.
source§

impl<T> From<Vector4<T>> for Vec4
where T: Unit<Scalar = f32>,

source§

fn from(vec: Vector4<T>) -> Vec4

Converts to this type from the input type.
source§

impl<T: Unit> FromRaw for Vector4<T>

source§

fn from_raw(raw: Self::Raw) -> Self

By-value conversion from Self::Raw.
source§

impl<T> Hash for Vector4<T>
where T: Unit, T::Scalar: Hash,

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: Unit> Index<usize> for Vector4<T>

§

type Output = <T as Unit>::Scalar

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T: Unit> IndexMut<usize> for Vector4<T>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T: Unit> IntoIterator for Vector4<T>

§

type Item = <T as Unit>::Scalar

The type of the elements being iterated over.
§

type IntoIter = <[<T as Unit>::Scalar; 4] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> Mul<Vector4<T>> for Matrix4<T::Scalar>
where T: Unit, T::Scalar: FloatScalar,

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Vector4<T>) -> Self::Output

Performs the * operation. Read more
source§

impl<T: Unit<Scalar = f32>> Mul<f32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: f32) -> Self

Performs the * operation. Read more
source§

impl<T: Unit<Scalar = f64>> Mul<f64> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: f64) -> Self

Performs the * operation. Read more
source§

impl<T: Unit<Scalar = i32>> Mul<i32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: i32) -> Self

Performs the * operation. Read more
source§

impl<T: Unit<Scalar = u32>> Mul<u32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: u32) -> Self

Performs the * operation. Read more
source§

impl<T: Unit> Mul for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

impl<T: Unit<Scalar = f32>> MulAssign<f32> for Vector4<T>

source§

fn mul_assign(&mut self, other: f32)

Performs the *= operation. Read more
source§

impl<T: Unit<Scalar = f64>> MulAssign<f64> for Vector4<T>

source§

fn mul_assign(&mut self, other: f64)

Performs the *= operation. Read more
source§

impl<T: Unit<Scalar = i32>> MulAssign<i32> for Vector4<T>

source§

fn mul_assign(&mut self, other: i32)

Performs the *= operation. Read more
source§

impl<T: Unit<Scalar = u32>> MulAssign<u32> for Vector4<T>

source§

fn mul_assign(&mut self, other: u32)

Performs the *= operation. Read more
source§

impl<T: Unit> MulAssign for Vector4<T>

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl<T> Neg for Vector4<T>
where T: Unit, T::Scalar: SignedScalar,

§

type Output = Vector4<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl<T: Unit> PartialEq<[<T as Unit>::Scalar; 4]> for Vector4<T>

source§

fn eq(&self, other: &[T::Scalar; 4]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Unit> PartialEq<(<T as Unit>::Scalar, <T as Unit>::Scalar, <T as Unit>::Scalar, <T as Unit>::Scalar)> for Vector4<T>

source§

fn eq( &self, (x, y, z, w): &(T::Scalar, T::Scalar, T::Scalar, T::Scalar) ) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Unit> PartialEq for Vector4<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, T: Unit> Product<&'a Vector4<T>> for Vector4<T>

source§

fn product<I>(iter: I) -> Self
where I: Iterator<Item = &'a Self>,

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<T: Unit> RelativeEq for Vector4<T>
where T::Scalar: RelativeEq,

source§

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
source§

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of RelativeEq::relative_eq.
source§

impl<T: Unit<Scalar = f32>> Rem<f32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: f32) -> Self

Performs the % operation. Read more
source§

impl<T: Unit<Scalar = f64>> Rem<f64> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: f64) -> Self

Performs the % operation. Read more
source§

impl<T: Unit<Scalar = i32>> Rem<i32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: i32) -> Self

Performs the % operation. Read more
source§

impl<T: Unit<Scalar = u32>> Rem<u32> for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: u32) -> Self

Performs the % operation. Read more
source§

impl<T: Unit> Rem for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
source§

impl<T: Unit<Scalar = f32>> RemAssign<f32> for Vector4<T>

source§

fn rem_assign(&mut self, other: f32)

Performs the %= operation. Read more
source§

impl<T: Unit<Scalar = f64>> RemAssign<f64> for Vector4<T>

source§

fn rem_assign(&mut self, other: f64)

Performs the %= operation. Read more
source§

impl<T: Unit<Scalar = i32>> RemAssign<i32> for Vector4<T>

source§

fn rem_assign(&mut self, other: i32)

Performs the %= operation. Read more
source§

impl<T: Unit<Scalar = u32>> RemAssign<u32> for Vector4<T>

source§

fn rem_assign(&mut self, other: u32)

Performs the %= operation. Read more
source§

impl<T: Unit> RemAssign for Vector4<T>

source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
source§

impl<T: Unit> Sub<Vector4<T>> for Point4<T>

§

type Output = Point4<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: Vector4<T>) -> Self

Performs the - operation. Read more
source§

impl<T: Unit> Sub for Vector4<T>

§

type Output = Vector4<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

impl<T: Unit> SubAssign<Vector4<T>> for Point4<T>

source§

fn sub_assign(&mut self, other: Vector4<T>)

Performs the -= operation. Read more
source§

impl<T: Unit<Scalar = f32>> SubAssign<f32> for Vector4<T>

source§

fn sub_assign(&mut self, other: f32)

Performs the -= operation. Read more
source§

impl<T: Unit<Scalar = f64>> SubAssign<f64> for Vector4<T>

source§

fn sub_assign(&mut self, other: f64)

Performs the -= operation. Read more
source§

impl<T: Unit<Scalar = i32>> SubAssign<i32> for Vector4<T>

source§

fn sub_assign(&mut self, other: i32)

Performs the -= operation. Read more
source§

impl<T: Unit<Scalar = u32>> SubAssign<u32> for Vector4<T>

source§

fn sub_assign(&mut self, other: u32)

Performs the -= operation. Read more
source§

impl<T: Unit> SubAssign for Vector4<T>

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl<'a, T: Unit> Sum<&'a Vector4<T>> for Vector4<T>

source§

fn sum<I>(iter: I) -> Self
where I: Iterator<Item = &'a Self>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<T: Unit> Swizzle<T> for Vector4<T>

source§

fn swizzle2<const X: usize, const Y: usize>(&self) -> Vector2<T>

Select two components from this vector and return a 2D vector made from those components.
source§

fn swizzle3<const X: usize, const Y: usize, const Z: usize>(&self) -> Vector3<T>

Select three components from this vector and return a 3D vector made from those components.
source§

fn swizzle4<const X: usize, const Y: usize, const Z: usize, const W: usize>( &self ) -> Vector4<T>

Select four components from this vector and return a 4D vector made from those components.
source§

impl<T: Unit> ToRaw for Vector4<T>

§

type Raw = <<T as Unit>::Scalar as Scalar>::Vec4

The underlying glam type.
source§

fn to_raw(self) -> Self::Raw

By-value conversion to Self::Raw.
source§

impl<T: Unit> TransparentWrapper<<<T as Unit>::Scalar as Scalar>::Vec4> for Vector4<T>

SAFETY: These are guaranteed to have the same representation.

source§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
source§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
source§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
source§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
source§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
source§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
source§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
source§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
source§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
source§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
source§

impl<T: Unit> UlpsEq for Vector4<T>
where T::Scalar: UlpsEq,

source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
source§

impl<T: Unit> Zeroable for Vector4<T>

SAFETY: T::Scalar is Zeroable, and Vector4 is #[repr(C)].

source§

fn zeroed() -> Self

source§

impl<T: Unit> Copy for Vector4<T>

source§

impl<T> Eq for Vector4<T>
where T: Unit, T::Scalar: Eq,

source§

impl<T: Unit> Pod for Vector4<T>

SAFETY: T::Scalar is Pod.

Auto Trait Implementations§

§

impl<T> Freeze for Vector4<T>
where <T as Unit>::Scalar: Freeze,

§

impl<T> RefUnwindSafe for Vector4<T>
where <T as Unit>::Scalar: RefUnwindSafe,

§

impl<T> Send for Vector4<T>

§

impl<T> Sync for Vector4<T>

§

impl<T> Unpin for Vector4<T>
where <T as Unit>::Scalar: Unpin,

§

impl<T> UnwindSafe for Vector4<T>
where <T as Unit>::Scalar: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AnyBitPattern for T
where T: Pod,

source§

impl<T> NoUninit for T
where T: Pod,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

source§

impl<T> PodValue for T
where T: Copy + Debug + Default + PartialEq + Pod + Send + Sync + Serializable + 'static,

source§

impl<T> Serializable for T