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

            for ii in 0..SIMD_WIDTH {
                let manifold = &mut manifolds_all[self.manifold_id[ii]];
                let k_base = self.manifold_contact_id;
                let active_contacts = &mut manifold.points[..manifold.data.num_active_contacts()];
                active_contacts[k_base + k].data.impulse = impulses[ii];

                #[cfg(feature = "dim2")]
                {
                    active_contacts[k_base + k].data.tangent_impulse = tangent_impulses[ii];
                }
                #[cfg(feature = "dim3")]
                {
                    active_contacts[k_base + k].data.tangent_impulse =
                        [tangent_impulses[ii], bitangent_impulses[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 impulses: [_; SIMD_WIDTH] = self.elements[k].normal_part.impulse.into();
            let tangent_impulses: [_; SIMD_WIDTH] =
                self.elements[k].tangent_parts[0].impulse.into();
            #[cfg(feature = "dim3")]
            let bitangent_impulses: [_; SIMD_WIDTH] =
                self.elements[k].tangent_parts[1].impulse.into();
            for ii in 0..SIMD_WIDTH {
                let manifold = &mut manifolds_all[self.manifold_id[ii]];
                let k_base = self.manifold_contact_id;
                let active_contacts = &mut manifold.points[..manifold.data.num_active_contacts()];
                active_contacts[k_base + k].data.impulse = impulses[ii];
                #[cfg(feature = "dim2")]
                {
                    active_contacts[k_base + k].data.tangent_impulse = tangent_impulses[ii];
                }
                #[cfg(feature = "dim3")]
                {
                    active_contacts[k_base + k].data.tangent_impulse =
                        [tangent_impulses[ii], bitangent_impulses[ii]];
                }
            }
        }
    }
pub fn writeback_impulses ( & self , manifolds_all : & mut [ & mut ContactManifold ] ) { for k in 0 .. self . num_contacts as usize { let impulses : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . normal_part . impulse . into ( ) ; let tangent_impulses : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . tangent_parts [ 0 ] . impulse . into ( ) ; # [ cfg ( feature " " ) ] let bitangent_impulses : [ _ ; SIMD_WIDTH ] = self . elements [ k ] . tangent_parts [ 1 ] . impulse . into ( ) ; for ii in 0 .. SIMD_WIDTH { let manifold = & mut manifolds_all [ self . manifold_id [ ii ] ] ; let k_base = self . manifold_contact_id ; let active_contacts = & mut manifold . points [ .. manifold . data . num_active_contacts ( ) ] ; active_contacts [ k_base + k ] . data . impulse = impulses [ ii ] ; # [ cfg ( feature " " ) ] { active_contacts [ k_base + k ] . data . tangent_impulse = tangent_impulses [ ii ] ; } # [ cfg ( feature " " ) ] { active_contacts [ k_base + k ] . data . tangent_impulse = [ tangent_impulses [ ii ] , bitangent_impulses [ ii ] ] ; } } } }
FIXME: duplicated code.
FIXME : duplicated code .
&self
manifolds_all
&mut [&mut ContactManifold]