diff --git a/Cargo.lock b/Cargo.lock index 5119656..db75df7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,15 +95,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "color-cube" -version = "0.1.0" -dependencies = [ - "stardust-xr-fusion", - "stardust-xr-molecules", - "tokio", -] - [[package]] name = "color-eyre" version = "0.6.3" @@ -144,6 +135,16 @@ dependencies = [ "tracing-error", ] +[[package]] +name = "color_cube" +version = "0.1.0" +dependencies = [ + "manifest-dir-macros", + "stardust-xr-fusion", + "stardust-xr-molecules", + "tokio", +] + [[package]] name = "convert_case" version = "0.6.0" diff --git a/Cargo.toml b/Cargo.toml index fcef42b..90faa15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [package] -name = "color-cube" +name = "color_cube" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +manifest-dir-macros = "0.1.18" stardust-xr-fusion = { git = "https://github.com/StardustXR/core" } stardust-xr-molecules = { git = "https://github.com/StardustXR/molecules" } tokio = { version = "1.37.0", features = ["full"] } diff --git a/res/color_cube/color_cube.blend b/res/color_cube/color_cube.blend new file mode 100644 index 0000000..7add51d Binary files /dev/null and b/res/color_cube/color_cube.blend differ diff --git a/res/color_cube/color_cube.glb b/res/color_cube/color_cube.glb new file mode 100644 index 0000000..ae860c5 Binary files /dev/null and b/res/color_cube/color_cube.glb differ diff --git a/src/main.rs b/src/main.rs index af46402..7c34d3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,21 @@ -use stardust_xr_fusion::client::Client; +use manifest_dir_macros::directory_relative_path; +use stardust_xr_fusion::{client::Client, core::values::ResourceID, drawable::Model, spatial::Transform}; #[tokio::main] async fn main() { let (client, event_loop) = Client::connect_with_async_loop().await.unwrap(); + client.set_base_prefixes(&[directory_relative_path!("res")]); + + let model = Model::create( + client.get_root(), + Transform::none(), + &ResourceID::new_namespaced( + "color_cube", + "color_cube.glb" + ), + ); + tokio::select! { _ = tokio::signal::ctrl_c() => (), _ = event_loop => panic!("server crashed"),