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
16 changes: 8 additions & 8 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: Dependencies
on:
push:
branches-ignore:
- 'dependabot/**'
- 'releases/**'
- "dependabot/**"
- "releases/**"
paths:
- 'Cargo.toml'
- 'deny.toml'
- "Cargo.toml"
- "deny.toml"
pull_request:
paths:
- 'Cargo.toml'
- 'deny.toml'
- "Cargo.toml"
- "deny.toml"
schedule:
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"
env:
CARGO_TERM_COLOR: always
jobs:
Expand All @@ -24,4 +24,4 @@ jobs:
uses: actions/checkout@v4

- name: Check dependencies
uses: EmbarkStudios/cargo-deny-action@v1
uses: EmbarkStudios/cargo-deny-action@v2
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
- Expose `RapierBevyComponentApply`, to help with creating your own schedules when you set `default_system_setup` to `false`.
- Add `set_local_axis1` and `set_local_axis2` to `RevoluteJoint` and `RevoluteJointBuilder`. [#666](https://github.com/dimforge/bevy_rapier/pull/666)

### Modified

- Update from rapier `0.25` to rapier `0.27`,
see [rapier's changelog](https://github.com/dimforge/rapier/blob/master/CHANGELOG.md).
- `RapierQueryPipeline` is no longer a component.
- Migration: Use `RapierContext` or retrieve the needed components to pass to `RapierQueryPipeline::new_scoped` and make your logic in a scoped function. This function allows capturing and returning information.
- a new `QueryPipelineMut` to provide the same API as rapier. It's currently used for the character controller.

### Fix

- Fix scale being applied with a frame delay. [#659](https://github.com/dimforge/bevy_rapier/pull/659)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ codegen-units = 1
#nalgebra = { path = "../nalgebra" }
#parry2d = { path = "../parry/crates/parry2d" }
#parry3d = { path = "../parry/crates/parry3d" }
# rapier2d = { path = "../rapier/crates/rapier2d" }
# rapier3d = { path = "../rapier/crates/rapier3d" }
#rapier2d = { path = "../rapier/crates/rapier2d" }
#rapier3d = { path = "../rapier/crates/rapier3d" }
#nalgebra = { git = "https://github.com/dimforge/nalgebra", branch = "dev" }
#parry2d = { git = "https://github.com/dimforge/parry", branch = "master" }
#parry3d = { git = "https://github.com/dimforge/parry", branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion bevy_rapier2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ to-bevy-mesh = ["bevy/bevy_render", "bevy/bevy_asset"]
[dependencies]
bevy = { version = "0.16.0", default-features = false, features = ["std"] }
nalgebra = { version = "0.33", features = ["convert-glam029"] }
rapier2d = "0.25"
rapier2d = "0.27.0-beta.0"
bitflags = "2.4"
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bevy_rapier2d/examples/custom_system_setup2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn despawn_one_box(
query: Query<Entity, (With<Collider>, With<RigidBody>)>,
) {
// Delete a box every 10 frames
if frame_count.0 % 10 == 0 && !query.is_empty() {
if frame_count.0.is_multiple_of(10) && !query.is_empty() {
let len = query.iter().len();
// Get a "random" box to make sim interesting
if let Some(entity) = query.iter().nth(frame_count.0 as usize % len) {
Expand Down
2 changes: 1 addition & 1 deletion bevy_rapier2d/examples/despawn2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub fn setup_physics(mut commands: Commands) {
Collider::cuboid(rad, rad),
));

if (i + j * num) % 100 == 0 {
if (i + j * num).is_multiple_of(100) {
entity.insert(Resize);
}
}
Expand Down
11 changes: 2 additions & 9 deletions bevy_rapier2d/examples/voxels2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bevy::prelude::*;
use bevy_rapier2d::prelude::*;
use rapier2d::prelude::VoxelPrimitiveGeometry;

fn main() {
App::new()
Expand Down Expand Up @@ -73,13 +72,7 @@ pub fn setup_physics(mut commands: Commands) {

commands.spawn((
Transform::from_xyz(-20.0 * scale, -10.0 * scale, 0.0),
Collider::voxelized_mesh(
VoxelPrimitiveGeometry::PseudoCube,
&polyline,
&indices,
0.2 * scale,
FillMode::default(),
),
Collider::voxelized_mesh(&polyline, &indices, 0.2 * scale, FillMode::default()),
));

/*
Expand All @@ -94,6 +87,6 @@ pub fn setup_physics(mut commands: Commands) {
.collect();
commands.spawn((
Transform::from_xyz(0.0, 0.0, 0.0),
Collider::voxels_from_points(VoxelPrimitiveGeometry::PseudoCube, voxel_size, &voxels),
Collider::voxels_from_points(voxel_size, &voxels),
));
}
2 changes: 1 addition & 1 deletion bevy_rapier3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ to-bevy-mesh = ["bevy/bevy_render", "bevy/bevy_asset"]
[dependencies]
bevy = { version = "0.16.0", default-features = false, features = ["std"] }
nalgebra = { version = "0.33", features = ["convert-glam029"] }
rapier3d = "0.25"
rapier3d = "0.27.0-beta.0"
bitflags = "2.4"
log = "0.4"
serde = { version = "1", features = ["derive"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion bevy_rapier3d/examples/custom_system_setup3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn despawn_one_box(
query: Query<Entity, (With<Collider>, With<RigidBody>)>,
) {
// Delete a box every 5 frames
if frame_count.0 % 5 == 0 && !query.is_empty() {
if frame_count.0.is_multiple_of(5) && !query.is_empty() {
let len = query.iter().len();
// Get a "random" box to make sim interesting
if let Some(entity) = query.iter().nth(frame_count.0 as usize % len) {
Expand Down
6 changes: 3 additions & 3 deletions bevy_rapier3d/examples/joints3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn create_prismatic_joints(commands: &mut Commands, origin: Vect, num: usize) {
for i in 0..num {
let dz = (i + 1) as f32 * shift;

let axis = if i % 2 == 0 {
let axis = if i.is_multiple_of(2) {
Vec3::new(1.0, 1.0, 0.0)
} else {
Vec3::new(-1.0, 1.0, 0.0)
Expand Down Expand Up @@ -171,7 +171,7 @@ fn create_fixed_joints(commands: &mut Commands, origin: Vec3, num: usize) {
// NOTE: the num - 2 test is to avoid two consecutive
// fixed bodies. Because physx will crash if we add
// a joint between these.
let rigid_body = if i == 0 && (k % 4 == 0 && k != num - 2 || k == num - 1) {
let rigid_body = if i == 0 && (k.is_multiple_of(4) && k != num - 2 || k == num - 1) {
RigidBody::Fixed
} else {
RigidBody::Dynamic
Expand Down Expand Up @@ -226,7 +226,7 @@ fn create_ball_joints(commands: &mut Commands, num: usize) {
let fk = k as f32;
let fi = i as f32;

let rigid_body = if i == 0 && (k % 4 == 0 || k == num - 1) {
let rigid_body = if i == 0 && (k.is_multiple_of(4) || k == num - 1) {
RigidBody::Fixed
} else {
RigidBody::Dynamic
Expand Down
6 changes: 3 additions & 3 deletions bevy_rapier3d/examples/joints_despawn3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn create_prismatic_joints(commands: &mut Commands, origin: Vect, num: usize) {
for i in 0..num {
let dz = (i + 1) as f32 * shift;

let axis = if i % 2 == 0 {
let axis = if i.is_multiple_of(2) {
Vec3::new(1.0, 1.0, 0.0)
} else {
Vec3::new(-1.0, 1.0, 0.0)
Expand Down Expand Up @@ -158,7 +158,7 @@ fn create_fixed_joints(commands: &mut Commands, origin: Vec3, num: usize) {
// NOTE: the num - 2 test is to avoid two consecutive
// fixed bodies. Because physx will crash if we add
// a joint between these.
let rigid_body = if i == 0 && (k % 4 == 0 && k != num - 2 || k == num - 1) {
let rigid_body = if i == 0 && (k.is_multiple_of(4) && k != num - 2 || k == num - 1) {
RigidBody::Fixed
} else {
RigidBody::Dynamic
Expand Down Expand Up @@ -213,7 +213,7 @@ fn create_ball_joints(commands: &mut Commands, num: usize) {
let fk = k as f32;
let fi = i as f32;

let rigid_body = if i == 0 && (k % 4 == 0 || k == num - 1) {
let rigid_body = if i == 0 && (k.is_multiple_of(4) || k == num - 1) {
RigidBody::Fixed
} else {
RigidBody::Dynamic
Expand Down
26 changes: 11 additions & 15 deletions bevy_rapier3d/examples/ray_casting3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,18 @@ pub fn cast_ray(
return Ok(());
};
let context = rapier_context.single()?;
// Then cast the ray.
let hit = context.cast_ray(
ray.origin,
ray.direction.into(),
f32::MAX,
true,
QueryFilter::only_dynamic(),
);
context.with_query_pipeline(QueryFilter::only_dynamic(), |query_pipeline| {
// Then cast the ray.
let hit = query_pipeline.cast_ray(ray.origin, ray.direction.into(), f32::MAX, true);

if let Some((entity, _toi)) = hit {
// Color in blue the entity we just hit.
// Because of the query filter, only colliders attached to a dynamic body
// will get an event.
let color = basic::BLUE.into();
commands.entity(entity).insert(ColliderDebugColor(color));
}
if let Some((entity, _toi)) = hit {
// Color in blue the entity we just hit.
// Because of the query filter, only colliders attached to a dynamic body
// will get an event.
let color = basic::BLUE.into();
commands.entity(entity).insert(ColliderDebugColor(color));
}
});
}

Ok(())
Expand Down
5 changes: 2 additions & 3 deletions bevy_rapier3d/examples/voxels3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::prelude::*;
use bevy_rapier3d::prelude::*;
use rapier3d::{math::Isometry, prelude::VoxelPrimitiveGeometry};
use rapier3d::math::Isometry;

fn main() {
App::new()
Expand Down Expand Up @@ -56,8 +56,7 @@ pub fn setup_physics(mut commands: Commands) {
}
}
}
let collider =
Collider::voxels_from_points(VoxelPrimitiveGeometry::PseudoCube, voxel_size, &samples);
let collider = Collider::voxels_from_points(voxel_size, &samples);
let ground_position = Vec3::new(voxel_size.x / 2f32, 0.0, voxel_size.z / 2f32);
let floor_aabb = collider.raw.compute_aabb(&Isometry::identity());
commands.spawn((Transform::from_translation(ground_position), collider));
Expand Down
2 changes: 1 addition & 1 deletion bevy_rapier_benches3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rapier3d = { features = ["profiler"], version = "0.25" }
rapier3d = { features = ["profiler"], version = "0.27.0-beta.0" }
bevy_rapier3d = { version = "0.30", path = "../bevy_rapier3d" }
bevy = { version = "0.16.0", default-features = false }

Expand Down
10 changes: 8 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
[advisories]
yanked = "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." },
# paste was announced as unmaintained with no explanation or replacement
# See:
# - https://rustsec.org/advisories/RUSTSEC-2024-0436
# - https://github.com/bevyengine/bevy/pull/18209
# Bevy relies on this in multiple indirect ways, so ignoring it is the only feasible current solution
"RUSTSEC-2024-0436",
]

[licenses]
allow = [
"MIT-0",
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"Zlib",
"CC0-1.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"Unicode-3.0",
"NCSA",
"Apache-2.0 WITH LLVM-exception",
]

[[licenses.clarify]]
Expand Down
Loading