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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
calculateLod
(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) clone()
protected Vector3f
getCenterLocation
(TerrainPatch terrainPatch) protected float
Gets the camera distance where the LOD level will changefloat
int
getSize()
boolean
isLodOff()
void
read
(JmeImporter im) void
setLodMultiplier
(float lodMultiplier) void
setSize
(int size) toString()
void
void
boolean
Does this calculator require the terrain to have the difference of LOD levels of neighbours to be more than 1.void
write
(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:
calculateLod
in interfaceLodCalculator
-
getCenterLocation
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
clone
- Specified by:
clone
in interfaceLodCalculator
- Overrides:
clone
in 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:
usesVariableLod
in 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:
turnOffLod
in interfaceLodCalculator
-
isLodOff
public boolean isLodOff()- Specified by:
isLodOff
in interfaceLodCalculator
-
turnOnLod
public void turnOnLod()- Specified by:
turnOnLod
in interfaceLodCalculator
-