private void RemoveFromSolver(ObiSolver solver) { // remove the constraint batch from the solver // (no need to destroy it as its destruction is managed by the solver) // Oni.RemoveBatch(actor1.solver.OniSolver, batch); if (inSolver && m_BatchImpl != null) { solver.implementation.DestroyConstraintsBatch(m_BatchImpl as IStitchConstraintsBatchImpl); m_BatchImpl.Destroy(); m_BatchImpl = null; inSolver = false; } }
private void AddToSolver(ObiSolver solver) { if (!inSolver) { inSolver = true; // create a constraint batch (CreateStitchConstraints() in burst returns a singleton): m_BatchImpl = solver.implementation.CreateConstraintsBatch(Oni.ConstraintType.Stitch) as IStitchConstraintsBatchImpl; // push current data to solver: PushDataToSolver(); // enable/disable the batch: m_BatchImpl.enabled = isActiveAndEnabled; } }
public void RemoveBatch(IStitchConstraintsBatchImpl batch) { batches.Remove(batch as BurstStitchConstraintsBatch); }