feat: rename JointAxesMask::X/Y/Z by ::LIN_X/LIN_Y/LIN_Z and JointAxis::X/Y/Z by ::LinX/LinY/LinZ

This commit is contained in:
Sébastien Crozet
2024-05-26 18:12:26 +02:00
committed by Sébastien Crozet
parent 5c44d936f7
commit c785ea4996
7 changed files with 61 additions and 59 deletions

View File

@@ -13,12 +13,12 @@ bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
pub struct JointAxesMask: u8 {
/// The translational degree of freedom along the local X axis of a joint.
const X = 1 << 0;
/// The translational degree of freedom along the local Y axis of a joint.
const Y = 1 << 1;
/// The translational degree of freedom along the local Z axis of a joint.
const Z = 1 << 2;
/// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0;
/// The linear (translational) degree of freedom along the local Y axis of a joint.
const LIN_Y = 1 << 1;
/// The linear (translational) degree of freedom along the local Z axis of a joint.
const LIN_Z = 1 << 2;
/// The angular degree of freedom along the local X axis of a joint.
const ANG_X = 1 << 3;
/// The angular degree of freedom along the local Y axis of a joint.
@@ -26,23 +26,23 @@ 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::X.bits | Self::Y.bits | Self::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::Y.bits | Self::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::X.bits | Self::Y.bits | Self::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::X.bits | Self::Y.bits | Self::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;
/// The set of degrees of freedom left free by a prismatic joint.
const FREE_PRISMATIC_AXES = Self::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;
/// The set of all translational degrees of freedom.
const LIN_AXES = Self::X.bits() | Self::Y.bits() | Self::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.
const ANG_AXES = Self::ANG_X.bits() | Self::ANG_Y.bits() | Self::ANG_Z.bits();
}
@@ -53,26 +53,26 @@ bitflags::bitflags! {
/// A bit mask identifying multiple degrees of freedom of a joint.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
pub struct JointAxesMask: u8 {
/// The translational degree of freedom along the local X axis of a joint.
const X = 1 << 0;
/// The translational degree of freedom along the local Y axis of a joint.
const Y = 1 << 1;
/// The linear (translational) degree of freedom along the local X axis of a joint.
const LIN_X = 1 << 0;
/// The linear (translational) degree of freedom along the local Y axis of a joint.
const LIN_Y = 1 << 1;
/// 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::X.bits | Self::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::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::X.bits | Self::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;
/// The set of degrees of freedom left free by a prismatic joint.
const FREE_PRISMATIC_AXES = Self::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.
const LIN_AXES = Self::X.bits() | Self::Y.bits();
const LIN_AXES = Self::LIN_X.bits() | Self::LIN_Y.bits();
/// The set of all angular degrees of freedom.
const ANG_AXES = Self::ANG_X.bits();
}
@@ -88,13 +88,13 @@ impl Default for JointAxesMask {
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum JointAxis {
/// The translational degree of freedom along the joints local X axis.
X = 0,
/// The translational degree of freedom along the joints local Y axis.
Y,
/// The translational degree of freedom along the joints local Z axis.
/// The linear (translational) degree of freedom along the joints local X axis.
LinX = 0,
/// The linear (translational) degree of freedom along the joints local Y axis.
LinY,
/// The linear (translational) degree of freedom along the joints local Z axis.
#[cfg(feature = "dim3")]
Z,
LinZ,
/// The rotational degree of freedom along the joints local X axis.
AngX,
/// The rotational degree of freedom along the joints local Y axis.