浏览代码

Examples: More clean up.

Mugen87 6 年之前
父节点
当前提交
5b4b5a2d4f

+ 0 - 2
examples/js/exporters/GLTFExporter.js

@@ -2224,8 +2224,6 @@ THREE.GLTFExporter.Utils = {
 
 
 			}
 			}
 
 
-			var mergedKeyframeIndex = 0;
-			var sourceKeyframeIndex = 0;
 			var sourceInterpolant = sourceTrack.createInterpolant( new sourceTrack.ValueBufferType( 1 ) );
 			var sourceInterpolant = sourceTrack.createInterpolant( new sourceTrack.ValueBufferType( 1 ) );
 
 
 			mergedTrack = mergedTracks[ sourceTrackNode.uuid ];
 			mergedTrack = mergedTracks[ sourceTrackNode.uuid ];

+ 0 - 2
examples/js/loaders/LDrawLoader.js

@@ -1045,8 +1045,6 @@ THREE.LDrawLoader = ( function () {
 			// Retrieve data from the parent parse scope
 			// Retrieve data from the parent parse scope
 			var parentParseScope = this.getParentParseScope();
 			var parentParseScope = this.getParentParseScope();
 
 
-			var isRoot = ! parentParseScope.isFromParse;
-
 			// Main colour codes passed to this subobject (or default codes 16 and 24 if it is the root object)
 			// Main colour codes passed to this subobject (or default codes 16 and 24 if it is the root object)
 			var mainColourCode = parentParseScope.mainColourCode;
 			var mainColourCode = parentParseScope.mainColourCode;
 			var mainEdgeColourCode = parentParseScope.mainEdgeColourCode;
 			var mainEdgeColourCode = parentParseScope.mainEdgeColourCode;

+ 6 - 12
examples/js/loaders/SVGLoader.js

@@ -881,19 +881,15 @@ THREE.SVGLoader.prototype = {
 
 
 			var transform = parseNodeTransform( node );
 			var transform = parseNodeTransform( node );
 
 
-			if ( transform ) {
-
-				if ( transformStack.length > 0 ) {
+			if ( transformStack.length > 0 ) {
 
 
-					transform.premultiply( transformStack[ transformStack.length - 1 ] );
-
-				}
-
-				currentTransform.copy( transform );
-				transformStack.push( transform );
+				transform.premultiply( transformStack[ transformStack.length - 1 ] );
 
 
 			}
 			}
 
 
+			currentTransform.copy( transform );
+			transformStack.push( transform );
+
 			return transform;
 			return transform;
 
 
 		}
 		}
@@ -1178,11 +1174,10 @@ THREE.SVGLoader.prototype = {
 
 
 };
 };
 
 
