void Update() { if (PointCorrespondences.Count > 0 && Input.GetKey(KeyCode.Space)) { //This keeps the simplex from becoming degenerate solver.constructRightAngleSimplex(solver.simplexVertices[0].coordinates, 0.001f); for (int i = 0; i < 10; i++) { solver.stepSolver(); } } }
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(); } }