Due to the machines being down, PA 4 will be merged with PA 5 and be due next week.
Using CreateLinks we create a hierarchical matrix. All energy transport is accounted for, although it may be spread out over many levels of the hierarchy. Unlike the older adaptive subdivision approaches, any patch at any level of the hierarchy can be both source and receiver to other patches at any level of the hierarchy. This means that no single patch will have a complete set of links representing all transfers to it. Some links may be above the patch in the hierarchy, and some may be below it. If we do a simple gather, as described last week, the energy will be spread out over potentially all levels of the hierarchy. The energy at each level of the hierarchy must be summed together to get the actual energy on each the surface, and then each level of the hierarchy must represent that energy as best it can.
GatherSweep(rec, radDown)
foreach link
radDown += link->FF * link->Src->Rad
if(rec->HasChildren)
radUp = 0
foreach child
radUp += (child->Area / rec->Area) * GatherSweep(child,radDown)
rec->Rad = radUp
else
rec->Rad = radDown
return rec->Rad