Struct vectory::V3xi32[][src]

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

A 3D vector type with elements of type i32.

Fields

x: f32y: f32z: f32

Implementations

impl V3xi32[src]

pub const LANES: usize[src]

The number of lanes in this vector.

pub const ZERO: V3xi32[src]

A vector with all its elements set to zero.

pub const ONE: V3xi32[src]

A vector with all its elements set to one.

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

Constructs a new vector with the given values.

pub fn splat(value: f32) -> Self[src]

Construct a new vector by setting each of its element to the given value.

pub fn unit_x() -> V3xi32[src]

Returns a unit vector which points along the x axis.

pub fn unit_y() -> V3xi32[src]

Returns a unit vector which points along the y axis.

pub fn unit_z() -> V3xi32[src]

Returns a unit vector which points along the z axis.

pub fn as_slice(&self) -> &[f32][src]

Views this vector as an immutable slice.

pub fn as_mut_slice(&mut self) -> &mut [f32][src]

Views this vector as a mutable slice.

pub fn sum(self) -> f32[src]

Returns the sum of all elements in this vector.

pub fn product(self) -> f32[src]

Returns the product of all elements in this vector.

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

Returns the dot product between self and other.

pub fn length_squared(self) -> f32[src]

Returns the sqaured length of this vector.

pub fn length(self) -> f32[src]

Returns the length of this vector.

pub fn length_recip(self) -> f32[src]

Returns the reciprocal of its length.

Panics

Panics if self is of length zero.

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

Returns the squared euclidean distance between two points.

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

Returns the euclidean distance between two points.

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

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

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

Returns a vector containing the maximun values for each elements of self and other.

pub fn min_elem(self) -> f32[src]

Returns the smallest element in this vector.

pub fn max_elem(self) -> f32[src]

Returns the largest element in this vector.

pub fn apply<F>(&mut self, f: F) where
    F: FnMut(f32) -> f32
[src]

Applies the function f to each element in order, in-place.

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

Computes the absolute value of self.

pub fn normalize(self) -> Self[src]

Returns a normalized self whose length is equal to 1.

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

Restricts each element in self to a certain interval given by the corresponing element in min and max.

Panics

For each corresponing element in min and max, panics if min > max, min is NaN, or max is NaN.

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

Returns the cross product between self and other.

pub fn is_nan(self) -> bool[src]

Returns true if any elements are NaN.

Trait Implementations

impl Add<V3xi32> for V3xi32[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<V3xi32> for f32[src]

type Output = V3xi32

The resulting type after applying the + operator.

impl AddAssign<V3xi32> for V3xi32[src]

impl AsMut<[f32]> for V3xi32[src]

impl AsMut<V3xi32> for V3xi32[src]

impl AsRef<[f32]> for V3xi32[src]

impl AsRef<V3xi32> for V3xi32[src]

impl Borrow<[f32]> for V3xi32[src]

impl BorrowMut<[f32]> for V3xi32[src]

impl Clone for V3xi32[src]

impl Copy for V3xi32[src]

impl Deref for V3xi32[src]

type Target = [f32]

The resulting type after dereferencing.

impl DerefMut for V3xi32[src]

impl Div<V3xi32> for V3xi32[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f32> for V3xi32[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<V3xi32> for V3xi32[src]

impl DivAssign<f32> for V3xi32[src]

impl From<[f32; 3]> for V3xi32[src]

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

impl From<f32> for V3xi32[src]

impl Into<[f32; 3]> for V3xi32[src]

impl Into<(f32, f32, f32)> for V3xi32[src]

impl Mul<V3xi32> for V3xi32[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<V3xi32> for f32[src]

type Output = V3xi32

The resulting type after applying the * operator.

impl Mul<f32> for V3xi32[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<V3xi32> for V3xi32[src]

impl MulAssign<f32> for V3xi32[src]

impl Neg for V3xi32[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<V3xi32> for V3xi32[src]

impl StructuralPartialEq for V3xi32[src]

impl Sub<V3xi32> for V3xi32[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<V3xi32> for V3xi32[src]

Auto Trait Implementations

impl RefUnwindSafe for V3xi32

impl Send for V3xi32

impl Sync for V3xi32

impl Unpin for V3xi32

impl UnwindSafe for V3xi32

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.