TerrainDisplay.MPQ.MpqTerrainManager.CopyIndicesToRecastArray C# (CSharp) Method

CopyIndicesToRecastArray() private static method

private static CopyIndicesToRecastArray ( IList renderIndices, IList indices, int idxOffset, int vecOffset ) : int
renderIndices IList
indices IList
idxOffset int
vecOffset int
return int
        private static int CopyIndicesToRecastArray(IList<int> renderIndices, IList<int> indices, int idxOffset, int vecOffset)
        {
            if (renderIndices != null)
            {
                const int second = 2;
                const int third = 1;

                var length = renderIndices.Count / 3;
                for (var i = 0; i < length; i++)
                {
                    var idx = i*3;
                    var index = renderIndices[idx + 0];
                    indices[idxOffset + idx + 0] = (index + vecOffset);

                    // reverse winding for recast
                    index = renderIndices[idx + second];
                    indices[idxOffset + idx + 1] = (index + vecOffset);

                    index = renderIndices[idx + third];
                    indices[idxOffset + idx + 2] = (index + vecOffset);
                }
                idxOffset += renderIndices.Count;
            }
            return idxOffset;
        }