pub fn writeback_impulses(&self, joints_all: &mut [JointGraphEdge]) {
        let joint = &mut joints_all[self.joint_id].weight;
        match &mut joint.params {
            JointParams::GenericJoint(out) => {
                out.impulse[0] = self.vel.lin_impulse.x;
                out.impulse[1] = self.vel.lin_impulse.y;
                out.impulse[2] = self.vel.lin_impulse.z;
                out.impulse[3] = self.vel.ang_impulse.x;
                out.impulse[4] = self.vel.ang_impulse.y;
                out.impulse[5] = self.vel.ang_impulse.z;
            }
            JointParams::RevoluteJoint(out) => {
                out.impulse[0] = self.vel.lin_impulse.x;
                out.impulse[1] = self.vel.lin_impulse.y;
                out.impulse[2] = self.vel.lin_impulse.z;
                out.motor_impulse = self.vel.ang_impulse.x;
                out.impulse[3] = self.vel.ang_impulse.y;
                out.impulse[4] = self.vel.ang_impulse.z;
            }
            _ => unimplemented!(),
        }
    }
// TODO: duplicated code with the non-ground constraint.
duplicated code with the non-ground constraint.
duplicated code with the non - ground constraint .
pub fn writeback_impulses(&self, joints_all: &mut [JointGraphEdge]) {
        let joint = &mut joints_all[self.joint_id].weight;
        match &mut joint.params {
            JointParams::GenericJoint(out) => {
                out.impulse[0] = self.vel.lin_impulse.x;
                out.impulse[1] = self.vel.lin_impulse.y;
                out.impulse[2] = self.vel.lin_impulse.z;
                out.impulse[3] = self.vel.ang_impulse.x;
                out.impulse[4] = self.vel.ang_impulse.y;
                out.impulse[5] = self.vel.ang_impulse.z;
            }
            JointParams::RevoluteJoint(out) => {
                out.impulse[0] = self.vel.lin_impulse.x;
                out.impulse[1] = self.vel.lin_impulse.y;
                out.impulse[2] = self.vel.lin_impulse.z;
                out.motor_impulse = self.vel.ang_impulse.x;
                out.impulse[3] = self.vel.ang_impulse.y;
                out.impulse[4] = self.vel.ang_impulse.z;
            }
            _ => unimplemented!(),
        }
    }
pub fn writeback_impulses ( & self , joints_all : & mut [ JointGraphEdge ] ) { let joint = & mut joints_all [ self . joint_id ] . weight ; match & mut joint . params { JointParams :: GenericJoint ( out ) => { out . impulse [ 0 ] = self . vel . lin_impulse . x ; out . impulse [ 1 ] = self . vel . lin_impulse . y ; out . impulse [ 2 ] = self . vel . lin_impulse . z ; out . impulse [ 3 ] = self . vel . ang_impulse . x ; out . impulse [ 4 ] = self . vel . ang_impulse . y ; out . impulse [ 5 ] = self . vel . ang_impulse . z ; } JointParams :: RevoluteJoint ( out ) => { out . impulse [ 0 ] = self . vel . lin_impulse . x ; out . impulse [ 1 ] = self . vel . lin_impulse . y ; out . impulse [ 2 ] = self . vel . lin_impulse . z ; out . motor_impulse = self . vel . ang_impulse . x ; out . impulse [ 3 ] = self . vel . ang_impulse . y ; out . impulse [ 4 ] = self . vel . ang_impulse . z ; } _ => unimplemented ! ( ) , } }
TODO: duplicated code with the non-ground constraint.
TODO : duplicated code with the non - ground constraint .
&self
joints_all
&mut [JointGraphEdge]