Struct Vector4

Source
#[repr(C)]
pub struct Vector4<T> { pub x: T, pub y: T, pub z: T, pub w: T, }

Fields§

§x: T§y: T§z: T§w: T

Implementations§

Source§

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

Source

pub fn new(x: T, y: T, z: T, w: T) -> Vector4<T>

Trait Implementations§

Source§

impl<T> Add for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Vector4<T>) -> <Vector4<T> as Add>::Output

Performs the + operation. Read more
Source§

impl AttributeDataTypeGetter for Vector4<f32>

Source§

impl AttributeDataTypeGetter for Vector4<i16>

Source§

impl AttributeDataTypeGetter for Vector4<i32>

Source§

impl AttributeDataTypeGetter for Vector4<i8>

Source§

impl AttributeDataTypeGetter for Vector4<u32>

Source§

impl AttributeDataTypeGetter for Vector4<u8>

Source§

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

Source§

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

Returns a duplicate 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> Debug for Vector4<T>
where T: Debug,

Source§

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

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

impl<T> Default for Vector4<T>
where T: Default,

Source§

fn default() -> Vector4<T>

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

impl<T> Div<T> for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> <Vector4<T> as Div<T>>::Output

Performs the / operation. Read more
Source§

impl<T> Div for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Vector4<T>) -> <Vector4<T> as Div>::Output

Performs the / operation. Read more
Source§

impl<T> FloatVector<T> for Vector4<T>
where T: FloatScalar,

Source§

fn length(&self) -> T

Source§

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

Source§

fn distance(l: &Vector4<T>, r: &Vector4<T>) -> T

Source§

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

Source§

type Output = Vector4<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T> Mul<T> for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = Vector4<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T> Mul for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = Vector4<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> <Vector4<T> as Neg>::Output

Performs the unary - operation. Read more
Source§

impl<T> Rem<T> for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: T) -> <Vector4<T> as Rem<T>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Vector4<T>) -> <Vector4<T> as Rem>::Output

Performs the % operation. Read more
Source§

impl<T> Sub for Vector4<T>
where T: Scalar,

Source§

type Output = Vector4<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Vector4<T>) -> <Vector4<T> as Sub>::Output

Performs the - operation. Read more
Source§

impl<T> Swizzle2<T> for Vector4<T>
where T: Scalar,

Source§

fn xx(&self) -> Vector2<T>

Source§

fn xy(&self) -> Vector2<T>

Source§

fn xz(&self) -> Vector2<T>

Source§

fn yx(&self) -> Vector2<T>

Source§

fn yy(&self) -> Vector2<T>

Source§

fn yz(&self) -> Vector2<T>

Source§

fn zx(&self) -> Vector2<T>

Source§

fn zy(&self) -> Vector2<T>

Source§

fn zz(&self) -> Vector2<T>

Source§

impl<T> Swizzle3<T> for Vector4<T>
where T: Scalar,

Source§

fn xxx(&self) -> Vector3<T>

Source§

fn xxy(&self) -> Vector3<T>

Source§

fn xxz(&self) -> Vector3<T>

Source§

fn xyx(&self) -> Vector3<T>

Source§

fn xyy(&self) -> Vector3<T>

Source§

fn xyz(&self) -> Vector3<T>

Source§

fn xzx(&self) -> Vector3<T>

Source§

fn xzy(&self) -> Vector3<T>

Source§

fn xzz(&self) -> Vector3<T>

Source§

fn yxx(&self) -> Vector3<T>

Source§

fn yxy(&self) -> Vector3<T>

Source§

fn yxz(&self) -> Vector3<T>

Source§

fn yyx(&self) -> Vector3<T>

Source§

fn yyy(&self) -> Vector3<T>

Source§

fn yyz(&self) -> Vector3<T>

Source§

fn yzx(&self) -> Vector3<T>

Source§

fn yzy(&self) -> Vector3<T>

Source§

fn yzz(&self) -> Vector3<T>

Source§

fn zxx(&self) -> Vector3<T>

Source§

fn zxy(&self) -> Vector3<T>

Source§

fn zxz(&self) -> Vector3<T>

Source§

fn zyx(&self) -> Vector3<T>

Source§

fn zyy(&self) -> Vector3<T>

Source§

fn zyz(&self) -> Vector3<T>

Source§

fn zzx(&self) -> Vector3<T>

Source§

fn zzy(&self) -> Vector3<T>

Source§

fn zzz(&self) -> Vector3<T>

Source§

impl UniformDataTypeGetter for Vector4<f32>

Source§

impl UniformDataTypeGetter for Vector4<i32>

Source§

impl UniformDataTypeGetter for Vector4<u32>

Source§

impl<T> Vector<T> for Vector4<T>
where T: Scalar,

Source§

fn zero() -> Vector4<T>

Source§

fn dot(l: &Vector4<T>, r: &Vector4<T>) -> T

Source§

fn add_vv(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn sub_vv(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn mul_vv(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn div_vv(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn mul_vs(l: &Vector4<T>, r: T) -> Vector4<T>

Source§

fn div_vs(l: &Vector4<T>, r: T) -> Vector4<T>

Source§

fn rem_vv(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn min(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

fn max(l: &Vector4<T>, r: &Vector4<T>) -> Vector4<T>

Source§

impl<T> Copy for Vector4<T>
where T: Copy,

Auto Trait Implementations§

§

impl<T> Freeze for Vector4<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Vector4<T>
where T: RefUnwindSafe,

§

impl<T> Send for Vector4<T>
where T: Send,

§

impl<T> Sync for Vector4<T>
where T: Sync,

§

impl<T> Unpin for Vector4<T>
where T: Unpin,

§

impl<T> UnwindSafe for Vector4<T>
where T: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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,

Source§

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

Source§

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

Source§

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.