Struct rs_math3d::vector::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: Scalar> Vector4<T>

source

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

Trait Implementations§

source§

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

§

type Output = Vector4<T>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

source§

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

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<T: Debug> Debug for Vector4<T>

source§

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

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

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

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,

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

source§

fn length(&self) -> T

source§

fn normalize(&self) -> Self

source§

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

source§

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

§

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,

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

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 Mul<Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

§

type Output = Vector4<T>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

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: Scalar> Swizzle3<T> for Vector4<T>

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<T: Scalar> Vector<T> for Vector4<T>

source§

fn zero() -> Self

source§

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

source§

fn add_vv(l: &Self, r: &Self) -> Self

source§

fn sub_vv(l: &Self, r: &Self) -> Self

source§

fn mul_vv(l: &Self, r: &Self) -> Self

source§

fn div_vv(l: &Self, r: &Self) -> Self

source§

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

source§

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

source§

fn rem_vv(l: &Self, r: &Self) -> Self

source§

fn min(l: &Self, r: &Self) -> Self

source§

fn max(l: &Self, r: &Self) -> Self

source§

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

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

§

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

§

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

§

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.