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); }
/// <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); }
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); }