本文整理汇总了C#中System.Vector4.FromBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4.FromBytes方法的具体用法?C# Vector4.FromBytes怎么用?C# Vector4.FromBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector4
的用法示例。
在下文中一共展示了Vector4.FromBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromBytes
public override void FromBytes(byte[] bytes, ref int i)
{
try {
Vector4 r1 = new Vector4(), r2 = new Vector4(), r3 = new Vector4(), r4 = new Vector4();
r1.FromBytes(bytes, i); i += sizeof(float) * 4;
r2.FromBytes(bytes, i); i += sizeof(float) * 4;
r3.FromBytes(bytes, i); i += sizeof(float) * 4;
r4.FromBytes(bytes, i); i += sizeof(float) * 4;
ProjectionMatrix.M11 = r1.X;
ProjectionMatrix.M12 = r1.Y;
ProjectionMatrix.M13 = r1.Z;
ProjectionMatrix.M14 = r1.W;
ProjectionMatrix.M21 = r2.X;
ProjectionMatrix.M22 = r2.Y;
ProjectionMatrix.M23 = r2.Z;
ProjectionMatrix.M24 = r2.W;
ProjectionMatrix.M31 = r3.X;
ProjectionMatrix.M32 = r3.Y;
ProjectionMatrix.M33 = r3.Z;
ProjectionMatrix.M34 = r3.W;
ProjectionMatrix.M41 = r4.X;
ProjectionMatrix.M42 = r4.Y;
ProjectionMatrix.M43 = r4.Z;
ProjectionMatrix.M44 = r4.W;
} catch (Exception) {
throw new MalformedDataException();
}
}