NaNavstevu bridge test page

Drives the room through Module.hostBridge, namespace nanavstevu. Only commands that work are here.

Waiting for the room...

Room save (the Unity _version 4 JSON)

resizeRoom (metres)

Camera

0

Mouse in the room: drag to turn, middle drag to move, as in the Unity release build (add ?input=showcase for wheel zoom, right-drag pan and the keys 1 orbit, 2 top-down, 3 walkthrough, F focus). Touch: one finger turns, two fingers move and pinch. In walkthrough WASD, Shift runs, Space jumps, a click looks around and opens doors and drawers, Esc leaves.

Selection

Nothing selected.

Click furniture in the room to select it (a press on furniture selects it and does not turn the camera); click the floor, a wall or empty space to deselect. On touch, tap. The dashed box is the item's screen rectangle from the events, drawn over the room. selectionUpdated events (the camera moved) update the box and are counted, not logged.

Editing

history: -

Drag the selected furniture in the room to move it: floor items slide on the floor, wall items along the walls (and onto another wall under the pointer), ceiling lights on the ceiling, sinks, taps and hobs onto worktops. Furniture does not move into other furniture; things standing on a cabinet move with it. Item id empty = the selected item. A door or window move, create, copy, delete and their undo rebuild the room (walls are cut again); the reply comes after that.

Materials

Paint mode makes walls, the ceiling and the floor clickable (Unity's Paint(1)); a click selects the surface behind the furniture. paintSurface paints the named or the selected wall or ceiling, setFloor swaps the floor, replaceMaterial switches a material variant on an item and what stands on it, or on every item of the room when nothing is selected. Each change is one undo step.

Room tools

-

Generic objects, kitchen presets and models by URL

-

Generic objects are Unity's procedural furniture (GenericObjectCatalog): setDimensions takes millimetres and answers with the same descriptor as the genericParameters event (Unity's returnGenericObjectParameters); setGenericMaterial changes the texture and the colour. The kitchen presets are Unity's _version 1 saves: addJson merges one into the room with Unity's id offset, loadJson replaces the room. A url model is downloaded, decoded by the engine glTF loader and placed with a box collider; the server must allow this page's origin (CORS).

Highlights outline items in their own colours (Unity's SetHighlights: "[ids][r,g,b;...][r,g,b,a;...]", or JSON); each call adds to the ones already set, the selection wins over its own highlight, clearHighlights removes them all.

Measurements draw dashed lines from the selected item to the nearest obstacle on each side, with the distance in cm (Unity's Measurements). Size, mirror and curtains work on the selected (or given) item: resizeItem takes Unity's "W;H;D" in millimetres, -1 keeps a side, values outside the item's range are ignored; mirror and resize are not undo steps (as in Unity), curtains are. Multi-select collects items you click; group joins them, or disbands the selected group. Grouped items select and move together; individual mode picks single items, and dragging one out of its group takes it out. Kitchen cabinets dropped next to each other snap together (white then green ghost box) and join a group.

Catalogue

Every model of the Unity catalogue (getCatalogue). Models outside the boot room are fetched from the site's lib/ folder when a save or createItem needs them (events fetchStarted, fetchProgress, fetchFinished); green = already in this page.

    The catalogue loads with the room.

    Events and replies