update threed

This commit is contained in:
Robin Appelman 2022-12-06 16:21:03 +01:00
commit 89529579be
4 changed files with 133 additions and 102 deletions

View file

@ -3,7 +3,7 @@ use arrayvec::ArrayString;
use bytemuck::{Pod, Zeroable};
use std::fmt;
use std::fmt::{Display, Formatter};
use std::ops::Add;
use std::ops::{Add, Mul};
use cgmath::Vector3;
#[derive(Debug, Clone, Copy, Zeroable, Pod)]
@ -74,6 +74,18 @@ impl Add<Vector> for Vector {
}
}
impl Mul<f32> for Vector {
type Output = Vector;
fn mul(self, rhs: f32) -> Self::Output {
Self {
x: self.x * rhs,
y: self.y * rhs,
z: self.z * rhs,
}
}
}
#[derive(Debug, Clone, Copy, Zeroable, Pod)]
#[repr(C)]
pub struct Quaternion {