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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mujoco-react",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "Composable React Three Fiber building blocks for MuJoCo WASM simulations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,6 +24,17 @@ const DEFAULTS: GenericIKOptions = {
24
24
  rotWeight: 0.3,
25
25
  };
26
26
 
27
+ function resolveOptions(opts?: Partial<GenericIKOptions>): GenericIKOptions {
28
+ return {
29
+ maxIterations: opts?.maxIterations ?? DEFAULTS.maxIterations,
30
+ damping: opts?.damping ?? DEFAULTS.damping,
31
+ tolerance: opts?.tolerance ?? DEFAULTS.tolerance,
32
+ epsilon: opts?.epsilon ?? DEFAULTS.epsilon,
33
+ posWeight: opts?.posWeight ?? DEFAULTS.posWeight,
34
+ rotWeight: opts?.rotWeight ?? DEFAULTS.rotWeight,
35
+ };
36
+ }
37
+
27
38
  /**
28
39
  * Generic Damped Least-Squares IK solver.
29
40
  * Uses finite-difference Jacobian via MuJoCo's mj_forward.
@@ -58,7 +69,7 @@ export class GenericIK {
58
69
  currentQ: ArrayLike<number>,
59
70
  opts?: Partial<GenericIKOptions>
60
71
  ): number[] | null {
61
- const o = { ...DEFAULTS, ...opts };
72
+ const o = resolveOptions(opts);
62
73
  const n = qposAdr.length;
63
74
 
64
75
  // Save full qpos so we can restore after solving