Skip to content

Commit 1454e7a

Browse files
authored
ObjectLoader: Refector (de)serialization of Fog and FogExp2 (mrdoob#26793)
* marshal fog/fogexp2 .name * use object literal
1 parent 1a7b805 commit 1454e7a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/loaders/ObjectLoader.js

+6
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,12 @@ class ObjectLoader extends Loader {
785785

786786
}
787787

788+
if ( data.fog.name !== '' ) {
789+
790+
object.fog.name = data.fog.name;
791+
792+
}
793+
788794
}
789795

790796
if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;

src/scenes/Fog.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Fog {
2525

2626
return {
2727
type: 'Fog',
28+
name: this.name,
2829
color: this.color.getHex(),
2930
near: this.near,
3031
far: this.far

src/scenes/FogExp2.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class FogExp2 {
2323

2424
return {
2525
type: 'FogExp2',
26+
name: this.name,
2627
color: this.color.getHex(),
2728
density: this.density
2829
};

0 commit comments

Comments
 (0)