Usage of the SDK constitutes your agreement with the Matterport SDK Agreement. Email developers@matterport.com with any questions.
Index
Types
CurrentRooms
Type declaration
-
rooms: Room.RoomData[]
RoomData
Properties
current
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');
}
});
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 thanINSIDE
, therooms
array may be empty. If the camera is in an unaligned sweep, therooms
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'); } });