Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

### Migration Guide

## `bevy_landmass` [0.11.1] - 2026-02-21

### Fixes

- `bevy_mesh_to_landmass_nav_mesh` now correctly orients faces.

## `bevy_landmass` [0.11.0] / `landmass_rerecast` [0.2.0] - 2026-01-29

### Migration Guide
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_landmass/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_landmass"
version = "0.11.0"
version = "0.11.1"
edition = "2024"

description = "A plugin for Bevy to handle navigation of AI characters."
Expand Down
Binary file modified crates/bevy_landmass/assets/playground.glb
Binary file not shown.
12 changes: 8 additions & 4 deletions crates/bevy_landmass/src/nav_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ pub fn bevy_mesh_to_landmass_nav_mesh<CS: CoordinateSystem>(
assert!(indices.len() % 3 == 0);
let mut polygons = Vec::with_capacity(indices.len() / 3);
for i in (0..indices.len()).step_by(3) {
let (b, c) =
if CS::FLIP_POLYGONS { (i + 2, i + 1) } else { (i + 1, i + 2) };
polygons.push(vec![
indices[i] as usize,
indices[i + 1] as usize,
indices[i + 2] as usize,
indices[b] as usize,
indices[c] as usize,
]);
}
polygons
Expand All @@ -57,10 +59,12 @@ pub fn bevy_mesh_to_landmass_nav_mesh<CS: CoordinateSystem>(
assert!(indices.len() % 3 == 0);
let mut polygons = Vec::with_capacity(indices.len() / 3);
for i in (0..indices.len()).step_by(3) {
let (b, c) =
if CS::FLIP_POLYGONS { (i + 2, i + 1) } else { (i + 1, i + 2) };
polygons.push(vec![
indices[i] as usize,
indices[i + 1] as usize,
indices[i + 2] as usize,
indices[b] as usize,
indices[c] as usize,
]);
}
polygons
Expand Down
14 changes: 8 additions & 6 deletions crates/bevy_landmass/src/nav_mesh_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,17 @@ fn converts_u32_indices() {
]
);

// ThreeD sets `FLIP_POLYGONS`, so the polygons end up flipped here (and then
// flipped back during validation).
assert_eq!(
nav_mesh.polygons,
vec![
vec![0, 1, 2],
vec![2, 3, 0],
vec![3, 2, 4],
vec![3, 4, 5],
vec![4, 2, 6],
vec![4, 6, 7],
vec![0, 2, 1],
vec![2, 0, 3],
vec![3, 4, 2],
vec![3, 5, 4],
vec![4, 6, 2],
vec![4, 7, 6],
]
);
}