From c8c6b125a3a098caa8b6d5c980ca3ee5b3b61870 Mon Sep 17 00:00:00 2001 From: Nova Date: Fri, 24 Jun 2022 21:20:42 -0400 Subject: [PATCH] feat(spatial): store node --- src/nodes/spatial.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nodes/spatial.rs b/src/nodes/spatial.rs index a6e4ad0..92404f2 100644 --- a/src/nodes/spatial.rs +++ b/src/nodes/spatial.rs @@ -6,10 +6,10 @@ use libstardustxr::flex::flexbuffer_from_vector_arguments; use libstardustxr::push_to_vec; use libstardustxr::{flex_to_quat, flex_to_vec3}; use parking_lot::Mutex; -use std::sync::Arc; +use std::sync::{Arc, Weak}; pub struct Spatial { - // node: Weak, + pub(super) node: Weak, parent: Mutex>>, transform: Mutex, } @@ -25,7 +25,7 @@ impl Spatial { "Internal: Node already has a Spatial aspect!" ); let spatial = Spatial { - // node: node.downgrade(), + node: Arc::downgrade(node), parent: Mutex::new(parent), transform: Mutex::new(transform), };