Axiom.Components.Terrain.TerrainQuadTreeNode.AssignVertexData C# (CSharp) Method

AssignVertexData() public method

Assign vertex data to the tree, from a depth and at a given resolution.
public AssignVertexData ( ushort treeDepthStart, ushort treeDepthEnd, ushort resolution, ushort sz ) : void
treeDepthStart ushort
treeDepthEnd ushort The end of the depth that should use this data (exclusive)
resolution ushort The resolution of the data to use (compared to full terrain)
sz ushort The size of the data along one edge
return void
        public void AssignVertexData(ushort treeDepthStart, ushort treeDepthEnd, ushort resolution, ushort sz)
        {
            Debug.Assert(treeDepthStart >= mDepth, "Should not be calling this");

            if (mDepth == treeDepthStart)
            {
                //we own this vertex data
                mNodeWithVertexData = this;
                mVertexDataRecord = new VertexDataRecord(resolution, sz, (ushort)(treeDepthEnd - treeDepthStart));

                CreateCpuVertexData();
                CreateCpuIndexData();

                //pass on to children
                if (!IsLeaf && treeDepthEnd > (mDepth + 1))// treeDepthEnd is exclusive, and this is children
                {
                    for (int i = 0; i < 4; i++)
                    {
                        mChildren[i].UseAncestorVertexData(this, treeDepthEnd, resolution);
                    }
                }
            }
            else
            {
                Debug.Assert(!IsLeaf, "No more levels below this!");

                for (int i = 0; i < 4; i++)
                {
                    mChildren[i].AssignVertexData(treeDepthStart, treeDepthEnd, resolution, sz);
                }
            }
        }
        /// <summary>