Share via


Kinect.sensor Function

Kinect for Windows 1.8

Retrieves a KinectSensor object for the Kinect sensor with the specified name.

Syntax

sensor(sensorName, onConnection);

Parameters

  • sensorName
    Type: String

    Optional. Name of the Kinect sensor to retrieve the KinectSensor object for. This sensor must be exposed by the connected server. The default value is "default". This method returns null if your application has explicitly closed the connection through a call to the disconnect function.

  • onConnection
    Type: Function

    Optional. Callback function to call when the connection to the server that owns the sensorName sensor is connected or disconnected. This function should have the parameters listed in the following table.

    Parameter name Type Description
    kinectSensor Object KinectSensor object that was connected or disconnected.
    isConnected Boolean Receives true if the KinectSensor object is now connected to the server; otherwise, false.

Remarks

If you call this method from a client that has not called the connect or disconnect function, this function implicitly calls connect with the default parameters.

The returned KinectSensor is already in a connected state; you do not need to call the connect function on this interface.

Requirements

Library: Kinect-1.8.0.js

See Also

Reference

Kinect Interface
Core Components