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

@@ -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.

View File

@@ -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();
}
}