This commit is contained in:
bird_egop
2026-06-06 00:42:07 +03:00
parent 49d9e23738
commit 0d8e4ba491
9 changed files with 266 additions and 35 deletions
+8
View File
@@ -29,6 +29,14 @@ public static class Extensions
return BinaryPrimitives.ReadUInt16LittleEndian(buf);
}
public static short ReadInt16LittleEndian(this Stream fs)
{
Span<byte> buf = stackalloc byte[2];
fs.ReadExactly(buf);
return BinaryPrimitives.ReadInt16LittleEndian(buf);
}
public static float ReadFloatLittleEndian(this Stream fs)
{
Span<byte> buf = stackalloc byte[4];
+1 -1
View File
@@ -2,7 +2,7 @@
public record Quaternion(float X, float Y, float Z, float W);
public record UShortQuaternion(ushort X, ushort Y, ushort Z, ushort W)
public record UShortQuaternion(short W, short X, short Y, short Z)
{
public Quaternion ToRegular()
{