com.jme3.terrain.geomipmap.lodcalc
Class PerspectiveLodCalculator

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

public class PerspectiveLodCalculator
extends java.lang.Object
implements LodCalculator


Constructor Summary
PerspectiveLodCalculator()
           
PerspectiveLodCalculator(Camera cam, float pixelError)
           
 
Method Summary
 boolean calculateLod(java.util.List<Vector3f> locations, java.util.HashMap<java.lang.String,UpdatedTerrainPatch> updates)
           
 boolean calculateLod(TerrainPatch terrainPatch, java.util.List<Vector3f> locations, java.util.HashMap<java.lang.String,UpdatedTerrainPatch> updates)
           
 LodCalculator clone()
           
 Vector3f getCenterLocation(TerrainPatch patch)
           
 float getPixelError()
           
 boolean isLodOff()
           
 void read(JmeImporter im)
           
 void setCam(Camera cam)
           
 void setPixelError(float pixelError)
           
 void turnOffLod()
           
 void turnOnLod()
           
 boolean usesVariableLod()
          If true, then this calculator can cause neighbouring terrain chunks to have LOD levels that are greater than 1 apart.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerspectiveLodCalculator

public PerspectiveLodCalculator()

PerspectiveLodCalculator

public PerspectiveLodCalculator(Camera cam,
                                float pixelError)
Method Detail

calculateLod

public boolean calculateLod(java.util.List<Vector3f> locations,
                            java.util.HashMap<java.lang.String,UpdatedTerrainPatch> updates)

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

public Vector3f getCenterLocation(TerrainPatch patch)

clone

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

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

usesVariableLod

public boolean usesVariableLod()
Description copied from interface: LodCalculator
If true, then this calculator can cause neighbouring terrain chunks to have LOD levels that are greater than 1 apart. Entropy algorithms will want to return true for this. Straight distance calculations will just want to return false.

Specified by:
usesVariableLod in interface LodCalculator

getPixelError

public float getPixelError()

setPixelError

public void setPixelError(float pixelError)

setCam

public void setCam(Camera cam)

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