|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.scene.control.AbstractControl
com.jme3.scene.control.LodControl
public class LodControl
Determines what Level of Detail a spatial should be, based on how many pixels on the screen the spatial is taking up. The more pixels covered, the more detailed the spatial should be. It calculates the area of the screen that the spatial covers by using its bounding box. When initializing, it will ask the spatial for how many triangles it has for each LOD. It then uses that, along with the trisPerPixel value to determine what LOD it should be at. It requires the camera to do this. The controlRender method is called each frame and will update the spatial's LOD if the camera has moved by a specified amount.
Field Summary |
---|
Fields inherited from class com.jme3.scene.control.AbstractControl |
---|
enabled, spatial |
Constructor Summary | |
---|---|
LodControl()
Creates a new LodControl . |
Method Summary | |
---|---|
Control |
cloneForSpatial(Spatial spatial)
Creates a clone of the Control, the given Spatial is the cloned version of the spatial to which this control is attached to. |
protected void |
controlRender(RenderManager rm,
ViewPort vp)
To be implemented in subclass. |
protected void |
controlUpdate(float tpf)
To be implemented in subclass. |
float |
getDistTolerance()
Returns the distance tolerance for changing LOD. |
float |
getTrisPerPixel()
Returns the triangles per pixel value. |
void |
read(JmeImporter im)
|
void |
setDistTolerance(float distTolerance)
Specifies the distance tolerance for changing the LOD level on the geometry. |
void |
setSpatial(Spatial spatial)
|
void |
setTrisPerPixel(float trisPerPixel)
Sets the triangles per pixel value. |
void |
write(JmeExporter ex)
|
Methods inherited from class com.jme3.scene.control.AbstractControl |
---|
getSpatial, isEnabled, render, setEnabled, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LodControl()
LodControl
.
Method Detail |
---|
public float getDistTolerance()
setDistTolerance(float)
public void setDistTolerance(float distTolerance)
distTolerance
- distance tolerance for changing LODpublic float getTrisPerPixel()
setTrisPerPixel(float)
public void setTrisPerPixel(float trisPerPixel)
LodControl
will use this value as an error metric
to determine which LOD level to use based on the geometry's
area on the screen.
trisPerPixel
- triangles per pixelpublic void setSpatial(Spatial spatial)
setSpatial
in interface Control
setSpatial
in class AbstractControl
spatial
- the spatial to be controlled. This should not be called
from user code.public Control cloneForSpatial(Spatial spatial)
Control
cloneForSpatial
in interface Control
protected void controlUpdate(float tpf)
AbstractControl
controlUpdate
in class AbstractControl
protected void controlRender(RenderManager rm, ViewPort vp)
AbstractControl
controlRender
in class AbstractControl
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class AbstractControl
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class AbstractControl
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |