public CompressedElement Read(ref Bitstream buffer, BitCullingLevel bcl = BitCullingLevel.NoCulling) { if (!cached) { CacheValues(); } if (TRSType == TRSType.Quaternion) { return(new CompressedElement(this, buffer.Read(cache_qBits), cache_qBits)); } else if (cache_isUniformScale) { return(new CompressedElement(this, buffer.Read(cache_uBits[(int)bcl]), cache_uBits[(int)bcl])); } int xbits = cache_xBits[(int)bcl]; int ybits = cache_yBits[(int)bcl]; int zbits = cache_zBits[(int)bcl]; uint cx = cache_xEnabled ? (uint)buffer.Read(xbits) : 0; uint cy = cache_yEnabled ? (uint)buffer.Read(ybits) : 0; uint cz = cache_zEnabled ? (uint)buffer.Read(zbits) : 0; return(new CompressedElement(this, cx, cy, cz, xbits, ybits, zbits)); }
public static CompressedFloat Read(this FloatCrusher fc, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { int bits = fc._bits[(int)bcl]; return(new CompressedFloat(fc, (uint)bitstream.Read(bits))); }