refactor(scenegraph): remove new function
This commit is contained in:
@@ -13,11 +13,10 @@ impl<'a> Client<'a> {
|
|||||||
pub fn from_connection(connection: UnixStream) -> RcCell<Self> {
|
pub fn from_connection(connection: UnixStream) -> RcCell<Self> {
|
||||||
let client = RcCell::new(Client {
|
let client = RcCell::new(Client {
|
||||||
weak_ref: WeakCell::new(),
|
weak_ref: WeakCell::new(),
|
||||||
scenegraph: None,
|
scenegraph: Default::default(),
|
||||||
messenger: Messenger::new(connection),
|
messenger: Messenger::new(connection),
|
||||||
});
|
});
|
||||||
client.borrow_mut().weak_ref = client.downgrade();
|
client.borrow_mut().weak_ref = client.downgrade();
|
||||||
client.borrow_mut().scenegraph = Some(Scenegraph::new(client.clone()));
|
|
||||||
client
|
client
|
||||||
}
|
}
|
||||||
pub fn dispatch(&self) -> Result<(), std::io::Error> {
|
pub fn dispatch(&self) -> Result<(), std::io::Error> {
|
||||||
|
|||||||
@@ -11,17 +11,6 @@ pub struct Scenegraph<'a> {
|
|||||||
pub nodes: HashMap<String, RcCell<Node<'a>>>,
|
pub nodes: HashMap<String, RcCell<Node<'a>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Scenegraph<'a> {
|
|
||||||
pub fn new(client: RcCell<Client<'a>>) -> Self {
|
|
||||||
// root: Spatial::new(Some(client), "/", Default::default()),
|
|
||||||
// hmd: Spatial::new(Some(client), "/hmd", Default::default()),
|
|
||||||
Scenegraph {
|
|
||||||
client: client.downgrade(),
|
|
||||||
nodes: HashMap::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Default for Scenegraph<'a> {
|
impl<'a> Default for Scenegraph<'a> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Scenegraph {
|
Scenegraph {
|
||||||
|
|||||||
Reference in New Issue
Block a user