Struct bevy::math::prelude::IVec4[][src]

#[repr(transparent)]pub struct IVec4(_);

A 4-dimensional vector.

Implementations

impl IVec4[src]

pub const ZERO: IVec4[src]

All zeroes.

pub const ONE: IVec4[src]

All ones.

pub const X: IVec4[src]

[1, 0, 0, 0]: a unit-length vector pointing along the positive X axis.

pub const Y: IVec4[src]

[0, 1, 0, 0]: a unit-length vector pointing along the positive Y axis.

pub const Z: IVec4[src]

[0, 0, 1, 0]: a unit-length vector pointing along the positive Z axis.

pub const W: IVec4[src]

[0, 0, 0, 1]: a unit-length vector pointing along the positive W axis.

pub fn new(x: i32, y: i32, z: i32, w: i32) -> IVec4[src]

Creates a new 4D vector.

pub const fn unit_x() -> IVec4[src]

👎 Deprecated:

Use Vec4::X instead

Creates a 4D vector with values [x: 1.0, y: 0.0, z: 0.0, w: 0.0].

pub const fn unit_y() -> IVec4[src]

👎 Deprecated:

Use Vec4::Y instead

Creates a 4D vector with values [x: 0.0, y: 1.0, z: 0.0, w: 0.0].

pub const fn unit_z() -> IVec4[src]

👎 Deprecated:

Use Vec4::Z instead

Creates a 4D vector with values [x: 0.0, y: 0.0, z: 1.0, w: 0.0].

pub const fn unit_w() -> IVec4[src]

👎 Deprecated:

Use Vec4::W instead

Creates a 4D vector with values [x: 0.0, y: 0.0, z: 0.0, w: 1.0].

pub fn truncate(self) -> IVec3[src]

Creates a Vec3 from the x, y and z elements of self, discarding w.

Truncation to Vec3 may also be performed by using self.xyz() or Vec3::from().

To truncate to Vec3A use Vec3A::from().

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

👎 Deprecated:

use ZERO constant instead

Creates a vector with all elements set to 0.0.

pub const fn one() -> IVec4[src]

👎 Deprecated:

use ONE constant instead

Creates a vector with all elements set to 1.0.

pub fn splat(v: i32) -> IVec4[src]

Creates a vector with all elements set to v.

pub fn select(mask: BVec4, if_true: IVec4, if_false: IVec4) -> IVec4[src]

Creates a vector from the elements in if_true and if_false, selecting which to use for each element of self.

A true element in the mask uses the corresponding element from if_true, and false uses the element from if_false.

pub fn dot(self, other: IVec4) -> i32[src]

Computes the dot product of self and other.

pub fn min(self, other: IVec4) -> IVec4[src]

Returns a vector containing the mininum values for each element of self and other.

In other words this computes [self.x.max(other.x), self.y.max(other.y), ..].

pub fn max(self, other: IVec4) -> IVec4[src]

Returns a vector containing the maximum values for each element of self and other.

In other words this computes [self.x.max(other.x), self.y.max(other.y), ..].

pub fn min_element(self) -> i32[src]

Returns the horizontal minimum of self.

In other words this computes min(x, y, ..).

pub fn max_element(self) -> i32[src]

Returns the horizontal maximum of self.

In other words this computes max(x, y, ..).

