void Update() { if (reinitializeSolverEveryFrame) { //This keeps the simplex from becoming degenerate solver.constructRightAngleSimplex(solver.simplexVertices[0].coordinates, 1f); } else { //Only do this when the optimum is moving! solver.recalculateSimplexCosts(); } //Step the solver forward for (int i = 0; i < iterationsPerFrame; i++) { solver.stepSolver(); } }