com.jme3.scene.control
Class UpdateControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.scene.control.UpdateControl
- All Implemented Interfaces:
- Savable, Control
public class UpdateControl
- extends AbstractControl
Allows for enqueueing tasks onto the update loop / rendering thread.
Usage:
mySpatial.addControl(new UpdateControl()); // add it once
mySpatial.getControl(UpdateControl.class).enqueue(new Callable() {
public Object call() throws Exception {
// do stuff here
return null;
}
});
Method Summary |
Control |
cloneForSpatial(Spatial newSpatial)
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. |
<V> java.util.concurrent.Future<V> |
|
enqueue(java.util.concurrent.Callable<V> callable)
Enqueues a task/callable object to execute in the jME3
rendering thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UpdateControl
public UpdateControl()
enqueue
public <V> java.util.concurrent.Future<V> enqueue(java.util.concurrent.Callable<V> callable)
- Enqueues a task/callable object to execute in the jME3
rendering thread.
controlUpdate
protected void controlUpdate(float tpf)
- Description copied from class:
AbstractControl
- To be implemented in subclass.
- Specified by:
controlUpdate
in class AbstractControl
controlRender
protected void controlRender(RenderManager rm,
ViewPort vp)
- Description copied from class:
AbstractControl
- To be implemented in subclass.
- Specified by:
controlRender
in class AbstractControl
cloneForSpatial
public Control cloneForSpatial(Spatial newSpatial)
- Description copied from interface:
Control
- Creates a clone of the Control, the given Spatial is the cloned
version of the spatial to which this control is attached to.
- Returns:
- A clone of this control for the spatial