mujoco-react 10.0.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3382,6 +3382,16 @@ var DEFAULTS = {
3382
3382
  posWeight: 1,
3383
3383
  rotWeight: 0.3
3384
3384
  };
3385
+ function resolveOptions(opts) {
3386
+ return {
3387
+ maxIterations: opts?.maxIterations ?? DEFAULTS.maxIterations,
3388
+ damping: opts?.damping ?? DEFAULTS.damping,
3389
+ tolerance: opts?.tolerance ?? DEFAULTS.tolerance,
3390
+ epsilon: opts?.epsilon ?? DEFAULTS.epsilon,
3391
+ posWeight: opts?.posWeight ?? DEFAULTS.posWeight,
3392
+ rotWeight: opts?.rotWeight ?? DEFAULTS.rotWeight
3393
+ };
3394
+ }
3385
3395
  var GenericIK = class {
3386
3396
  mujoco;
3387
3397
  constructor(mujoco) {
@@ -3400,7 +3410,7 @@ var GenericIK = class {
3400
3410
  * @returns Joint angles array, or null if solver diverged
3401
3411
  */
3402
3412
  solve(model, data, siteId, qposAdr, targetPos, targetQuat, currentQ, opts) {
3403
- const o = { ...DEFAULTS, ...opts };
3413
+ const o = resolveOptions(opts);
3404
3414
  const n = qposAdr.length;
3405
3415
  const savedQpos = new Float64Array(data.qpos.length);
3406
3416
  savedQpos.set(data.qpos);