|
@@ -1,10 +1,10 @@
|
|
|
-import { Color } from '../math/Color.js';
|
|
|
-
|
|
|
/**
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
* @author alteredq / http://alteredqualia.com/
|
|
|
*/
|
|
|
|
|
|
+import { Color } from '../math/Color.js';
|
|
|
+
|
|
|
function Fog( color, near, far ) {
|
|
|
|
|
|
this.name = '';
|
|
@@ -16,23 +16,27 @@ function Fog( color, near, far ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-Fog.prototype.isFog = true;
|
|
|
+Object.assign( Fog.prototype, {
|
|
|
+
|
|
|
+ isFog: true,
|
|
|
+
|
|
|
+ clone: function () {
|
|
|
|
|
|
-Fog.prototype.clone = function () {
|
|
|
+ return new Fog( this.color, this.near, this.far );
|
|
|
|
|
|
- return new Fog( this.color, this.near, this.far );
|
|
|
+ },
|
|
|
|
|
|
-};
|
|
|
+ toJSON: function ( /* meta */ ) {
|
|
|
|
|
|
-Fog.prototype.toJSON = function ( /* meta */ ) {
|
|
|
+ return {
|
|
|
+ type: 'Fog',
|
|
|
+ color: this.color.getHex(),
|
|
|
+ near: this.near,
|
|
|
+ far: this.far
|
|
|
+ }
|
|
|
|
|
|
- return {
|
|
|
- type: 'Fog',
|
|
|
- color: this.color.getHex(),
|
|
|
- near: this.near,
|
|
|
- far: this.far
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
-};
|
|
|
+} );
|
|
|
|
|
|
export { Fog };
|