@umicat/three-sdk 1.27.0 → 1.28.0

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.
@@ -668,10 +668,10 @@ export async function runEditorDesignPlayer3D(renderer, opts = {}) {
668
668
  const a = sceneData?.entities.find((en) => en.id === entityId);
669
669
  return a?.editorHidden === true || a?.editorLocked === true;
670
670
  };
671
- const pickEntityAt = (e) => {
671
+ const pickEntityAt = (e, includeInert = false) => {
672
672
  raycaster.setFromCamera(ndcFromEvent(e), camera);
673
673
  const targets = Array.from(entityByObject.keys())
674
- .filter((o) => o.visible !== false && !isInert(entityByObject.get(o)));
674
+ .filter((o) => o.visible !== false && (includeInert || !isInert(entityByObject.get(o))));
675
675
  const hits = raycaster.intersectObjects(targets, true);
676
676
  if (hits.length === 0)
677
677
  return null;
@@ -1375,7 +1375,16 @@ export async function runEditorDesignPlayer3D(renderer, opts = {}) {
1375
1375
  // decides whether an empty-space menu is worth showing (e.g. Paste).
1376
1376
  if (!scene || rightMoved)
1377
1377
  return;
1378
- const hit = pickEntityAt(e);
1378
+ // Right-click reaches a HIDDEN or LOCKED entity even though every other
1379
+ // gesture ignores it. Lock blocks MANIPULATION — click-select, drag,
1380
+ // marquee — and blocking the context menu as well would leave the only
1381
+ // way out behind a menu you have to already know exists. Reported from a
1382
+ // real session: "I locked it and now there is no way to unlock it."
1383
+ //
1384
+ // It is still not SELECTED: selecting would attach the gizmo and make it
1385
+ // draggable again, which is the one thing the lock is for. The menu acts
1386
+ // on the entity it was opened on, not on the selection.
1387
+ const hit = pickEntityAt(e, true);
1379
1388
  if (!hit) {
1380
1389
  clearWorldSelection();
1381
1390
  if (hudSelectedId)
@@ -1383,6 +1392,10 @@ export async function runEditorDesignPlayer3D(renderer, opts = {}) {
1383
1392
  window.parent.postMessage({ type: 'umicat:editor:contextMenu3d', entityId: null, clientX: e.clientX, clientY: e.clientY }, '*');
1384
1393
  return;
1385
1394
  }
1395
+ if (isInert(hit.entityId)) {
1396
+ window.parent.postMessage({ type: 'umicat:editor:contextMenu3d', entityId: hit.entityId, inert: true, clientX: e.clientX, clientY: e.clientY }, '*');
1397
+ return;
1398
+ }
1386
1399
  if (hudSelectedId)
1387
1400
  selectHudEntity(null);
1388
1401
  // ADR-046 — right-clicking an entity that's ALREADY part of a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umicat/three-sdk",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "Three.js runtime for Umicat games: the scene3d design format, its loader with physics, a kinematic character controller, and the Umicat platform via @umicat/platform-sdk.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",