public override void AddToSolver(ObiSolver solver) { // Create distance constraints batch directly. m_BatchImpl = solver.implementation.CreateConstraintsBatch(constraintType) as IBendConstraintsBatchImpl; if (m_BatchImpl != null) { m_BatchImpl.SetBendConstraints(particleIndices, restBends, bendingStiffnesses, plasticity, lambdas, m_ActiveConstraintCount); } }
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 < restBends.count; i++) { particleIndices[i * 3] = constraints.GetActor().solverIndices[m_Source.particleIndices[i * 3]]; particleIndices[i * 3 + 1] = constraints.GetActor().solverIndices[m_Source.particleIndices[i * 3 + 1]]; particleIndices[i * 3 + 2] = constraints.GetActor().solverIndices[m_Source.particleIndices[i * 3 + 2]]; lambdas.Add(0); } // pass constraint data arrays to the solver: m_BatchImpl.SetBendConstraints(particleIndices, restBends, bendingStiffnesses, lambdas, m_ConstraintCount); m_BatchImpl.SetActiveConstraints(m_ActiveConstraintCount); } }
public void RemoveBatch(IBendConstraintsBatchImpl batch) { batches.Remove(batch as BurstBendConstraintsBatch); }