Struct slender_math::Vector3i

source ·
#[repr(C, align(16))]
pub struct Vector3i(_);
Expand description

A vector with 3 i32 components

Implementations§

source§

impl Vector3i

source

pub const ZERO: Self = _

The vector (0, 0, 0)

source

pub const fn x(&self) -> i32

The x component of the vector

source

pub fn x_mut(&mut self) -> &mut i32

The x component of the vector

source

pub const fn y(&self) -> i32

The y component of the vector

source

pub fn y_mut(&mut self) -> &mut i32

The y component of the vector

source

pub const fn z(&self) -> i32

The z component of the vector

source

pub fn z_mut(&mut self) -> &mut i32

The z component of the vector

source

pub const fn new(x: i32, y: i32, z: i32) -> Self

Creates a new vector from the given components

source

pub const fn from_scalar(scalar: i32) -> Self

Creates a new vector by setting all components to the given scalar

source

pub const fn from_array(array: [i32; 3]) -> Self

Creates a new vector from the given array

source

pub const fn from_v2i(v: v2i, z: i32) -> Self

Creates a new vector from the given 2-component vector

source

pub const fn to_array(&self) -> [i32; 3]

Converts the vector into an array

source

pub fn to_float(&self) -> Vector3f

Casts this vector into a floating point vector

source

pub const fn as_array(&self) -> &[i32; 3]

Returns an array reference to the vector

source

pub fn as_mut_array(&mut self) -> &mut [i32; 3]

Returns a mutable array reference to the vector

source§

impl Vector3i

source

pub fn abs(self) -> Self

Returns a vector with each component set to the absolute value of the corresponding component in this vector

source

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

Returns a vector with each component set to the minimum of the corresponding components between this vector and rhs

source

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

Returns a vector with each component set to the maximum of the corresponding components between this vector and rhs

§

impl Vector3i

pub fn xx(&self) -> Vector2i

pub fn xy(&self) -> Vector2i

pub fn xz(&self) -> Vector2i

pub fn yx(&self) -> Vector2i

pub fn yy(&self) -> Vector2i

pub fn yz(&self) -> Vector2i

pub fn zx(&self) -> Vector2i

pub fn zy(&self) -> Vector2i

pub fn zz(&self) -> Vector2i

pub fn xxx(&self) -> Vector3i

pub fn xxy(&self) -> Vector3i

pub fn xxz(&self) -> Vector3i

pub fn xyx(&self) -> Vector3i

pub fn xyy(&self) -> Vector3i

pub fn xyz(&self) -> Vector3i

pub fn xzx(&self) -> Vector3i

pub fn xzy(&self) -> Vector3i

pub fn xzz(&self) -> Vector3i

pub fn yxx(&self) -> Vector3i

pub fn yxy(&self) -> Vector3i

pub fn yxz(&self) -> Vector3i

pub fn yyx(&self) -> Vector3i

pub fn yyy(&self) -> Vector3i

pub fn yyz(&self) -> Vector3i

pub fn yzx(&self) -> Vector3i

pub fn yzy(&self) -> Vector3i

pub fn yzz(&self) -> Vector3i

pub fn zxx(&self) -> Vector3i

pub fn zxy(&self) -> Vector3i

pub fn zxz(&self) -> Vector3i

pub fn zyx(&self) -> Vector3i

pub fn zyy(&self) -> Vector3i

pub fn zyz(&self) -> Vector3i

pub fn zzx(&self) -> Vector3i

pub fn zzy(&self) -> Vector3i

pub fn zzz(&self) -> Vector3i

pub fn xxxx(&self) -> Vector4i

pub fn xxxy(&self) -> Vector4i

pub fn xxxz(&self) -> Vector4i

pub fn xxyx(&self) -> Vector4i

pub fn xxyy(&self) -> Vector4i

pub fn xxyz(&self) -> Vector4i

pub fn xxzx(&self) -> Vector4i

pub fn xxzy(&self) -> Vector4i

pub fn xxzz(&self) -> Vector4i

pub fn xyxx(&self) -> Vector4i

pub fn xyxy(&self) -> Vector4i

pub fn xyxz(&self) -> Vector4i

pub fn xyyx(&self) -> Vector4i

pub fn xyyy(&self) -> Vector4i

pub fn xyyz(&self) -> Vector4i

pub fn xyzx(&self) -> Vector4i

pub fn xyzy(&self) -> Vector4i

pub fn xyzz(&self) -> Vector4i

pub fn xzxx(&self) -> Vector4i

pub fn xzxy(&self) -> Vector4i

pub fn xzxz(&self) -> Vector4i

pub fn xzyx(&self) -> Vector4i

pub fn xzyy(&self) -> Vector4i

pub fn xzyz(&self) -> Vector4i

pub fn xzzx(&self) -> Vector4i

pub fn xzzy(&self) -> Vector4i

pub fn xzzz(&self) -> Vector4i

pub fn yxxx(&self) -> Vector4i

pub fn yxxy(&self) -> Vector4i

pub fn yxxz(&self) -> Vector4i

pub fn yxyx(&self) -> Vector4i

pub fn yxyy(&self) -> Vector4i

pub fn yxyz(&self) -> Vector4i

pub fn yxzx(&self) -> Vector4i

pub fn yxzy(&self) -> Vector4i

pub fn yxzz(&self) -> Vector4i

pub fn yyxx(&self) -> Vector4i

pub fn yyxy(&self) -> Vector4i

pub fn yyxz(&self) -> Vector4i

pub fn yyyx(&self) -> Vector4i

