feat: root node
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::scenegraph::Scenegraph;
|
||||
use crate::nodes::field;
|
||||
use crate::nodes::root;
|
||||
use crate::nodes::spatial;
|
||||
use libstardustxr::messenger::Messenger;
|
||||
use mio::net::UnixStream;
|
||||
@@ -17,6 +18,7 @@ impl Client {
|
||||
scenegraph: Default::default(),
|
||||
});
|
||||
let _ = client.scenegraph.client.set(Arc::downgrade(&client));
|
||||
root::create_root(&client);
|
||||
spatial::create_interface(&client);
|
||||
field::create_interface(&client);
|
||||
client
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod root;
|
||||
pub mod core;
|
||||
pub mod data;
|
||||
pub mod field;
|
||||
|
||||
11
src/nodes/root.rs
Normal file
11
src/nodes/root.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use super::core::Node;
|
||||
use super::spatial::Spatial;
|
||||
use crate::core::client::Client;
|
||||
use glam::Mat4;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub fn create_root(client: &Arc<Client>) {
|
||||
let node = Node::create("", "", false);
|
||||
let node = client.scenegraph.add_node(node);
|
||||
let _ = Spatial::add_to(&node, None, Mat4::IDENTITY);
|
||||
}
|
||||
Reference in New Issue
Block a user