Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
9c3d9952d7 fix: closes #674
Some checks failed
CI / test (pull_request) Failing after 9s
CI / validate (pull_request) Failing after 13s
Review Approval Gate / verify-review (pull_request) Failing after 2s
2026-04-12 12:26:17 -04:00

8
app.js
View File

@@ -1919,10 +1919,12 @@ function setupControls() {
);
const raycaster = new THREE.Raycaster();
raycaster.setFromCamera(mouse, camera);
const intersects = raycaster.intersectObjects(portals.map(p => p.ring));
// Raycast against both ring and swirl for a larger click target
const portalMeshes = portals.flatMap(p => [p.ring, p.swirl]);
const intersects = raycaster.intersectObjects(portalMeshes);
if (intersects.length > 0) {
const clickedRing = intersects[0].object;
const portal = portals.find(p => p.ring === clickedRing);
const hitObj = intersects[0].object;
const portal = portals.find(p => p.ring === hitObj || p.swirl === hitObj);
if (portal) activatePortal(portal);
}
}