Skip to content

Commit

Permalink
add the layers example
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Oct 1, 2024
1 parent c5b5225 commit 1ca4443
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ jobs:
cp wasm/example.html wasm/${example}.html
sed -i'' "s/name-of-example/${example}/g" wasm/${example}.html
done
for example in "layers"
do
echo "Building $example"
cargo build --target wasm32-unknown-unknown --release --example $example --features "bevy/webgl2,avian2d,avian3d,detailed-layers"
wasm-bindgen --no-typescript --out-dir wasm --target web target/wasm32-unknown-unknown/release/examples/$example.wasm
wasm-opt -Oz wasm/${example}_bg.wasm --output wasm/${example}-opt.wasm
rm wasm/${example}_bg.wasm
mv wasm/${example}-opt.wasm wasm/${example}_bg.wasm
cp wasm/example.html wasm/${example}.html
sed -i'' "s/name-of-example/${example}/g" wasm/${example}.html
done
- name: Copy Assets
run: cp -r assets wasm/
Expand Down
Binary file added screenshots/layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 6 additions & 7 deletions wasm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ <h1 class="text-3xl font-bold mb-4">Examples</h1>
alt="NavMesh updated using primitive shapes" />
<div class="ml-8 text-xl">NavMesh updated using primitive shapes (rectangle, circle, ...)</div>
</a>
<a href="demo.html" class="flex items-center flex-row-reverse">
<img src="screenshots/demo.png" class="object-cover w-1/2" alt="Demo to test NavMesh settings" />
<div class="mr-8 text-xl">Demo to test NavMesh settings</div>
<a href="layers.html" class="flex items-center flex-row-reverse">
<img src="screenshots/layers.png" class="object-cover w-1/2" alt="Overlapping layers" />
<div class="mr-8 text-xl">Overlapping layers</div>
</a>
</div>

Expand Down Expand Up @@ -227,10 +227,9 @@ <h2 class="text-2xl font-bold mt-8 mb-4">Others</h2>
<img src="screenshots/random_obstacles.png" class="object-cover" alt="Navmesh from random obstacles" />
<div class="mt-2">Navmesh from random obstacles</div>
</a>
<a href="auto_navmesh_aabb.html" class="m-5 text-xl flex flex-col items-center">
<img src="screenshots/auto_navmesh_aabb.png" class="object-cover"
alt="NavMesh automatically updated from obstacles using Aabb" />
<div class="mt-2">NavMesh automatically updated from obstacles using `Aabb`</div>
<a href="demo.html" class="m-5 text-xl flex flex-col items-center">
<img src="screenshots/demo.png" class="object-cover" alt="Demo to test NavMesh settings" />
<div class="mt-2">Demo to test NavMesh settings</div>
</a>
</div>
</div>
Expand Down

0 comments on commit 1ca4443

Please sign in to comment.