浏览代码

Converted space indents to tabs. See #6252.

Mr.doob 10 年之前
父节点
当前提交
c1faad5bde

+ 1 - 1
src/cameras/OrthographicCamera.js

@@ -70,4 +70,4 @@ THREE.OrthographicCamera.prototype.toJSON = function ( meta ) {
 
 	return data;
 
-};
+};

+ 1 - 1
src/cameras/PerspectiveCamera.js

@@ -152,4 +152,4 @@ THREE.PerspectiveCamera.prototype.toJSON = function ( meta ) {
 
 	return data;
 
-};
+};

+ 12 - 12
src/core/BufferGeometry.js

@@ -876,25 +876,25 @@ THREE.BufferGeometry.prototype = {
 
 	toJSON: function() {
 
-	  // we will store all serialization data on 'data'
-	  var data = {};
+		// we will store all serialization data on 'data'
+		var data = {};
 
-    // add metadata
-    data.metadata = {
+		// add metadata
+		data.metadata = {
 			version: 4.4,
 			type: 'BufferGeometry',
 			generator: 'BufferGeometry.toJSON'
 		}
 
-	  // standard BufferGeometry serialization
+		// standard BufferGeometry serialization
 
-	  data.type = this.type;
-	  data.uuid = this.uuid;
-	  if ( this.name !== '' ) data.name = this.name;
-	  data.data = {};
-	  data.data.attributes = {};
+		data.type = this.type;
+		data.uuid = this.uuid;
+		if ( this.name !== '' ) data.name = this.name;
+		data.data = {};
+		data.data.attributes = {};
 
-	  var attributes = this.attributes;
+		var attributes = this.attributes;
 		var offsets = this.offsets;
 		var boundingSphere = this.boundingSphere;
 
@@ -927,7 +927,7 @@ THREE.BufferGeometry.prototype = {
 
 		}
 
-	  return data;
+		return data;
 
 	},
 

+ 10 - 10
src/core/Geometry.js

@@ -799,23 +799,23 @@ THREE.Geometry.prototype = {
 
 	toJSON: function() {
 
-	  // we will store all serialization data on 'data'
-	  var data = {};
+		// we will store all serialization data on 'data'
+		var data = {};
 
-    // add metadata
-    data.metadata = {
+		// add metadata
+		data.metadata = {
 			version: 4.4,
 			type: 'Geometry',
 			generator: 'Geometry.toJSON'
 		};
 
-	  // standard Geometry serialization
+		// standard Geometry serialization
 
-	  data.type = this.type;
-	  data.uuid = this.uuid;
-	  if ( this.name !== '' ) data.name = this.name;
+		data.type = this.type;
+		data.uuid = this.uuid;
+		if ( this.name !== '' ) data.name = this.name;
 
-	  if ( this.parameters !== undefined ) {
+		if ( this.parameters !== undefined ) {
 
 			var parameters = this.parameters;
 
@@ -996,7 +996,7 @@ THREE.Geometry.prototype = {
 		if ( uvs.length > 0 ) data.data.uvs = [ uvs ]; // temporal backward compatibility
 		data.data.faces = faces;
 
-	  return data;
+		return data;
 
 	},
 

+ 57 - 57
src/core/Object3D.js

@@ -571,85 +571,85 @@ THREE.Object3D.prototype = {
 
 		var isRootObject = ( meta === undefined );
 
-	  // we will store all serialization data on 'data'
-	  var data = {};
-	  var metadata;
-
-	  // meta is a hash used to collect geometries, materials.
-	  // not providing it implies that this is the root object
-	  // being serialized.
-	  if ( isRootObject ) {
-
-	    // initialize meta obj
-	    meta = {
-	      geometries: {},
-	      materials: {}
-	    }
-
-	    // add metadata
-	    metadata = {
+		// we will store all serialization data on 'data'
+		var data = {};
+		var metadata;
+
+		// meta is a hash used to collect geometries, materials.
+		// not providing it implies that this is the root object
+		// being serialized.
+		if ( isRootObject ) {
+
+			// initialize meta obj
+			meta = {
+				geometries: {},
+				materials: {}
+			}
+
+			// add metadata
+			metadata = {
 				version: 4.4,
 				type: 'Object',
 				generator: 'Object3D.toJSON'
 			}
 
-	  }
-
-	  // standard Object3D serialization
+		}
 
-	  data.type = this.type;
-	  data.uuid = this.uuid;
-	  if ( this.name !== '' ) data.name = this.name;
-	  if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
-	  if ( this.visible !== true ) data.visible = this.visible;
+		// standard Object3D serialization
 
-	  data.matrix = this.matrix.toArray();
+		data.type = this.type;
+		data.uuid = this.uuid;
+		if ( this.name !== '' ) data.name = this.name;
+		if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
+		if ( this.visible !== true ) data.visible = this.visible;
 
-	  if ( this.children.length > 0 ) {
+		data.matrix = this.matrix.toArray();
 
-	    data.children = [];
+		if ( this.children.length > 0 ) {
 
-	    for ( var i = 0; i < this.children.length; i ++ ) {
+			data.children = [];
 
-	      data.children.push( this.children[ i ].toJSON( meta ).object );
+			for ( var i = 0; i < this.children.length; i ++ ) {
 
-	    }
+				data.children.push( this.children[ i ].toJSON( meta ).object );
 
-	  }
+			}
 
-	  // wrap serialized object with additional data
+		}
 
-	  var output;
+		// wrap serialized object with additional data
 
-	  if ( isRootObject ) {
+		var output;
 
-	  	output = {
-	  		metadata: metadata,
-	  		geometries: extractFromCache(meta.geometries),
-	  		materials: extractFromCache(meta.materials),
-	  		object: data
-	  	};
+		if ( isRootObject ) {
 
-	  } else {
+			output = {
+				metadata: metadata,
+				geometries: extractFromCache(meta.geometries),
+				materials: extractFromCache(meta.materials),
+				object: data
+			};
 
-	  	output = { object: data };
+		} else {
 
-	  }
+			output = { object: data };
 
-	  return output;
+		}
 
-	  // extract data from the cache hash
-	  // remove metadata on each item
-	  // and return as array
-	  function extractFromCache ( cache ) {
-	  	var values = [];
-	  	for ( var key in cache ) {
-	  		var data = cache[ key ];
-	  		delete data.metadata;
-	  		values.push( data );
-	  	}
-	  	return values;
-	  }
+		return output;
+
+		// extract data from the cache hash
+		// remove metadata on each item
+		// and return as array
+		function extractFromCache ( cache ) {
+			var values = [];
+			for ( var key in cache ) {
+				var data = cache[ key ];
+				delete data.metadata;
+				values.push( data );
+			}
+			return values;
+		}
 
 	},
 

+ 4 - 4
src/lights/AmbientLight.js

@@ -25,10 +25,10 @@ THREE.AmbientLight.prototype.clone = function () {
 
 THREE.AmbientLight.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
-  data.object.color = this.color.getHex();
+	data.object.color = this.color.getHex();
 
-  return data;
+	return data;
 
-};
+};

+ 6 - 6
src/lights/DirectionalLight.js

@@ -47,7 +47,7 @@ THREE.DirectionalLight = function ( color, intensity ) {
 	this.shadowCascadeHeight = [ 512, 512, 512 ];
 
 	this.shadowCascadeNearZ = [ - 1.000, 0.990, 0.998 ];
-	this.shadowCascadeFarZ  = [ 0.990, 0.998, 1.000 ];
+	this.shadowCascadeFarZ = [ 0.990, 0.998, 1.000 ];
 
 	this.shadowCascadeArray = [];
 
@@ -106,7 +106,7 @@ THREE.DirectionalLight.prototype.clone = function () {
 	light.shadowCascadeHeight = this.shadowCascadeHeight.slice( 0 );
 
 	light.shadowCascadeNearZ = this.shadowCascadeNearZ.slice( 0 );
-	light.shadowCascadeFarZ  = this.shadowCascadeFarZ.slice( 0 );
+	light.shadowCascadeFarZ = this.shadowCascadeFarZ.slice( 0 );
 
 	return light;
 
@@ -114,11 +114,11 @@ THREE.DirectionalLight.prototype.clone = function () {
 
 THREE.DirectionalLight.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
-  data.object.color = this.color.getHex();
+	data.object.color = this.color.getHex();
 	data.object.intensity = this.intensity;
 
-  return data;
+	return data;
 
-};
+};

+ 3 - 3
src/lights/HemisphereLight.js

@@ -33,11 +33,11 @@ THREE.HemisphereLight.prototype.clone = function () {
 
 THREE.HemisphereLight.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	data.object.color = this.color.getHex();
 	data.object.groundColor = this.groundColor.getHex();
 
-  return data;
+	return data;
 
-};
+};

+ 3 - 3
src/lights/PointLight.js

@@ -33,13 +33,13 @@ THREE.PointLight.prototype.clone = function () {
 
 THREE.PointLight.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	data.object.color = this.color.getHex();
 	data.object.intensity = this.intensity;
 	data.object.distance = this.distance;
 	data.object.decay = this.decay;
 
-  return data;
+	return data;
 
-};
+};

+ 3 - 3
src/lights/SpotLight.js

@@ -83,7 +83,7 @@ THREE.SpotLight.prototype.clone = function () {
 
 THREE.SpotLight.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	data.object.color = this.color.getHex();
 	data.object.intensity = this.intensity;
@@ -92,6 +92,6 @@ THREE.SpotLight.prototype.toJSON = function ( meta ) {
 	data.object.exponent = this.exponent;
 	data.object.decay = this.decay;
 
-  return data;
+	return data;
 
-};
+};

+ 10 - 10
src/materials/Material.js

@@ -109,26 +109,26 @@ THREE.Material.prototype = {
 
 	toJSON: function() {
 
-	  // we will store all serialization data on 'data'
-	  var data = {};
+		// we will store all serialization data on 'data'
+		var data = {};
 
-    // add metadata
-    data.metadata = {
+		// add metadata
+		data.metadata = {
 			version: 4.4,
 			type: 'Material',
 			generator: 'Material.toJSON'
 		}
 
-	  // standard Material serialization
-	  data.type = this.type;
-	  data.uuid = this.uuid;
-	  if ( this.name !== '' ) data.name = this.name;
+		// standard Material serialization
+		data.type = this.type;
+		data.uuid = this.uuid;
+		if ( this.name !== '' ) data.name = this.name;
 
-	  if ( this.opacity < 1 ) data.opacity = this.opacity;
+		if ( this.opacity < 1 ) data.opacity = this.opacity;
 		if ( this.transparent !== false ) data.transparent = this.transparent;
 		if ( this.wireframe !== false ) data.wireframe = this.wireframe;
 
-	  return data;
+		return data;
 
 	},
 

+ 4 - 4
src/materials/MeshBasicMaterial.js

@@ -121,10 +121,10 @@ THREE.MeshBasicMaterial.prototype.toJSON = function () {
 	var data = THREE.Material.prototype.toJSON.call( this );
 
 	data.color = this.color.getHex();
-  if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
-  if ( this.side !== THREE.FrontSide ) data.side = this.side;
+	if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.side !== THREE.FrontSide ) data.side = this.side;
 
 	return data;
 
-};
+};

+ 3 - 3
src/materials/MeshDepthMaterial.js

@@ -48,9 +48,9 @@ THREE.MeshDepthMaterial.prototype.toJSON = function () {
 
 	var data = THREE.Material.prototype.toJSON.call( this );
 
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
-  if ( this.side !== THREE.FrontSide ) data.side = this.side;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.side !== THREE.FrontSide ) data.side = this.side;
 
 	return data;
 
-};
+};

+ 6 - 6
src/materials/MeshLambertMaterial.js

@@ -134,12 +134,12 @@ THREE.MeshLambertMaterial.prototype.toJSON = function () {
 	var data = THREE.Material.prototype.toJSON.call( this );
 
 	data.color = this.color.getHex();
-  data.emissive = this.emissive.getHex();
-  if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
-  if ( this.shading !== THREE.SmoothShading ) data.shading = this.shading;
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
-  if ( this.side !== THREE.FrontSide ) data.side = this.side;
+	data.emissive = this.emissive.getHex();
+	if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
+	if ( this.shading !== THREE.SmoothShading ) data.shading = this.shading;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.side !== THREE.FrontSide ) data.side = this.side;
 
 	return data;
 
-};
+};

+ 3 - 3
src/materials/MeshNormalMaterial.js

@@ -49,9 +49,9 @@ THREE.MeshPhongMaterial.prototype.toJSON = function () {
 
 	var data = THREE.Material.prototype.toJSON.call( this );
 
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
-  if ( this.side !== THREE.FrontSide ) data.side = this.side;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.side !== THREE.FrontSide ) data.side = this.side;
 
 	return data;
 
-};
+};

