Skip to main content

Room

Namespaces
Observables

Types

CurrentRooms

CurrentRooms: object
PropertyType
roomsRoom.RoomData[]

RoomData

RoomData: object
PropertyType
bounds{ min: Vector3; max: Vector3; }
centerVector3
floorInfo{ id: string; sequence: number; }
idstring
labelstring
sizeVector3

Observables

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');
}
});