vec3: helper to create a Vec3 from a single f32.
This commit is contained in:
parent
2d91f781f3
commit
54e72cd81d
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user