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

A Sensor that detects Sources and provides information about the reading of each.

Hierarchy

Index

Properties

forward

forward: Vector3

The world-space "forward" direction describing which direction the sensor is facing.

origin

origin: Vector3

The world-space position of the sensor.

readings

readings: object

An observable used to get information about assocated ISources added with ISensor.addSource

Type declaration

Methods

addSource

  • Add a source, to add its readings to the set of readings provided by .subscribe.

    Parameters

    Returns void

dispose

  • dispose(): void
  • Teardown and cleanup the sensor, and stop receiving updates.

    Returns void

showDebug

  • showDebug(show: boolean): void
  • Show debug visuals for this sensor. Existing visuals are disposed.

    Parameters

    • show: boolean

    Returns void

subscribe

  • Start receiving updates when properties of this sensor change, e.g. origin or forward, not its readings.
    Subscribe to readings to receive updates about associated ISources

    Type parameters

    • DataT

    Parameters

    Returns ISubscription

waitUntil

  • Wait for a specific condition on this object to be met. When this observable detects a change, the condition provided will be called. When the condition returns true, the returned Promise will be resolved.

     // Example: pause execution of code until the app state is in the "playing" phase
     await sdk.App.state.waitUntil(
      appState => appState.phase == sdk.App.Phase.PLAYING
     );
    

    or:

    await sdk.App.state.waitUntil({
      waitUntil(appState) {
        return appState.phase == sdk.App.Phase.PLAYING;
      }
    });
    

    Parameters

    Returns Promise<Sensor.ISensor>

    A promise that is resolved when condition returns true.