File tree Expand file tree Collapse file tree 4 files changed +9
-123
lines changed
jme3-core/src/main/java/com/jme3/scene
jme3-examples/src/main/java/jme3test/light Expand file tree Collapse file tree 4 files changed +9
-123
lines changed Original file line number Diff line number Diff line change 4444 * with a {@link Node} object.
4545 *
4646 * @author Tim8Dev
47+ * @deprecated Use a {@link LightControl} attached to a {@link Node} directly.
4748 */
49+ @ Deprecated
4850public class LightNode extends Node {
4951
5052 private LightControl lightControl ;
Original file line number Diff line number Diff line change 4747import com .jme3 .math .*;
4848import com .jme3 .renderer .Camera ;
4949import com .jme3 .scene .Geometry ;
50- import com .jme3 .scene .LightNode ;
5150import com .jme3 .scene .Node ;
5251import com .jme3 .scene .Spatial ;
52+ import com .jme3 .scene .control .LightControl ;
5353import com .jme3 .scene .debug .Grid ;
5454import com .jme3 .scene .debug .WireFrustum ;
5555import com .jme3 .scene .shape .Box ;
@@ -108,8 +108,12 @@ public void simpleInitApp() {
108108 geom .getMaterial ().setColor ("Diffuse" , ColorRGBA .White );
109109 geom .getMaterial ().setColor ("Ambient" , ColorRGBA .DarkGray );
110110 geom .getMaterial ().setBoolean ("UseMaterialColors" , true );
111- final LightNode ln = new LightNode ("lb" , spotLight );
111+
112+ final Node ln = new Node ("lb" );
113+ LightControl lightControl = new LightControl (spotLight );
114+ ln .addControl (lightControl );
112115 ln .attachChild (geom );
116+
113117 geom .setLocalTranslation (0 , -spotLight .getSpotRange () / 2f , 0 );
114118 geom .rotate (-FastMath .HALF_PI , 0 , 0 );
115119 rootNode .attachChild (ln );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5252import com .jme3 .renderer .RenderManager ;
5353import com .jme3 .renderer .ViewPort ;
5454import com .jme3 .scene .Geometry ;
55- import com .jme3 .scene .LightNode ;
5655import com .jme3 .scene .Node ;
5756import com .jme3 .scene .Spatial ;
5857import com .jme3 .scene .control .AbstractControl ;
@@ -105,27 +104,19 @@ public void simpleInitApp() {
105104 if (nb > 60 ) {
106105 n .removeLight (light );
107106 } else {
108-
109- LightNode ln = new LightNode ("l" , light );
110- n .attachChild (ln );
111- ln .setLocalTranslation (p .getPosition ());
112107 int rand = FastMath .nextRandomInt (0 , 3 );
113108 switch (rand ) {
114109 case 0 :
115110 light .setColor (ColorRGBA .Red );
116- // ln.addControl(new MoveControl(5f));
117111 break ;
118112 case 1 :
119113 light .setColor (ColorRGBA .Yellow );
120- // ln.addControl(new MoveControl(5f));
121114 break ;
122115 case 2 :
123116 light .setColor (ColorRGBA .Green );
124- //ln.addControl(new MoveControl(-5f));
125117 break ;
126118 case 3 :
127119 light .setColor (ColorRGBA .Orange );
128- //ln.addControl(new MoveControl(-5f));
129120 break ;
130121 }
131122 }
@@ -278,4 +269,4 @@ protected void controlUpdate(float tpf) {
278269 protected void controlRender (RenderManager rm , ViewPort vp ) {
279270 }
280271 }
281- }
272+ }
You can’t perform that action at this time.
0 commit comments