refactor(scenegraph): use RcCell<Node> instead of Rc<RefCell<Node>>

This commit is contained in:
Nova
2022-05-22 10:11:55 -04:00
parent 323d1e01fe
commit 73a0c6ff7a
5 changed files with 37 additions and 17 deletions

View File

@@ -1,15 +1,16 @@
use super::core::{Node, NodeRef};
use super::core::{Node, NodeData, NodeRef};
use crate::core::client::Client;
use anyhow::Result;
use vek::mat::repr_c::row_major::Mat4;
pub struct Spatial {
pub struct Spatial<'a> {
node: &'a Node<'a>,
transform: Mat4<f32>,
}
impl<'a> Spatial {
pub fn new(transform: Mat4<f32>) -> Self {
Spatial { transform }
impl<'a> Spatial<'a> {
pub fn new(node: &'a Node<'a>, transform: Mat4<f32>) -> Self {
Spatial { node, transform }
}
pub fn new_node(