Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream' into picking_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Dec 9, 2024
2 parents 9fe001a + 0022583 commit 58d2bf0
Show file tree
Hide file tree
Showing 19 changed files with 201 additions and 108 deletions.
30 changes: 15 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@

## Unreleased

## v0.28.0 (09 December 2024)

### Modified

- Update from rapier `0.21` to rapier `0.22`,
see [rapier's changelog](https://github.com/dimforge/rapier/blob/master/CHANGELOG.md).
- Update bevy to 0.15.
- `RapierContext`, `RapierConfiguration` and `RenderToSimulationTime` are now a `Component` instead of resources.
- Rapier now supports multiple independent physics worlds, see example `multi_world3` for usage details.
- Migration guide:
- `ResMut<mut RapierContext>` -> `WriteDefaultRapierContext`
- `Res<RapierContext>` -> `ReadDefaultRapierContext`
- Access to `RapierConfiguration` and `RenderToSimulationTime` should query for it
on the responsible entity owning the `RenderContext`.
- If you are building a library on top of `bevy_rapier` and would want to support multiple independent physics worlds too,
you can check out the details of [#545](https://github.com/dimforge/bevy_rapier/pull/545)
to get more context and information.
- `colliders_with_aabb_intersecting_aabb` now takes `bevy::math::bounding::Aabb3d` (or `[..]::Aabb2d` in 2D) as parameter.
- it is now accessible with `headless` feature enabled.

### Fix

Expand All @@ -21,21 +36,6 @@ which was its hardcoded behaviour.
`RapierDebugColliderPlugin` and `DebugRenderContext`, as well as individual collider setup via
a `ColliderDebug` component.

### Modified

- `RapierContext`, `RapierConfiguration` and `RenderToSimulationTime` are now a `Component` instead of resources.
- Rapier now supports multiple independent physics worlds, see example `multi_world3` for usage details.
- Migration guide:
- `ResMut<mut RapierContext>` -> `WriteDefaultRapierContext`
- `Res<RapierContext>` -> `ReadDefaultRapierContext`
- Access to `RapierConfiguration` and `RenderToSimulationTime` should query for it
on the responsible entity owning the `RenderContext`.
- If you are building a library on top of `bevy_rapier` and would want to support multiple independent physics worlds too,
you can check out the details of [#545](https://github.com/dimforge/bevy_rapier/pull/545)
to get more context and information.
- `colliders_with_aabb_intersecting_aabb` now takes `bevy::math::bounding::Aabb3d` (or `[..]::Aabb2d` in 2D) as parameter.
- it is now accessible with `headless` feature enabled.

## v0.27.0 (07 July 2024)

**This is an update from rapier 0.19 to Rapier 0.21 which includes several stability improvements
Expand Down
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
members = ["bevy_rapier2d", "bevy_rapier3d", "bevy_rapier_benches3d"]
resolver = "2"

[workspace.lints]
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim2", "dim3"))',
] }

[profile.dev]
# Use slightly better optimization by default, as examples otherwise seem laggy.
opt-level = 1
Expand All @@ -25,5 +20,3 @@ codegen-units = 1
#parry3d = { git = "https://github.com/dimforge/parry", branch = "master" }
#rapier2d = { git = "https://github.com/dimforge/rapier", branch = "character-controller" }
#rapier3d = { git = "https://github.com/dimforge/rapier", branch = "character-controller" }
bevy_egui = { git = "https://github.com/Vrixyz/bevy_egui", branch = "bevy_main" }
bevy-inspector-egui = { git = "https://github.com/Vrixyz/bevy-inspector-egui", branch = "bevy_0.15" }
19 changes: 11 additions & 8 deletions bevy_rapier2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_rapier2d"
version = "0.27.0"
version = "0.28.0"
authors = ["Sébastien Crozet <[email protected]>"]
description = "2-dimensional physics engine in Rust, official Bevy plugin."
documentation = "http://docs.rs/bevy_rapier2d"
Expand All @@ -18,7 +18,10 @@ path = "../src/lib.rs"
required-features = ["dim2"]

[lints]
workspace = true
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim3"))',
] }
clippy = { needless_lifetimes = "allow" }

