Skip to content

Constraint Solving

VonTum edited this page Jan 1, 2021 · 1 revision

Constraint Solving

BallConstraint example

Each constraint defines a parameter space p, the number of which defines the degrees of freedom that are taken from the whole system. These parameters describe the internal forces, moments, impulses, etc of the constraint. For example for a BallConstraint, that would be the force or impulse applied along the cardinal axes. These forces are applied by the constraint to cancel out the error between it's two attachments. This error is in the form of the positions not matching exactly (as in the picture above) but also the velocities of the attachments, or higher derivatives of the position. In general, the constraint defines it's own error values and how to correct them.

Constraint interface

The constraint provides 5 matrices:

  • Two (Px6) matrices describing the parameter effects on each part's Motion: P->M1 and P->M2
  • Two (6xP) matrices describing the effects of the motion of each of the parts on the constraint error: M1->E and M2->E
  • A (XxP) matrix describing the current error of the constraint. This is a list of column vectors, each describing the error of one of the components of the constraint. (position, velocity, acceleration, etc)

Math

These matrices of every constraint are then used to construct a system of equations that is solved for the parameters to make the total error 0

MP=E

Conditional Constraints

WIP

Clone this wiki locally