Skip to content

Commit

Permalink
Merge branch 'main' into interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Dec 5, 2024
2 parents 800f6d2 + 52cbcec commit ded0f31
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 37 deletions.
13 changes: 5 additions & 8 deletions crates/avian2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,14 @@ bench = false

[dependencies]
avian_derive = { path = "../avian_derive", version = "0.1" }
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false }
bevy_math = { git = "https://github.com/bevyengine/bevy" }
bevy_transform_interpolation = { git = "https://github.com/Jondolf/bevy_transform_interpolation", branch = "extrapolation-and-hermite-interpolation" }
bevy = { version = "0.15", default-features = false }
bevy_math = { version = "0.15" }
libm = { version = "0.2", optional = true }
parry2d = { version = "0.17", optional = true }
parry2d-f64 = { version = "0.17", optional = true }
nalgebra = { version = "0.33", features = ["convert-glam029"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
derive_more = "0.99"
derive_more = "1"
indexmap = "2.0.0"
fxhash = "0.2.1"
itertools = "0.13"
Expand All @@ -76,14 +75,12 @@ bitflags = "2.5.0"
[dev-dependencies]
examples_common_2d = { path = "../examples_common_2d" }
benches_common_2d = { path = "../benches_common_2d" }
bevy_math = { git = "https://github.com/bevyengine/bevy", features = [
"approx",
] }
bevy_math = { version = "0.15", features = ["approx"] }
glam = { version = "0.29", features = ["bytemuck"] }
approx = "0.5"
bytemuck = "1.19"
criterion = { version = "0.5", features = ["html_reports"] }
bevy_mod_debugdump = { git = "https://github.com/andriyDev/bevy_mod_debugdump", branch = "bevy-0.15" }
bevy_mod_debugdump = { git = "https://github.com/jakobhellermann/bevy_mod_debugdump" }

[[example]]
name = "dynamic_character_2d"
Expand Down
16 changes: 7 additions & 9 deletions crates/avian3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,30 @@ bench = false

[dependencies]
avian_derive = { path = "../avian_derive", version = "0.1" }
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false }
bevy_math = { git = "https://github.com/bevyengine/bevy" }
bevy_transform_interpolation = { git = "https://github.com/Jondolf/bevy_transform_interpolation", branch = "extrapolation-and-hermite-interpolation" }
bevy = { version = "0.15", default-features = false }
bevy_math = { version = "0.15" }
libm = { version = "0.2", optional = true }
parry3d = { version = "0.17", optional = true }
parry3d-f64 = { version = "0.17", optional = true }
nalgebra = { version = "0.33", features = ["convert-glam029"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
derive_more = "0.99"
derive_more = "1"
indexmap = "2.0.0"
fxhash = "0.2.1"
itertools = "0.13"
bitflags = "2.5.0"

[dev-dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false, features = [
bevy = { version = "0.15", default-features = false, features = [
"bevy_gltf",
"animation",
] }
examples_common_3d = { path = "../examples_common_3d" }
benches_common_3d = { path = "../benches_common_3d" }
bevy_math = { git = "https://github.com/bevyengine/bevy", features = [
"approx",
] }
bevy_math = { version = "0.15", features = ["approx"] }
approx = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
bevy_mod_debugdump = { git = "https://github.com/andriyDev/bevy_mod_debugdump", branch = "bevy-0.15" }
bevy_mod_debugdump = { git = "https://github.com/jakobhellermann/bevy_mod_debugdump" }

[[example]]
name = "dynamic_character_3d"
Expand Down
2 changes: 1 addition & 1 deletion crates/benches_common_2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false }
bevy = { version = "0.15", default-features = false }
avian2d = { path = "../avian2d", default-features = false }
criterion = "0.5"
2 changes: 1 addition & 1 deletion crates/benches_common_3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false }
bevy = { version = "0.15", default-features = false }
avian3d = { path = "../avian3d", default-features = false }
criterion = "0.5"
3 changes: 2 additions & 1 deletion crates/examples_common_2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
use-debug-plugin = []

[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", default-features = false, features = [
bevy = { version = "0.15", default-features = false, features = [
"bevy_core_pipeline",
"bevy_state",
"bevy_text",
Expand All @@ -22,6 +22,7 @@ bevy = { git = "https://github.com/bevyengine/bevy", default-features = false, f
"ktx2",
"zstd",
"bevy_winit",
"bevy_window",
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
] }
avian2d = { path = "../avian2d", default-features = false }
4 changes: 3 additions & 1 deletion crates/examples_common_3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
use-debug-plugin = []

[dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", features = [
bevy = { version = "0.15", default-features = false, features = [
"bevy_core_pipeline",
"bevy_state",
"bevy_text",
Expand All @@ -18,12 +18,14 @@ bevy = { git = "https://github.com/bevyengine/bevy", features = [
"bevy_pbr",
"bevy_gizmos",
"bevy_gltf",
"animation",
"default_font",
"tonemapping_luts",
"ktx2",
"png",
"zstd",
"bevy_winit",
"bevy_window",
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
] }
avian3d = { path = "../avian3d", default-features = false }
1 change: 0 additions & 1 deletion src/collision/collider/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ use mass_properties::OnChangeColliderMassProperties;
/// it should now work with the rest of the engine just like normal [`Collider`]s!
///
/// **Note**: [Spatial queries](spatial_query) are not supported for custom colliders yet.
pub struct ColliderBackendPlugin<C: ScalableCollider> {
schedule: Interned<dyn ScheduleLabel>,
_phantom: PhantomData<C>,
Expand Down
2 changes: 1 addition & 1 deletion src/collision/collider/world_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct ColliderQuery<C: AnyCollider> {
pub shape: &'static C,
}

impl<'w, C: AnyCollider> ColliderQueryItem<'w, C> {
impl<C: AnyCollider> ColliderQueryItem<'_, C> {
/// Returns the current position of the body. This is a sum of the [`Position`] and
/// [`AccumulatedTranslation`] components.
pub fn current_position(&self) -> Vector {
Expand Down
2 changes: 1 addition & 1 deletion src/collision/narrow_phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ pub struct NarrowPhase<'w, 's, C: AnyCollider> {
contact_tolerance: Local<'s, Scalar>,
}

impl<'w, 's, C: AnyCollider> NarrowPhase<'w, 's, C> {
impl<C: AnyCollider> NarrowPhase<'_, '_, C> {
/// Updates the narrow phase by computing [`Contacts`] based on [`BroadCollisionPairs`]
/// and adding them to [`Collisions`].
fn update(&mut self, broad_collision_pairs: &[(Entity, Entity)], delta_secs: Scalar) {
Expand Down
2 changes: 1 addition & 1 deletion src/debug_render/gizmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub trait PhysicsGizmoExt {
);
}

impl<'w, 's> PhysicsGizmoExt for Gizmos<'w, 's, PhysicsGizmos> {
impl PhysicsGizmoExt for Gizmos<'_, '_, PhysicsGizmos> {
/// Draws a line from `a` to `b`.
fn draw_line(&mut self, a: Vector, b: Vector, color: Color) {
#[cfg(feature = "2d")]
Expand Down
6 changes: 3 additions & 3 deletions src/dynamics/rigid_body/mass_properties/world_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct MassPropertiesQuery {
pub center_of_mass: &'static mut CenterOfMass,
}

impl<'w> MassPropertiesQueryItem<'w> {
impl MassPropertiesQueryItem<'_> {
/// Computes the angular inertia shifted by the given offset, taking into account mass.
#[cfg(feature = "2d")]
#[inline]
Expand Down Expand Up @@ -49,7 +49,7 @@ impl<'w> MassPropertiesQueryItem<'w> {
}
}

impl<'w> AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
impl AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'_> {
fn add_assign(&mut self, rhs: ColliderMassProperties) {
let mass1 = self.mass.value();
let mass2 = rhs.mass;
Expand All @@ -75,7 +75,7 @@ impl<'w> AddAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
}
}

impl<'w> SubAssign<ColliderMassProperties> for MassPropertiesQueryItem<'w> {
impl SubAssign<ColliderMassProperties> for MassPropertiesQueryItem<'_> {
fn sub_assign(&mut self, rhs: ColliderMassProperties) {
if self.mass.inverse() + rhs.mass.recip_or_zero() <= 0.0 {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/dynamics/rigid_body/world_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct RigidBodyQuery {
pub is_sensor: Has<Sensor>,
}

impl<'w> RigidBodyQueryItem<'w> {
impl RigidBodyQueryItem<'_> {
/// Computes the velocity at the given `point` relative to the center of the body.
pub fn velocity_at_point(&self, point: Vector) -> Vector {
#[cfg(feature = "2d")]
Expand Down Expand Up @@ -114,7 +114,7 @@ impl<'w> RigidBodyQueryItem<'w> {
}
}

impl<'w> RigidBodyQueryReadOnlyItem<'w> {
impl RigidBodyQueryReadOnlyItem<'_> {
/// Computes the velocity at the given `point` relative to the center of mass.
pub fn velocity_at_point(&self, point: Vector) -> Vector {
#[cfg(feature = "2d")]
Expand Down
12 changes: 6 additions & 6 deletions src/spatial_query/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ impl SpatialQueryPipeline {
pub(crate) fn as_composite_shape<'a>(
&'a self,
query_filter: &'a SpatialQueryFilter,
) -> QueryPipelineAsCompositeShape {
) -> QueryPipelineAsCompositeShape<'a> {
QueryPipelineAsCompositeShape {
pipeline: self,
colliders: &self.colliders,
query_filter,
}
}

pub(crate) fn as_composite_shape_with_predicate<'a>(
pub(crate) fn as_composite_shape_with_predicate<'a: 'b, 'b>(
&'a self,
query_filter: &'a SpatialQueryFilter,
predicate: &'a dyn Fn(Entity) -> bool,
) -> QueryPipelineAsCompositeShapeWithPredicate {
) -> QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
QueryPipelineAsCompositeShapeWithPredicate {
pipeline: self,
colliders: &self.colliders,
Expand Down Expand Up @@ -124,7 +124,7 @@ impl SpatialQueryPipeline {
&'a HashMap<Entity, (Isometry<Scalar>, Collider, CollisionLayers)>,
);

impl<'a> parry::partitioning::QbvhDataGenerator<u32> for DataGenerator<'a> {
impl parry::partitioning::QbvhDataGenerator<u32> for DataGenerator<'_> {
fn size_hint(&self) -> usize {
self.0.len()
}
Expand Down Expand Up @@ -812,7 +812,7 @@ pub(crate) struct QueryPipelineAsCompositeShape<'a> {
query_filter: &'a SpatialQueryFilter,
}

impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
impl TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'_> {
type PartShape = dyn Shape;
type PartNormalConstraints = dyn NormalConstraints;
type PartId = u32;
Expand Down Expand Up @@ -858,7 +858,7 @@ pub(crate) struct QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
predicate: &'b dyn Fn(Entity) -> bool,
}

impl<'a, 'b> TypedSimdCompositeShape for QueryPipelineAsCompositeShapeWithPredicate<'a, 'b> {
impl TypedSimdCompositeShape for QueryPipelineAsCompositeShapeWithPredicate<'_, '_> {
type PartShape = dyn Shape;
type PartNormalConstraints = dyn NormalConstraints;
type PartId = u32;
Expand Down
2 changes: 1 addition & 1 deletion src/spatial_query/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct SpatialQuery<'w, 's> {
pub query_pipeline: ResMut<'w, SpatialQueryPipeline>,
}

impl<'w, 's> SpatialQuery<'w, 's> {
impl SpatialQuery<'_, '_> {
/// Updates the colliders in the pipeline. This is done automatically once per physics frame in
/// [`PhysicsStepSet::SpatialQuery`], but if you modify colliders or their positions before that, you can
/// call this to make sure the data is up to date when performing spatial queries using [`SpatialQuery`].
Expand Down

0 comments on commit ded0f31

Please sign in to comment.