[features]
default = ["dim2", "async-collider", "debug-render-2d"]
Expand Down Expand Up @@ -46,30 +49,30 @@ wasm-bindgen = ["rapier2d/wasm-bindgen"]
serde-serialize = ["rapier2d/serde-serialize", "bevy/serialize", "serde"]
enhanced-determinism = ["rapier2d/enhanced-determinism"]
headless = []
async-collider = ["bevy/bevy_asset", "bevy/bevy_scene"]
async-collider = ["bevy/bevy_asset", "bevy/bevy_scene", "bevy/bevy_render"]
picking-backend = ["bevy/bevy_picking"]

[dependencies]
bevy = { version = "0.15.0-rc.2", default-features = false }
bevy = { version = "0.15", default-features = false }
nalgebra = { version = "0.33", features = ["convert-glam029"] }
rapier2d = "0.22"
bitflags = "2.4"
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }

[dev-dependencies]
bevy = { version = "0.15.0-rc.2", default-features = false, features = [
bevy = { version = "0.15", default-features = false, features = [
"x11",
"bevy_state",
"bevy_window",
"bevy_debug_stepping",
] }
oorandom = "11"
approx = "0.5.1"
glam = { version = "0.29", features = ["approx"] }
bevy-inspector-egui = "0.28.0"
bevy_egui = "0.30.0"
# bevy_mod_debugdump = "0.11"
bevy_mod_debugdump = { git = "https://github.com/andriyDev/bevy_mod_debugdump.git", branch = "bevy-0.15" }
bevy_egui = "0.31"
bevy_mod_debugdump = "0.12"

[package.metadata.docs.rs]
# Enable all the features when building the docs on docs.rs
Expand Down
1 change: 1 addition & 0 deletions bevy_rapier2d/examples/testbed2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fn main() {
)
.run_if(in_state(Examples::DebugToggle2)),
)
.add_systems(OnExit(Examples::DebugToggle2), cleanup)
//
// rope joint
.add_systems(
Expand Down
29 changes: 11 additions & 18 deletions bevy_rapier3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_rapier3d"
version = "0.27.0"
version = "0.28.0"
authors = ["Sébastien Crozet <[email protected]>"]
description = "3-dimensional physics engine in Rust, official Bevy plugin."
documentation = "http://docs.rs/bevy_rapier3d"
Expand All @@ -18,7 +18,10 @@ path = "../src/lib.rs"
required-features = ["dim3"]

[lints]
workspace = true
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim2"))',
] }
clippy = { needless_lifetimes = "allow" }

[features]
default = ["dim3", "async-collider", "debug-render-3d"]
Expand All @@ -39,7 +42,6 @@ debug-render-3d = [
"bevy/bevy_asset",
]
rapier-debug-render = ["rapier3d/debug-render"]
picking-backend = ["bevy/bevy_picking"]

parallel = ["rapier3d/parallel"]
simd-stable = ["rapier3d/simd-stable"]
Expand All @@ -48,18 +50,20 @@ wasm-bindgen = ["rapier3d/wasm-bindgen"]
serde-serialize = ["rapier3d/serde-serialize", "bevy/serialize", "serde"]
enhanced-determinism = ["rapier3d/enhanced-determinism"]
headless = []
async-collider = ["bevy/bevy_asset", "bevy/bevy_scene"]
async-collider = ["bevy/bevy_asset", "bevy/bevy_scene", "bevy/bevy_render"]
picking-backend = ["bevy/bevy_picking"]

[dependencies]
bevy = { version = "0.15.0-rc.2", default-features = false }
bevy = { version = "0.15", default-features = false }
nalgebra = { version = "0.33", features = ["convert-glam029"] }
rapier3d = "0.22"
bitflags = "2.4"
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }

