Multi-room anchoring
Multi-room anchoring
MultiRoomAnchoring matches one client scan against several pre-registered rooms at once.
Scene setup
- Create a GameObject with a
MultiRoomAnchoringcomponent. - In the Inspector, populate
_rooms, a list where each entry has:Room ID(your own string identifier for the room).Source RootTransform (the root of the scannedMeshFilters for that room).AnchorTransform (optional; defaults to the source root’s own position).
- Call
BuildBatches()to extract anchor payloads from all rooms (or callLocalize(clientPayload)directly:BuildBatchesis called automatically if needed). - Assign your client-scan root Transform to the
_clientfield. - Call
Localize()with the client scan to run registration against all rooms.
Result
The result is one of:
- Matched: found in room ID X with this transform.
- Ambiguous: multiple rooms scored too similarly to pick a winner confidently.
- NoMatch: no room had enough shared geometry or passed verification.
Each result includes per-room failure reasons (for example “insufficient overlap”, “floor level did not match”) and, on a match, the anchor’s world position in the client’s frame. These strings are deliberately plain-language. No algorithm jargon leaks into them, so they’re safe to surface directly in your own UI.
Next
- Single room, single anchor instead: Manual anchoring.
- Reading registration results in depth: Diagnostics.