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>