Allow a custom Executor to be passed to the TerrainLodControl
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10880 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f4598eeb91
commit
ac51e1d885
@ -73,6 +73,11 @@ import java.util.logging.Logger;
|
|||||||
* This camera reference has to be manually added in when you load the
|
* This camera reference has to be manually added in when you load the
|
||||||
* terrain to the scene!
|
* terrain to the scene!
|
||||||
*
|
*
|
||||||
|
* When the control or the terrain are removed from the scene, you should call
|
||||||
|
* TerrainLodControl.detachAndCleanUpControl() to remove any threads it created
|
||||||
|
* to handle the LOD processing. If you supply your own executor service, then
|
||||||
|
* you have to handle its thread termination yourself.
|
||||||
|
*
|
||||||
* @author Brent Owens
|
* @author Brent Owens
|
||||||
*/
|
*/
|
||||||
public class TerrainLodControl extends AbstractControl {
|
public class TerrainLodControl extends AbstractControl {
|
||||||
@ -119,6 +124,14 @@ public class TerrainLodControl extends AbstractControl {
|
|||||||
@Override
|
@Override
|
||||||
protected void controlRender(RenderManager rm, ViewPort vp) {
|
protected void controlRender(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set your own custom executor to be used. The control will use
|
||||||
|
* this instead of creating its own.
|
||||||
|
*/
|
||||||
|
public void setExecutor(ExecutorService executor) {
|
||||||
|
this.executor = executor;
|
||||||
|
}
|
||||||
|
|
||||||
protected ExecutorService createExecutorService() {
|
protected ExecutorService createExecutorService() {
|
||||||
return Executors.newSingleThreadExecutor(new ThreadFactory() {
|
return Executors.newSingleThreadExecutor(new ThreadFactory() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user