-THREE.SVGLoader.getStrokeStyle = function ( width, color, opacity, lineJoin, lineCap, miterLimit ) {
+THREE.SVGLoader.getStrokeStyle = function ( width, color, lineJoin, lineCap, miterLimit ) {
 
 
 	// Param width: Stroke width
 	// Param width: Stroke width
 	// Param color: As returned by THREE.Color.getStyle()
 	// Param color: As returned by THREE.Color.getStyle()
-	// Param opacity: 0 (transparent) to 1 (opaque)
 	// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
 	// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
 	// Param lineCap: One of "round", "square" or "butt"
 	// Param lineCap: One of "round", "square" or "butt"
 	// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
 	// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
@@ -1190,7 +1185,6 @@ THREE.SVGLoader.getStrokeStyle = function ( width, color, opacity, lineJoin, lin
 
 
 	width = width !== undefined ? width : 1;
 	width = width !== undefined ? width : 1;
 	color = color !== undefined ? color : '#000';
 	color = color !== undefined ? color : '#000';
-	opacity = opacity !== undefined ? opacity : 1;
 	lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
 	lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
 	lineCap = lineCap !== undefined ? lineCap : 'butt';
 	lineCap = lineCap !== undefined ? lineCap : 'butt';
 	miterLimit = miterLimit !== undefined ? miterLimit : 4;
 	miterLimit = miterLimit !== undefined ? miterLimit : 4;

+ 0 - 2
examples/jsm/exporters/GLTFExporter.js

@@ -2248,8 +2248,6 @@ GLTFExporter.Utils = {
 
 
 			}
 			}
 
 
-			var mergedKeyframeIndex = 0;
-			var sourceKeyframeIndex = 0;
 			var sourceInterpolant = sourceTrack.createInterpolant( new sourceTrack.ValueBufferType( 1 ) );
 			var sourceInterpolant = sourceTrack.createInterpolant( new sourceTrack.ValueBufferType( 1 ) );
 
 
 			mergedTrack = mergedTracks[ sourceTrackNode.uuid ];
 			mergedTrack = mergedTracks[ sourceTrackNode.uuid ];

+ 0 - 2
examples/jsm/loaders/LDrawLoader.js

@@ -1063,8 +1063,6 @@ var LDrawLoader = ( function () {
 			// Retrieve data from the parent parse scope
 			// Retrieve data from the parent parse scope
 			var parentParseScope = this.getParentParseScope();
 			var parentParseScope = this.getParentParseScope();
 
 
-			var isRoot = ! parentParseScope.isFromParse;
-
 			// Main colour codes passed to this subobject (or default codes 16 and 24 if it is the root object)
 			// Main colour codes passed to this subobject (or default codes 16 and 24 if it is the root object)
 			var mainColourCode = parentParseScope.mainColourCode;
 			var mainColourCode = parentParseScope.mainColourCode;
 			var mainEdgeColourCode = parentParseScope.mainEdgeColourCode;
 			var mainEdgeColourCode = parentParseScope.mainEdgeColourCode;

+ 1 - 1
examples/jsm/loaders/SVGLoader.d.ts

@@ -28,7 +28,7 @@ export class SVGLoader {
 
 
   parse(text: string) : SVGResult;
   parse(text: string) : SVGResult;
 
 
-  static getStrokeStyle(width: number, color: string, opacity: number, lineJoin: string, lineCap: string, miterLimit: number): StrokeStyle;
+  static getStrokeStyle(width: number, color: string, lineJoin: string, lineCap: string, miterLimit: number): StrokeStyle;
   static pointsToStroke(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number ): BufferGeometry;
   static pointsToStroke(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number ): BufferGeometry;
   static pointsToStrokeWithBuffers(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number, vertices: number[], normals: number[], uvs: number[], vertexOffset: number): number;
   static pointsToStrokeWithBuffers(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number, vertices: number[], normals: number[], uvs: number[], vertexOffset: number): number;
 }
 }

+ 6 - 12
examples/jsm/loaders/SVGLoader.js

@@ -894,19 +894,15 @@ SVGLoader.prototype = {
 
 
 			var transform = parseNodeTransform( node );
 			var transform = parseNodeTransform( node );
 
 
-			if ( transform ) {
-
-				if ( transformStack.length > 0 ) {
+			if ( transformStack.length > 0 ) {
 
 
-					transform.premultiply( transformStack[ transformStack.length - 1 ] );
-
-				}
-
-				currentTransform.copy( transform );
-				transformStack.push( transform );
+				transform.premultiply( transformStack[ transformStack.length - 1 ] );
 
 
 			}
 			}
 
 
+			currentTransform.copy( transform );
+			transformStack.push( transform );
+
 			return transform;
 			return transform;
 
 
 		}
 		}
@@ -1191,11 +1187,10 @@ SVGLoader.prototype = {
 
 
 };
 };
 
 
-SVGLoader.getStrokeStyle = function ( width, color, opacity, lineJoin, lineCap, miterLimit ) {
+SVGLoader.getStrokeStyle = function ( width, color, lineJoin, lineCap, miterLimit ) {
 
 
 	// Param width: Stroke width
 	// Param width: Stroke width
 	// Param color: As returned by Color.getStyle()
 	// Param color: As returned by Color.getStyle()
-	// Param opacity: 0 (transparent) to 1 (opaque)
 	// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
 	// Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
 	// Param lineCap: One of "round", "square" or "butt"
 	// Param lineCap: One of "round", "square" or "butt"
 	// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
 	// Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
@@ -1203,7 +1198,6 @@ SVGLoader.getStrokeStyle = function ( width, color, opacity, lineJoin, lineCap,
 
 
 	width = width !== undefined ? width : 1;
 	width = width !== undefined ? width : 1;
 	color = color !== undefined ? color : '#000';
 	color = color !== undefined ? color : '#000';
-	opacity = opacity !== undefined ? opacity : 1;
 	lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
 	lineJoin = lineJoin !== undefined ? lineJoin : 'miter';
 	lineCap = lineCap !== undefined ? lineCap : 'butt';
 	lineCap = lineCap !== undefined ? lineCap : 'butt';
 	miterLimit = miterLimit !== undefined ? miterLimit : 4;
 	miterLimit = miterLimit !== undefined ? miterLimit : 4;

+ 1 - 1
examples/webgl_gpgpu_water.html

@@ -520,7 +520,7 @@
 						var x = i * 128 / WIDTH;
 						var x = i * 128 / WIDTH;
 						var y = j * 128 / WIDTH;
 						var y = j * 128 / WIDTH;
 
 
-						pixels[ p + 0 ] = noise( x, y, 123.4 );
+						pixels[ p + 0 ] = noise( x, y );
 						pixels[ p + 1 ] = pixels[ p + 0 ];
 						pixels[ p + 1 ] = pixels[ p + 0 ];
 						pixels[ p + 2 ] = 0;
 						pixels[ p + 2 ] = 0;
 						pixels[ p + 3 ] = 1;
 						pixels[ p + 3 ] = 1;

+ 1 - 1
examples/webgl_shaders_vector.html

@@ -204,7 +204,7 @@
 
 
 						hole = subshape.holes[ i ];
 						hole = subshape.holes[ i ];
 
 
-						process = processShape( hole.curves, true );
+						process = processShape( hole.curves );
 
 
 						pts = process.pts;
 						pts = process.pts;
 						pts2 = process.pts2;
 						pts2 = process.pts2;