Beispiel #1
0
 // 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);
 }
Beispiel #2
0
 // 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);
 }
Beispiel #3
0
 public ulong Write(ulong cQuat, ref Bitstream bitstream)
 {
     bitstream.Write(cQuat, bits);
     return(cQuat);
 }
Beispiel #4
0
 public void ExtractBitstream(ElementCrusher crusher, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling)
 {
     crusher.Write(this, ref bitstream, BitCullingLevel.NoCulling);
 }
Beispiel #5
0
 public ulong Write(CompressedElement ce, ref Bitstream bitstream)
 {
     bitstream.Write((ulong)ce.cQuat, bits);
     return((ulong)ce.cQuat);
 }
Beispiel #6
0
        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));
        }
Beispiel #7
0
        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)));
        }