예제 #1
0
파일: Vector2h.cs 프로젝트: conankzhang/fez
 public static byte[] GetBytes(Vector2h h)
 {
     byte[] numArray = new byte[Vector2h.SizeInBytes];
     byte[] bytes1   = Half.GetBytes(h.X);
     numArray[0] = bytes1[0];
     numArray[1] = bytes1[1];
     byte[] bytes2 = Half.GetBytes(h.Y);
     numArray[2] = bytes2[0];
     numArray[3] = bytes2[1];
     return(numArray);
 }
예제 #2
0
 /// <summary>Returns the Half2 as an array of bytes.</summary>
 /// <param name="h">The Half2 to convert.</param>
 /// <returns>The input as byte array.</returns>
 public static byte[] GetBytes(Vector2h h)
 {
     byte[] result = new byte[SizeInBytes];
     byte[] temp   = Half.GetBytes(h.X);
     result[0] = temp[0];
     result[1] = temp[1];
     temp      = Half.GetBytes(h.Y);
     result[2] = temp[0];
     result[3] = temp[1];
     return(result);
 }
예제 #3
0
파일: Vector4h.cs 프로젝트: conankzhang/fez
 public static byte[] GetBytes(Vector4h h)
 {
     byte[] numArray = new byte[Vector4h.SizeInBytes];
     byte[] bytes1   = Half.GetBytes(h.X);
     numArray[0] = bytes1[0];
     numArray[1] = bytes1[1];
     byte[] bytes2 = Half.GetBytes(h.Y);
     numArray[2] = bytes2[0];
     numArray[3] = bytes2[1];
     byte[] bytes3 = Half.GetBytes(h.Z);
     numArray[4] = bytes3[0];
     numArray[5] = bytes3[1];
     byte[] bytes4 = Half.GetBytes(h.W);
     numArray[6] = bytes4[0];
     numArray[7] = bytes4[1];
     return(numArray);
 }