feat(spatial): space to space matrix function for relativity

This commit is contained in:
Nova
2022-06-10 20:17:14 -04:00
parent 50b7cc676c
commit 459c96616a

View File

@@ -77,7 +77,11 @@ impl<'a> Spatial<'a> {
todo!()
}
// pub fn relative_transform(&self, space: WeakCell<Spatial>) {}
pub fn space_to_space_matrix(from: &Spatial, to: &Spatial) -> Mat4 {
let space_to_world_matrix = from.global_transform();
let world_to_space_matrix = to.global_transform().inverse();
world_to_space_matrix * space_to_world_matrix
}
}
pub fn create_interface(client: Rc<Client>) {