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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user