// Constructor for uniform scale public CompressedElement(ElementCrusher crusher, uint cUniform, int ubits) : this() { this.crusher = crusher; this.cUniform = cUniform; this.bitstream = new Bitstream(cUniform, ubits); }
// Constructor for Quaternion rotation public CompressedElement(ElementCrusher crusher, ulong cQuat, int qbits) : this() { this.crusher = crusher; this.cQuat = cQuat; this.bitstream = new Bitstream(cQuat, qbits); }
public ulong Write(ulong cQuat, ref Bitstream bitstream) { bitstream.Write(cQuat, bits); return(cQuat); }
public void ExtractBitstream(ElementCrusher crusher, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { crusher.Write(this, ref bitstream, BitCullingLevel.NoCulling); }
public ulong Write(CompressedElement ce, ref Bitstream bitstream) { bitstream.Write((ulong)ce.cQuat, bits); return((ulong)ce.cQuat); }
public CompressedMatrix Read(ulong fragment0, ulong fragment1 = 0, ulong fragment2 = 0, ulong fragment3 = 0, uint fragment4 = 0, BitCullingLevel bcl = BitCullingLevel.NoCulling) { Bitstream buffer = new Bitstream(fragment0, fragment1, fragment2, fragment3, fragment4); return(Read(ref buffer, bcl)); }
public Matrix ReadAndDecompress(ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { CompressedMatrix cm = Read(ref bitstream, bcl); return(Decompress(cm)); }
public static float ReadAndDecompress(this FloatCrusher fc, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { CompressedFloat c = fc.Read(ref bitstream, bcl); return(fc.Decompress(c)); }
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))); }