public override void AddToSolver() { // create and add the implementation: if (m_Constraints != null && m_Constraints.implementation != null) { m_BatchImpl = m_Constraints.implementation.CreateConstraintsBatch(); } if (m_BatchImpl != null) { lambdas.Clear(); for (int i = 0; i < particleIndices.count; i++) { particleIndices[i] = constraints.GetActor().solverIndices[m_Source.particleIndices[i]]; } for (int i = 0; i < restVolumes.count; i++) { lambdas.Add(0); } m_BatchImpl.SetVolumeConstraints(particleIndices, firstTriangle, restVolumes, pressureStiffness, lambdas, m_ConstraintCount); m_BatchImpl.SetActiveConstraints(m_ActiveConstraintCount); } }
public override void AddToSolver(ObiSolver solver) { // Create distance constraints batch directly. m_BatchImpl = solver.implementation.CreateConstraintsBatch(constraintType) as IVolumeConstraintsBatchImpl; if (m_BatchImpl != null) { m_BatchImpl.SetVolumeConstraints(particleIndices, firstTriangle, numTriangles, restVolumes, pressureStiffness, lambdas, m_ActiveConstraintCount); } }
public void RemoveBatch(IVolumeConstraintsBatchImpl batch) { batches.Remove(batch as BurstVolumeConstraintsBatch); }