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++) { if (m_Source != null) { particleIndices[i] = constraints.GetActor().solverIndices[m_Source.particleIndices[i]]; } stiffnesses[i * 2] = 0; stiffnesses[i * 2 + 1] = 0; lambdas.Add(0); lambdas.Add(0); lambdas.Add(0); lambdas.Add(0); } UpdateColliderIndices(); m_BatchImpl.SetPinConstraints(particleIndices, colliderIndices, offsets, restDarbouxVectors, stiffnesses, lambdas, m_ConstraintCount); m_BatchImpl.SetActiveConstraints(m_ActiveConstraintCount); } }
public override void AddToSolver(ObiSolver solver) { if (solver != null && solver.implementation != null) { m_BatchImpl = solver.implementation.CreateConstraintsBatch(constraintType) as IPinConstraintsBatchImpl; if (m_BatchImpl != null) { m_BatchImpl.SetPinConstraints(particleIndices, colliderIndices, offsets, restDarbouxVectors, stiffnesses, lambdas, m_ActiveConstraintCount); } } }
public void RemoveBatch(IPinConstraintsBatchImpl batch) { batches.Remove(batch as BurstPinConstraintsBatch); }