public void PreDeltaCalculation(Rectangle rect)
{
if (rect.Left <= mBoundaryX || rect.Right > mOffsetX
|| rect.Top <= mBoundaryY || rect.Bottom > mOffsetY)
{
// relevant to this node (overlaps)
// if the rect covers the whole node, reset the max height
// this means that if you recalculate the deltas progressively, end up keeping
// a max height that's no longer the case (ie more conservative lod),
// but that's the price for not recaculating the whole node. If a
// complete recalculation is required, just dirty the entire node. (or terrain)
// Note we use the 'calc' field here to avoid interfering with any
// ongoing LOD calculations (this can be in the background)
if (rect.Left <= mOffsetX && rect.Right > mBoundaryX
&& rect.Top <= mOffsetY && rect.Bottom > mBoundaryY)
{
for (int i = 0; i < mLodLevels.Count; i++)
{
LodLevel tmp = mLodLevels[i];
tmp.CalcMaxHeightDelta = 0.0f;
}
}
//pass on to children
if (!IsLeaf)
{
for (int i = 0; i < 4; i++)
mChildren[i].PreDeltaCalculation(rect);
}
}
}
/// <summary>