refactor: use typemap for aspects!

This commit is contained in:
Nova
2024-02-05 05:09:48 -05:00
parent 36dacb3322
commit d4b7c3f61a
36 changed files with 518 additions and 528 deletions

View File

@@ -49,7 +49,7 @@ impl ClientState {
}
fn spatial_transform(client: &Client, path: &str) -> Option<Mat4> {
let node = client.scenegraph.get_node(path)?;
let spatial = node.spatial.get()?;
let spatial = node.get_aspect::<Spatial>().ok()?;
Some(spatial.global_transform())
}
@@ -81,7 +81,7 @@ impl ClientState {
let node = Node::create_parent_name(client, "/spatial/anchor", k, true)
.add_to_scenegraph()
.unwrap();
Spatial::add_to(&node, None, *v, false).unwrap();
Spatial::add_to(&node, None, *v, false);
k.clone()
})
})