1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::*;
#[derive(Debug, Clone, Copy)]
#[repr(transparent)]
pub struct Vec3 {
raw: Vec4,
}
unsafe impl Zeroable for Vec3 {}
unsafe impl Pod for Vec3 {}
impl Default for Vec3 {
fn default() -> Self {
Self::zeroed()
}
}
impl From<[f32; 3]> for Vec3 {
fn from(val: [f32; 3]) -> Self {
Self {
raw: cast([val[0], val[1], val[2], 0.0]),
}
}
}
impl Vec3 {
pub fn abs(self) -> Self {
Self {
raw: self.raw.abs(),
}
}
}