コード例 #1
0
            public FloatCompressor(FloatCompression compression)
            {
                if (compression.Min < compression.Max)
                {
                    _min = compression.Min;
                    _max = compression.Max;

                    _accuracy    = compression.Accuracy;
                    _accuracyInv = 1.0f / _accuracy;

                    _range = (uint)((compression.Max - compression.Min) * (1.0 / _accuracy));

                    _bits = Maths.BitsRequiredForNumber(_range);
                }
                else
                {
                    _min         = 0;
                    _max         = 0;
                    _range       = 0;
                    _accuracy    = 0;
                    _accuracyInv = 0;

                    _bits = 32;
                }
            }