Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
07c19b4
compiling 3d (from folder)
ThierryBerger Mar 3, 2025
8922108
add an example loading a mesh into a particle
ThierryBerger Mar 4, 2025
e94f20d
attempt to sample vertex colors from material
ThierryBerger Mar 8, 2025
82e67e2
attempt to load glb into particles ; not working
ThierryBerger Mar 10, 2025
ec3aa08
better model to showcase
ThierryBerger Mar 11, 2025
56215de
correct color loading for gltf
ThierryBerger Mar 11, 2025
6d6bbd1
wip loading banana and knife
ThierryBerger Mar 12, 2025
00f01a1
format credits
ThierryBerger Mar 12, 2025
d501afa
correctly load rigidbody coupling
ThierryBerger Mar 12, 2025
4276c3e
knife cutting through banana (but cut is bugged)
ThierryBerger Mar 12, 2025
25dc1f4
knife with open blade correctly cuts :)
ThierryBerger Mar 12, 2025
37b7124
better time management
ThierryBerger Mar 12, 2025
51c4af3
inside the banana is now white/yellow
ThierryBerger Mar 12, 2025
841a565
attempt to use lib examples
ThierryBerger Mar 13, 2025
cca0349
knif model follow its rigidbody
ThierryBerger Mar 14, 2025
0c1be37
add comment about sample_mesh
ThierryBerger Mar 14, 2025
5b38cf6
use binary for examples 3d
ThierryBerger Mar 14, 2025
82ffe57
use binary for examples 2d
ThierryBerger Mar 14, 2025
1b971d9
fix wasm build
ThierryBerger Mar 14, 2025
27768c3
better banana cut ; moved utils functions to wgsparkl behind a featur…
ThierryBerger Mar 17, 2025
0b2c38e
less bevy specific examples
ThierryBerger Mar 18, 2025
f22a3f6
independant example for loading a glb to point cloud
ThierryBerger Mar 18, 2025
c7fe2b3
fix some slippy lints
ThierryBerger Mar 18, 2025
996eb87
better banana cut
ThierryBerger Mar 18, 2025
b799c92
fix 2d examples
ThierryBerger Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ members = [
"crates/wgsparkl-testbed3d",
"crates/wgsparkl2d",
"crates/wgsparkl3d",
"examples3d",
"examples2d",
]
resolver = "2"

Expand All @@ -23,15 +25,32 @@ rust.unexpected_cfgs = { level = "warn", check-cfg = [
] }

[patch.crates-io]
parry2d = { path = "../parry/crates/parry2d" }
parry3d = { path = "../parry/crates/parry3d" }
encase = { path = "../encase" }
wgcore = { path = "../wgmath/crates/wgcore" }
wgebra = { path = "../wgmath/crates/wgebra" }
wgparry2d = { path = "../wgmath/crates/wgparry/crates/wgparry2d" }
wgparry3d = { path = "../wgmath/crates/wgparry/crates/wgparry3d" }
wgrapier2d = { path = "../wgmath/crates/wgrapier/crates/wgrapier2d" }
wgrapier3d = { path = "../wgmath/crates/wgrapier/crates/wgrapier3d" }
# parry2d = { path = "../parry/crates/parry2d" }
# parry3d = { path = "../parry/crates/parry3d" }
# encase = { path = "../encase" }
# wgcore = { path = "../wgmath/crates/wgcore" }
# wgebra = { path = "../wgmath/crates/wgebra" }
# wgparry2d = { path = "../wgmath/crates/wgparry/crates/wgparry2d" }
# wgparry3d = { path = "../wgmath/crates/wgparry/crates/wgparry3d" }
# wgrapier2d = { path = "../wgmath/crates/wgrapier/crates/wgrapier2d" }
# wgrapier3d = { path = "../wgmath/crates/wgrapier/crates/wgrapier3d" }

