|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2009-2019 jMonkeyEngine
|
|
|
+ * Copyright (c) 2009-2021 jMonkeyEngine
|
|
|
* All rights reserved.
|
|
|
*
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -196,6 +196,24 @@ public class EnvironmentCamera extends BaseAppState {
|
|
|
jobs.remove(0);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Alter the background color of an initialized EnvironmentCamera.
|
|
|
+ *
|
|
|
+ * @param bgColor the desired color (not null, unaffected, default is the
|
|
|
+ * background color of the application's default viewport)
|
|
|
+ */
|
|
|
+ public void setBackGroundColor(ColorRGBA bgColor) {
|
|
|
+ if (!isInitialized()) {
|
|
|
+ throw new IllegalStateException(
|
|
|
+ "The EnvironmentCamera is uninitialized.");
|
|
|
+ }
|
|
|
+
|
|
|
+ backGroundColor.set(bgColor);
|
|
|
+ for (int i = 0; i < 6; ++i) {
|
|
|
+ viewports[i].setBackgroundColor(bgColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Gets the size of environment cameras.
|
|
|
*
|
|
@@ -260,7 +278,7 @@ public class EnvironmentCamera extends BaseAppState {
|
|
|
|
|
|
@Override
|
|
|
protected void initialize(Application app) {
|
|
|
- this.backGroundColor = app.getViewPort().getBackgroundColor();
|
|
|
+ this.backGroundColor = app.getViewPort().getBackgroundColor().clone();
|
|
|
|
|
|
final Camera[] cameras = new Camera[6];
|
|
|
final Texture2D[] textures = new Texture2D[6];
|