pub trait Swizzle<T: Unit> {
// Required methods
fn swizzle2<const X: usize, const Y: usize>(&self) -> Vector2<T>;
fn swizzle3<const X: usize, const Y: usize, const Z: usize>(
&self
) -> Vector3<T>;
fn swizzle4<const X: usize, const Y: usize, const Z: usize, const W: usize>(
&self
) -> Vector4<T>;
}
Expand description
Vector swizzling by const generics.
For GLSL-like swizzling, see glam::Vec2Swizzles
, glam::Vec3Swizzles
,
or glam::Vec4Swizzles
.
Required Methods§
sourcefn swizzle2<const X: usize, const Y: usize>(&self) -> Vector2<T>
fn swizzle2<const X: usize, const Y: usize>(&self) -> Vector2<T>
Select two components from this vector and return a 2D vector made from those components.
Object Safety§
This trait is not object safe.