Runs the Solver asynchronously in a WebWorker. The worker owns a copy of the frames and the
resulting joint values are copied back onto the frames on the main thread as solves complete.
On this page
Properties
The roots to solve for. If modified updateStructure must be called.
The SOLVE_STATUS of each chain from the most recent solve in the worker.
Whether a solve is running in the worker.
Methods
new WorkerSolver(
// The roots of the trees to solve.
roots: Frame | Array<Frame>
)updateStructure(): voidSends the structure of the trees to the worker. Must be called whenever the parent child structure, the degrees of freedom of a joint, or the joint values are changed on the main thread.
updateSolverSettings(
// Option names and values as listed on `Solver`.
settings: Object
): voidSets the given Solver options on the solver in the worker.
updateFrameState(
// The frames to copy.
...frames: Frame
): voidCopies the frame transforms and joint settings, everything except the joint values being solved for, to the worker. Copies every frame if none are given.
solve(): voidStarts a solve loop in the worker if one is not running. The loop stops on its own once no
chain returns SOLVE_STATUS.TIMEOUT.
stop(): voidStops the solve loop in the worker.
dispose(): voidStops the solve loop and terminates the worker.