Skip to content

Commit

Permalink
added test and made forwarded more structs
Browse files Browse the repository at this point in the history
using a new method to split up bounds
fixed line crossing that could not be handled by the CDT
fixed some CDT edges that were wrongfully determined as constrained edges
added 3 tests
locking dependencies for tag
rename as_navmeshes as as_navmesh
rename add_obstacle as queue_subtract
adding wasm-compatible and wasm-incompatible feature flags
using a few small changes from a fork of bvh2d (earlier error detection)
separate navmesh islands should now be possible
using different approach for passable/unpassable terrain (obstacles): using addition/set union and subtraction/set difference for more fine-grained control over the mesh
trying to make holes (unpassable polygons) possible in the navmesh
swapped out geo-booleanop through geo-clipper, because of issue 21re/rust-geo-booleanop#17
  • Loading branch information
AnAverageGitUser committed Jul 17, 2024
1 parent 41c43f2 commit 5e7bd65
Show file tree
Hide file tree
Showing 17 changed files with 46,855 additions and 250 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/target
/Cargo.lock
TODO.md
17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polyanya"
version = "0.5.2"
version = "0.4.0"
edition = "2021"
license = "MIT OR Apache-2.0"
keywords = ["pathfinding"]
Expand All @@ -24,20 +24,21 @@ serde = ["glam/serde", "bvh2d/serde", "dep:serde"]
[dependencies]
tracing = { version = "0.1", optional = true }
hashbrown = { version = "0.14" }
glam = { version = "0.25", features = ["approx"] }
glam = { version = "0.24", features = ["approx"] }
smallvec = { version = "1.9", features = ["union", "const_generics"] }
bvh2d = { version = "0.4", git = "https://github.com/mockersf/bvh2d" }
bvh2d = { git = "https://github.com/AnAverageGitUser/bvh2d.git", tag = "aagu/v0.1.0" }
#bvh2d = { path = "../bvh2d" }
serde = { version = "1.0", features = ["derive"], optional = true }
spade = "2.2"
log = "0.4"
geo = "0.28.0"
geo-offset = { git = "https://github.com/mockersf/geo-offset", branch = "support-f32" }
geo-booleanop = { git = "https://github.com/21re/rust-geo-booleanop", optional = true }
geo = "0.27.0"
geo-offset = { git = "https://github.com/mockersf/geo-offset", rev = "f4568a04188cbb55a7ae211e534e0a6144ae5291" }
geo-booleanop = { git = "https://github.com/21re/rust-geo-booleanop", rev = "b9bbdbb34ebfa2aaeb99665842e64ede1696ed65", optional = true }
geo-clipper = { version = "0.8.0", optional = true }
log = "0.4"

[dev-dependencies]
criterion = "0.5"
tracing-tracy = "0.11"
tracing-tracy = "0.10"
tracing-subscriber = "0.3"
tracing = "0.1"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Implementation of [Polyanya](https://www.ijcai.org/proceedings/2017/0070.pdf) in Rust! Polyanya is a [any-angle path planning](https://en.wikipedia.org/wiki/Any-angle_path_planning) algorithm.

A WASM demo made with [Bevy](https://bevyengine.org) is available [here](https://vleue.github.io/vleue_navigator/).
A WASM demo made with [Bevy](https://bevyengine.org) is available [here](https://vleue.github.io/bevy_pathmesh/).

## Usage

Expand Down
16 changes: 8 additions & 8 deletions benches/triangulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,25 @@ fn triangulation_square(c: &mut Criterion) {
vec2(10.0, 10.0),
vec2(0.0, 10.0),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(2.5, 2.5),
vec2(2.5, 5.0),
vec2(5.0, 5.0),
vec2(5.0, 2.5),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(2.5, 5.01),
vec2(2.5, 7.5),
vec2(5.01, 7.5),
vec2(5.01, 5.01),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(5.01, 2.5),
vec2(5.01, 5.0),
vec2(7.5, 5.0),
vec2(7.5, 2.5),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(5.01, 5.01),
vec2(5.01, 7.5),
vec2(7.5, 7.5),
Expand All @@ -254,25 +254,25 @@ fn triangulation_square_overlapping(c: &mut Criterion) {
vec2(10.0, 10.0),
vec2(0.0, 10.0),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(2.5, 2.5),
vec2(2.5, 6.0),
vec2(6.0, 6.0),
vec2(6.0, 2.5),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(2.5, 4.0),
vec2(2.5, 7.5),
vec2(6.0, 7.5),
vec2(6.0, 4.0),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(4.0, 2.5),
vec2(4.0, 6.0),
vec2(7.5, 6.0),
vec2(7.5, 2.5),
]);
triangulation.add_obstacle(vec![
triangulation.queue_subtract([
vec2(4.0, 4.0),
vec2(4.0, 7.5),
vec2(7.5, 7.5),
Expand Down
2 changes: 1 addition & 1 deletion examples/aurora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
use tracing_subscriber::layer::SubscriberExt;

tracing::subscriber::set_global_default(
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::new()),
)
.expect("set up the subscriber");

Expand Down
2 changes: 1 addition & 1 deletion examples/scenario_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() {
use tracing_subscriber::layer::SubscriberExt;

tracing::subscriber::set_global_default(
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::new()),
)
.expect("set up the subscriber");

Expand Down
4 changes: 2 additions & 2 deletions examples/traced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"

[dependencies]
polyanya = { path = "../../", features = ["tracing"] }
glam = "0.25"
glam = "0.24"
tracing-subscriber = "0.3"
tracing-tracy = "0.11"
tracing-tracy = "0.10"
tracing = "0.1"
geo-offset = { git = "https://github.com/mockersf/geo-offset", branch = "support-f32" }
2 changes: 1 addition & 1 deletion examples/traced/src/bin/merged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tracing_subscriber::layer::SubscriberExt;

fn main() {
tracing::subscriber::set_global_default(
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::new()),
)
.expect("set up the subscriber");

Expand Down
2 changes: 1 addition & 1 deletion examples/traced/src/bin/triangulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tracing_subscriber::layer::SubscriberExt;

fn main() {
tracing::subscriber::set_global_default(
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::new()),
)
.expect("set up the subscriber");

Expand Down
Loading

0 comments on commit 5e7bd65

Please sign in to comment.