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

ParameterTypeDescription
positionsPositionsBody positions keyed by id (bare longitudes or states).
constraintsConstraint[]The constraints to score.

Returns

number

The total weighted loss in degrees (0 = all satisfied).

Start building

Quickstart →