public Quaternion(BinaryReader reader, QuaternionCompression compression = QuaternionCompression.None) { if (compression == QuaternionCompression.None) { X = reader.ReadSingle(); Y = reader.ReadSingle(); Z = reader.ReadSingle(); W = reader.ReadSingle(); } else { float compressionScale = 4096.0f; X = reader.ReadInt16() / compressionScale; Y = reader.ReadInt16() / compressionScale; Z = reader.ReadInt16() / compressionScale; W = reader.ReadInt16() / compressionScale; } }
public Quaternion(BinaryReader reader, QuaternionCompression compression = QuaternionCompression.None) { if (compression == QuaternionCompression.None) { X = reader.ReadSingle(); Y = reader.ReadSingle(); Z = reader.ReadSingle(); W = reader.ReadSingle(); } else { float compressionScale = 4096.0f; X = reader.ReadInt16() / compressionScale; Y = reader.ReadInt16() / compressionScale; Z = reader.ReadInt16() / compressionScale; W = reader.ReadInt16() / compressionScale; } }