コード例 #1
0
  @Override
  protected void controlUpdate(float tpf) {
    // list of cameras for when terrain supports multiple cameras (ie split screen)

    if (lodCalculator == null) return;

    if (!enabled) {
      if (!hasResetLod) {
        // this will get run once
        hasResetLod = true;
        lodCalculator.turnOffLod();
      }
    }

    if (cameras != null) {
      if (cameraLocations.isEmpty() && !cameras.isEmpty()) {
        for (Camera c : cameras) // populate them
        {
          cameraLocations.add(c.getLocation());
        }
      }
      updateLOD(cameraLocations, lodCalculator);
    }
  }