Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions jme3-core/src/main/java/com/jme3/scene/LightNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
* with a {@link Node} object.
*
* @author Tim8Dev
* @deprecated Use a {@link LightControl} attached to a {@link Node} directly.
*/
@Deprecated
public class LightNode extends Node {

private LightControl lightControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
import com.jme3.math.*;
import com.jme3.renderer.Camera;
import com.jme3.scene.Geometry;
import com.jme3.scene.LightNode;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.LightControl;
import com.jme3.scene.debug.Grid;
import com.jme3.scene.debug.WireFrustum;
import com.jme3.scene.shape.Box;
Expand Down Expand Up @@ -108,8 +108,12 @@ public void simpleInitApp() {
geom.getMaterial().setColor("Diffuse", ColorRGBA.White);
geom.getMaterial().setColor("Ambient", ColorRGBA.DarkGray);
geom.getMaterial().setBoolean("UseMaterialColors", true);
final LightNode ln = new LightNode("lb", spotLight);

final Node ln = new Node("lb");
LightControl lightControl = new LightControl(spotLight);
ln.addControl(lightControl);
ln.attachChild(geom);

geom.setLocalTranslation(0, -spotLight.getSpotRange() / 2f, 0);
geom.rotate(-FastMath.HALF_PI, 0, 0);
rootNode.attachChild(ln);
Expand Down
111 changes: 0 additions & 111 deletions jme3-examples/src/main/java/jme3test/light/TestLightNode.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.LightNode;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
Expand Down Expand Up @@ -105,27 +104,19 @@ public void simpleInitApp() {
if (nb > 60) {
n.removeLight(light);
} else {

LightNode ln = new LightNode("l", light);
n.attachChild(ln);
ln.setLocalTranslation(p.getPosition());
int rand = FastMath.nextRandomInt(0, 3);
switch (rand) {
case 0:
light.setColor(ColorRGBA.Red);
// ln.addControl(new MoveControl(5f));
break;
case 1:
light.setColor(ColorRGBA.Yellow);
// ln.addControl(new MoveControl(5f));
break;
case 2:
light.setColor(ColorRGBA.Green);
//ln.addControl(new MoveControl(-5f));
break;
case 3:
light.setColor(ColorRGBA.Orange);
//ln.addControl(new MoveControl(-5f));
break;
}
}
Expand Down Expand Up @@ -278,4 +269,4 @@ protected void controlUpdate(float tpf) {
protected void controlRender(RenderManager rm, ViewPort vp) {
}
}
}
}