Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -196,6 +196,24 @@ public void render(final RenderManager renderManager) {
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.
*
Expand Down Expand Up @@ -260,7 +278,7 @@ public ViewPort[] getViewPorts(){

@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];
Expand Down