parry2d = { git = "https://github.com/dimforge/parry.git", rev = "407fb449504dde7ba0a3d80a8de7e37ac991a77a" }
parry3d = { git = "https://github.com/dimforge/parry.git", rev = "407fb449504dde7ba0a3d80a8de7e37ac991a77a" }
encase = { git = "https://github.com/sebcrozet/encase.git", rev = "6755c1414c225cbeac9fde1ff9394b70d3b05404" }
# wgcore = { git = "https://github.com/dimforge/wgmath.git", rev = "32b54c802be6040c5f003e7d3def4a33e4730d92" }
wgcore = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgcore-derive = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgebra = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgparry3d = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgparry2d = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgrapier3d = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
wgrapier2d = { git = "https://github.com/dimforge/wgmath.git", branch = "wgml-chat" }
rapier3d = { git = "https://github.com/vrixyz/rapier.git", branch = "uber_physics_context" }
rapier2d = { git = "https://github.com/vrixyz/rapier.git", branch = "uber_physics_context" }

[profile.release]
opt-level = 'z'

[profile.dev]
opt-level = 1
16 changes: 8 additions & 8 deletions build_wasm.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

cargo build --example elasticity2 --release --target wasm32-unknown-unknown --features dim2
cargo build --example elasticity3 --release --target wasm32-unknown-unknown --features dim3
wasm-bindgen --no-typescript --target web --out-dir dist2d --out-name elasticity2 ./target/wasm32-unknown-unknown/release/examples/elasticity2.wasm
wasm-bindgen --no-typescript --target web --out-dir dist3d --out-name elasticity3 ./target/wasm32-unknown-unknown/release/examples/elasticity3.wasm
wasm-opt -Oz -o ./dist2d/opt.wasm ./dist2d/elasticity2_bg.wasm && mv ./dist2d/opt.wasm ./dist2d/elasticity2_bg.wasm
wasm-opt -Oz -o ./dist3d/opt.wasm ./dist3d/elasticity3_bg.wasm && mv ./dist3d/opt.wasm ./dist3d/elasticity3_bg.wasm
# cargo build -p wgsparkl-examples-2d --release --target wasm32-unknown-unknown
cargo build -p wgsparkl-examples-3d --release --target wasm32-unknown-unknown
# wasm-bindgen --no-typescript --target web --out-dir dist2d --out-name wgsparkl-examples-2d ./target/wasm32-unknown-unknown/release/wgsparkl-examples-2d.wasm
wasm-bindgen --no-typescript --target web --out-dir dist3d --out-name wgsparkl-examples-3d ./target/wasm32-unknown-unknown/release/wgsparkl-examples-3d.wasm
# wasm-opt -Oz -o ./dist2d/opt.wasm ./dist2d/wgsparkl-examples-2d_bg.wasm && mv ./dist2d/opt.wasm ./dist2d/wgsparkl-examples-2d_bg.wasm
wasm-opt -Oz -o ./dist3d/opt.wasm ./dist3d/wgsparkl-examples-3d_bg.wasm && mv ./dist3d/opt.wasm ./dist3d/wgsparkl-examples-3d_bg.wasm

brotli ./dist2d/elasticity2_bg.wasm && mv ./dist2d/elasticity2_bg.wasm.br ./dist2d/elasticity2_bg.wasm
brotli ./dist3d/elasticity3_bg.wasm && mv ./dist3d/elasticity3_bg.wasm.br ./dist3d/elasticity3_bg.wasm
# brotli ./dist2d/wgsparkl-examples-2d_bg.wasm && mv ./dist2d/wgsparkl-examples-2d_bg.wasm.br ./dist2d/wgsparkl-examples-2d_bg.wasm
brotli ./dist3d/wgsparkl-examples-3d_bg.wasm && mv ./dist3d/wgsparkl-examples-3d_bg.wasm.br ./dist3d/wgsparkl-examples-3d_bg.wasm
15 changes: 11 additions & 4 deletions crates/wgsparkl-testbed2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ path = "../../src_testbed/lib.rs"
required-features = ["dim2"]

[features]
default = ["dim2"]
dim2 = []
default_features = ["dim2"]

[dependencies]
nalgebra = { workspace = true, features = ["rand"] }
Expand All @@ -31,10 +31,17 @@ futures-test = "0.3"
serial_test = "3"
approx = "0.5"
async-std = { version = "1", features = ["attributes"] }
bevy = { version = "0.15.0", features = ["shader_format_glsl", "shader_format_spirv", "webgpu"] }
bevy = { version = "0.15.0", features = [
"shader_format_glsl",
"shader_format_spirv",
"webgpu",
] }
#bevy_wasm_window_resize = "0.4"
bevy_editor_cam = "0.5"
bevy_egui = { version = "0.31", default-features = false, features = ["default_fonts", "render"] }
bevy_egui = { version = "0.31", default-features = false, features = [
"default_fonts",
"render",
] }
bevy_sprite = "0.15"
wgsparkl2d = { path = "../wgsparkl2d" }
futures = "0.3"
futures = "0.3"
13 changes: 10 additions & 3 deletions crates/wgsparkl-testbed3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ path = "../../src_testbed/lib.rs"
required-features = ["dim3"]

