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

@@ -109,9 +109,10 @@ impl Model {
material_parameters.clear();
}
let global_transform = self.space.global_transform().into();
sk_model.draw(
draw_ctx,
self.space.global_transform().into(),
global_transform,
Rgba::new(Rgb::new(1_f32, 1_f32, 1_f32), 1_f32),
RenderLayer::Layer0,
);

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();