API Reference / formLoss · function
Function: formLoss()
function formLoss(positions, constraints): number;
Total weighted loss for a set of body positions — the sum of each constraint's constraintLoss times its weight. The objective compileForm minimizes.
Parameters
| Parameter | Type | Description |
|---|---|---|
positions | Positions | Body positions keyed by id (bare longitudes or states). |
constraints | Constraint[] | The constraints to score. |
Returns
number
The total weighted loss in degrees (0 = all satisfied).