Ejemplo n.º 1
0
        public void Close()
        {
            if (vertCount < vertLen - VertUnusedLimit)
            {
                vertLen = vertCount + VertExpandAmount;
                Array.Resize(ref verts, vertLen);
                Array.Resize(ref colors, vertLen);
                Array.Resize(ref uvs, vertLen);
            }

            if (triCount < triLen - TriUnusedLimit)
            {
                triLen = triCount + TriExpandAmount;
                Array.Resize(ref tris, triLen);
            }

            if (triCount < triLen - 1)                // fill unused triangles
            {
                Array.Clear(tris, triCount, triLen - triCount - 1);
            }

            mesh.vertices = verts;
            mesh.colors   = colors;
            mesh.uv       = uvs;

            mesh.triangles = tris;

//			mesh.RecalculateBounds();
//			mesh.RecalculateNormals();
//			mesh.RecalculateTangents();
        }
Ejemplo n.º 2
0
        public void Clear()
        {
            SysArray.Clear(_Array, 0, _Size);
            _Size = 0;
#if USE_MIN_MAX_VARIABLES
            _Min = default(T);
            _Max = default(T);
#endif
        }
Ejemplo n.º 3
0
        /*public SortedList< T > SplitInTwo()
         * {
         *  var half = (_Size >> 1);
         *  var other = new SortedList< T >( _Comparer )
         *  {
         *      _Array = new T[ _Array.Length ],
         *      _Size  = half,
         *  };
         *  _Size -= half;
         *  SysArray.Copy( _Array, _Size, other._Array, 0, half );
         *  SysArray.Clear( _Array, _Size, half );
         *
         *  return (other);
         * }*/
        public void SplitInTwo <X>(X other)
            where X : SortedList <T>
        {
            var half = (_Size >> 1);

            other._Comparer = _Comparer;
            other._Array    = new T[_Array.Length];
            other._Size     = half;

            _Size -= half;
            SysArray.Copy(_Array, _Size, other._Array, 0, half);
            SysArray.Clear(_Array, _Size, half);
#if USE_MIN_MAX_VARIABLES
            _Min       = _Array[0];
            _Max       = _Array[_Size - 1];
            other._Min = other._Array[0];
            other._Max = other._Array[other._Size - 1];
#endif
            //return (other);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets all elements in this buffer to 0.
 /// </summary>
 /// <exception cref="System.ArgumentNullException"/>
 public void ZeroMemory()
 {
     Array.Clear(memory, 0, memory.Length);
 }
Ejemplo n.º 5
0
 public void Clear() =>
 Array.Clear(memory, 0x0, Memory.Length);