Class DistanceLodCalculator
java.lang.Object
com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator
- All Implemented Interfaces:
Savable,LodCalculator,Cloneable
Calculates the LOD of the terrain based on its distance from the
cameras. Taking the minimum distance from all cameras.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancalculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) clone()protected Vector3fgetCenterLocation(TerrainPatch terrainPatch) protected floatGets the camera distance where the LOD level will changefloatintgetSize()booleanisLodOff()voidread(JmeImporter im) voidsetLodMultiplier(float lodMultiplier) voidsetSize(int size) toString()voidvoidbooleanDoes this calculator require the terrain to have the difference of LOD levels of neighbours to be more than 1.voidwrite(JmeExporter ex)
-
Constructor Details
-
DistanceLodCalculator
public DistanceLodCalculator() -
DistanceLodCalculator
public DistanceLodCalculator(int patchSize, float multiplier)
-
-
Method Details
-
calculateLod
public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) - Specified by:
calculateLodin interfaceLodCalculator
-
getCenterLocation
-
write
- Specified by:
writein interfaceSavable- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Throws:
IOException
-
clone
- Specified by:
clonein interfaceLodCalculator- Overrides:
clonein classObject
-
toString
-
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:
usesVariableLodin interfaceLodCalculator
-
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:
turnOffLodin interfaceLodCalculator
-
isLodOff
public boolean isLodOff()- Specified by:
isLodOffin interfaceLodCalculator
-
turnOnLod
public void turnOnLod()- Specified by:
turnOnLodin interfaceLodCalculator
-