Vector6

Type Alias Vector6 

Source
pub type Vector6<T> = Matrix<T, Const<6>, Const<1>, ArrayStorage<T, 6, 1>>;
Expand description

A stack-allocated, 6-dimensional column vector.

Aliased Type§

pub struct Vector6<T> {
    pub data: ArrayStorage<T, 6, 1>,
    /* private fields */
}

Fields§

§data: ArrayStorage<T, 6, 1>

The data storage that contains all the matrix components. Disappointed?

Well, if you came here to see how you can access the matrix components, you may be in luck: you can access the individual components of all vectors with compile-time dimensions <= 6 using field notation like this: vec.x, vec.y, vec.z, vec.w, vec.a, vec.b. Reference and assignation work too:

let mut vec = Vector3::new(1.0, 2.0, 3.0);
vec.x = 10.0;
vec.y += 30.0;
assert_eq!(vec.x, 10.0);
assert_eq!(vec.y + 100.0, 132.0);

Similarly, for matrices with compile-time dimensions <= 6, you can use field notation like this: mat.m11, mat.m42, etc. The first digit identifies the row to address and the second digit identifies the column to address. So mat.m13 identifies the component at the first row and third column (note that the count of rows and columns start at 1 instead of 0 here. This is so we match the mathematical notation).

For all matrices and vectors, independently from their size, individual components can be accessed and modified using indexing: vec[20], mat[(20, 19)]. Here the indexing starts at 0 as you would expect.

Trait Implementations§

Source§

impl<T: Scalar> AsPnt<OPoint<T, Const<6>>> for Vector6<T>

Source§

fn as_pnt(&self) -> &Point6<T>

Source§

impl<N: BaseNum> NumVec for Vector6<N>

Source§

type Field = N

Source§

impl<T: Scalar> Swizzles2<T> for Vector6<T>

Source§

type Swizzle2 = Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

Source§

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

Source§

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

Source§

impl<T: Scalar> Swizzles2Mut<T> for Vector6<T>

Source§

fn set_xy(&mut self, right: &Vector2<T>)

Source§

fn set_yx(&mut self, right: &Vector2<T>)

Source§

impl<T: Scalar> Swizzles3<T> for Vector6<T>

Source§

type Swizzle3 = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn yz(&self) -> Self::Swizzle2

Source§

fn xz(&self) -> Self::Swizzle2

Source§

fn zy(&self) -> Self::Swizzle2

Source§

fn zx(&self) -> Self::Swizzle2

Source§

impl<T: Scalar> Swizzles3Mut<T> for Vector6<T>

Source§

fn set_xyz(&mut self, right: &Vector3<T>)

Source§

fn set_xzy(&mut self, right: &Vector3<T>)

Source§

fn set_yxz(&mut self, right: &Vector3<T>)

Source§

fn set_yzx(&mut self, right: &Vector3<T>)

Source§

fn set_zxy(&mut self, right: &Vector3<T>)

Source§

fn set_zyx(&mut self, right: &Vector3<T>)

Source§

fn set_yz(&mut self, right: &Self::Swizzle2)

Source§

fn set_xz(&mut self, right: &Self::Swizzle2)

Source§

fn set_zy(&mut self, right: &Self::Swizzle2)

Source§

fn set_zx(&mut self, right: &Self::Swizzle2)

Source§

impl<T: Scalar> Swizzles4<T> for Vector6<T>

Source§

type Swizzle4 = Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>

Source§

fn xyzw(&self) -> Self::Swizzle4

Source§

fn xyw(&self) -> Self::Swizzle3

Source§

fn yxw(&self) -> Self::Swizzle3

Source§

fn wxy(&self) -> Self::Swizzle3

Source§

fn wyx(&self) -> Self::Swizzle3

Source§

fn yzw(&self) -> Self::Swizzle3

Source§

fn zyw(&self) -> Self::Swizzle3

Source§

fn wyz(&self) -> Self::Swizzle3

Source§

fn wzy(&self) -> Self::Swizzle3

Source§

fn xzw(&self) -> Self::Swizzle3

Source§

fn zxw(&self) -> Self::Swizzle3

Source§

fn wxz(&self) -> Self::Swizzle3

Source§

fn wzx(&self) -> Self::Swizzle3

Source§

fn xw(&self) -> Self::Swizzle2

Source§

fn yw(&self) -> Self::Swizzle2

Source§

fn zw(&self) -> Self::Swizzle2

Source§

fn wx(&self) -> Self::Swizzle2

Source§

fn wy(&self) -> Self::Swizzle2

Source§

fn wz(&self) -> Self::Swizzle2

Source§

impl<T: Scalar> Swizzles4Mut<T> for Vector6<T>

Source§

fn set_xyzw(&mut self, right: &Self::Swizzle4)

Source§

fn set_xyw(&mut self, right: &Self::Swizzle3)

Source§

fn set_yxw(&mut self, right: &Self::Swizzle3)

Source§

fn set_wxy(&mut self, right: &Self::Swizzle3)

Source§

fn set_wyx(&mut self, right: &Self::Swizzle3)

Source§

fn set_yzw(&mut self, right: &Self::Swizzle3)

Source§

fn set_zyw(&mut self, right: &Self::Swizzle3)

Source§

fn set_wyz(&mut self, right: &Self::Swizzle3)

Source§

fn set_wzy(&mut self, right: &Self::Swizzle3)

Source§

fn set_xzw(&mut self, right: &Self::Swizzle3)

Source§

fn set_zxw(&mut self, right: &Self::Swizzle3)

Source§

fn set_wxz(&mut self, right: &Self::Swizzle3)

Source§

fn set_wzx(&mut self, right: &Self::Swizzle3)

Source§

fn set_xw(&mut self, right: &Self::Swizzle2)

Source§

fn set_yw(&mut self, right: &Self::Swizzle2)

Source§

fn set_zw(&mut self, right: &Self::Swizzle2)

Source§

fn set_wx(&mut self, right: &Self::Swizzle2)

Source§

fn set_wy(&mut self, right: &Self::Swizzle2)

Source§

fn set_wz(&mut self, right: &Self::Swizzle2)

Source§

impl<T: Scalar> ToPnt<OPoint<T, Const<6>>> for Vector6<T>

Source§

fn to_pnt(self) -> Point6<T>

Source§

impl<N: BaseNum + RealField> FloatVec for Vector6<N>