Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website improvements #60

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ Pathfinding:
NavMesh building:
* [Line Generalisation by Repeated Elimination of Points](https://hull-repository.worktribe.com/preview/376364/000870493786962263.pdf): Geometry simplification while keeping the general shape
* [Constrained Delaunay Triangulation](https://en.wikipedia.org/wiki/Constrained_Delaunay_triangulation): Building a tri-mesh from edges
* [Polygon Offsetting by Computing Winding Numbers](https://mcmains.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf): Agent radius


### To Implement

* Steering Behaviors For Autonomous Characters https://www.red3d.com/cwr/steer/
* A Generic Solution to Polygon Clipping https://dl.acm.org/doi/pdf/10.1145/129902.129906
* Polygon Offsetting by Computing Winding Numbers https://mcmains.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf

## Bevy Supported Versions

Expand Down
2 changes: 1 addition & 1 deletion examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn main() {
remove_obstacles,
ui::display_settings,
ui::update_settings::<10>,
agent3d::give_target_to_navigator::<10, MESH_WIDTH, MESH_HEIGHT>,
agent3d::give_target_to_navigator::<MESH_WIDTH, MESH_HEIGHT>,
agent3d::move_navigator::<100>,
agent3d::display_navigator_path.after(agent3d::move_navigator::<100>),
agent3d::refresh_path::<MESH_WIDTH, MESH_HEIGHT>,
Expand Down
2 changes: 1 addition & 1 deletion examples/helpers/agent3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn setup_agent<const SIZE: u32>(
}
}

pub fn give_target_to_navigator<const SIZE: u32, const X: u32, const Y: u32>(
pub fn give_target_to_navigator<const X: u32, const Y: u32>(
mut commands: Commands,
navigators: Query<(Entity, &Transform, &Navigator), Without<Path>>,
mut navmeshes: ResMut<Assets<NavMesh>>,
Expand Down
4 changes: 2 additions & 2 deletions examples/primitive_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fn main() {
remove_obstacles,
ui::display_settings,
ui::update_settings::<10>,
agent2d::give_target_to_navigator::<100, MESH_WIDTH, MESH_HEIGHT>,
agent2d::move_navigator::<10>,
agent2d::give_target_to_navigator::<MESH_WIDTH, MESH_HEIGHT>,
agent2d::move_navigator::<100>,
agent2d::display_navigator_path,
agent2d::refresh_path::<MESH_WIDTH, MESH_HEIGHT>,
),
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.
Binary file added wasm/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wasm/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wasm/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 3 additions & 16 deletions wasm/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,17 @@

<head>
<title>
Navmesh with Polyanya
Vleue Navigator
</title>
<style>
.disable-select {
user-select: none;
/* supported by Chrome and Opera */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
}
</style>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
</head>

<script type="module">
import init from './name-of-example.js'
init()
</script>

<body style="margin: 0px; height: 100vh" class="disable-select">
<body class="h-screen m-0 flex items-center justify-center bg-gray-900 text-white">

</body>

Expand Down
Binary file added wasm/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wasm/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wasm/favicon.ico
Binary file not shown.
Loading