if (records == null || records.length == 0) { LoggingSystem.getLogger().log(Level.WARNING, "Records was null."); return 0; }
  public int chooseTargetRecord(Renderer r) {    if (getWorldBound() == null) {      LoggingSystem.getLogger().log(Level.WARNING,                                    "AreaClodMesh found with no Bounds.");      return 0;    }        float newDistance = getWorldBound().distanceTo(r.getCamera().getLocation());    if (Math.abs(newDistance - lastDistance) <= distTolerance)      return targetRecord; // we haven't moved relative to the model, send the old measurement back.    if (lastDistance > newDistance && targetRecord == 0)      return targetRecord; // we're already at the lowest setting and we just got closer to the model, no need to keep trying.    if (lastDistance < newDistance && targetRecord == records.length-1)      return targetRecord; // we're already at the highest setting and we just got further from the model, no need to keep trying.    lastDistance = newDistance;    // estimate area of polygon via bounding volume    float area = AreaUtils.calcScreenArea(getWorldBound(), lastDistance, DisplaySystem.getDisplaySystem().getWidth());    float trisToDraw = area * trisPerPixel;    if (records == null || records.length == 0) {      LoggingSystem.getLogger().log(Level.WARNING,                                    "Records was null.");      return 0;    }        targetRecord = records.length - 1;    for (int i = records.length; --i >= 0; ) {      if (trisToDraw - records[i].numbTriangles < 0) break;      targetRecord = i;    }    return targetRecord;  }