Struct glam::i32::IVec3[][src]

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

A 3-dimensional vector.

Implementations

impl IVec3[src]

pub const ZERO: Self[src]

All zeroes.

pub const ONE: Self[src]

All ones.

pub const X: Self[src]

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

pub const Y: Self[src]

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

pub const Z: Self[src]

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

pub const AXES: [Self; 3][src]

The unit axes.

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

Creates a new 3D vector.

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

👎 Deprecated:

Use Vec3::X instead

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

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

👎 Deprecated:

Use Vec3::Y instead

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

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

👎 Deprecated:

Use Vec3::Z instead

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

pub fn extend(self, w: i32) -> IVec4[src]

Creates a 4D vector from self and the given w value.

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

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

Truncation may also be performed by using self.xy() or Vec2::from().

pub fn cross(self, other: Self) -> Self[src]

Computes the cross product of self and other.

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

👎 Deprecated:

use ZERO constant instead

Creates a vector with all elements set to 0.0.

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

👎 Deprecated:

use ONE constant instead

Creates a vector with all elements set to 1.0.

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

Creates a vector with all elements set to v.

pub fn select(mask: BVec3, if_true: IVec3, if_false: IVec3) -> IVec3[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: Self) -> i32[src]

Computes the dot product of self and other.

pub fn min(self, other: Self) -> Self[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: Self) -> Self[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 clamp(self, min: Self, max: Self) -> Self[src]

Component-wise clamping of values, similar to [std::f32::clamp].

Each element in min must be less-or-equal to the corresponing element in max.

If the glam-assert feature is enabled, the function will panic if the contract is not met, otherwise the behavior is undefined.

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: Self) -> BVec3[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: Self) -> BVec3[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: Self) -> BVec3[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: Self) -> BVec3[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: Self) -> BVec3[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: Self) -> BVec3[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]) -> Self[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) -> Self[src]

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

pub fn signum(self) -> Self[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) -> Vec3[src]

Casts all elements of self to f32.

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

Casts all elements of self to f64.

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

Casts all elements of self to u32.

Trait Implementations

impl Add<IVec3> for IVec3[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<IVec3> for IVec3[src]

impl AsMut<[i32; 3]> for IVec3[src]

impl AsRef<[i32; 3]> for IVec3[src]

impl Clone for IVec3[src]

impl Copy for IVec3[src]

impl Debug for IVec3[src]

impl Default for IVec3[src]

impl Deref for IVec3[src]

type Target = XYZ<i32>

The resulting type after dereferencing.

impl DerefMut for IVec3[src]

impl Display for IVec3[src]

impl Div<IVec3> for IVec3[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<i32> for IVec3[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<IVec3> for IVec3[src]

impl DivAssign<i32> for IVec3[src]

impl Eq for IVec3[src]

impl From<[i32; 3]> for IVec3[src]

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

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

impl From<IVec3> for IVec2[src]

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

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

impl From<IVec4> for IVec3[src]

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

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

impl Hash for IVec3[src]

impl Index<usize> for IVec3[src]

type Output = i32

The returned type after indexing.

impl IndexMut<usize> for IVec3[src]

impl Mul<IVec3> for IVec3[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<i32> for IVec3[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<IVec3> for IVec3[src]

impl MulAssign<i32> for IVec3[src]

impl Neg for IVec3[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<IVec3> for IVec3[src]

impl PartialOrd<IVec3> for IVec3[src]

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

impl Sub<IVec3> for IVec3[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<IVec3> for IVec3[src]

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

impl Vec3Swizzles for IVec3[src]

type Vec2 = IVec2

type Vec4 = IVec4

Auto Trait Implementations

impl RefUnwindSafe for IVec3

impl Send for IVec3

impl Sync for IVec3

impl Unpin for IVec3

impl UnwindSafe for IVec3

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