pub fn cmpeq(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a == comparison for each element of self and other.

In other words, this computes [self.x == other.x, self.y == other.y, ..] for all elements.

pub fn cmpne(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a != comparison for each element of self and other.

In other words this computes [self.x != other.x, self.y != other.y, ..] for all elements.

pub fn cmpge(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a >= comparison for each element of self and other.

In other words this computes [self.x >= other.x, self.y >= other.y, ..] for all elements.

pub fn cmpgt(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a > comparison for each element of self and other.

In other words this computes [self.x > other.x, self.y > other.y, ..] for all elements.

pub fn cmple(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a <= comparison for each element of self and other.

In other words this computes [self.x <= other.x, self.y <= other.y, ..] for all elements.

pub fn cmplt(self, other: IVec4) -> BVec4[src]

Returns a vector mask containing the result of a < comparison for each element of self and other.

In other words this computes [self.x < other.x, self.y < other.y, ..] for all elements.

pub fn from_slice_unaligned(slice: &[i32]) -> IVec4[src]

Creates a vector from the first N values in slice.

Panics

Panics if slice is less than N elements long.

pub fn write_to_slice_unaligned(self, slice: &mut [i32])[src]

Writes the elements of self to the first N elements in slice.

Panics

Panics if slice is less than N elements long.

pub fn abs(self) -> IVec4[src]

Returns a vector containing the absolute value of each element of self.

pub fn signum(self) -> IVec4[src]

Returns a vector with elements representing the sign of self.

  • 1.0 if the number is positive, +0.0 or INFINITY
  • -1.0 if the number is negative, -0.0 or NEG_INFINITY
  • NAN if the number is NAN

pub fn as_f32(&self) -> Vec4[src]

Casts all elements of self to f32.

pub fn as_f64(&self) -> DVec4[src]

Casts all elements of self to f64.

pub fn as_u32(&self) -> UVec4[src]

Casts all elements of self to u32.

Trait Implementations

impl Add<IVec4> for IVec4[src]

type Output = IVec4

The resulting type after applying the + operator.

impl AddAssign<IVec4> for IVec4[src]

impl AsMut<[i32; 4]> for IVec4[src]

impl AsRef<[i32; 4]> for IVec4[src]

impl Clone for IVec4[src]

impl Copy for IVec4[src]

impl Debug for IVec4[src]

impl Default for IVec4[src]

impl Deref for IVec4[src]

type Target = XYZW<i32>

The resulting type after dereferencing.

impl DerefMut for IVec4[src]

impl<'de> Deserialize<'de> for IVec4[src]

impl Display for IVec4[src]

impl Div<IVec4> for IVec4[src]

type Output = IVec4

The resulting type after applying the / operator.

impl Div<i32> for IVec4[src]

type Output = IVec4

The resulting type after applying the / operator.

impl DivAssign<IVec4> for IVec4[src]

impl DivAssign<i32> for IVec4[src]

impl Eq for IVec4[src]

impl From<[i32; 4]> for IVec4[src]

impl From<(IVec3, i32)> for IVec4[src]

impl From<(i32, i32, i32, i32)> for IVec4[src]

impl From<IVec4> for [i32; 4][src]

impl From<IVec4> for XYZW<i32>[src]

impl From<IVec4> for IVec2[src]

pub fn from(v: IVec4) -> IVec2[src]

Creates a 2D vector from the x and y elements of self, discarding z and w.

impl From<IVec4> for (i32, i32, i32, i32)[src]

impl From<IVec4> for IVec3[src]

pub fn from(v: IVec4) -> IVec3[src]

Creates a 3D vector from the x, y and z elements of self, discarding w.

impl From<XYZW<i32>> for IVec4[src]

impl GetTypeRegistration for IVec4

impl Hash for IVec4[src]

impl Index<usize> for IVec4[src]

type Output = i32

The returned type after indexing.

impl IndexMut<usize> for IVec4[src]

impl Mul<IVec4> for IVec4[src]

type Output = IVec4

The resulting type after applying the * operator.

impl Mul<i32> for IVec4[src]

type Output = IVec4

The resulting type after applying the * operator.

impl MulAssign<IVec4> for IVec4[src]

impl MulAssign<i32> for IVec4[src]

impl Neg for IVec4[src]

type Output = IVec4

The resulting type after applying the - operator.

impl PartialEq<IVec4> for IVec4[src]

impl PartialOrd<IVec4> for IVec4[src]

impl<'a> Product<&'a IVec4> for IVec4[src]

impl Reflect for IVec4

impl Serialize for IVec4[src]

impl Sub<IVec4> for IVec4[src]

type Output = IVec4

The resulting type after applying the - operator.

impl SubAssign<IVec4> for IVec4[src]

impl<'a> Sum<&'a IVec4> for IVec4[src]

impl Vec4Swizzles for IVec4[src]

type Vec2 = IVec2

type Vec3 = IVec3

Auto Trait Implementations

impl RefUnwindSafe for IVec4

impl Send for IVec4

impl Sync for IVec4

impl Unpin for IVec4

impl UnwindSafe for IVec4

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<T> CallHasher for T where
    T: Hash + ?Sized

impl<T> CallHasher for T where
    T: Hash

impl<T> CloneAny for T where
    T: Any + Clone

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> Downcast<T> for T

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

impl<T> DynEq for T where
    T: Any + Eq

impl<T> DynHash for T where
    T: DynEq + Hash

impl<Q, K> Equivalent<K> for Q where
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized
[src]

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

impl<T> FromWorld for T where
    T: Default

impl<T> GetPath for T where
    T: Reflect

impl<T> Instrument for T[src]

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

impl<M> Measure for M where
    M: Debug + PartialOrd<M> + Add<M, Output = M> + Default + Clone
[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<T> TypeData for T where
    T: 'static + Send + Sync + Clone

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,