public CompressedMatrix Write(Transform transform, ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { if (!cached) { CacheValues(); } CompressedMatrix cm = Compress(transform); bitstream.Write(cm); return(cm); }
public Matrix Decompress(CompressedMatrix compMatrix) { if (!cached) { CacheValues(); } return(new Matrix( this, posCrusher.Decompress(compMatrix.cPos), rotCrusher.Decompress(compMatrix.cRot), sclCrusher.Decompress(compMatrix.cScl) )); }
/// <summary> /// Apply the TRS matrix to a transform. Any axes not included in the Crusher are left as is. /// </summary> public void Apply(Transform t, CompressedMatrix cmatrix) { if (cached_pBits > 0) { posCrusher.Apply(t, cmatrix.cPos); } if (cached_rBits > 0) { rotCrusher.Apply(t, cmatrix.cRot); } if (cached_sBits > 0) { sclCrusher.Apply(t, cmatrix.cScl); } }
public CompressedMatrix Compress(Transform transform) { if (!cached) { CacheValues(); } CompressedElement cpos = (cached_pBits > 0) ? posCrusher.Compress(transform) : CompressedElement.Empty; CompressedElement crot = (cached_rBits > 0) ? rotCrusher.Compress(transform) : CompressedElement.Empty; CompressedElement cscl = (cached_sBits > 0) ? sclCrusher.Compress(transform) : CompressedElement.Empty; //Debug.Log("<b>TC compress </b> \n" + cpos + "\n" + crot + "\n" + cscl); CompressedMatrix cm = new CompressedMatrix( this, cpos, crot, cscl, cached_pBits, cached_rBits, cached_sBits); return(cm); }
/// <summary> /// Compress this matrix using the crusher it was previously created with. /// </summary> /// <returns></returns> public void Compress(CompressedMatrix nonalloc) { crusher.Compress(nonalloc, this); }
public static StringBuilder AppendSB(this StringBuilder strb, CompressedMatrix cm) { strb.Append(" cPos: ").AppendSB(cm.cPos).Append(" cRot: ").AppendSB(cm.cRot).Append(" cScl: ").AppendSB(cm.cScl); return(strb); }
/// <summary> /// Apply the TRS matrix to a transform. Any axes not included in the Crusher are left as is. /// </summary> public void Apply(CompressedMatrix cmatrix) { DebugX.LogError(transformMissingError, !defaultTransform, true); Apply(defaultTransform, cmatrix); }
public void Apply(Transform t, ulong u0, ulong u1, ulong u2, ulong u3, uint u4) { CompressedMatrix cmatrix = Read(u0, u1, u2, u3, u4); Apply(t, cmatrix); }
//public Matrix Decompress(CompositeBuffer buffer, BitCullingLevel bcl = BitCullingLevel.NoCulling) //{ // CompressedMatrix compMatrix = Read(buffer, bcl); // return Decompress(compMatrix); //} public Matrix Decompress(ulong compressed, BitCullingLevel bcl = BitCullingLevel.NoCulling) { CompressedMatrix compMatrix = Read(compressed, bcl); return(Decompress(compMatrix)); }
public Matrix ReadAndDecompress(ref Bitstream bitstream, BitCullingLevel bcl = BitCullingLevel.NoCulling) { CompressedMatrix cm = Read(ref bitstream, bcl); return(Decompress(cm)); }
public Matrix ReadAndDecompress(ulong buffer, ref int bitposition, BitCullingLevel bcl = BitCullingLevel.NoCulling) { CompressedMatrix cMatrix = Read(buffer, ref bitposition, bcl); return(Decompress(cMatrix)); }