Skip to content

Commit d87f7c2

Browse files
Update bevy to 0.15 (#595)
1 parent 577ecb1 commit d87f7c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+259
-371
lines changed

CHANGELOG.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66

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

1023
### Fix
1124

@@ -21,21 +34,6 @@ which was its hardcoded behaviour.
2134
`RapierDebugColliderPlugin` and `DebugRenderContext`, as well as individual collider setup via
2235
a `ColliderDebug` component.
2336

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

4139
**This is an update from rapier 0.19 to Rapier 0.21 which includes several stability improvements

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ codegen-units = 1
2323
#parry3d = { path = "../parry/crates/parry3d" }
2424
#rapier2d = { path = "../rapier/crates/rapier2d" }
2525
#rapier3d = { path = "../rapier/crates/rapier3d" }
26-
2726
#nalgebra = { git = "https://github.com/dimforge/nalgebra", branch = "dev" }
2827
#parry2d = { git = "https://github.com/dimforge/parry", branch = "master" }
2928
#parry3d = { git = "https://github.com/dimforge/parry", branch = "master" }

bevy_rapier2d/Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,26 @@ headless = []
4949
async-collider = ["bevy/bevy_asset", "bevy/bevy_scene", "bevy/bevy_render"]
5050

5151
[dependencies]
52-
bevy = { version = "0.14", default-features = false }
53-
nalgebra = { version = "0.33", features = ["convert-glam027"] }
52+
bevy = { version = "0.15", default-features = false }
53+
nalgebra = { version = "0.33", features = ["convert-glam029"] }
5454
rapier2d = "0.22"
5555
bitflags = "2.4"
5656
log = "0.4"
5757
serde = { version = "1", features = ["derive"], optional = true }
5858

5959
[dev-dependencies]
60-
bevy = { version = "0.14", default-features = false, features = [
60+
bevy = { version = "0.15", default-features = false, features = [
6161
"x11",
6262
"bevy_state",
63+
"bevy_window",
6364
"bevy_debug_stepping",
6465
] }
6566
oorandom = "11"
6667
approx = "0.5.1"
67-
glam = { version = "0.27", features = ["approx"] }
68-
bevy-inspector-egui = "0.25.1"
69-
bevy_egui = "0.28.0"
70-
bevy_mod_debugdump = "0.11"
68+
glam = { version = "0.29", features = ["approx"] }
69+
bevy-inspector-egui = "0.28.0"
70+
bevy_egui = "0.31"
71+
bevy_mod_debugdump = "0.12"
7172

7273
[package.metadata.docs.rs]
7374
# Enable all the features when building the docs on docs.rs

bevy_rapier2d/examples/boxes2.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ fn main() {
1818
}
1919

2020
pub fn setup_graphics(mut commands: Commands) {
21-
commands.spawn(Camera2dBundle {
22-
transform: Transform::from_xyz(0.0, 20.0, 0.0),
23-
..default()
24-
});
21+
commands.spawn((Camera2d::default(), Transform::from_xyz(0.0, 20.0, 0.0)));
2522
}
2623

2724
pub fn setup_physics(mut commands: Commands) {
@@ -32,7 +29,7 @@ pub fn setup_physics(mut commands: Commands) {
3229
let ground_height = 10.0;
3330

3431
commands.spawn((
35-
TransformBundle::from(Transform::from_xyz(0.0, 0.0 * -ground_height, 0.0)),
32+
Transform::from_xyz(0.0, 0.0 * -ground_height, 0.0),
3633
Collider::cuboid(ground_size, ground_height),
3734
));
3835

@@ -54,7 +51,7 @@ pub fn setup_physics(mut commands: Commands) {
5451
let y = j as f32 * shift + centery + 30.0;
5552

5653
commands.spawn((
57-
TransformBundle::from(Transform::from_xyz(x, y, 0.0)),
54+
Transform::from_xyz(x, y, 0.0),
5855
RigidBody::Dynamic,
5956
Collider::cuboid(rad, rad),
6057
));

bevy_rapier2d/examples/contact_filter2.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ fn main() {
4545
}
4646

4747
fn setup_graphics(mut commands: Commands) {
48-
commands.spawn(Camera2dBundle {
49-
transform: Transform::from_xyz(0.0, 20.0, 0.0),
50-
..default()
51-
});
48+
commands.spawn((Camera2d::default(), Transform::from_xyz(0.0, 20.0, 0.0)));
5249
}
5350

5451
pub fn setup_physics(mut commands: Commands) {
@@ -58,13 +55,13 @@ pub fn setup_physics(mut commands: Commands) {
5855
let ground_size = 100.0;
5956

6057
commands.spawn((
61-
TransformBundle::from(Transform::from_xyz(0.0, -100.0, 0.0)),
58+
Transform::from_xyz(0.0, -100.0, 0.0),
6259
Collider::cuboid(ground_size, 12.0),
6360
CustomFilterTag::GroupA,
6461
));
6562

6663
commands.spawn((
67-
TransformBundle::from(Transform::from_xyz(0.0, 0.0, 0.0)),
64+
Transform::from_xyz(0.0, 0.0, 0.0),
6865
Collider::cuboid(ground_size, 12.0),
6966
CustomFilterTag::GroupB,
7067
));
@@ -89,7 +86,7 @@ pub fn setup_physics(mut commands: Commands) {
8986
group_id += 1;
9087

9188
commands.spawn((
92-
TransformBundle::from(Transform::from_xyz(x, y, 0.0)),
89+
Transform::from_xyz(x, y, 0.0),
9390
RigidBody::Dynamic,
9491
Collider::cuboid(rad, rad),
9592
ActiveHooks::FILTER_CONTACT_PAIRS,

bevy_rapier2d/examples/custom_system_setup2.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ fn despawn_one_box(
6161
}
6262

6363
fn setup_graphics(mut commands: Commands) {
64-
commands.spawn(Camera2dBundle {
65-
transform: Transform::from_xyz(0.0, 20.0, 0.0),
66-
..default()
67-
});
64+
commands.spawn((Camera2d::default(), Transform::from_xyz(0.0, 20.0, 0.0)));
6865
}
6966

7067
pub fn setup_physics(mut commands: Commands) {
@@ -75,7 +72,7 @@ pub fn setup_physics(mut commands: Commands) {
7572
let ground_height = 10.0;
7673

7774
commands.spawn((
78-
TransformBundle::from(Transform::from_xyz(0.0, 0.0 * -ground_height, 0.0)),
75+
Transform::from_xyz(0.0, 0.0 * -ground_height, 0.0),
7976
Collider::cuboid(ground_size, ground_height),
8077
));
8178

@@ -97,7 +94,7 @@ pub fn setup_physics(mut commands: Commands) {
9794
let y = j as f32 * shift + centery + 30.0;
9895

9996
commands.spawn((
100-
TransformBundle::from(Transform::from_xyz(x, y, 0.0)),
97+
Transform::from_xyz(x, y, 0.0),
10198
RigidBody::Dynamic,
10299
Collider::cuboid(rad, rad),
103100
));

bevy_rapier2d/examples/debug_despawn2.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn setup_game(mut commands: Commands, mut game: ResMut<Game>) {
9292
byte_rgb(255, 0, 0),
9393
];
9494

95-
commands.spawn(Camera2dBundle::default());
95+
commands.spawn(Camera2d::default());
9696

9797
setup_board(&mut commands, &game);
9898

@@ -131,15 +131,12 @@ fn setup_board(commands: &mut Commands, game: &Game) {
131131

132132
// Add floor
133133
commands.spawn((
134-
SpriteBundle {
135-
sprite: Sprite {
136-
color: Color::srgb(0.5, 0.5, 0.5),
137-
custom_size: Some(Vec2::new(game.n_lanes as f32 * 30.0, 60.0)),
138-
..Default::default()
139-
},
140-
transform: Transform::from_xyz(0.0, floor_y - 30.0 * 0.5, 0.0),
134+
Sprite {
135+
color: Color::srgb(0.5, 0.5, 0.5),
136+
custom_size: Some(Vec2::new(game.n_lanes as f32 * 30.0, 60.0)),
141137
..Default::default()
142138
},
139+
Transform::from_xyz(0.0, floor_y - 30.0 * 0.5, 0.0),
143140
RigidBody::Fixed,
144141
Collider::cuboid(game.n_lanes as f32 * 30.0 / 2.0, 60.0 / 2.0),
145142
));
@@ -200,15 +197,12 @@ fn spawn_block(
200197

201198
commands
202199
.spawn((
203-
SpriteBundle {
204-
sprite: Sprite {
205-
color: game.cube_colors[kind as usize],
206-
custom_size: Some(Vec2::new(30.0, 30.0)),
207-
..Default::default()
208-
},
209-
transform: Transform::from_xyz(x, y, 0.0),
200+
Sprite {
201+
color: game.cube_colors[kind as usize],
202+
custom_size: Some(Vec2::new(30.0, 30.0)),
210203
..Default::default()
211204
},
205+
Transform::from_xyz(x, y, 0.0),
212206
RigidBody::Dynamic,
213207
Damping {
214208
linear_damping,

bevy_rapier2d/examples/debug_toggle2.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ fn main() {
3131
}
3232

3333
pub fn setup_graphics(mut commands: Commands) {
34-
commands.spawn(Camera3dBundle {
35-
transform: Transform::from_xyz(-30.0, 30.0, 100.0)
36-
.looking_at(Vec3::new(0.0, 10.0, 0.0), Vec3::Y),
37-
..Default::default()
38-
});
34+
commands.spawn((
35+
Camera3d::default(),
36+
Transform::from_xyz(-30.0, 30.0, 100.0).looking_at(Vec3::new(0.0, 10.0, 0.0), Vec3::Y),
37+
));
3938
}
4039

4140
#[derive(Component)]
@@ -49,7 +48,7 @@ pub fn setup_physics(mut commands: Commands) {
4948
let ground_height = 0.1;
5049

5150
commands.spawn((
52-
TransformBundle::from(Transform::from_xyz(0.0, -ground_height, 0.0)),
51+
Transform::from_xyz(0.0, -ground_height, 0.0),
5352
Collider::cuboid(ground_size, ground_height),
5453
));
5554

@@ -81,12 +80,10 @@ pub fn setup_physics(mut commands: Commands) {
8180
color += 1;
8281

8382
commands
84-
.spawn(TransformBundle::from(Transform::from_rotation(
85-
Quat::from_rotation_x(0.2),
86-
)))
83+
.spawn(Transform::from_rotation(Quat::from_rotation_x(0.2)))
8784
.with_children(|child| {
8885
child.spawn((
89-
TransformBundle::from(Transform::from_xyz(x, y, z)),
86+
Transform::from_xyz(x, y, z),
9087
RigidBody::Dynamic,
9188
Collider::cuboid(rad, rad),
9289
ColliderDebugColor(colors[color % 3]),

bevy_rapier2d/examples/despawn2.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ pub fn setup_graphics(
4343
resize.timer = Timer::from_seconds(6.0, TimerMode::Once);
4444
despawn.timer = Timer::from_seconds(5.0, TimerMode::Once);
4545

46-
commands.spawn(Camera2dBundle {
47-
transform: Transform::from_xyz(0.0, 20.0, 0.0),
48-
..default()
49-
});
46+
commands.spawn((Camera2d::default(), Transform::from_xyz(0.0, 20.0, 0.0)));
5047
}
5148

5249
pub fn setup_physics(mut commands: Commands) {
@@ -58,12 +55,12 @@ pub fn setup_physics(mut commands: Commands) {
5855
commands.spawn((Collider::cuboid(ground_size, 12.0), Despawn));
5956

6057
commands.spawn((
61-
TransformBundle::from(Transform::from_xyz(ground_size, ground_size * 2.0, 0.0)),
58+
Transform::from_xyz(ground_size, ground_size * 2.0, 0.0),
6259
Collider::cuboid(12.0, ground_size * 2.0),
6360
));
6461

6562
commands.spawn((
66-
TransformBundle::from(Transform::from_xyz(-ground_size, ground_size * 2.0, 0.0)),
63+
Transform::from_xyz(-ground_size, ground_size * 2.0, 0.0),
6764
Collider::cuboid(12.0, ground_size * 2.0),
6865
));
6966

@@ -83,7 +80,7 @@ pub fn setup_physics(mut commands: Commands) {
8380
let y = j as f32 * shift + centery + 2.0;
8481

8582
let mut entity = commands.spawn((
86-
TransformBundle::from(Transform::from_xyz(x, y, 0.0)),
83+
Transform::from_xyz(x, y, 0.0),
8784
RigidBody::Dynamic,
8885
Collider::cuboid(rad, rad),
8986
));

bevy_rapier2d/examples/events2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() {
1919
}
2020

2121
pub fn setup_graphics(mut commands: Commands) {
22-
commands.spawn(Camera2dBundle::default());
22+
commands.spawn(Camera2d::default());
2323
}
2424

2525
pub fn display_events(
@@ -40,18 +40,18 @@ pub fn setup_physics(mut commands: Commands) {
4040
* Ground
4141
*/
4242
commands.spawn((
43-
TransformBundle::from(Transform::from_xyz(0.0, -24.0, 0.0)),
43+
Transform::from_xyz(0.0, -24.0, 0.0),
4444
Collider::cuboid(80.0, 20.0),
4545
));
4646

4747
commands.spawn((
48-
TransformBundle::from(Transform::from_xyz(0.0, 100.0, 0.0)),
48+
Transform::from_xyz(0.0, 100.0, 0.0),
4949
Collider::cuboid(80.0, 30.0),
5050
Sensor,
5151
));
5252

5353
commands.spawn((
54-
TransformBundle::from(Transform::from_xyz(0.0, 260.0, 0.0)),
54+
Transform::from_xyz(0.0, 260.0, 0.0),
5555
RigidBody::Dynamic,
5656
Collider::cuboid(10.0, 10.0),
5757
ActiveEvents::COLLISION_EVENTS,

0 commit comments

Comments
 (0)