pub fn yyyy(&self) -> Vector4i

pub fn yyyz(&self) -> Vector4i

pub fn yyzx(&self) -> Vector4i

pub fn yyzy(&self) -> Vector4i

pub fn yyzz(&self) -> Vector4i

pub fn yzxx(&self) -> Vector4i

pub fn yzxy(&self) -> Vector4i

pub fn yzxz(&self) -> Vector4i

pub fn yzyx(&self) -> Vector4i

pub fn yzyy(&self) -> Vector4i

pub fn yzyz(&self) -> Vector4i

pub fn yzzx(&self) -> Vector4i

pub fn yzzy(&self) -> Vector4i

pub fn yzzz(&self) -> Vector4i

pub fn zxxx(&self) -> Vector4i

pub fn zxxy(&self) -> Vector4i

pub fn zxxz(&self) -> Vector4i

pub fn zxyx(&self) -> Vector4i

pub fn zxyy(&self) -> Vector4i

pub fn zxyz(&self) -> Vector4i

pub fn zxzx(&self) -> Vector4i

pub fn zxzy(&self) -> Vector4i

pub fn zxzz(&self) -> Vector4i

pub fn zyxx(&self) -> Vector4i

pub fn zyxy(&self) -> Vector4i

pub fn zyxz(&self) -> Vector4i

pub fn zyyx(&self) -> Vector4i

pub fn zyyy(&self) -> Vector4i

pub fn zyyz(&self) -> Vector4i

pub fn zyzx(&self) -> Vector4i

pub fn zyzy(&self) -> Vector4i

pub fn zyzz(&self) -> Vector4i

pub fn zzxx(&self) -> Vector4i

pub fn zzxy(&self) -> Vector4i

pub fn zzxz(&self) -> Vector4i

pub fn zzyx(&self) -> Vector4i

pub fn zzyy(&self) -> Vector4i

pub fn zzyz(&self) -> Vector4i

pub fn zzzx(&self) -> Vector4i

pub fn zzzy(&self) -> Vector4i

pub fn zzzz(&self) -> Vector4i

Trait Implementations§

source§

impl Add<Vector3i> for Vector3i

§

type Output = Vector3i

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl Add<i32> for Vector3i

§

type Output = Vector3i

The resulting type after applying the + operator.
source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<Vector3i> for Vector3i

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl AddAssign<i32> for Vector3i

source§

fn add_assign(&mut self, rhs: i32)

Performs the += operation. Read more
source§

impl AsMut<[i32; 3]> for Vector3i

source§

fn as_mut(&mut self) -> &mut [i32; 3]

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

impl AsRef<[i32; 3]> for Vector3i

source§

fn as_ref(&self) -> &[i32; 3]

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

impl Borrow<[i32; 3]> for Vector3i

source§

fn borrow(&self) -> &[i32; 3]

Immutably borrows from an owned value. Read more
source§

impl BorrowMut<[i32; 3]> for Vector3i

source§

fn borrow_mut(&mut self) -> &mut [i32; 3]

Mutably borrows from an owned value. Read more
source§

impl Clone for Vector3i

source§

fn clone(&self) -> Vector3i

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 Debug for Vector3i

source§

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

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

impl Display for Vector3i

source§

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

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

impl Div<Vector3i> for Vector3i

§

type Output = Vector3i

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl Div<i32> for Vector3i

§

type Output = Vector3i

The resulting type after applying the / operator.
source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign<Vector3i> for Vector3i

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl DivAssign<i32> for Vector3i

source§

fn div_assign(&mut self, rhs: i32)

Performs the /= operation. Read more
source§

impl From<[i32; 3]> for Vector3i

source§

fn from(a: [i32; 3]) -> Self

Converts to this type from the input type.
source§

impl Hash for Vector3i

source§

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

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 Index<usize> for Vector3i

§

type Output = i32

The returned type after indexing.
source§

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

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

impl IndexMut<usize> for Vector3i

source§

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

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

impl Into<[i32; 3]> for Vector3i

source§

fn into(self) -> [i32; 3]

Converts this type into the (usually inferred) input type.
source§

impl Mul<Vector3i> for Vector3i

§

type Output = Vector3i

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<i32> for Vector3i

§

type Output = Vector3i

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign<Vector3i> for Vector3i

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl MulAssign<i32> for Vector3i

source§

fn mul_assign(&mut self, rhs: i32)

Performs the *= operation. Read more
source§

impl Neg for Vector3i

§

type Output = Vector3i

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl PartialEq<Vector3i> for Vector3i

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 Rem<Vector3i> for Vector3i

§

type Output = Vector3i

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl Rem<i32> for Vector3i

§

type Output = Vector3i

The resulting type after applying the % operator.
source§

fn rem(self, rhs: i32) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign<Vector3i> for Vector3i

source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
source§

impl RemAssign<i32> for Vector3i

source§

fn rem_assign(&mut self, rhs: i32)

Performs the %= operation. Read more
source§

impl Sub<Vector3i> for Vector3i

§

type Output = Vector3i

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<i32> for Vector3i

§

type Output = Vector3i

The resulting type after applying the - operator.
source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<Vector3i> for Vector3i

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl SubAssign<i32> for Vector3i

source§

fn sub_assign(&mut self, rhs: i32)

Performs the -= operation. Read more
source§

impl Zeroable for Vector3i

source§

fn zeroed() -> Self

source§

impl Copy for Vector3i

source§

impl Eq for Vector3i

source§

impl Pod for Vector3i

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for Twhere 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

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> NoUninit for Twhere T: Pod,