@volter/editor-threejs 0.5.206 → 0.5.207

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/editor-threejs",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.206",
4
+ "version": "0.5.207",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -135,12 +135,12 @@
135
135
  "serving": "./dist-node/serving.mjs"
136
136
  },
137
137
  "dependencies": {
138
- "@volter/project": "0.5.206",
138
+ "@volter/project": "0.5.207",
139
139
  "@sparkjsdev/spark": "^2.1.0",
140
140
  "three.quarks": "^0.16.0",
141
141
  "zod": "^4.3.6",
142
142
  "typescript": "5.9.3",
143
- "@volter/sdk": "0.5.206",
143
+ "@volter/sdk": "0.5.207",
144
144
  "postprocessing": "6.38.3",
145
145
  "quarks.core": "0.16.0",
146
146
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
@@ -1517,7 +1517,9 @@ export function Object3DDocumentViewport({
1517
1517
  // events, which have no browser-owned active pointer and therefore
1518
1518
  // cannot be captured. Hardware pointers still take capture so a
1519
1519
  // gesture can leave the viewport without getting stranded.
1520
- if (event.isTrusted) canvas.setPointerCapture?.(event.pointerId);
1520
+ // Nor can a pointer be captured while the document holds a pointer lock (a game's
1521
+ // mouse look): the browser throws InvalidStateError on every click in Play.
1522
+ if (event.isTrusted && !canvas.ownerDocument.pointerLockElement) canvas.setPointerCapture?.(event.pointerId);
1521
1523
  };
1522
1524
  pointerMoveListener = (event) => {
1523
1525
  if (!gestureController?.hasActiveGesture()) return;
@@ -1399,6 +1399,15 @@ export class EditorViewport {
1399
1399
 
1400
1400
  // OrbitControls: the editor's own mouse is right-drag to orbit, middle-drag to pan and the
1401
1401
  // wheel to zoom; a keymap may orbit on the middle button instead (`applyKeymapNavigation`).
1402
+ // OrbitControls captures the pointer on every pointerdown; while a game holds a pointer lock
1403
+ // (its mouse look) the browser refuses capture with an uncaught InvalidStateError on each
1404
+ // click. Capture is meaningless under a lock (every move already comes to the locked
1405
+ // element), so it is skipped then.
1406
+ const capture = interactionElement.setPointerCapture.bind(interactionElement);
1407
+ interactionElement.setPointerCapture = (pointerId: number) => {
1408
+ if (interactionElement.ownerDocument.pointerLockElement) return;
1409
+ capture(pointerId);
1410
+ };
1402
1411
  this.orbitControls = new OrbitControls(this.camera, interactionElement);
1403
1412
  this.orbitControls.enableDamping = true;
1404
1413
  this.orbitControls.dampingFactor = 0.1;