[features]
default = ["dim3"]
dim3 = []
default_features = ["dim3"]

[dependencies]
nalgebra = { workspace = true, features = ["rand"] }
Expand All @@ -31,10 +31,17 @@ futures-test = "0.3"
serial_test = "3"
approx = "0.5"
async-std = { version = "1", features = ["attributes"] }
bevy = { version = "0.15.0", features = ["shader_format_glsl", "shader_format_spirv", "webgpu"] }
bevy = { version = "0.15.0", features = [
"shader_format_glsl",
"shader_format_spirv",
"webgpu",
] }
bevy_editor_cam = "0.5"
#bevy_mod_picking = { version = "0.20", default-features = false }
#bevy_wasm_window_resize = "0.4"
bevy_egui = { version = "0.31", default-features = false, features = ["default_fonts", "render"] }
bevy_egui = { version = "0.31", default-features = false, features = [
"default_fonts",
"render",
] }
wgsparkl3d = { path = "../wgsparkl3d" }
futures = "0.3"
9 changes: 0 additions & 9 deletions crates/wgsparkl2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,3 @@ rapier2d = "0.23"
# For wasm?
getrandom = { version = "0.3.1", features = ["wasm_js"] }
uuid = { version = "1", features = ["js"] }

[dev-dependencies]
nalgebra = { version = "0.33", features = ["rand"] }
futures-test = "0.3"
serial_test = "3"
approx = "0.5"
async-std = { version = "1", features = ["attributes"] }
bevy = { version = "0.15.0", features = ["shader_format_glsl", "shader_format_spirv", "webgpu"] }
wgsparkl_testbed2d = { path = "../wgsparkl-testbed2d", features = ["dim2"] }
53 changes: 0 additions & 53 deletions crates/wgsparkl2d/examples/testbed2.rs

This file was deleted.

27 changes: 19 additions & 8 deletions crates/wgsparkl3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ required-features = ["dim3"]
[features]
default = ["dim3"]
dim3 = []
load_gltf = ["obj-rs", "image"]
load_obj = ["gltf", "image"]
load_bevy = ["bevy", "image"]

[dependencies]
nalgebra = { workspace = true }
Expand All @@ -33,11 +36,19 @@ wgrapier3d = "0.2"
# TODO: make rapier optional?
rapier3d = "0.23"

[dev-dependencies]
nalgebra = { version = "0.33", features = ["rand"] }
futures-test = "0.3"
serial_test = "3"
approx = "0.5"
async-std = { version = "1", features = ["attributes"] }
bevy = { version = "0.15.0", features = ["shader_format_glsl", "shader_format_spirv", "webgpu"] }
wgsparkl_testbed3d = { path = "../wgsparkl-testbed3d" }
# for loaders
# TODO: slim bevy features
bevy = { version = "0.15.0", features = [
"shader_format_glsl",
"shader_format_spirv",
"webgpu",
"jpeg",
], optional = true }
gltf = { version = "1.3", features = [
"KHR_materials_pbrSpecularGlossiness",
], optional = true }
obj-rs = { version = "0.7", default-features = false, optional = true }
image = { version = "0.25", optional = true }

[package.metadata.docs.rs]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
121 changes: 0 additions & 121 deletions crates/wgsparkl3d/examples/sand3.rs

This file was deleted.

2 changes: 1 addition & 1 deletion dist2d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<body style="margin: 0px;">
<script type="module">
import init from './elasticity2.js'
import init from './wgsparkl-examples-2d.js'

init().catch((error) => {
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
Expand Down
2 changes: 1 addition & 1 deletion dist3d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<body style="margin: 0px;">
<script type="module">
import init from './elasticity3.js'
import init from './wgsparkl-examples-3d.js'

init().catch((error) => {
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
Expand Down
Loading