Add furniture click events, OrbitControls toggle, and floor change event

- Export COLORS for external module access (themes)
- Extend _onClick to detect furniture clicks before room clicks,
  dispatching 'furnitureclick' with catalog/room/mesh details
- Add setControlsEnabled(enabled) to toggle OrbitControls
- Dispatch 'floorchange' event from showFloor()
- Wire up furnitureclick in index.html to show item info
This commit is contained in:
m
2026-02-07 12:19:19 +01:00
parent bf4eee8595
commit 35300aa57a
2 changed files with 29 additions and 2 deletions

View File

@@ -151,6 +151,11 @@
viewer.addEventListener('roomclick', (e) => {
selectRoom(e.detail.roomId);
});
viewer.addEventListener('furnitureclick', (e) => {
const d = e.detail;
document.getElementById('info').textContent = `${d.itemName} — in ${renderer.getRooms().find(r => r.id === d.roomId)?.name || d.roomId}`;
});
</script>
</body>
</html>