+ 8 - 8
src/materials/MeshPhongMaterial.js

@@ -174,15 +174,15 @@ THREE.MeshPhongMaterial.prototype.toJSON = function () {
 	var data = THREE.Material.prototype.toJSON.call( this );
 
 	data.color = this.color.getHex();
-  data.emissive = this.emissive.getHex();
-  data.specular = this.specular.getHex();
-  data.shininess = this.shininess;
+	data.emissive = this.emissive.getHex();
+	data.specular = this.specular.getHex();
+	data.shininess = this.shininess;
 
-  if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
-  if ( this.shading !== THREE.SmoothShading ) data.shading = this.shading;
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
-  if ( this.side !== THREE.FrontSide ) data.side = this.side;
+	if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
+	if ( this.shading !== THREE.SmoothShading ) data.shading = this.shading;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.side !== THREE.FrontSide ) data.side = this.side;
 
 	return data;
 
-};
+};

+ 5 - 5
src/materials/PointCloudMaterial.js

@@ -69,12 +69,12 @@ THREE.MeshDepthMaterial.prototype.toJSON = function () {
 
 	var data = THREE.Material.prototype.toJSON.call( this );
 
-  data.size  = this.size;
-  data.sizeAttenuation = this.sizeAttenuation;
-  data.color = this.color.getHex();
+	data.size	= this.size;
+	data.sizeAttenuation = this.sizeAttenuation;
+	data.color = this.color.getHex();
 
-  if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
-  if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
+	if ( this.vertexColors !== THREE.NoColors ) data.vertexColors = this.vertexColors;
+	if ( this.blending !== THREE.NormalBlending ) data.blending = this.blending;
 
 	return data;
 

+ 3 - 3
src/materials/ShaderMaterial.js

@@ -114,9 +114,9 @@ THREE.ShaderMaterial.prototype.toJSON = function () {
 
 	var data = THREE.Material.prototype.toJSON.call( this );
 
-  data.uniforms = this.uniforms;
-  data.vertexShader = this.vertexShader;
-  data.fragmentShader = this.fragmentShader;
+	data.uniforms = this.uniforms;
+	data.vertexShader = this.vertexShader;
+	data.fragmentShader = this.fragmentShader;
 
 	return data;
 

+ 1 - 1
src/materials/SpriteMaterial.js

@@ -60,7 +60,7 @@ THREE.SpriteMaterial.prototype.toJSON = function () {
 
 	var data = THREE.Material.prototype.toJSON.call( this );
 
-  data.color = this.color.getHex();
+	data.color = this.color.getHex();
 
 	return data;
 

+ 3 - 3
src/objects/Line.js

@@ -194,7 +194,7 @@ THREE.Line.prototype.clone = function ( object ) {
 
 THREE.Line.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	data.object.mode = this.mode;
 
@@ -211,6 +211,6 @@ THREE.Line.prototype.toJSON = function ( meta ) {
 	data.object.geometry = this.geometry.uuid;
 	data.object.material = this.material.uuid;
 
-  return data;
+	return data;
 
-};
+};

+ 3 - 3
src/objects/Mesh.js

@@ -326,7 +326,7 @@ THREE.Mesh.prototype.clone = function ( object, recursive ) {
 
 THREE.Mesh.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	// only serialize if not in meta geometries cache
 	if ( meta.geometries[ this.geometry.uuid ] === undefined ) {
@@ -341,6 +341,6 @@ THREE.Mesh.prototype.toJSON = function ( meta ) {
 	data.object.geometry = this.geometry.uuid;
 	data.object.material = this.material.uuid;
 
-  return data;
+	return data;
 
-};
+};

+ 2 - 2
src/objects/PointCloud.js

@@ -155,7 +155,7 @@ THREE.PointCloud.prototype.clone = function ( object ) {
 
 THREE.PointCloud.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	// only serialize if not in meta geometries cache
 	if ( meta.geometries[ this.geometry.uuid ] === undefined ) {
@@ -170,7 +170,7 @@ THREE.PointCloud.prototype.toJSON = function ( meta ) {
 	data.object.geometry = this.geometry.uuid;
 	data.object.material = this.material.uuid;
 
-  return data;
+	return data;
 
 };
 

+ 2 - 2
src/objects/Sprite.js

@@ -71,7 +71,7 @@ THREE.Sprite.prototype.clone = function ( object ) {
 
 THREE.Sprite.prototype.toJSON = function ( meta ) {
 
-  var data = THREE.Object3D.prototype.toJSON.call( this, meta );
+	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
 	// only serialize if not in meta materials cache
 	if ( meta.materials[ this.material.uuid ] === undefined ) {
@@ -80,7 +80,7 @@ THREE.Sprite.prototype.toJSON = function ( meta ) {
 
 	data.object.material = this.material.uuid;
 
-  return data;
+	return data;
 
 };