@Override protected void updateWorldLightList() { super.updateWorldLightList(); // geometry requires lights to be sorted worldLights.sort(true); }
@Override protected void updateWorldTransforms() { super.updateWorldTransforms(); computeWorldMatrix(); if (isGrouped()) { groupNode.onTransformChange(this); } // geometry requires lights to be sorted worldLights.sort(true); }
@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. }
@Override protected void updateWorldLightList() { super.updateWorldLightList(); // geometry requires lights to be sorted worldLights.sort(true); }
@Override protected void updateWorldTransforms() { super.updateWorldTransforms(); computeWorldMatrix(); if (isGrouped()) { groupNode.onTransformChange(this); } // geometry requires lights to be sorted worldLights.sort(true); }
@Override protected void updateWorldTransforms() { super.updateWorldTransforms(); computeWorldMatrix(); if (isBatched()) { batchNode.updateSubBatch(this); } // geometry requires lights to be sorted worldLights.sort(true); }