Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1.         public unsafe Point3[][] Contours
  2.         {
  3.             set
  4.             {
  5.                 //Point3*[] ps = new Point3*[value.Length];
  6.                 //uint[] lengths = new uint[value.Length];
  7.                 //GCHandle[] handles = new GCHandle[value.Length];
  8.                 float[] identityMatrix = new float[16];
  9.                 identityMatrix[0] = identityMatrix[5] = identityMatrix[10] = identityMatrix[15] = 1;
  10.                 SetContours(value, identityMatrix);
  11.  
  12.                 /*
  13.                 for (int i = 0; i < value.Length; i++)
  14.                 {
  15.                     // Don't do this at home...
  16.                     handles[i] = GCHandle.Alloc(value[i]);
  17.                     fixed (Point3* p = value[i])
  18.                     {
  19.                         ps[i] = p;
  20.                         lengths[i] = (uint)value[i].Length;
  21.                     }
  22.                 }
  23.                 fixed (Point3** psp = ps)
  24.                 {
  25.                     NativeMethods.SetContours(context.ptr, id, psp, lengths, (uint)value.Length, identityMatrix, ref err);
  26.                 }
  27.                 foreach (var handle in handles)
  28.                 {
  29.                     handle.Free();
  30.                 }
  31.                 NativeMethods.check(err);
  32.                 */
  33.             }
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement