Swizzle2

Trait Swizzle2 

Source
pub trait Swizzle2<T: Scalar> {
    // Required methods
    fn xx(&self) -> Vector2<T>;
    fn xy(&self) -> Vector2<T>;
    fn xz(&self) -> Vector2<T>;
    fn yx(&self) -> Vector2<T>;
    fn yy(&self) -> Vector2<T>;
    fn yz(&self) -> Vector2<T>;
    fn zx(&self) -> Vector2<T>;
    fn zy(&self) -> Vector2<T>;
    fn zz(&self) -> Vector2<T>;
}
Expand description

Trait for 2D swizzle operations on vectors.

Provides methods to rearrange and duplicate vector components into 2D vectors using familiar shader-style syntax.

Required Methods§

Source

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

Returns a vector with components (x, x).

Source

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

Returns a vector with components (x, y).

Source

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

Returns a vector with components (x, z).

Source

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

Returns a vector with components (y, x).

Source

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

Returns a vector with components (y, y).

Source

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

Returns a vector with components (y, z).

Source

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

Returns a vector with components (z, x).

Source

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

Returns a vector with components (z, y).

Source

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

Returns a vector with components (z, z).

Implementors§

Source§

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

Source§

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

Source§

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