fix(spatial): set spatial parent in place correct reference space

This commit is contained in:
Nova
2022-09-05 01:22:09 -04:00
parent e5062a4bbb
commit d23d974e34
2 changed files with 4 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ use std::sync::{Arc, Weak};
pub struct Spatial {
pub(super) node: Weak<Node>,
parent: Mutex<Option<Arc<Spatial>>>,
transform: Mutex<Mat4>,
pub(super) transform: Mutex<Mat4>,
}
impl Spatial {
@@ -135,7 +135,7 @@ impl Spatial {
}
self.set_local_transform(Spatial::space_to_space_matrix(
self.parent.lock().as_deref(),
Some(self),
parent.cloned().as_deref(),
));
*self.parent.lock() = parent.cloned();