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
use super::Vector3;
use binrw::BinRead;

#[derive(Debug, PartialEq, BinRead, Clone)]
pub struct Matrix33 {
    pub column_major: [f32; 9],
}

impl From<&Matrix33> for glam::Mat3 {
    fn from(val: &Matrix33) -> Self {
        glam::Mat3::from_cols_array(&val.column_major).transpose()
    }
}

impl From<Matrix33> for glam::Mat3 {
    fn from(val: Matrix33) -> Self {
        (&val).into()
    }
}

#[derive(Debug, PartialEq, BinRead)]
pub struct NiTransform {
    pub rotation: Matrix33,
    pub translation: Vector3,
    pub scale: f32,
}