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

Index

Namespaces

Types

Properties

Types

CurrentRooms

CurrentRooms: object

Type declaration

RoomData

RoomData: object

Type declaration

  • bounds: object
  • center: Vector3
  • floorInfo: object
    • id: string
    • sequence: number
  • id: string
  • label: string
  • size: Vector3

Properties

current

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.

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