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

@@ -14,16 +14,13 @@ lazy_static::lazy_static! {
fn create() -> Arc<Node> {
let node = Arc::new(Node::create_parent_name(&INTERNAL_CLIENT, "", "hmd", false));
Spatial::add_to(&node, None, Mat4::IDENTITY, false).expect("Unable to make spatial for HMD");
Spatial::add_to(&node, None, Mat4::IDENTITY, false);
node
}
pub fn frame(sk: &impl StereoKitMultiThread) {
let spatial = HMD
.spatial
.get()
.expect("Unable to get spatial to update HMD");
let spatial = HMD.get_aspect::<Spatial>().unwrap();
let hmd_pose = sk.input_head();
*spatial.transform.lock() = Mat4::from_scale_rotation_translation(
vec3(1.0, 1.0, 1.0),