Skip to content

Commit 2632bd9

Browse files
authored
LightControl: setLight(Light) allows you to set null light
1 parent 1af2acf commit 2632bd9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

jme3-core/src/main/java/com/jme3/scene/control/LightControl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ public void setInvertAxisDirection(boolean invertAxisDirection) {
158158
}
159159

160160
private void validateSupportedLightType(Light light) {
161+
if (light == null) {
162+
return;
163+
}
164+
161165
switch (light.getType()) {
162166
case Point:
163167
case Directional:
@@ -172,6 +176,10 @@ private void validateSupportedLightType(Light light) {
172176

173177
@Override
174178
protected void controlUpdate(float tpf) {
179+
if (light == null) {
180+
return;
181+
}
182+
175183
switch (controlDir) {
176184
case SpatialToLight:
177185
spatialToLight(light);

0 commit comments

Comments
 (0)