public void setEnvironmentLights(Array<BaseLight<?>> lights, Vector3 sunDirection) { environment = new Environment(); environment.add((shadowLight = new DirectionalShadowLight( GameSettings.SHADOW_MAP_WIDTH, GameSettings.SHADOW_MAP_HEIGHT, GameSettings.SHADOW_VIEWPORT_WIDTH, GameSettings.SHADOW_VIEWPORT_HEIGHT, GameSettings.SHADOW_NEAR, GameSettings.SHADOW_FAR)) .set(GameSettings.SHADOW_INTENSITY, GameSettings.SHADOW_INTENSITY, GameSettings.SHADOW_INTENSITY, sunDirection.nor())); environment.shadowMap = shadowLight; float ambientLight = GameSettings.SCENE_AMBIENT_LIGHT; environment.set(new ColorAttribute(ColorAttribute.AmbientLight, ambientLight, ambientLight, ambientLight, 1)); for (BaseLight<?> light : lights) { environment.add(light); } }
public Environment add (BaseLight light) { if (light instanceof DirectionalLight) directionalLights.add((DirectionalLight)light); else if (light instanceof PointLight) pointLights.add((PointLight)light); else throw new GdxRuntimeException("Unknown light type"); return this; }
public Environment remove (BaseLight light) { if (light instanceof DirectionalLight) directionalLights.removeValue((DirectionalLight)light, false); else if (light instanceof PointLight) pointLights.removeValue((PointLight)light, false); else throw new GdxRuntimeException("Unknown light type"); return this; }
public Environment add (final BaseLight... lights) { for (final BaseLight light : lights) add(light); return this; }
public Environment add (final Array<BaseLight> lights) { for (final BaseLight light : lights) add(light); return this; }
public Environment remove (final BaseLight... lights) { for (final BaseLight light : lights) remove(light); return this; }
public Environment remove (final Array<BaseLight> lights) { for (final BaseLight light : lights) remove(light); return this; }