com.jme3.terrain.geomipmap.lodcalc
Class DistanceLodCalculator

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

public class DistanceLodCalculator
extends java.lang.Object
implements LodCalculator

Calculates the LOD of the terrain based on its distance from the cameras. Taking the minimum distance from all cameras.


Constructor Summary
DistanceLodCalculator()
           
DistanceLodCalculator(int patchSize, float multiplier)
           
 
Method Summary
 boolean calculateLod(TerrainPatch terrainPatch, java.util.List<Vector3f> locations, java.util.HashMap<java.lang.String,UpdatedTerrainPatch> updates)
           
 LodCalculator clone()
           
protected  Vector3f getCenterLocation(TerrainPatch terrainPatch)
           
protected  float getLodDistanceThreshold()
          Gets the camera distance where the LOD level will change
 float getLodMultiplier()
           
 int getSize()
           
 boolean isLodOff()
           
 void read(JmeImporter im)
           
 void setLodMultiplier(float lodMultiplier)
           
 void setSize(int size)
           
 java.lang.String toString()
           
 void turnOffLod()
           
 void turnOnLod()
           
 boolean usesVariableLod()
          Does this calculator require the terrain to have the difference of LOD levels of neighbours to be more than 1.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistanceLodCalculator

public DistanceLodCalculator()

DistanceLodCalculator

public DistanceLodCalculator(int patchSize,
                             float multiplier)
Method Detail

calculateLod

public boolean calculateLod(TerrainPatch terrainPatch,
                            java.util.List<Vector3f> locations,
                            java.util.HashMap<java.lang.String,UpdatedTerrainPatch> updates)
Specified by:
calculateLod in interface LodCalculator

getCenterLocation

protected Vector3f getCenterLocation(TerrainPatch terrainPatch)

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException

clone

public LodCalculator clone()
Specified by:
clone in interface LodCalculator
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.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