feat(node): add NodeRef type
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
use super::core::Node;
|
||||
use super::core::{Node, NodeRef};
|
||||
use crate::core::client::Client;
|
||||
use anyhow::Result;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Weak;
|
||||
use vek::mat::repr_c::row_major::Mat4;
|
||||
|
||||
pub struct Spatial {
|
||||
@@ -18,7 +16,7 @@ impl<'a> Spatial {
|
||||
client: Option<&'a mut Client<'a>>,
|
||||
path: &str,
|
||||
transform: Mat4<f32>,
|
||||
) -> Result<Weak<RefCell<Node<'a>>>> {
|
||||
) -> Result<NodeRef<'a>> {
|
||||
let node = Node::from_path(client, path)?;
|
||||
node.upgrade().unwrap().borrow_mut().spatial = Some(Spatial::new(transform));
|
||||
Ok(node)
|
||||
|
||||
Reference in New Issue
Block a user