pub fn writeback_impulses(&self, manifolds_all: &mut [&mut ContactManifold]) {
        for k in 0..self.num_contacts as usize {
            let rhs: [_; SIMD_WIDTH] = self.elements[k].normal_part.rhs.into();
            let impulses: [_; SIMD_WIDTH] = self.elements[k].normal_part.impulse.into();
            #[cfg(feature = "dim2")]
            let tangent_impulses: [_; SIMD_WIDTH] = self.elements[k].tangent_part.impulse[0].into();
            #[cfg(feature = "dim3")]
            let tangent_impulses = self
                .tangent_rot1
                .inverse_transform_vector(&self.elements[k].tangent_part.impulse);

            for ii in 0..SIMD_WIDTH {
                let manifold = &mut manifolds_all[self.manifold_id[ii]];
                let contact_id = self.manifold_contact_id[k][ii];
                let active_contact = &mut manifold.points[contact_id as usize];
                active_contact.data.rhs = rhs[ii];
                active_contact.data.impulse = impulses[ii];

                #[cfg(feature = "dim2")]
                {
                    active_contact.data.tangent_impulse = tangent_impulses[ii];
                }
                #[cfg(feature = "dim3")]
                {
                    active_contact.data.tangent_impulse = tangent_impulses.extract(ii);
                }
            }
        }
    }
// FIXME: duplicated code. This is exactly the same as in the non-ground velocity constraint.
duplicated code. This is exactly the same as in the non-ground velocity constraint.
duplicated code . This is exactly the same as in the non - ground velocity constraint .
pub fn writeback_impulses(&self, manifolds_all: &mut [&mut ContactManifold]) {
        for k in 0..self.num_contacts as usize {
            let rhs: [_; SIMD_WIDTH] = self.elements[k].normal_part.rhs.into();
            let impulses: [_; SIMD_WIDTH] = self.elements[k].normal_part.impulse.into();
            #[cfg(feature = "dim2")]
            let tangent_impulses: [_; SIMD_WIDTH] = self.elements[k].tangent_part.impulse[0].into();
            #[cfg(feature = "dim3")]
            let tangent_impulses = self
                .tangent_rot1
                .inverse_transform_vector(&self.elements[k].tangent_part.impulse);
            for ii in 0..SIMD_WIDTH {
                let manifold = &mut manifolds_all[self.manifold_id[ii]];
                let contact_id = self.manifold_contact_id[k][ii];
                let active_contact = &mut manifold.points[contact_id as usize];
                active_contact.data.rhs = rhs[ii];
                active_contact.data.impulse = impulses[ii];
                #[cfg(feature = "dim2")]
                {
                    active_contact.data.tangent_impulse = tangent_impulses[ii];
                }
                #[cfg(feature = "dim3")]
                {
                    active_contact.data.tangent_impulse = tangent_impulses.extract(ii);
                }
            }
        }
    }
pub fn writeback_impulses ( & self , manifolds_all : & mut [ & mut ContactManifold ] ) { for k in 0 .. self . num_contacts as usize { let rhs : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . normal_part . rhs . into ( ) ; let impulses : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . normal_part . impulse . into ( ) ; # [ cfg ( feature " " ) ] let tangent_impulses : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . tangent_part . impulse [ 0 ] . into ( ) ; # [ cfg ( feature " " ) ] let tangent_impulses = self . tangent_rot1 . inverse_transform_vector ( & self . elements [ k ] . tangent_part . impulse ) ; for ii in 0 .. SIMD_WIDTH { let manifold = & mut manifolds_all [ self . manifold_id [ ii ] ] ; let contact_id = self . manifold_contact_id [ k ] [ ii ] ; let active_contact = & mut manifold . points [ contact_id as usize ] ; active_contact . data . rhs = rhs [ ii ] ; active_contact . data . impulse = impulses [ ii ] ; # [ cfg ( feature " " ) ] { active_contact . data . tangent_impulse = tangent_impulses [ ii ] ; } # [ cfg ( feature " " ) ] { active_contact . data . tangent_impulse = tangent_impulses . extract ( ii ) ; } } } }
FIXME: duplicated code.
FIXME : duplicated code .
&self
manifolds_all
&mut [&mut ContactManifold]