@@ -39,6 +39,7 @@ public enum Renderer {YAFARAY, SUNFLOW}
39
39
public enum Quality {HIGH , LOW }
40
40
41
41
private Home home ;
42
+ private Camera camera ;
42
43
private Map <String , List <HomeLight >> lights ;
43
44
private Map <String , Map <String , List <HomeLight >>> lightsGroups ;
44
45
private List <String > lightsNames ;
@@ -77,6 +78,7 @@ public StateIcon(String name, Point2d position, String type, String action, Stri
77
78
78
79
public Controller (Home home ) {
79
80
this .home = home ;
81
+ camera = home .getCamera ().clone ();
80
82
propertyChangeSupport = new PropertyChangeSupport (this );
81
83
lights = getEnabledLights ();
82
84
lightsGroups = getLightsGroups (lights );
@@ -330,7 +332,6 @@ private List<HomePieceOfFurniture> getHomeAssistantEntities() {
330
332
}
331
333
332
334
private void build3dProjection () {
333
- Camera camera = home .getCamera ();
334
335
cameraPosition = new Vector4d (camera .getX (), camera .getZ (), camera .getY (), 0 );
335
336
336
337
Transform3D yawRotation = new Transform3D ();
@@ -398,7 +399,7 @@ private BufferedImage renderScene() throws IOException {
398
399
rendererToClassName .get (renderer ),
399
400
home , null , this .quality == Quality .LOW ? AbstractPhotoRenderer .Quality .LOW : AbstractPhotoRenderer .Quality .HIGH );
400
401
BufferedImage image = new BufferedImage (renderWidth , renderHeight , BufferedImage .TYPE_INT_RGB );
401
- photoRenderer .render (image , home . getCamera () , null );
402
+ photoRenderer .render (image , camera , null );
402
403
403
404
return image ;
404
405
}
0 commit comments