/** * <code>addLight</code> adds the given light to the Spatial; causing all * child Spatials to be affected by it. * * @param light The light to add. */ public void addLight(Light light) { localLights.add(light); setLightListRefresh(); }
@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The first probe is actually the closest to the geometry since the //light list is sorted according to the distance to the geom. LightProbe p = lightProbes.get(0); if (p.isReady()) { lightList.add(p); } //clearing the list for next pass. lightProbes.clear(); } }
@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The 3 first probes are the closest to the geometry since the //light list is sorted according to the distance to the geom. int addedProbes = 0; for (LightProbe p : lightProbes) { if (p.isReady() && p.isEnabled()) { lightList.add(p); addedProbes ++; } if (addedProbes == MAX_PROBES) { break; } } //clearing the list for next pass. lightProbes.clear(); } }
@Test public void testSimpleSort() { Geometry g = new Geometry("test", new Mesh()); LightList list = new LightList(g); list.add(new SpotLight(Vector3f.ZERO, Vector3f.UNIT_X)); list.add(new PointLight(Vector3f.UNIT_X)); list.add(new DirectionalLight(Vector3f.UNIT_X)); list.add(new AmbientLight()); list.sort(true); assert list.get(0) instanceof AmbientLight; // Ambients always first assert list.get(1) instanceof DirectionalLight; // .. then directionals assert list.get(2) instanceof SpotLight; // Spot is 0 units away from geom assert list.get(3) instanceof PointLight; // .. and point is 1 unit away. }
probeBlendStrat.registerProbe((LightProbe) light); } else { filteredLightList.add(light);
public void populateProbe(LightList lightList){ if(probe != null && probe.isReady()){ lightList.add(probe); } }
/** * <code>addLight</code> adds the given light to the Spatial; causing * all child Spatials to be effected by it. * * @param light The light to add. */ public void addLight(Light light) { localLights.add(light); setLightListRefresh(); }
/** * <code>addLight</code> adds the given light to the Spatial; causing all * child Spatials to be affected by it. * * @param light The light to add. */ public void addLight(Light light) { localLights.add(light); setLightListRefresh(); }
@Override public void populateProbes(Geometry g, LightList lightList) { if (!lightProbes.isEmpty()) { //The first probe is actually the closest to the geometry since the //light list is sorted according to the distance to the geom. LightProbe p = lightProbes.get(0); if (p.isReady()) { lightList.add(p); } //clearing the list for next pass. lightProbes.clear(); } }
filteredLightList.add(light);
probeBlendStrat.registerProbe((LightProbe) light); } else { filteredLightList.add(light);