[dev-dependencies]
bevy = { version = "0.15.0-rc.3", default-features = false, features = [
bevy = { version = "0.15", default-features = false, features = [
"bevy_window",
"x11",
"tonemapping_luts",
"bevy_state",
Expand All @@ -71,22 +75,11 @@ bevy = { version = "0.15.0-rc.3", default-features = false, features = [
approx = "0.5.1"
glam = { version = "0.29", features = ["approx"] }
bevy-inspector-egui = "0.28"
bevy_egui = "0.30.0"
divan = "0.1"
bevy_rapier_benches3d = { version = "0.1", path = "../bevy_rapier_benches3d" }
bevy_egui = "0.31"

[package.metadata.docs.rs]
# Enable all the features when building the docs on docs.rs
features = ["debug-render-3d", "serde-serialize"]

[[example]]
name = "picking3"
required-features = ["picking-backend"]

[[bench]]
name = "cubes"
harness = false

[[bench]]
name = "many_pyramids3"
harness = false
5 changes: 1 addition & 4 deletions bevy_rapier3d/examples/ray_casting3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ pub fn cast_ray(
// We will color in read the colliders hovered by the mouse.
for (camera, camera_transform) in &cameras {
// First, compute a ray from the mouse position.
let Some(ray) = camera
.viewport_to_world(camera_transform, cursor_position)
.ok()
else {
let Ok(ray) = camera.viewport_to_world(camera_transform, cursor_position) else {
return;
};

Expand Down
1 change: 1 addition & 0 deletions bevy_rapier3d/examples/testbed3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ fn main() {
)
.run_if(in_state(Examples::DebugToggle3)),
)
.add_systems(OnExit(Examples::DebugToggle3), cleanup)
//
// despawn
.init_resource::<despawn3::DespawnResource>()
Expand Down
15 changes: 13 additions & 2 deletions bevy_rapier_benches3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,16 @@ edition = "2021"

[dependencies]
rapier3d = { features = ["profiler"], version = "0.22" }
bevy_rapier3d = { version = "0.27", path = "../bevy_rapier3d" }
bevy = { version = "0.15.0-rc.2", default-features = false }
bevy_rapier3d = { version = "0.28", path = "../bevy_rapier3d" }
bevy = { version = "0.15", default-features = false }

[dev-dependencies]
divan = "0.1"

[[bench]]
name = "cubes"
harness = false

[[bench]]
name = "many_pyramids3"
harness = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 1 addition & 21 deletions bevy_rapier_benches3d/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
use bevy::{
app::PluginsState,
prelude::*,
render::{
settings::{RenderCreation, WgpuSettings},
RenderPlugin,
},
scene::ScenePlugin,
time::TimeUpdateStrategy,
};
use bevy::{app::PluginsState, prelude::*, time::TimeUpdateStrategy};
use bevy_rapier3d::prelude::*;

pub fn default_app() -> App {
let mut app = App::new();

app.add_plugins((
WindowPlugin::default(),
MinimalPlugins,
AssetPlugin::default(),
ScenePlugin,
RenderPlugin {
render_creation: RenderCreation::Automatic(WgpuSettings {
backends: None,
..Default::default()
}),
..Default::default()
},
ImagePlugin::default(),
HierarchyPlugin,
TransformPlugin,
RapierPhysicsPlugin::<()>::default(),
Expand Down
19 changes: 15 additions & 4 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
[advisories]
unmaintained = "deny"
yanked = "deny"
notice = "deny"
ignore = [
{ id = "RUSTSEC-2024-0384", reason = "this is about instant crate, which is only used for benchmarks + an upstream fix is in the works." },
]

[licenses]
copyleft = "deny"
allow-osi-fsf-free = "either"
allow = [
"MIT-0",
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"Zlib",
"CC0-1.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"Unicode-3.0",
]

[[licenses.clarify]]
name = "stretch"
Expand Down
5 changes: 4 additions & 1 deletion src/plugin/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
pub use self::configuration::{RapierConfiguration, SimulationToRenderTime, TimestepMode};
pub use self::context::{
systemparams::{RapierContextAccess, ReadDefaultRapierContext, WriteRapierContext},
systemparams::{
RapierContextAccess, ReadDefaultRapierContext, WriteDefaultRapierContext,
WriteRapierContext,
},
DefaultRapierContext, RapierContext, RapierContextEntityLink,
};
pub use self::plugin::{
Expand Down
Loading

0 comments on commit 58d2bf0

Please sign in to comment.