chore: update to nalgebra 0.33 and parry 0.16 (#664)
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user