title: Kinect v2 + Unity -> MapDepthFrameToColorSpaceUsingIntPtr
body: <p>I'm trying to map the Depth Data from KinectV2 to the Color Space in a Unity-Script.
  It worked as expected with the usual coordinate mapper function</p>
  
  <p><code>_sensor.CoordinateMapper.MapDepthFrameToColorSpace(_depthData, _colorSpacePoints)</code></p>
  
  <p>But it reduced my Framerate by 11 - wich is not acceptable =)</p>
  
  <p>Therefore i took a look in the unity examples provided by Microsoft and found some piece for
  Mapping working with Pointer.</p>
  
  <pre class="lang-cs prettyprint-override"><code>var pDepthData = GCHandle.Alloc(pDepthBuffer, GCHandleType.Pinned);
  var pDepthCoordinatesData = GCHandle.Alloc(m_pDepthCoordinates, GCHandleType.Pinned);
  
  m_pCoordinateMapper.MapColorFrameToDepthSpaceUsingIntPtr(
          pDepthData.AddrOfPinnedObject(), 
          (uint)pDepthBuffer.Length * sizeof(ushort),
          pDepthCoordinatesData.AddrOfPinnedObject(), 
          (uint)m_pDepthCoordinates.Length);
  
  pDepthCoordinatesData.Free();
  pDepthData.Free();
  </code></pre>
  
  <p>The equivalent method for my needs exist as well. I tried the pointer version of 
  MapDepthFrameToColorSpace</p>
  
  <pre class="lang-cs prettyprint-override"><code>var pDepthData = GCHandle.Alloc(pDepthBuffer, GCHandleType.Pinned);
  var pColorData = GCHandle.Alloc(m_pColorSpacePoints, GCHandleType.Pinned);
  
  m_pCoordinateMapper.MapDepthFrameToColorSpaceUsingIntPtr(
          pDepthData.AddrOfPinnedObject(), 
          pDepthBuffer.Length * sizeof(ushort),
          pColorData.AddrOfPinnedObject(),
          (uint)m_pColorSpacePoints.Length * sizeof(float) * 2);
  
  pColorData.Free();
  pDepthData.Free();
  </code></pre>
  
  <p>The pDepthBuffer has valid data at method call and m_pColorSpacePoints is initialized and
  has the same length as pDepthBuffer (as recommended in the MSDN Documentation)
  Im still working with 1408 SDK version.
  The Result after the Function is an Array with Empty/NegativeInfinity Float values and no valid
  ColorSpacePoints. No Error-Message as well.
  Any suggestions?</p>