@ -67,6 +67,7 @@ public class ScenePreviewProcessor implements SceneProcessor {
private ConcurrentLinkedQueue < PreviewRequest > previewQueue = new ConcurrentLinkedQueue < PreviewRequest > ( ) ;
private PreviewRequest currentPreviewRequest ;
private RenderManager rm ;
private PointLight light ;
public void addRequest ( PreviewRequest request ) {
previewQueue . add ( request ) ;
@ -103,7 +104,7 @@ public class ScenePreviewProcessor implements SceneProcessor {
offView . setOutputFrameBuffer ( offBuffer ) ;
// setup framebuffer's scene
PointLight light = new PointLight ( ) ;
light = new PointLight ( ) ;
light . setPosition ( offCamera . getLocation ( ) ) ;
light . setColor ( ColorRGBA . White ) ;
previewNode . addLight ( light ) ;
@ -127,6 +128,16 @@ public class ScenePreviewProcessor implements SceneProcessor {
currentPreviewRequest = previewQueue . poll ( ) ;
if ( currentPreviewRequest ! = null ) {
previewNode . attachChild ( currentPreviewRequest . getSpatial ( ) ) ;
if ( currentPreviewRequest . getCameraRequest ( ) . location ! = null ) {
offCamera . setLocation ( currentPreviewRequest . getCameraRequest ( ) . location ) ;
light . setPosition ( currentPreviewRequest . getCameraRequest ( ) . location ) ;
}
if ( currentPreviewRequest . getCameraRequest ( ) . rotation ! = null ) {
offCamera . setRotation ( currentPreviewRequest . getCameraRequest ( ) . rotation ) ;
}
if ( currentPreviewRequest . getCameraRequest ( ) . lookAt ! = null ) {
offCamera . lookAt ( currentPreviewRequest . getCameraRequest ( ) . lookAt , currentPreviewRequest . getCameraRequest ( ) . up ) ;
}
}
update ( f ) ;
}