File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed
jme3-core/src/main/java/com/jme3/light Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -146,4 +146,10 @@ public void read(JmeImporter im) throws IOException {
146146 direction = (Vector3f ) ic .readSavable ("direction" , null );
147147 }
148148
149+ @ Override
150+ public DirectionalLight clone () {
151+ DirectionalLight l = (DirectionalLight )super .clone ();
152+ l .direction = direction .clone ();
153+ return l ;
154+ }
149155}
Original file line number Diff line number Diff line change @@ -228,7 +228,9 @@ public void setEnabled(boolean enabled) {
228228 @ Override
229229 public Light clone (){
230230 try {
231- return (Light ) super .clone ();
231+ Light l = (Light ) super .clone ();
232+ l .color = color .clone ();
233+ return l ;
232234 } catch (CloneNotSupportedException ex ) {
233235 throw new AssertionError ();
234236 }
Original file line number Diff line number Diff line change @@ -241,4 +241,11 @@ public void read(JmeImporter im) throws IOException {
241241 this .invRadius = 0 ;
242242 }
243243 }
244+
245+ @ Override
246+ public PointLight clone () {
247+ PointLight p = (PointLight )super .clone ();
248+ p .position = position .clone ();
249+ return p ;
250+ }
244251}
Original file line number Diff line number Diff line change @@ -448,5 +448,13 @@ public void read(JmeImporter im) throws IOException {
448448 this .invSpotRange = 0 ;
449449 }
450450 }
451+
452+ @ Override
453+ public SpotLight clone () {
454+ SpotLight s = (SpotLight )super .clone ();
455+ s .direction = direction .clone ();
456+ s .position = position .clone ();
457+ return s ;
458+ }
451459}
452460
You can’t perform that action at this time.
0 commit comments