Room Namespace

Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.

Index

Types

Properties

Types

RoomData

RoomData: object

Type declaration

Properties

current

current: IObservable<object>

An observable to determine which rooms the player's camera is currently in.

If the camera is in a location between rooms, or somehwere where our room bounds overlap, the rooms array will contain both (or more) rooms. If the camera is in a mode other than INSIDE, the rooms array may be empty. If the camera is in an unaligned sweep, the rooms array will be empty.

mpSdk.Room.current.subscribe(function (currentRooms) {
  if (currentRooms.rooms.length > 0) {
    console.log('currently in', currentRooms.rooms.length, 'rooms');
  } else {
    console.log('Not currently inside any rooms');
  }
});

data

An observable collection of Room data that can be subscribed to.

See IObservableMap to learn how to receive data from the collection.

showcase.Room.data.subscribe({
  onCollectionUpdated: function (collection) {
    console.log('Collection received. There are ', Object.keys(collection).length, 'rooms in the collection');
  }
});