Forráskód Böngészése

LDrawLoader: Clean up.

Mr.doob 5 éve
szülő
commit
629cfbcb44
2 módosított fájl, 44 hozzáadás és 44 törlés
  1. 22 22
      examples/js/loaders/LDrawLoader.js
  2. 22 22
      examples/jsm/loaders/LDrawLoader.js

+ 22 - 22
examples/js/loaders/LDrawLoader.js

@@ -1174,36 +1174,36 @@ THREE.LDrawLoader = ( function () {
 
 									type = lp.getToken();
 
-										currentParseScope.triangles = [];
-										currentParseScope.lineSegments = [];
-										currentParseScope.conditionalSegments = [];
-										currentParseScope.type = type;
+									currentParseScope.triangles = [];
+									currentParseScope.lineSegments = [];
+									currentParseScope.conditionalSegments = [];
+									currentParseScope.type = type;
 
-										var isRoot = ! parentParseScope.isFromParse;
-										if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
+									var isRoot = ! parentParseScope.isFromParse;
+									if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
 
-											currentParseScope.groupObject = new THREE.Group();
+										currentParseScope.groupObject = new THREE.Group();
 
-											currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
+										currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
 
-										}
+									}
 
-										// If the scale of the object is negated then the triangle winding order
-										// needs to be flipped.
-										var matrix = currentParseScope.matrix;
-										if (
-											matrix.determinant() < 0 && (
-												scope.separateObjects && isPrimitiveType( type ) ||
-												! scope.separateObjects
-											) ) {
+									// If the scale of the object is negated then the triangle winding order
+									// needs to be flipped.
+									var matrix = currentParseScope.matrix;
+									if (
+										matrix.determinant() < 0 && (
+											scope.separateObjects && isPrimitiveType( type ) ||
+											! scope.separateObjects
+										) ) {
 
-											currentParseScope.inverted = ! currentParseScope.inverted;
+										currentParseScope.inverted = ! currentParseScope.inverted;
 
-										}
+									}
 
-										triangles = currentParseScope.triangles;
-										lineSegments = currentParseScope.lineSegments;
-										conditionalSegments = currentParseScope.conditionalSegments;
+									triangles = currentParseScope.triangles;
+									lineSegments = currentParseScope.lineSegments;
+									conditionalSegments = currentParseScope.conditionalSegments;
 
 									break;
 

+ 22 - 22
examples/jsm/loaders/LDrawLoader.js

@@ -1192,36 +1192,36 @@ var LDrawLoader = ( function () {
 
 									type = lp.getToken();
 
-										currentParseScope.triangles = [];
-										currentParseScope.lineSegments = [];
-										currentParseScope.conditionalSegments = [];
-										currentParseScope.type = type;
+									currentParseScope.triangles = [];
+									currentParseScope.lineSegments = [];
+									currentParseScope.conditionalSegments = [];
+									currentParseScope.type = type;
 
-										var isRoot = ! parentParseScope.isFromParse;
-										if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
+									var isRoot = ! parentParseScope.isFromParse;
+									if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
 
-											currentParseScope.groupObject = new Group();
+										currentParseScope.groupObject = new Group();
 
-											currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
+										currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
 
-										}
+									}
 
-										// If the scale of the object is negated then the triangle winding order
-										// needs to be flipped.
-										var matrix = currentParseScope.matrix;
-										if (
-											matrix.determinant() < 0 && (
-												scope.separateObjects && isPrimitiveType( type ) ||
-												! scope.separateObjects
-											) ) {
+									// If the scale of the object is negated then the triangle winding order
+									// needs to be flipped.
+									var matrix = currentParseScope.matrix;
+									if (
+										matrix.determinant() < 0 && (
+											scope.separateObjects && isPrimitiveType( type ) ||
+											! scope.separateObjects
+										) ) {
 
-											currentParseScope.inverted = ! currentParseScope.inverted;
+										currentParseScope.inverted = ! currentParseScope.inverted;
 
-										}
+									}
 
-										triangles = currentParseScope.triangles;
-										lineSegments = currentParseScope.lineSegments;
-										conditionalSegments = currentParseScope.conditionalSegments;
+									triangles = currentParseScope.triangles;
+									lineSegments = currentParseScope.lineSegments;
+									conditionalSegments = currentParseScope.conditionalSegments;
 
 									break;