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

Bevy 0.12 #18

Merged
merged 2 commits into from
Nov 9, 2023
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.8.0
- Update to Bevy 0.12

## 0.7.0
- Added support for using XPBD & wrapped Parry3d components for Nav-Mesh generation (Courtesy of @Elabajaba)
- Add benchmarks.
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "oxidized_navigation"
description = "A Nav-Mesh generation plugin for Bevy Engine."
version = "0.7.0"
version = "0.8.0"
edition = "2021"

authors = ["TheGrimsey"]
Expand Down Expand Up @@ -48,19 +48,19 @@ required-features = ["xpbd"]
name = "parry3d"

[dependencies]
bevy = { version = "0.11", default-features = false }
bevy = { version = "0.12", default-features = false, features = ["multi-threaded"] }

# parry3d doesn't expose the convert-glam feature, so we need to add nalgebra to enable the feature
nalgebra = { version = "0.32", features = ["convert-glam024"] }
parry3d = "0.13"

bevy_rapier3d = { version = "0.22", optional = true }
bevy_xpbd_3d = { version = "0.2", optional = true }
bevy_rapier3d = { version = "0.23", optional = true, default-features = false, features = ["dim3"] }
bevy_xpbd_3d = { version = "0.3", optional = true, default-features = false, features = ["3d", "f32"] }

smallvec = { version = "1.11", features = ["union"] }

[dev-dependencies]
bevy = { version = "0.11", default-features = false, features = [
bevy = { version = "0.12", default-features = false, features = [
"bevy_asset",
"bevy_pbr",
"bevy_render",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Debug draw is available behind the ``debug_draw`` feature and using the ``Oxidiz

| Crate Version | Bevy Version | Bevy Rapier 3D Version | Bevy Xpbd 3D Version | Parry3d Version |
| ------------- | ------------ | ---------------------- | -------------------- | --------------- |
| unreleased | 0.12 | 0.23 | 0.3 | 0.13 |
| 0.7.0 | 0.11 | 0.22 | 0.2 | 0.13 |
| 0.6.0 | 0.11 | 0.22 | unsupported | unsupported |
| 0.5.X | 0.10.X | 0.21 | unsupported | unsupported |
Expand All @@ -72,4 +73,3 @@ In this case you may be able to [override which version Oxidized Navigation depe
- [ ] Nav-mesh "layers" using different ``NavMeshSettings``.
- [ ] Pathfinding ticket system (Call to pathfinding returns a ticket that one can check later, controlling async pathfinding like this allows us to limit the amount of parallel tasks & prioritize them)
- [ ] Remove ``create_nav_mesh_tile_from_poly_mesh`` in favor of creating data in the right format from the start.

7 changes: 3 additions & 4 deletions examples/xpbd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn setup(
transform: Transform::IDENTITY,
..default()
},
Collider::cuboid(50.0, 0.2, 50.0),
Collider::cuboid(25.0, 0.1, 25.0),
NavMeshAffector, // Only entities with a NavMeshAffector component will contribute to the nav-mesh.
));

Expand All @@ -94,7 +94,7 @@ fn setup(
transform: Transform::from_xyz(-5.0, 0.8, -5.0),
..default()
},
Collider::cuboid(2.5, 2.5, 2.5),
Collider::cuboid(1.25, 1.25, 1.25),
NavMeshAffector, // Only entities with a NavMeshAffector component will contribute to the nav-mesh.
));

Expand All @@ -106,8 +106,7 @@ fn setup(
transform: Transform::from_xyz(-3.0, 0.8, 5.0).with_scale(Vec3::new(50.0, 15.0, 1.0)),
..default()
},
// At the time of writing, xpbd (v0.2) colliders don't support scaling, so you have to create the collider with the post-scaled size.
Collider::cuboid(5.0, 1.5, 0.1),
Collider::cuboid(0.05, 0.05, 0.05),
NavMeshAffector, // Only entities with a NavMeshAffector component will contribute to the nav-mesh.
));
}
Expand Down
4 changes: 2 additions & 2 deletions src/colliders/xpbd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use super::OxidizedCollider;
/// This is only compiled and available when the "xpbd" feature is enabled.
impl OxidizedCollider for bevy_xpbd_3d::prelude::Collider {
fn oxidized_into_typed_shape(&self) -> TypedShape {
self.as_typed_shape()
self.shape_scaled().as_typed_shape()
}

fn oxidized_compute_local_aabb(&self) -> Aabb {
self.compute_local_aabb()
self.shape_scaled().compute_local_aabb()
}
}
2 changes: 1 addition & 1 deletion src/contour.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::cmp::Ordering;

use bevy::prelude::{warn, IVec2, UVec2, UVec4};
use bevy::{prelude::{IVec2, UVec2, UVec4}, log::warn};

use crate::{
get_neighbour_index,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ fn handle_removed_affectors_system(
mut dirty_tiles: ResMut<DirtyTiles>,
) {
for relations in removed_affectors
.iter()
.read()
.filter_map(|removed| affector_relations.0.remove(&removed))
{
for tile in relations {
Expand Down
2 changes: 1 addition & 1 deletion src/mesher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::prelude::{info, UVec2, UVec3, UVec4};
use bevy::{prelude::{UVec2, UVec3, UVec4}, log::info};

use crate::{contour::ContourSet, Area};

Expand Down
6 changes: 1 addition & 5 deletions tests/rapier3d.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use bevy::{prelude::*, scene::ScenePlugin};
use bevy::prelude::*;
use bevy_rapier3d::prelude::{Collider, NoUserData, RapierPhysicsPlugin};
use oxidized_navigation::{
query::find_path, ActiveGenerationTasks, NavMesh, NavMeshAffector, NavMeshSettings,
Expand Down Expand Up @@ -82,11 +82,7 @@ fn setup_app(app: &mut App) {
max_tile_generation_tasks: Some(9), // Github Actions are limited to 7 GB.
}),
RapierPhysicsPlugin::<NoUserData>::default(),
// Required by Rapier
AssetPlugin::default(),
ScenePlugin,
));
app.add_asset::<Mesh>();
// Required by Rapier.
}

Expand Down