public class LodControl extends AbstractControl implements java.lang.Cloneable, JmeCloneable
enabled, spatial
Constructor and Description |
---|
LodControl()
Creates a new
LodControl . |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.Object |
jmeClone()
Performs a regular shallow clone of the object.
|
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) |
cloneFields, cloneForSpatial, getSpatial, isEnabled, render, setEnabled, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cloneFields
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 java.lang.Object jmeClone()
JmeCloneable
This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone
in interface JmeCloneable
jmeClone
in class AbstractControl
protected void controlUpdate(float tpf)
AbstractControl
controlUpdate
in class AbstractControl
tpf
- time per frame (in seconds)protected void controlRender(RenderManager rm, ViewPort vp)
AbstractControl
controlRender
in class AbstractControl
rm
- the RenderManager rendering the controlled Spatial (not null)vp
- the ViewPort being rendered (not null)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