diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 59f5e030..451d98d1 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,4 +1,3 @@ - name: deploy github pages on: @@ -41,10 +40,13 @@ jobs: - name: generate bindings with wasm-bindgen run: wasm-bindgen --out-dir ./www/out/ --target web ./target/wasm32-unknown-unknown/release/viewer.wasm + - name: copy assets + run: mkdir -p ./www/assets && cp -r ./assets/* ./www/assets/ + - name: upload artifact for github pages uses: actions/upload-pages-artifact@v1 with: - path: ./www/out/ + path: ./www deploy: needs: build @@ -57,5 +59,5 @@ jobs: - name: deploy to github pages uses: JamesIves/github-pages-deploy-action@v4 with: - folder: ./www/out + folder: ./www branch: www diff --git a/Cargo.toml b/Cargo.toml index e487e00b..036e05b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,6 +93,7 @@ sort_radix = [] sort_rayon = ["rayon"] sort_std = [] +testing = [] tooling = ["byte-unit"] perftest = [] @@ -121,6 +122,7 @@ web = [ "buffer_texture", "f16", "io_flexbuffers", + "io_ply", "planar", "precompute_covariance_3d", "sort_std", @@ -136,7 +138,7 @@ webgpu = ["bevy/webgpu"] bevy_args = { version = "1.3.0", optional = true } bevy-inspector-egui = { version = "0.24", optional = true } bevy_mod_picking = { version = "0.18", optional = true } -bevy_panorbit_camera = { version = "0.17", optional = true } +bevy_panorbit_camera = { version = "0.18", optional = true } bevy_transform_gizmo = { version = "0.11", optional = true } bincode2 = { version = "2.0", optional = true } byte-unit = { version = "5.0", optional = true } @@ -225,15 +227,17 @@ required-features = ["io_ply", "tooling"] [[bin]] name = "compare_aabb_obb" path = "tools/compare_aabb_obb.rs" +required-features = ["tooling"] [[bin]] name = "test_gaussian" path = "tests/gpu/gaussian.rs" +required-features = ["testing"] [[bin]] name = "test_radix" path = "tests/gpu/radix.rs" -required-features = ["debug_gpu", "sort_radix"] +required-features = ["debug_gpu", "sort_radix", "testing"] [[example]] name = "minimal" diff --git a/src/utils.rs b/src/utils.rs index 24a987d7..f06d9cb4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,10 +1,5 @@ -// #[cfg(target_arch = "wasm32")] -// pub use wasm_bindgen_rayon::init_thread_pool; - #[cfg(target_arch = "wasm32")] use wasm_bindgen::prelude::*; -#[cfg(target_arch = "wasm32")] -use std::collections::HashMap; use bevy::prelude::*; use bevy_args::{ diff --git a/viewer/viewer.rs b/viewer/viewer.rs index e3d101ac..fc366e78 100644 --- a/viewer/viewer.rs +++ b/viewer/viewer.rs @@ -180,7 +180,8 @@ fn example_app() { #[cfg(target_arch = "wasm32")] let primary_window = Some(Window { - fit_canvas_to_parent: true, + // fit_canvas_to_parent: true, + canvas: Some("#bevy".to_string()), mode: bevy::window::WindowMode::Windowed, prevent_default_event_handling: true, title: config.name.clone(), @@ -195,7 +196,6 @@ fn example_app() { #[cfg(not(target_arch = "wasm32"))] let primary_window = Some(Window { - canvas: Some("#bevy".to_string()), mode: bevy::window::WindowMode::Windowed, prevent_default_event_handling: false, resolution: (config.width, config.height).into(), diff --git a/www/index.html b/www/index.html index d05d4ed5..2c3021a9 100644 --- a/www/index.html +++ b/www/index.html @@ -17,10 +17,24 @@ init() +
- +