rapier2d/dynamics/joint/multibody_joint/
multibody_workspace.rsuse crate::dynamics::RigidBodyVelocity;
use crate::math::Real;
use na::DVector;
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Clone, Debug)]
pub(crate) struct MultibodyWorkspace {
pub accs: Vec<RigidBodyVelocity>,
pub ndofs_vec: DVector<Real>,
}
impl MultibodyWorkspace {
pub fn new() -> Self {
MultibodyWorkspace {
accs: Vec::new(),
ndofs_vec: DVector::zeros(0),
}
}
pub fn resize(&mut self, nlinks: usize, ndofs: usize) {
self.accs.resize(nlinks, RigidBodyVelocity::zero());
self.ndofs_vec = DVector::zeros(ndofs)
}
}