Skip to content

Commit

Permalink
ObjectLoader: Refector (de)serialization of Fog and FogExp2 (mrdoob#2…
Browse files Browse the repository at this point in the history
…6793)

* marshal fog/fogexp2 .name

* use object literal
  • Loading branch information
ycw authored Sep 18, 2023
1 parent 1a7b805 commit 1454e7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/loaders/ObjectLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,12 @@ class ObjectLoader extends Loader {

}

if ( data.fog.name !== '' ) {

object.fog.name = data.fog.name;

}

}

if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;
Expand Down
1 change: 1 addition & 0 deletions src/scenes/Fog.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Fog {

return {
type: 'Fog',
name: this.name,
color: this.color.getHex(),
near: this.near,
far: this.far
Expand Down
1 change: 1 addition & 0 deletions src/scenes/FogExp2.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class FogExp2 {

return {
type: 'FogExp2',
name: this.name,
color: this.color.getHex(),
density: this.density
};
Expand Down

0 comments on commit 1454e7a

Please sign in to comment.