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