Class SolverAbstract

Base class for constraint solvers.

Hierarchy

Constructors

  • Parameters

    Returns Solver

Properties

equationSortFunction?: ((a, b) => number)

Type declaration

    • (a, b): number
    • Function that is used to sort all equations before each solve.

      Parameters

      Returns number

equations: Equation[]

Current equations in the solver.

type: number

The type of solver.

GS: 1

Gauss-Seidel solver.

Methods

  • Add an equation to be solved.

    Parameters

    Returns void

  • Add equations. Same as .addEquation, but this time the argument is an array of Equations

    Parameters

    Returns void

  • Removes all currently added equations

    Returns void

  • Removes an equation

    Parameters

    Returns void

  • Method to be implemented in each subclass

    Parameters

    • dt: number
    • world: World

    Returns void

  • Sort all equations using the .equationSortFunction. Should be called by subclasses before solving.

    Returns void