Kinect.KinectManager.GetDepthForPixel C# (CSharp) Method

GetDepthForPixel() public method

Gets the depth value for the specified pixel, if ComputeUserMap is true.
public GetDepthForPixel ( int x, int y ) : ushort
x int The X coordinate of the pixel.
y int The Y coordinate of the pixel.
return ushort
        public ushort GetDepthForPixel(int x, int y)
        {
            if (sensorData != null && sensorData.depthImage != null)
            {
                int index = y * sensorData.depthImageWidth + x;

                if (index >= 0 && index < sensorData.depthImage.Length)
                {
                    return sensorData.depthImage[index];
                }
            }

            return 0;
        }
KinectManager