Class DistanceLodCalculator

java.lang.Object
com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator
All Implemented Interfaces:
com.jme3.export.Savable, LodCalculator, Cloneable

public class DistanceLodCalculator extends Object implements LodCalculator
Calculates the LOD of the terrain based on its distance from the cameras. Taking the minimum distance from all cameras.
Author:
bowens
  • Constructor Details

    • DistanceLodCalculator

      public DistanceLodCalculator()
    • DistanceLodCalculator

      public DistanceLodCalculator(int patchSize, float multiplier)
  • Method Details

    • calculateLod

      public boolean calculateLod(TerrainPatch terrainPatch, List<com.jme3.math.Vector3f> locations, HashMap<String,UpdatedTerrainPatch> updates)
      Specified by:
      calculateLod in interface LodCalculator
    • getCenterLocation

      protected com.jme3.math.Vector3f getCenterLocation(TerrainPatch terrainPatch)
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Throws:
      IOException
    • clone

      public DistanceLodCalculator clone()
      Specified by:
      clone in interface LodCalculator
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLodDistanceThreshold

      protected float getLodDistanceThreshold()
      Gets the camera distance where the LOD level will change
    • usesVariableLod

      public boolean usesVariableLod()
      Does this calculator require the terrain to have the difference of LOD levels of neighbours to be more than 1.
      Specified by:
      usesVariableLod in interface LodCalculator
    • getLodMultiplier

      public float getLodMultiplier()
    • setLodMultiplier

      public void setLodMultiplier(float lodMultiplier)
    • getSize

      public int getSize()
    • setSize

      public void setSize(int size)
    • turnOffLod

      public void turnOffLod()
      Specified by:
      turnOffLod in interface LodCalculator
    • isLodOff

      public boolean isLodOff()
      Specified by:
      isLodOff in interface LodCalculator
    • turnOnLod

      public void turnOnLod()
      Specified by:
      turnOnLod in interface LodCalculator