## 0.12.0
### Minimum `bevy` version is `0.15.0`
### Replaced `Xpbd` support with its replacement `Avian3d`
See [Rebrand Bevy XPBD](https://github.com/Jondolf/avian/issues/346).
Currently `Avian3D` has yet to publish an official `bevy:0.15` release, so you will need to use a crates-io patch to use this backend:
```toml
[dependencies]
avian3d = { version = "0.1" }
oxidized_navigation = { version = "0.12.0", features = ["avian"] }
[patch.crates-io]
avian3d = { git = "https://github.com/Jondolf/avian.git", rev = "52cbcec" }
```
### Removed `parry_<version>` features
If you were depending on the `parry_015` / `parry_016` features these have been replaced with a single `parry3d` feature that currently adds a dependency on `parry3d:0.17`:
```toml
# 0.11:
[dependencies]
parry3d = { version = "0.16" }
oxidized_navigation = { version = "0.11.0", features = ["parry_016"] }
# 0.12:
[dependencies]
parry3d = { version = "0.17" }
oxidized_navigation = { version = "0.12.0", features = ["parry3d"] }
```
## 0.7
### ``OxidizedNavigationPlugin`` is now generic over OxidizedColliders.
You will need to specify what collider type to use. This is implemented for [Bevy Rapier3D](https://crates.io/crates/bevy_rapier3d) colliders (behind ``rapier`` feature) & [Bevy Xpbd_3D](https://crates.io/crates/bevy_xpbd_3d) (behind ``xpbd`` feature).
```rust
// 0.6
app.add_plugins(OxidizedNavigationPlugin { settings });
// 0.7 (Bevy Rapier3D)
use bevy_rapier3d::prelude::Collider;
app.add_plugins(OxidizedNavigationPlugin::<Collider>::new(settings));
// 0.7 (Bevy Xpbd)
use bevy_xpbd_3d::prelude::Collider;
app.add_plugins(OxidizedNavigationPlugin::<Collider>::new(settings));
```
## 0.5
### ``OxidizedNavigationPlugin`` now takes a settings parameter containing ``NavMeshSettings``
You no longer have to remember to separately insert the ``NavMeshSettings`` resource.
```rust
// 0.4
app.insert_resource(NavMeshSettings {
// etc...
});
app.add_plugin(OxidizedNavigationPlugin);
// 0.5
app.add_plugin(OxidizedNavigationPlugin {
settings: NavMeshSettings {
// etc..
}
});
```
### ``find_path`` now performs string pulling as well as path finding.
``find_polygon_path`` acts as ``find_path`` did previously if you only want the polygon path.
```rust
// 0.4
match find_path(
&nav_mesh,
&nav_mesh_settings,
start_pos,
end_pos,
position_search_radius,
area_cost_multiplier,
) {
Ok(path) => {
// Convert polygon path to a path of Vec3s.
match perform_string_pulling_on_path(&nav_mesh, start_pos, end_pos, &path) {
Ok(string_path) => {
return Some(string_path);
}
Err(error) => {} // Handle error
};
}
Err(error) => {} // Handle error
}
// 0.5
match find_path(
&nav_mesh,
&nav_mesh_settings,
start_pos,
end_pos,
position_search_radius,
area_cost_multiplier,
) {
Ok(string_path) => {
return Some(string_path);
}
Err(error) => {} // Handle error
}
```
## 0.4
### ``OxidizedNavigation`` system set is now an enum.
To continue with previous behaviour you should configure the ``OxidizedNavigation::Main`` set. The ``RemovedComponent`` set should **not** be throttled as it reacts to removing navmesh affectors. Throttling it may cause it to miss affectors being removed.
### ``NavMeshAffector`` component is now an empty type.
Remove ``::default()`` from when inserting the component.
## 0.1 to 0.2
### ``OxidizedNavigationPlugin`` now takes a ``NavMeshGenerationState``.
This allows determining the starting state of generation, allowing pausing it until the world has loaded in fully.
```rust
// 0.1
app.add_plugin(OxidizedNavigationPlugin);
// 0.2
app.add_plugin(OxidizedNavigationPlugin {
starting_state: NavMeshGenerationState::Running,
});
// Or alternatively it will default to Running
app.add_plugin(OxidizedNavigationPlugin::default());
```
### ``find_path`` now takes an optional slice of f32s
These determine the cost multiplier for crossing an area.
```rust
// 0.1
find_path(
&nav_mesh,
&nav_mesh_settings,
start_pos,
end_pos,
position_search_radius,
);
// 0.2
// Replicating 0.1 behaviour
find_path(
&nav_mesh,
&nav_mesh_settings,
start_pos,
end_pos,
position_search_radius,
None // All areas will have a cost multiplier of 1.0.
);
// Or with different costs.
find_path(
&nav_mesh,
&nav_mesh_settings,
start_pos,
end_pos,
position_search_radius,
Some(&[1.0, 0.5]), // Areas of type 0 have a cost multiplier of 1.0. Whilst areas of type 1 have a cost of 0.5. Type 1 areas will be considered cheaper to traverse. Any areas above type 1 will have a multiplier of 1.0.
);
```