chore: update to nalgebra 0.33 and parry 0.16 (#664)

This commit is contained in:
Sébastien Crozet
2024-06-23 22:57:51 +02:00
committed by GitHub
parent 3e8650f3a7
commit 3004a7d38d
21 changed files with 82 additions and 65 deletions

View File

@@ -5,6 +5,7 @@ resolver = "2"
[patch.crates-io] [patch.crates-io]
#wrapped2d = { git = "https://github.com/Bastacyclop/rust_box2d.git" } #wrapped2d = { git = "https://github.com/Bastacyclop/rust_box2d.git" }
#xurdf = { path = "../xurdf/xurdf" }
#simba = { path = "../simba" } #simba = { path = "../simba" }
#kiss3d = { path = "../kiss3d" } #kiss3d = { path = "../kiss3d" }
@@ -12,7 +13,7 @@ resolver = "2"
#parry3d = { path = "../parry/crates/parry3d" } #parry3d = { path = "../parry/crates/parry3d" }
#parry2d-f64 = { path = "../parry/crates/parry2d-f64" } #parry2d-f64 = { path = "../parry/crates/parry2d-f64" }
#parry3d-f64 = { path = "../parry/crates/parry3d-f64" } #parry3d-f64 = { path = "../parry/crates/parry3d-f64" }
# nalgebra = { path = "../nalgebra" } #nalgebra = { path = "../nalgebra" }
#kiss3d = { git = "https://github.com/sebcrozet/kiss3d" } #kiss3d = { git = "https://github.com/sebcrozet/kiss3d" }

View File

@@ -21,7 +21,7 @@ dim2 = []
f64 = [] f64 = []
parallel = ["rayon"] parallel = ["rayon"]
simd-stable = ["simba/wide", "simd-is-enabled"] 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 # Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature. # enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"] simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim2", "f64"]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true } instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.32" nalgebra = "0.33"
parry2d-f64 = "0.15.0" parry2d-f64 = "0.16.0"
simba = "0.8" simba = "0.9"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
arrayvec = "0.7" arrayvec = "0.7"
bit-vec = "0.6" bit-vec = "0.6"
rustc-hash = "1" rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2" downcast-rs = "1.2"
num-derive = "0.4" num-derive = "0.4"
bitflags = "1" bitflags = "2"
log = "0.4" log = "0.4"
ordered-float = "4" ordered-float = "4"
thiserror = "1" thiserror = "1"

View File

@@ -21,7 +21,7 @@ dim2 = []
f32 = [] f32 = []
parallel = ["rayon"] parallel = ["rayon"]
simd-stable = ["simba/wide", "simd-is-enabled"] 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 # Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature. # enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"] simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim2", "f32"]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true } instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.32" nalgebra = "0.33"
parry2d = "0.15.0" parry2d = "0.16.0"
simba = "0.8" simba = "0.9"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
arrayvec = "0.7" arrayvec = "0.7"
bit-vec = "0.6" bit-vec = "0.6"
rustc-hash = "1" rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2" downcast-rs = "1.2"
num-derive = "0.4" num-derive = "0.4"
bitflags = "1" bitflags = "2"
log = "0.4" log = "0.4"
ordered-float = "4" ordered-float = "4"
thiserror = "1" thiserror = "1"

View File

@@ -21,7 +21,7 @@ dim3 = []
f64 = [] f64 = []
parallel = ["rayon"] parallel = ["rayon"]
simd-stable = ["parry3d-f64/simd-stable", "simba/wide", "simd-is-enabled"] 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 # Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature. # enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"] simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim3", "f64"]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true } instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.32" nalgebra = "0.33"
parry3d-f64 = "0.15.0" parry3d-f64 = "0.16.0"
simba = "0.8" simba = "0.9"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
arrayvec = "0.7" arrayvec = "0.7"
bit-vec = "0.6" bit-vec = "0.6"
rustc-hash = "1" rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2" downcast-rs = "1.2"
num-derive = "0.4" num-derive = "0.4"
bitflags = "1" bitflags = "2"
log = "0.4" log = "0.4"
ordered-float = "4" ordered-float = "4"
thiserror = "1" thiserror = "1"

View File

@@ -21,7 +21,7 @@ dim3 = []
f32 = [] f32 = []
parallel = ["rayon"] parallel = ["rayon"]
simd-stable = ["parry3d/simd-stable", "simba/wide", "simd-is-enabled"] 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 # Do not enable this feature directly. It is automatically
# enabled with the "simd-stable" or "simd-nightly" feature. # enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = ["vec_map"] simd-is-enabled = ["vec_map"]
@@ -51,19 +51,19 @@ required-features = ["dim3", "f32"]
vec_map = { version = "0.8", optional = true } vec_map = { version = "0.8", optional = true }
instant = { version = "0.1", features = ["now"], optional = true } instant = { version = "0.1", features = ["now"], optional = true }
num-traits = "0.2" num-traits = "0.2"
nalgebra = "0.32" nalgebra = "0.33"
parry3d = "0.15.0" parry3d = "0.16.0"
simba = "0.8" simba = "0.9"
approx = "0.5" approx = "0.5"
rayon = { version = "1", optional = true } rayon = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
arrayvec = "0.7" arrayvec = "0.7"
bit-vec = "0.6" bit-vec = "0.6"
rustc-hash = "1" rustc-hash = "2"
serde = { version = "1", features = ["derive"], optional = true } serde = { version = "1", features = ["derive"], optional = true }
downcast-rs = "1.2" downcast-rs = "1.2"
num-derive = "0.4" num-derive = "0.4"
bitflags = "1" bitflags = "2"
log = "0.4" log = "0.4"
ordered-float = "4" ordered-float = "4"
thiserror = "1" thiserror = "1"

View File

@@ -28,11 +28,11 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.32", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
bitflags = "1" bitflags = "2"
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
wrapped2d = { version = "0.4", optional = true } wrapped2d = { version = "0.4", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -28,11 +28,11 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.32", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
bitflags = "1" bitflags = "2"
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
wrapped2d = { version = "0.4", optional = true } wrapped2d = { version = "0.4", optional = true }
crossbeam = "0.8" crossbeam = "0.8"

View File

@@ -27,11 +27,11 @@ parallel = ["rapier/parallel", "num_cpus"]
features = ["parallel"] features = ["parallel"]
[dependencies] [dependencies]
nalgebra = { version = "0.32", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
bitflags = "1" bitflags = "2"
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
crossbeam = "0.8" crossbeam = "0.8"
bincode = "1" bincode = "1"

View File

@@ -28,11 +28,11 @@ other-backends = ["physx", "physx-sys", "glam"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.32", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam025"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
bitflags = "1" bitflags = "2"
glam = { version = "0.24", optional = true } # For Physx glam = { version = "0.24", optional = true } # For Physx
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
physx = { version = "0.19", features = ["glam"], optional = true } physx = { version = "0.19", features = ["glam"], optional = true }

View File

@@ -12,6 +12,7 @@ use crate::dynamics::SphericalJoint;
bitflags::bitflags! { bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint. /// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct JointAxesMask: u8 { pub struct JointAxesMask: u8 {
/// The linear (translational) degree of freedom along the local X axis of a joint. /// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0; const LIN_X = 1 << 0;
@@ -26,21 +27,21 @@ bitflags::bitflags! {
/// The angular degree of freedom along the local Z axis of a joint. /// The angular degree of freedom along the local Z axis of a joint.
const ANG_Z = 1 << 5; const ANG_Z = 1 << 5;
/// The set of degrees of freedom locked by a revolute joint. /// 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. /// 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. /// 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. /// 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. /// 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. /// 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. /// The set of degrees of freedom left free by a fixed joint.
const FREE_FIXED_AXES = 0; const FREE_FIXED_AXES = 0;
/// The set of degrees of freedom left free by a spherical joint. /// 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. /// The set of all translational degrees of freedom.
const LIN_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits(); const LIN_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits() | Self::LIN_Z.bits();
/// The set of all angular degrees of freedom. /// The set of all angular degrees of freedom.
@@ -52,6 +53,7 @@ bitflags::bitflags! {
bitflags::bitflags! { bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint. /// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct JointAxesMask: u8 { pub struct JointAxesMask: u8 {
/// The linear (translational) degree of freedom along the local X axis of a joint. /// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0; const LIN_X = 1 << 0;
@@ -60,15 +62,15 @@ bitflags::bitflags! {
/// The angular degree of freedom of a joint. /// The angular degree of freedom of a joint.
const ANG_X = 1 << 2; const ANG_X = 1 << 2;
/// The set of degrees of freedom locked by a revolute joint. /// 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. /// 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. /// 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. /// 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. /// 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. /// The set of degrees of freedom left free by a fixed joint.
const FREE_FIXED_AXES = 0; const FREE_FIXED_AXES = 0;
/// The set of all translational degrees of freedom. /// The set of all translational degrees of freedom.

View File

@@ -96,6 +96,7 @@ impl RigidBodyType {
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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. /// Flags describing how the rigid-body has been modified by the user.
pub struct RigidBodyChanges: u32 { pub struct RigidBodyChanges: u32 {
/// Flag indicating that any component of this rigid-body has been modified. /// Flag indicating that any component of this rigid-body has been modified.
@@ -204,6 +205,7 @@ where
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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. /// Flags affecting the behavior of the constraints solver for a given contact manifold.
// FIXME: rename this to LockedAxes // FIXME: rename this to LockedAxes
pub struct LockedAxes: u8 { pub struct LockedAxes: u8 {
@@ -214,7 +216,7 @@ bitflags::bitflags! {
/// Flag indicating that the rigid-body cannot translate along the `Z` axis. /// Flag indicating that the rigid-body cannot translate along the `Z` axis.
const TRANSLATION_LOCKED_Z = 1 << 2; const TRANSLATION_LOCKED_Z = 1 << 2;
/// Flag indicating that the rigid-body cannot translate along any direction. /// 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. /// Flag indicating that the rigid-body cannot rotate along the `X` axis.
const ROTATION_LOCKED_X = 1 << 3; const ROTATION_LOCKED_X = 1 << 3;
/// Flag indicating that the rigid-body cannot rotate along the `Y` axis. /// 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. /// Flag indicating that the rigid-body cannot rotate along the `Z` axis.
const ROTATION_LOCKED_Z = 1 << 5; const ROTATION_LOCKED_Z = 1 << 5;
/// Combination of flags indicating that the rigid-body cannot rotate along any axis. /// 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();
} }
} }

View File

@@ -43,6 +43,7 @@ impl IndexedData for ColliderHandle {
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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. /// Flags describing how the collider has been modified by the user.
pub struct ColliderChanges: u32 { pub struct ColliderChanges: u32 {
/// Flag indicating that any component of the collider has been modified. /// Flag indicating that any component of the collider has been modified.
@@ -301,6 +302,7 @@ impl Default for ColliderMaterial {
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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 /// Flags affecting whether or not collision-detection happens between two colliders
/// depending on the type of rigid-bodies they are attached to. /// depending on the type of rigid-bodies they are attached to.
pub struct ActiveCollisionTypes: u16 { pub struct ActiveCollisionTypes: u16 {
@@ -364,8 +366,8 @@ impl ActiveCollisionTypes {
// //
// Because that test must be symmetric, we perform two similar tests by swapping // Because that test must be symmetric, we perform two similar tests by swapping
// rb_type1 and rb_type2. // rb_type1 and rb_type2.
((self.bits >> (rb_type1 as u32 * 4)) & 0b0000_1111) & (1 << rb_type2 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 || ((self.bits() >> (rb_type2 as u32 * 4)) & 0b0000_1111) & (1 << rb_type1 as u32) != 0
} }
} }

View File

@@ -9,6 +9,7 @@ use super::CollisionEvent;
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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. /// Flags affecting the behavior of the constraints solver for a given contact manifold.
pub struct SolverFlags: u32 { pub struct SolverFlags: u32 {
/// The constraint solver will take this contact manifold into /// The constraint solver will take this contact manifold into

View File

@@ -80,6 +80,7 @@ use bitflags::bitflags;
bitflags! { bitflags! {
/// A bit mask identifying groups for interaction. /// A bit mask identifying groups for interaction.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Group: u32 { pub struct Group: u32 {
/// The group n°1. /// The group n°1.
const GROUP_1 = 1 << 0; const GROUP_1 = 1 << 0;
@@ -156,7 +157,7 @@ bitflags! {
impl From<u32> for Group { impl From<u32> for Group {
#[inline] #[inline]
fn from(val: u32) -> Self { fn from(val: u32) -> Self {
unsafe { Self::from_bits_unchecked(val) } Self::from_bits_retain(val)
} }
} }

View File

@@ -59,6 +59,7 @@ pub type DefaultBroadPhase = BroadPhaseMultiSap;
bitflags::bitflags! { bitflags::bitflags! {
/// Flags providing more information regarding a collision event. /// Flags providing more information regarding a collision event.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct CollisionEventFlags: u32 { pub struct CollisionEventFlags: u32 {
/// Flag set if at least one of the colliders involved in the /// Flag set if at least one of the colliders involved in the
/// collision was a sensor when the event was fired. /// collision was a sensor when the event was fired.

View File

@@ -16,6 +16,7 @@ use std::collections::HashMap;
bitflags::bitflags! { bitflags::bitflags! {
/// Flags indicating what part of the physics engine should be rendered /// Flags indicating what part of the physics engine should be rendered
/// by the debug-renderer. /// by the debug-renderer.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct DebugRenderMode: u32 { pub struct DebugRenderMode: u32 {
/// If this flag is set, the collider shapes will be rendered. /// If this flag is set, the collider shapes will be rendered.
const COLLIDER_SHAPES = 1 << 0; const COLLIDER_SHAPES = 1 << 0;
@@ -26,7 +27,7 @@ bitflags::bitflags! {
/// If this flag is set, the impulse joints will be rendered. /// If this flag is set, the impulse joints will be rendered.
const IMPULSE_JOINTS = 1 << 3; const IMPULSE_JOINTS = 1 << 3;
/// If this flag is set, all the joints will be rendered. /// 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. /// If this flag is set, the solver contacts will be rendered.
const SOLVER_CONTACTS = 1 << 4; const SOLVER_CONTACTS = 1 << 4;
/// If this flag is set, the geometric contacts will be rendered. /// If this flag is set, the geometric contacts will be rendered.

View File

@@ -5,6 +5,7 @@ use crossbeam::channel::Sender;
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
/// Flags affecting the events generated for this collider. /// Flags affecting the events generated for this collider.
pub struct ActiveEvents: u32 { pub struct ActiveEvents: u32 {
/// If set, Rapier will call `EventHandler::handle_collision_event` /// If set, Rapier will call `EventHandler::handle_collision_event`

View File

@@ -118,6 +118,7 @@ impl<'a> ContactModificationContext<'a> {
bitflags::bitflags! { bitflags::bitflags! {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[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. /// Flags affecting the behavior of the constraints solver for a given contact manifold.
pub struct ActiveHooks: u32 { pub struct ActiveHooks: u32 {
/// If set, Rapier will call `PhysicsHooks::filter_contact_pair` whenever relevant. /// If set, Rapier will call `PhysicsHooks::filter_contact_pair` whenever relevant.

View File

@@ -43,7 +43,7 @@ struct QueryPipelineAsCompositeShape<'a> {
} }
bitflags::bitflags! { bitflags::bitflags! {
#[derive(Default)] #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
/// Flags for excluding whole sets of colliders from a scene query. /// Flags for excluding whole sets of colliders from a scene query.
pub struct QueryFilterFlags: u32 { pub struct QueryFilterFlags: u32 {
/// Exclude from the query any collider attached to a fixed rigid-body and colliders with no rigid-body attached. /// 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. /// Exclude from the query any collider that is not a sensor.
const EXCLUDE_SOLIDS = 1 << 5; const EXCLUDE_SOLIDS = 1 << 5;
/// Excludes all colliders not attached to a dynamic rigid-body. /// 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. /// 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 /// Exclude all colliders attached to a non-fixed rigid-body
/// (this will not exclude colliders not attached to any 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();
} }
} }

View File

@@ -441,23 +441,23 @@ impl PhysxWorld {
px_frame2.as_ptr(), 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 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 physx_sys::PxD6Motion::Free
} else { } else {
physx_sys::PxD6Motion::Locked 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 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 physx_sys::PxD6Motion::Free
} else { } else {
physx_sys::PxD6Motion::Locked 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 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 physx_sys::PxD6Motion::Free
} else { } else {
physx_sys::PxD6Motion::Locked physx_sys::PxD6Motion::Locked

View File

@@ -75,7 +75,7 @@ fn usage(exe_name: &str) {
} }
bitflags! { bitflags! {
#[derive(Default)] #[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct TestbedStateFlags: u32 { pub struct TestbedStateFlags: u32 {
const NONE = 0; const NONE = 0;
const SLEEP = 1 << 0; const SLEEP = 1 << 0;
@@ -92,6 +92,7 @@ bitflags! {
} }
bitflags! { bitflags! {
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct TestbedActionFlags: u32 { pub struct TestbedActionFlags: u32 {
const RESET_WORLD_GRAPHICS = 1 << 0; const RESET_WORLD_GRAPHICS = 1 << 0;
const EXAMPLE_CHANGED = 1 << 1; 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 crate::mouse::{track_mouse_state, MainCamera, SceneMouse};
use bevy::window::PrimaryWindow; use bevy::window::PrimaryWindow;
#[allow(clippy::type_complexity)]
fn update_testbed( fn update_testbed(
mut commands: Commands, mut commands: Commands,
windows: Query<&Window, With<PrimaryWindow>>, windows: Query<&Window, With<PrimaryWindow>>,
@@ -1121,9 +1123,11 @@ fn update_testbed(
#[cfg(feature = "other-backends")] mut other_backends: NonSendMut<OtherBackends>, #[cfg(feature = "other-backends")] mut other_backends: NonSendMut<OtherBackends>,
mut plugins: NonSendMut<Plugins>, mut plugins: NonSendMut<Plugins>,
mut ui_context: EguiContexts, mut ui_context: EguiContexts,
mut gfx_components: Query<&mut Transform>, (mut gfx_components, mut cameras, mut material_handles): (
mut cameras: Query<(&Camera, &GlobalTransform, &mut OrbitCamera)>, Query<&mut Transform>,
mut material_handles: Query<&mut Handle<BevyMaterial>>, Query<(&Camera, &GlobalTransform, &mut OrbitCamera)>,
Query<&mut Handle<BevyMaterial>>,
),
keys: Res<ButtonInput<KeyCode>>, keys: Res<ButtonInput<KeyCode>>,
) { ) {
let meshes = &mut *meshes; let meshes = &mut *meshes;