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 < restLengths.count; i++) { particleIndices[i * 2] = constraints.GetActor().solverIndices[m_Source.particleIndices[i * 2]]; particleIndices[i * 2 + 1] = constraints.GetActor().solverIndices[m_Source.particleIndices[i * 2 + 1]]; orientationIndices[i] = constraints.GetActor().solverIndices[((ObiStretchShearConstraintsBatch)m_Source).orientationIndices[i]]; lambdas.Add(0); lambdas.Add(0); lambdas.Add(0); } m_BatchImpl.SetStretchShearConstraints(particleIndices, orientationIndices, restLengths, restOrientations, stiffnesses, 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 IStretchShearConstraintsBatchImpl; if (m_BatchImpl != null) { m_BatchImpl.SetStretchShearConstraints(particleIndices, orientationIndices, restLengths, restOrientations, stiffnesses, lambdas, m_ActiveConstraintCount); } }
public void RemoveBatch(IStretchShearConstraintsBatchImpl batch) { batches.Remove(batch as BurstStretchShearConstraintsBatch); }