vec3: helper to create a Vec3 from a single f32.

This commit is contained in:
Bill Thiede 2023-01-15 11:54:48 -08:00
parent 2d91f781f3
commit 54e72cd81d

View File

@ -57,6 +57,12 @@ impl Vec3 {
}
}
impl From<f32> for Vec3 {
fn from(v: f32) -> Self {
Vec3 { x: v, y: v, z: v }
}
}
impl From<[f32; 3]> for Vec3 {
fn from(v: [f32; 3]) -> Self {
Vec3 {