Переглянути джерело

OBJExporter: convert indents (spaces to tabs)

Arthur Schwaiger 10 роки тому
батько
коміт
2fa9cce7d6
1 змінених файлів з 61 додано та 61 видалено
  1. 61 61
      examples/js/exporters/OBJExporter.js

+ 61 - 61
examples/js/exporters/OBJExporter.js

@@ -6,101 +6,101 @@ THREE.OBJExporter = function () {};
 
 THREE.OBJExporter.prototype = {
 
-    constructor: THREE.OBJExporter,
+	constructor: THREE.OBJExporter,
 
-    indexVertex: 0,
-    indexVertexUvs: 0,
-    indexNormals: 0,
+	indexVertex: 0,
+	indexVertexUvs: 0,
+	indexNormals: 0,
 
-    parse: function ( object, scaleFactor ) {
-        var output = '';
+	parse: function ( object, scaleFactor ) {
+		var output = '';
 
-        var nbVertex, nbVertexUvs, nbNormals;
-        nbVertex = nbVertexUvs = nbNormals = 0;
+		var nbVertex, nbVertexUvs, nbNormals;
+		nbVertex = nbVertexUvs = nbNormals = 0;
 
-        var geometry = object.geometry;
+		var geometry = object.geometry;
 
-        if (scaleFactor === undefined) {
-            scaleFactor = 1;
-        }
+		if (scaleFactor === undefined) {
+			scaleFactor = 1;
+		}
 
-        output += 'g ' + object.id + '\n';
+		output += 'g ' + object.id + '\n';
 
-        if (object.geometry) {
-            for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
+		if (object.geometry) {
+			for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {
 
-                var vertex = geometry.vertices[ i ].clone();
-                vertex.applyMatrix4( object.matrixWorld );
+				var vertex = geometry.vertices[ i ].clone();
+				vertex.applyMatrix4( object.matrixWorld );
 
-                output += 'v ' + scaleFactor * vertex.x + ' ' + scaleFactor * vertex.y + ' ' + scaleFactor * vertex.z + '\n';
+				output += 'v ' + scaleFactor * vertex.x + ' ' + scaleFactor * vertex.y + ' ' + scaleFactor * vertex.z + '\n';
 
-                nbVertex++;
-            }
+				nbVertex++;
+			}
 
-            // uvs
+			// uvs
 
-            for ( var i = 0, l = geometry.faceVertexUvs[ 0 ].length; i < l; i ++ ) {
+			for ( var i = 0, l = geometry.faceVertexUvs[ 0 ].length; i < l; i ++ ) {
 
-                var vertexUvs = geometry.faceVertexUvs[ 0 ][ i ];
+				var vertexUvs = geometry.faceVertexUvs[ 0 ][ i ];
 
-                for ( var j = 0; j < vertexUvs.length; j ++ ) {
+				for ( var j = 0; j < vertexUvs.length; j ++ ) {
 
-                    var uv = vertexUvs[ j ];
-                    vertex.applyMatrix4( object.matrixWorld );
+					var uv = vertexUvs[ j ];
+					vertex.applyMatrix4( object.matrixWorld );
 
-                    output += 'vt ' + scaleFactor * uv.x + ' ' + scaleFactor * uv.y + '\n';
+					output += 'vt ' + scaleFactor * uv.x + ' ' + scaleFactor * uv.y + '\n';
 
-                    nbVertexUvs++;
-                }
+					nbVertexUvs++;
+				}
 
-            }
+			}
 
-            // normals
+			// normals
 
-            for ( var i = 0, l = geometry.faces.length; i < l; i ++ ) {
+			for ( var i = 0, l = geometry.faces.length; i < l; i ++ ) {
 
-                var normals = geometry.faces[ i ].vertexNormals;
+				var normals = geometry.faces[ i ].vertexNormals;
 
-                for ( var j = 0; j < normals.length; j ++ ) {
+				for ( var j = 0; j < normals.length; j ++ ) {
 
-                    var normal = normals[ j ];
-                    output += 'vn ' + scaleFactor * normal.x + ' ' + scaleFactor * normal.y + ' ' + scaleFactor * normal.z + '\n';
+					var normal = normals[ j ];
+					output += 'vn ' + scaleFactor * normal.x + ' ' + scaleFactor * normal.y + ' ' + scaleFactor * normal.z + '\n';
 
-                    nbNormals++;
-                }
+					nbNormals++;
+				}
 
-            }
+			}
 
-            // faces
+			// faces
 
-            for ( var i = 0, j = 1, l = geometry.faces.length; i < l; i ++, j += 3 ) {
+			for ( var i = 0, j = 1, l = geometry.faces.length; i < l; i ++, j += 3 ) {
 
-                var face = geometry.faces[ i ];
+				var face = geometry.faces[ i ];
 
-                output += 'f ';
-                output += ( this.indexVertex + face.a + 1 ) + '/' + ( this.indexVertexUvs + j ) + '/' + ( this.indexNormals + j ) + ' ';
-                output += ( this.indexVertex + face.b + 1 ) + '/' + ( this.indexVertexUvs + j + 1 ) + '/' + ( this.indexNormals + j + 1 ) + ' ';
-                output += ( this.indexVertex + face.c + 1 ) + '/' + ( this.indexVertexUvs + j + 2 ) + '/' + ( this.indexNormals + j + 2 ) + '\n';
+				output += 'f ';
+				output += ( this.indexVertex + face.a + 1 ) + '/' + ( this.indexVertexUvs + j ) + '/' + ( this.indexNormals + j ) + ' ';
+				output += ( this.indexVertex + face.b + 1 ) + '/' + ( this.indexVertexUvs + j + 1 ) + '/' + ( this.indexNormals + j + 1 ) + ' ';
+				output += ( this.indexVertex + face.c + 1 ) + '/' + ( this.indexVertexUvs + j + 2 ) + '/' + ( this.indexNormals + j + 2 ) + '\n';
 
-            }
-        }
+			}
+		}
 
-        // update index
-        this.indexVertex += nbVertex;
-        this.indexVertexUvs += nbVertexUvs
-        this.indexNormals += nbNormals
+		// update index
+		this.indexVertex += nbVertex;
+		this.indexVertexUvs += nbVertexUvs
+		this.indexNormals += nbNormals
 
-        // Create children objects
-        if (object.children && object.children.length > 0) {
+		// Create children objects
+		if (object.children && object.children.length > 0) {
 
-            for ( var i in object.children ) {
-                output += '# new children object: ' + object.children[i].id + '\n';
-                output += this.parse( object.children[i], scaleFactor );
-            }
-        }
+			for ( var i in object.children ) {
+				output += '# new children object: ' + object.children[i].id + '\n';
+				output += this.parse( object.children[i], scaleFactor );
+			}
+		}
 
-        return output;
+		return output;
 
-    }
+	}
 
 }