aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2024-06-23 22:57:51 +0200
committerGitHub <noreply@github.com>2024-06-23 22:57:51 +0200
commit3004a7d38da447e307e11d86528047bdb724c318 (patch)
treec16924c62b12523525d95711e9773a6ba96e5271
parent3e8650f3a761422f0926300dc98f9870e5d92776 (diff)
downloadrapier-3004a7d38da447e307e11d86528047bdb724c318.tar.gz
rapier-3004a7d38da447e307e11d86528047bdb724c318.tar.bz2
rapier-3004a7d38da447e307e11d86528047bdb724c318.zip
chore: update to nalgebra 0.33 and parry 0.16 (#664)
-rw-r--r--Cargo.toml3
-rw-r--r--crates/rapier2d-f64/Cargo.toml12
-rw-r--r--crates/rapier2d/Cargo.toml12
-rw-r--r--crates/rapier3d-f64/Cargo.toml12
-rw-r--r--crates/rapier3d/Cargo.toml12
-rw-r--r--crates/rapier_testbed2d-f64/Cargo.toml4
-rw-r--r--crates/rapier_testbed2d/Cargo.toml4
-rw-r--r--crates/rapier_testbed3d-f64/Cargo.toml4
-rw-r--r--crates/rapier_testbed3d/Cargo.toml4
-rw-r--r--src/dynamics/joint/generic_joint.rs26
-rw-r--r--src/dynamics/rigid_body_components.rs6
-rw-r--r--src/geometry/collider_components.rs6
-rw-r--r--src/geometry/contact_pair.rs1
-rw-r--r--src/geometry/interaction_groups.rs3
-rw-r--r--src/geometry/mod.rs1
-rw-r--r--src/pipeline/debug_render_pipeline/debug_render_pipeline.rs3
-rw-r--r--src/pipeline/event_handler.rs1
-rw-r--r--src/pipeline/physics_hooks.rs1
-rw-r--r--src/pipeline/query_pipeline/mod.rs8
-rw-r--r--src_testbed/physx_backend.rs12
-rw-r--r--src_testbed/testbed.rs12
21 files changed, 82 insertions, 65 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 971dff9..fd16059 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,7 @@ resolver = "2"
[patch.crates-io]
#wrapped2d = { git = "https://github.com/Bastacyclop/rust_box2d.git" }
+#xurdf = { path = "../xurdf/xurdf" }
#simba = { path = "../simba" }
#kiss3d = { path = "../kiss3d" }
@@ -12,7 +13,7 @@ resolver = "2"
#parry3d = { path = "../parry/crates/parry3d" }
#parry2d-f64 = { path = "../parry/crates/parry2d-f64" }
#parry3d-f64 = { path = "../parry/crates/parry3d-f64" }
-# nalgebra = { path = "../nalgebra" }
+#nalgebra = { path = "../nalgebra" }
#kiss3d = { git = "https://github.com/sebcrozet/kiss3d" }
diff --git a/crates/rapier2d-f64/Cargo.toml b/crates/rapier2d-f64/Cargo.toml
index a6b4671..23bc4d1 100644
--- a/crates/rapier2d-f64/Cargo.toml
+++ b/crates/rapier2d-f64/Cargo.toml
@@ -21,7 +21,7 @@ dim2 = []
f64 = []
parallel = ["rayon"]
simd-stable = ["simba/wide", "simd-is-enabled"]
-simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
+simd-nightly = ["simba/portable_simd", "simd-is-enabled"]
# Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim2", "f64"]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2"
-nalgebra = "0.32"
-parry2d-f64 = "0.15.0"
-simba = "0.8"
+nalgebra = "0.33"
+parry2d-f64 = "0.16.0"
+simba = "0.9"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
arrayvec = "0.7"
bit-vec = "0.6"
-rustc-hash = "1"
+rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2"
num-derive = "0.4"
-bitflags = "1"
+bitflags = "2"
log = "0.4"
ordered-float = "4"
thiserror = "1"
diff --git a/crates/rapier2d/Cargo.toml b/crates/rapier2d/Cargo.toml
index cdd9310..94ecd28 100644
--- a/crates/rapier2d/Cargo.toml
+++ b/crates/rapier2d/Cargo.toml
@@ -21,7 +21,7 @@ dim2 = []
f32 = []
parallel = ["rayon"]
simd-stable = ["simba/wide", "simd-is-enabled"]
-simd-nightly = ["simba/packed_simd", "simd-is-enabled"]
+simd-nightly = ["simba/portable_simd", "simd-is-enabled"]
# Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim2", "f32"]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2"
-nalgebra = "0.32"
-parry2d = "0.15.0"
-simba = "0.8"
+nalgebra = "0.33"
+parry2d = "0.16.0"
+simba = "0.9"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
arrayvec = "0.7"
bit-vec = "0.6"
-rustc-hash = "1"
+rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2"
num-derive = "0.4"
-bitflags = "1"
+bitflags = "2"
log = "0.4"
ordered-float = "4"
thiserror = "1"
diff --git a/crates/rapier3d-f64/Cargo.toml b/crates/rapier3d-f64/Cargo.toml
index 95a3ab7..538456d 100644
--- a/crates/rapier3d-f64/Cargo.toml
+++ b/crates/rapier3d-f64/Cargo.toml
@@ -21,7 +21,7 @@ dim3 = []
f64 = []
parallel = ["rayon"]
simd-stable = ["parry3d-f64/simd-stable", "simba/wide", "simd-is-enabled"]
-simd-nightly = ["parry3d-f64/simd-nightly", "simba/packed_simd", "simd-is-enabled"]
+simd-nightly = ["parry3d-f64/simd-nightly", "simba/portable_simd", "simd-is-enabled"]
# Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim3", "f64"]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2"
-nalgebra = "0.32"
-parry3d-f64 = "0.15.0"
-simba = "0.8"
+nalgebra = "0.33"
+parry3d-f64 = "0.16.0"
+simba = "0.9"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
arrayvec = "0.7"
bit-vec = "0.6"
-rustc-hash = "1"
+rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2"
num-derive = "0.4"
-bitflags = "1"
+bitflags = "2"
log = "0.4"
ordered-float = "4"
thiserror = "1"
diff --git a/crates/rapier3d/Cargo.toml b/crates/rapier3d/Cargo.toml
index 2142e82..db40c57 100644
--- a/crates/rapier3d/Cargo.toml
+++ b/crates/rapier3d/Cargo.toml
@@ -21,7 +21,7 @@ dim3 = []
f32 = []
parallel = ["rayon"]
simd-stable = ["parry3d/simd-stable", "simba/wide", "simd-is-enabled"]
-simd-nightly = ["parry3d/simd-nightly", "simba/packed_simd", "simd-is-enabled"]
+simd-nightly = ["parry3d/simd-nightly", "simba/portable_simd", "simd-is-enabled"]
# Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim3", "f32"]
vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2"
-nalgebra = "0.32"
-parry3d = "0.15.0"
-simba = "0.8"
+nalgebra = "0.33"
+parry3d = "0.16.0"
+simba = "0.9"
approx = "0.5"
rayon = { version = "1", optional = true }
crossbeam = "0.8"
arrayvec = "0.7"
bit-vec = "0.6"
-rustc-hash = "1"
+rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2"
num-derive = "0.4"
-bitflags = "1"
+bitflags = "2"
log = "0.4"
ordered-float = "4"
thiserror = "1"
diff --git a/crates/rapier_testbed2d-f64/Cargo.toml b/crates/rapier_testbed2d-f64/Cargo.toml
index 55d1c18..8b236ff 100644
--- a/crates/rapier_testbed2d-f64/Cargo.toml
+++ b/crates/rapier_testbed2d-f64/Cargo.toml
@@ -28,11 +28,11 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"]
[dependencies]
-nalgebra = { version = "0.32", features = ["rand", "glam025"] }
+nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] }
-bitflags = "1"
+bitflags = "2"
num_cpus = { version = "1", optional = true }
wrapped2d = { version = "0.4", optional = true }
crossbeam = "0.8"
diff --git a/crates/rapier_testbed2d/Cargo.toml b/crates/rapier_testbed2d/Cargo.toml
index d8abcb6..26fe127 100644
--- a/crates/rapier_testbed2d/Cargo.toml
+++ b/crates/rapier_testbed2d/Cargo.toml
@@ -28,11 +28,11 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"]
[dependencies]
-nalgebra = { version = "0.32", features = ["rand", "glam025"] }
+nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] }
-bitflags = "1"
+bitflags = "2"
num_cpus = { version = "1", optional = true }
wrapped2d = { version = "0.4", optional = true }
crossbeam = "0.8"
diff --git a/crates/rapier_testbed3d-f64/Cargo.toml b/crates/rapier_testbed3d-f64/Cargo.toml
index 5baefa2..fb813bf 100644
--- a/crates/rapier_testbed3d-f64/Cargo.toml
+++ b/crates/rapier_testbed3d-f64/Cargo.toml
@@ -27,11 +27,11 @@ parallel = ["rapier/parallel", "num_cpus"]
features = ["parallel"]
[dependencies]
-nalgebra = { version = "0.32", features = ["rand", "glam025"] }
+nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] }
-bitflags = "1"
+bitflags = "2"
num_cpus = { version = "1", optional = true }
crossbeam = "0.8"
bincode = "1"
diff --git a/crates/rapier_testbed3d/Cargo.toml b/crates/rapier_testbed3d/Cargo.toml
index 7633e64..7e66de4 100644
--- a/crates/rapier_testbed3d/Cargo.toml
+++ b/crates/rapier_testbed3d/Cargo.toml
@@ -28,11 +28,11 @@ other-backends = ["physx", "physx-sys", "glam"]
features = ["parallel", "other-backends"]
[dependencies]
-nalgebra = { version = "0.32", features = ["rand", "glam025"] }
+nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8"
rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] }
-bitflags = "1"
+bitflags = "2"
glam = { version = "0.24", optional = true } # For Physx
num_cpus = { version = "1", optional = true }
physx = { version = "0.19", features = ["glam"], optional = true }
diff --git a/src/dynamics/joint/generic_joint.rs b/src/dynamics/joint/generic_joint.rs
index 154c439..8d4066d 100644
--- a/src/dynamics/joint/generic_joint.rs
+++ b/src/dynamics/joint/generic_joint.rs
@@ -12,6 +12,7 @@ use crate::dynamics::SphericalJoint;
bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct JointAxesMask: u8 {
/// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0;
@@ -26,21 +27,21 @@ bitflags::bitflags! {
/// The angular degree of freedom along the local Z axis of a joint.
const ANG_Z = 1 << 5;
/// The set of degrees of freedom locked by a revolute joint.
- const LOCKED_REVOLUTE_AXES = Self::LIN_X.bits | Self::LIN_Y.bits | Self::LIN_Z.bits | Self::ANG_Y.bits | Self::ANG_Z.bits;
+ const LOCKED_REVOLUTE_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits() | Self::ANG_Y.bits() | Self::ANG_Z.bits();
/// The set of degrees of freedom locked by a prismatic joint.
- const LOCKED_PRISMATIC_AXES = Self::LIN_Y.bits | Self::LIN_Z.bits | Self::ANG_X.bits | Self::ANG_Y.bits | Self::ANG_Z.bits;
+ const LOCKED_PRISMATIC_AXES = Self::LIN_Y.bits() | Self::LIN_Z.bits() | Self::ANG_X.bits() | Self::ANG_Y.bits() | Self::ANG_Z.bits();
/// The set of degrees of freedom locked by a fixed joint.
- const LOCKED_FIXED_AXES = Self::LIN_X.bits | Self::LIN_Y.bits | Self::LIN_Z.bits | Self::ANG_X.bits | Self::ANG_Y.bits | Self::ANG_Z.bits;
+ const LOCKED_FIXED_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits() | Self::ANG_X.bits() | Self::ANG_Y.bits() | Self::ANG_Z.bits();
/// The set of degrees of freedom locked by a spherical joint.
- const LOCKED_SPHERICAL_AXES = Self::LIN_X.bits | Self::LIN_Y.bits | Self::LIN_Z.bits;
+ const LOCKED_SPHERICAL_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits();
/// The set of degrees of freedom left free by a revolute joint.
- const FREE_REVOLUTE_AXES = Self::ANG_X.bits;
+ const FREE_REVOLUTE_AXES = Self::ANG_X.bits();
/// The set of degrees of freedom left free by a prismatic joint.
- const FREE_PRISMATIC_AXES = Self::LIN_X.bits;
+ const FREE_PRISMATIC_AXES = Self::LIN_X.bits();
/// The set of degrees of freedom left free by a fixed joint.
const FREE_FIXED_AXES = 0;
/// The set of degrees of freedom left free by a spherical joint.
- const FREE_SPHERICAL_AXES = Self::ANG_X.bits | Self::ANG_Y.bits | Self::ANG_Z.bits;
+ const FREE_SPHERICAL_AXES = Self::ANG_X.bits() | Self::ANG_Y.bits() | Self::ANG_Z.bits();
/// The set of all translational degrees of freedom.
const LIN_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits();
/// The set of all angular degrees of freedom.
@@ -52,6 +53,7 @@ bitflags::bitflags! {
bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct JointAxesMask: u8 {
/// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0;
@@ -60,15 +62,15 @@ bitflags::bitflags! {
/// The angular degree of freedom of a joint.
const ANG_X = 1 << 2;
/// The set of degrees of freedom locked by a revolute joint.
- const LOCKED_REVOLUTE_AXES = Self::LIN_X.bits | Self::LIN_Y.bits;
+ const LOCKED_REVOLUTE_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits();
/// The set of degrees of freedom locked by a prismatic joint.
- const LOCKED_PRISMATIC_AXES = Self::LIN_Y.bits | Self::ANG_X.bits;
+ const LOCKED_PRISMATIC_AXES = Self::LIN_Y.bits() | Self::ANG_X.bits();
/// The set of degrees of freedom locked by a fixed joint.
- const LOCKED_FIXED_AXES = Self::LIN_X.bits | Self::LIN_Y.bits | Self::ANG_X.bits;
+ const LOCKED_FIXED_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::ANG_X.bits();
/// The set of degrees of freedom left free by a revolute joint.
- const FREE_REVOLUTE_AXES = Self::ANG_X.bits;
+ const FREE_REVOLUTE_AXES = Self::ANG_X.bits();
/// The set of degrees of freedom left free by a prismatic joint.
- const FREE_PRISMATIC_AXES = Self::LIN_X.bits;
+ const FREE_PRISMATIC_AXES = Self::LIN_X.bits();
/// The set of degrees of freedom left free by a fixed joint.
const FREE_FIXED_AXES = 0;
/// The set of all translational degrees of freedom.
diff --git a/src/dynamics/rigid_body_components.rs b/src/dynamics/rigid_body_components.rs
index a391feb..641434c 100644
--- a/src/dynamics/rigid_body_components.rs
+++ b/src/dynamics/rigid_body_components.rs
@@ -96,6 +96,7 @@ impl RigidBodyType {
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
/// Flags describing how the rigid-body has been modified by the user.
pub struct RigidBodyChanges: u32 {
/// Flag indicating that any component of this rigid-body has been modified.
@@ -204,6 +205,7 @@ where
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
/// Flags affecting the behavior of the constraints solver for a given contact manifold.
// FIXME: rename this to LockedAxes
pub struct LockedAxes: u8 {
@@ -214,7 +216,7 @@ bitflags::bitflags! {
/// Flag indicating that the rigid-body cannot translate along the `Z` axis.
const TRANSLATION_LOCKED_Z = 1 << 2;
/// Flag indicating that the rigid-body cannot translate along any direction.
- const TRANSLATION_LOCKED = Self::TRANSLATION_LOCKED_X.bits | Self::TRANSLATION_LOCKED_Y.bits | Self::TRANSLATION_LOCKED_Z.bits;
+ const TRANSLATION_LOCKED = Self::TRANSLATION_LOCKED_X.bits() | Self::TRANSLATION_LOCKED_Y.bits() | Self::TRANSLATION_LOCKED_Z.bits();
/// Flag indicating that the rigid-body cannot rotate along the `X` axis.
const ROTATION_LOCKED_X = 1 << 3;
/// Flag indicating that the rigid-body cannot rotate along the `Y` axis.
@@ -222,7 +224,7 @@ bitflags::bitflags! {
/// Flag indicating that the rigid-body cannot rotate along the `Z` axis.
const ROTATION_LOCKED_Z = 1 << 5;
/// Combination of flags indicating that the rigid-body cannot rotate along any axis.
- const ROTATION_LOCKED = Self::ROTATION_LOCKED_X.bits | Self::ROTATION_LOCKED_Y.bits | Self::ROTATION_LOCKED_Z.bits;
+ const ROTATION_LOCKED = Self::ROTATION_LOCKED_X.bits() | Self::ROTATION_LOCKED_Y.bits() | Self::ROTATION_LOCKED_Z.bits();
}
}
diff --git a/src/geometry/collider_components.rs b/src/geometry/collider_components.rs
index 123e32c..efaccd0 100644
--- a/src/geometry/collider_components.rs
+++ b/src/geometry/collider_components.rs
@@ -43,6 +43,7 @@ impl IndexedData for ColliderHandle {
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
/// Flags describing how the collider has been modified by the user.
pub struct ColliderChanges: u32 {
/// Flag indicating that any component of the collider has been modified.
@@ -301,6 +302,7 @@ impl Default for ColliderMaterial {
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
/// Flags affecting whether or not collision-detection happens between two colliders
/// depending on the type of rigid-bodies they are attached to.
pub struct ActiveCollisionTypes: u16 {
@@ -364,8 +366,8 @@ impl ActiveCollisionTypes {
//
// Because that test must be symmetric, we perform two similar tests by swapping
// rb_type1 and rb_type2.
- ((self.bits >> (rb_type1 as u32 * 4)) & 0b0000_1111) & (1 << rb_type2 as u32) != 0
- || ((self.bits >> (rb_type2 as u32 * 4)) & 0b0000_1111) & (1 << rb_type1 as u32) != 0
+ ((self.bits() >> (rb_type1 as u32 * 4)) & 0b0000_1111) & (1 << rb_type2 as u32) != 0
+ || ((self.bits() >> (rb_type2 as u32 * 4)) & 0b0000_1111) & (1 << rb_type1 as u32) != 0
}
}
diff --git a/src/geometry/contact_pair.rs b/src/geometry/contact_pair.rs
index c57f98a..8ff5dd6 100644
--- a/src/geometry/contact_pair.rs
+++ b/src/geometry/contact_pair.rs
@@ -9,6 +9,7 @@ use super::CollisionEvent;
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
/// Flags affecting the behavior of the constraints solver for a given contact manifold.
pub struct SolverFlags: u32 {
/// The constraint solver will take this contact manifold into
diff --git a/src/geometry/interaction_groups.rs b/src/geometry/interaction_groups.rs
index b07389c..f61de1a 100644
--- a/src/geometry/interaction_groups.rs
+++ b/src/geometry/interaction_groups.rs
@@ -80,6 +80,7 @@ use bitflags::bitflags;
bitflags! {
/// A bit mask identifying groups for interaction.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Group: u32 {
/// The group n°1.
const GROUP_1 = 1 << 0;
@@ -156,7 +157,7 @@ bitflags! {
impl From<u32> for Group {
#[inline]
fn from(val: u32) -> Self {
- unsafe { Self::from_bits_unchecked(val) }
+ Self::from_bits_retain(val)
}
}
diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs
index e7f0da7..ea0c7fb 100644
--- a/src/geometry/mod.rs
+++ b/src/geometry/mod.rs
@@ -59,6 +59,7 @@ pub type DefaultBroadPhase = BroadPhaseMultiSap;
bitflags::bitflags! {
/// Flags providing more information regarding a collision event.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct CollisionEventFlags: u32 {
/// Flag set if at least one of the colliders involved in the
/// collision was a sensor when the event was fired.
diff --git a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
index 041862c..831f815 100644
--- a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
+++ b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
@@ -16,6 +16,7 @@ use std::collections::HashMap;
bitflags::bitflags! {
/// Flags indicating what part of the physics engine should be rendered
/// by the debug-renderer.
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct DebugRenderMode: u32 {
/// If this flag is set, the collider shapes will be rendered.
const COLLIDER_SHAPES = 1 << 0;
@@ -26,7 +27,7 @@ bitflags::bitflags! {
/// If this flag is set, the impulse joints will be rendered.
const IMPULSE_JOINTS = 1 << 3;
/// If this flag is set, all the joints will be rendered.
- const JOINTS = Self::MULTIBODY_JOINTS.bits | Self::IMPULSE_JOINTS.bits;
+ const JOINTS = Self::MULTIBODY_JOINTS.bits() | Self::IMPULSE_JOINTS.bits();
/// If this flag is set, the solver contacts will be rendered.
const SOLVER_CONTACTS = 1 << 4;
/// If this flag is set, the geometric contacts will be rendered.
diff --git a/src/pipeline/event_handler.rs b/src/pipeline/event_handler.rs
index 7957ccf..ab98434 100644
--- a/src/pipeline/event_handler.rs
+++ b/src/pipeline/event_handler.rs
@@ -5,6 +5,7 @@ use crossbeam::channel::Sender;
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
/// Flags affecting the events generated for this collider.
pub struct ActiveEvents: u32 {
/// If set, Rapier will call `EventHandler::handle_collision_event`
diff --git a/src/pipeline/physics_hooks.rs b/src/pipeline/physics_hooks.rs
index 11166b5..558962d 100644
--- a/src/pipeline/physics_hooks.rs
+++ b/src/pipeline/physics_hooks.rs
@@ -118,6 +118,7 @@ impl<'a> ContactModificationContext<'a> {
bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
/// Flags affecting the behavior of the constraints solver for a given contact manifold.
pub struct ActiveHooks: u32 {
/// If set, Rapier will call `PhysicsHooks::filter_contact_pair` whenever relevant.
diff --git a/src/pipeline/query_pipeline/mod.rs b/src/pipeline/query_pipeline/mod.rs
index cd8ae4c..18d7948 100644
--- a/src/pipeline/query_pipeline/mod.rs
+++ b/src/pipeline/query_pipeline/mod.rs
@@ -43,7 +43,7 @@ struct QueryPipelineAsCompositeShape<'a> {
}
bitflags::bitflags! {
- #[derive(Default)]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
/// Flags for excluding whole sets of colliders from a scene query.
pub struct QueryFilterFlags: u32 {
/// Exclude from the query any collider attached to a fixed rigid-body and colliders with no rigid-body attached.
@@ -57,12 +57,12 @@ bitflags::bitflags! {
/// Exclude from the query any collider that is not a sensor.
const EXCLUDE_SOLIDS = 1 << 5;
/// Excludes all colliders not attached to a dynamic rigid-body.
- const ONLY_DYNAMIC = Self::EXCLUDE_FIXED.bits | Self::EXCLUDE_KINEMATIC.bits;
+ const ONLY_DYNAMIC = Self::EXCLUDE_FIXED.bits() | Self::EXCLUDE_KINEMATIC.bits();
/// Excludes all colliders not attached to a kinematic rigid-body.
- const ONLY_KINEMATIC = Self::EXCLUDE_DYNAMIC.bits | Self::EXCLUDE_FIXED.bits;
+ const ONLY_KINEMATIC = Self::EXCLUDE_DYNAMIC.bits() | Self::EXCLUDE_FIXED.bits();
/// Exclude all colliders attached to a non-fixed rigid-body
/// (this will not exclude colliders not attached to any rigid-body).
- const ONLY_FIXED = Self::EXCLUDE_DYNAMIC.bits | Self::EXCLUDE_KINEMATIC.bits;
+ const ONLY_FIXED = Self::EXCLUDE_DYNAMIC.bits() | Self::EXCLUDE_KINEMATIC.bits();
}
}
diff --git a/src_testbed/physx_backend.rs b/src_testbed/physx_backend.rs
index 7070c81..71f8f9d 100644
--- a/src_testbed/physx_backend.rs
+++ b/src_testbed/physx_backend.rs
@@ -441,23 +441,23 @@ impl PhysxWorld {
px_frame2.as_ptr(),
);
- let motion_x = if joint.1.data.limit_axes.contains(JointAxesMask::X) {
+ let motion_x = if joint.1.data.limit_axes.contains(JointAxesMask::LIN_X) {
physx_sys::PxD6Motion::Limited
- } else if !joint.1.data.locked_axes.contains(JointAxesMask::X) {
+ } else if !joint.1.data.locked_axes.contains(JointAxesMask::LIN_X) {
physx_sys::PxD6Motion::Free
} else {
physx_sys::PxD6Motion::Locked
};
- let motion_y = if joint.1.data.limit_axes.contains(JointAxesMask::Y) {
+ let motion_y = if joint.1.data.limit_axes.contains(JointAxesMask::LIN_Y) {
physx_sys::PxD6Motion::Limited
- } else if !joint.1.data.locked_axes.contains(JointAxesMask::Y) {
+ } else if !joint.1.data.locked_axes.contains(JointAxesMask::LIN_Y) {
physx_sys::PxD6Motion::Free
} else {
physx_sys::PxD6Motion::Locked
};
- let motion_z = if joint.1.data.limit_axes.contains(JointAxesMask::Z) {
+ let motion_z = if joint.1.data.limit_axes.contains(JointAxesMask::LIN_Z) {
physx_sys::PxD6Motion::Limited
- } else if !joint.1.data.locked_axes.contains(JointAxesMask::Z) {
+ } else if !joint.1.data.locked_axes.contains(JointAxesMask::LIN_Z) {
physx_sys::PxD6Motion::Free
} else {
physx_sys::PxD6Motion::Locked
diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs
index dc747ed..26d8d9d 100644
--- a/src_testbed/testbed.rs
+++ b/src_testbed/testbed.rs
@@ -75,7 +75,7 @@ fn usage(exe_name: &str) {
}
bitflags! {
- #[derive(Default)]
+ #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct TestbedStateFlags: u32 {
const NONE = 0;
const SLEEP = 1 << 0;
@@ -92,6 +92,7 @@ bitflags! {
}
bitflags! {
+ #[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct TestbedActionFlags: u32 {
const RESET_WORLD_GRAPHICS = 1 << 0;
const EXAMPLE_CHANGED = 1 << 1;
@@ -1106,6 +1107,7 @@ fn egui_focus(mut ui_context: EguiContexts, mut cameras: Query<&mut OrbitCamera>
use crate::mouse::{track_mouse_state, MainCamera, SceneMouse};
use bevy::window::PrimaryWindow;
+#[allow(clippy::type_complexity)]
fn update_testbed(
mut commands: Commands,
windows: Query<&Window, With<PrimaryWindow>>,
@@ -1121,9 +1123,11 @@ fn update_testbed(
#[cfg(feature = "other-backends")] mut other_backends: NonSendMut<OtherBackends>,
mut plugins: NonSendMut<Plugins>,
mut ui_context: EguiContexts,
- mut gfx_components: Query<&mut Transform>,
- mut cameras: Query<(&Camera, &GlobalTransform, &mut OrbitCamera)>,
- mut material_handles: Query<&mut Handle<BevyMaterial>>,
+ (mut gfx_components, mut cameras, mut material_handles): (
+ Query<&mut Transform>,
+ Query<(&Camera, &GlobalTransform, &mut OrbitCamera)>,
+ Query<&mut Handle<BevyMaterial>>,
+ ),
keys: Res<ButtonInput<KeyCode>>,
) {
let meshes = &mut *meshes;