Address issues with the genral-case for multibody joints

This commit is contained in:
Sébastien Crozet
2022-01-08 21:09:11 +01:00
parent 9726738cd2
commit 87ec0ced40
7 changed files with 261 additions and 587 deletions

View File

@@ -389,19 +389,6 @@ impl RigidBodyVelocity {
}
}
#[cfg(feature = "dim2")]
pub(crate) fn from_vectors(linvel: Vector<Real>, angvel: na::Vector1<Real>) -> Self {
Self {
linvel,
angvel: angvel.x,
}
}
#[cfg(feature = "dim3")]
pub(crate) fn from_vectors(linvel: Vector<Real>, angvel: Vector<Real>) -> Self {
Self { linvel, angvel }
}
/// Velocities set to zero.
#[must_use]
pub fn zero() -> Self {
@@ -463,21 +450,9 @@ impl RigidBodyVelocity {
unsafe { std::mem::transmute(self) }
}
/// Return `self` transformed by `transform`.
#[must_use]
pub fn transformed(self, transform: &Isometry<Real>) -> Self {
Self {
linvel: transform * self.linvel,
#[cfg(feature = "dim2")]
angvel: self.angvel,
#[cfg(feature = "dim3")]
angvel: transform * self.angvel,
}
}
/// Return `self` rotated by `rotation`.
#[must_use]
pub fn rotated(self, rotation: &Rotation<Real>) -> Self {
pub fn transformed(self, rotation: &Rotation<Real>) -> Self {
Self {
linvel: rotation * self.linvel,
#[cfg(feature = "dim2")]