getAreaRatio method
Get the ratio of the sum of the node areas to the root area.
Implementation
@override
double getAreaRatio() {
if (_root == null) {
return 0.0;
}
final rootArea = _root!.aabb.perimeter;
var totalArea = 0.0;
for (var i = 0; i < _nodeCapacity; ++i) {
final node = _nodes[i];
if (node.height < 0) {
// Free node in pool
continue;
}
totalArea += node.aabb.perimeter;
}
return totalArea / rootArea;
}