pub type Vec4<T = f32> = Vector<T, 4>;
Expand description
A 4D vector
Aliased Type§
struct Vec4<T = f32>(/* private fields */);
Implementations§
source§impl<T: Copy + NumAssign> Vec4<T>
impl<T: Copy + NumAssign> Vec4<T>
sourcepub fn from_vec3(v: Vec3<T>, w: T) -> Self
pub fn from_vec3(v: Vec3<T>, w: T) -> Self
Creates a new Vec4
from a Vec3
and w component.
§Examples
let v = Vec3::<i32>::from_slice(&[2, 3, 4]);
assert_eq!(*Vec4::<i32>::from_vec3(v, 1).as_ref(), [2, 3, 4, 1]);