Mr.doob пре 6 година
родитељ
комит
fde9b0ed71
2 измењених фајлова са 35 додато и 27 уклоњено
  1. 18 14
      src/scenes/Fog.js
  2. 17 13
      src/scenes/FogExp2.js

+ 18 - 14
src/scenes/Fog.js

@@ -1,10 +1,10 @@
-import { Color } from '../math/Color.js';
-
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  * @author alteredq / http://alteredqualia.com/
  * @author alteredq / http://alteredqualia.com/
  */
  */
 
 
+import { Color } from '../math/Color.js';
+
 function Fog( color, near, far ) {
 function Fog( color, near, far ) {
 
 
 	this.name = '';
 	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 };
 export { Fog };

+ 17 - 13
src/scenes/FogExp2.js

@@ -1,10 +1,10 @@
-import { Color } from '../math/Color.js';
-
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  * @author alteredq / http://alteredqualia.com/
  * @author alteredq / http://alteredqualia.com/
  */
  */
 
 
+import { Color } from '../math/Color.js';
+
 function FogExp2( color, density ) {
 function FogExp2( color, density ) {
 
 
 	this.name = '';
 	this.name = '';
@@ -14,22 +14,26 @@ function FogExp2( color, density ) {
 
 
 }
 }
 
 
-FogExp2.prototype.isFogExp2 = true;
+Object.assign( FogExp2.prototype, {
+
+	isFogExp2: true,
+
+	clone: function () {
 
 
-FogExp2.prototype.clone = function () {
+		return new FogExp2( this.color, this.density );
 
 
-	return new FogExp2( this.color, this.density );
+	},
 
 
-};
+	toJSON: function ( /* meta */ ) {
 
 
-FogExp2.prototype.toJSON = function ( /* meta */ ) {
+		return {
+			type: 'FogExp2',
+			color: this.color.getHex(),
+			density: this.density
+		};
 
 
-	return {
-		type: 'FogExp2',
-		color: this.color.getHex(),
-		density: this.density
-	};
+	}
 
 
-};
+} );
 
 
 export { FogExp2 };
 export { FogExp2 };