feat: model nodes

This commit is contained in:
Nova
2023-05-10 08:38:21 -04:00
parent 3e0860073d
commit ee5a226c5e
6 changed files with 212 additions and 99 deletions

View File

@@ -72,6 +72,10 @@ impl Spatial {
Ok(spatial)
}
pub fn node(&self) -> Option<Arc<Node>> {
self.node.upgrade()
}
#[instrument(level = "debug", skip_all)]
pub fn space_to_space_matrix(from: Option<&Spatial>, to: Option<&Spatial>) -> Mat4 {
let space_to_world_matrix = from.map_or(Mat4::IDENTITY, |from| from.global_transform());