浏览代码

Example: Clean up

Mugen87 6 年之前
父节点
当前提交
e7ce357b79

+ 3 - 3
examples/js/geometries/LightningStrike.js

@@ -532,7 +532,7 @@ THREE.LightningStrike.prototype.fillMesh = function ( time ) {
 
 
 };
 };
 
 
-THREE.LightningStrike.prototype.addNewSubray = function ( rayParameters ) {
+THREE.LightningStrike.prototype.addNewSubray = function ( /*rayParameters*/ ) {
 
 
 	return this.subrays[ this.numSubrays ++ ];
 	return this.subrays[ this.numSubrays ++ ];
 
 
@@ -784,7 +784,7 @@ THREE.LightningStrike.prototype.createTriangleVerticesWithUVs = function ( pos,
 
 
 };
 };
 
 
-THREE.LightningStrike.prototype.createPrismFaces = function ( vertex, index ) {
+THREE.LightningStrike.prototype.createPrismFaces = function ( vertex/*, index*/ ) {
 
 
 	var indices = this.indices;
 	var indices = this.indices;
 	var vertex = this.currentVertex - 6;
 	var vertex = this.currentVertex - 6;
@@ -831,7 +831,7 @@ THREE.LightningStrike.prototype.createDefaultSubrayCreationCallbacks = function
 		var childSubraySeed = random1() * ( currentCycle + 1 );
 		var childSubraySeed = random1() * ( currentCycle + 1 );
 
 
 		var isActive = phase % period <= dutyCycle * period;
 		var isActive = phase % period <= dutyCycle * period;
-		
+
 		var probability = 0;
 		var probability = 0;
 
 
 		if ( isActive ) {
 		if ( isActive ) {

+ 0 - 2
examples/js/utils/SkeletonUtils.js

@@ -2,8 +2,6 @@
  * @author sunag / http://www.sunag.com.br
  * @author sunag / http://www.sunag.com.br
  */
  */
 
 
-'use strict';
-
 THREE.SkeletonUtils = {
 THREE.SkeletonUtils = {
 
 
 	retarget: function () {
 	retarget: function () {

+ 4 - 5
examples/jsm/geometries/LightningStrike.js

@@ -7,7 +7,7 @@
  * Usage
  * Usage
  *
  *
  * var myRay = new LightningStrike( paramsObject );
  * var myRay = new LightningStrike( paramsObject );
- * var myRayMesh = new Mesh( myRay, myMaterial );
+ * var myRayMesh = new THREE.Mesh( myRay, myMaterial );
  * scene.add( myRayMesh );
  * scene.add( myRayMesh );
  * ...
  * ...
  * myRay.update( currentTime );
  * myRay.update( currentTime );
@@ -105,7 +105,6 @@ import {
 	BufferGeometry,
 	BufferGeometry,
 	Float32BufferAttribute,
 	Float32BufferAttribute,
 	Math as _Math,
 	Math as _Math,
-	Mesh,
 	Uint32BufferAttribute,
 	Uint32BufferAttribute,
 	Vector3
 	Vector3
 } from "../../../build/three.module.js";
 } from "../../../build/three.module.js";
@@ -542,7 +541,7 @@ LightningStrike.prototype.fillMesh = function ( time ) {
 
 
 };
 };
 
 
-LightningStrike.prototype.addNewSubray = function ( rayParameters ) {
+LightningStrike.prototype.addNewSubray = function ( /*rayParameters*/ ) {
 
 
 	return this.subrays[ this.numSubrays ++ ];
 	return this.subrays[ this.numSubrays ++ ];
 
 
@@ -794,7 +793,7 @@ LightningStrike.prototype.createTriangleVerticesWithUVs = function ( pos, up, fo
 
 
 };
 };
 
 
-LightningStrike.prototype.createPrismFaces = function ( vertex, index ) {
+LightningStrike.prototype.createPrismFaces = function ( vertex/*, index*/ ) {
 
 
 	var indices = this.indices;
 	var indices = this.indices;
 	var vertex = this.currentVertex - 6;
 	var vertex = this.currentVertex - 6;
@@ -841,7 +840,7 @@ LightningStrike.prototype.createDefaultSubrayCreationCallbacks = function () {
 		var childSubraySeed = random1() * ( currentCycle + 1 );
 		var childSubraySeed = random1() * ( currentCycle + 1 );
 
 
 		var isActive = phase % period <= dutyCycle * period;
 		var isActive = phase % period <= dutyCycle * period;
-		
+
 		var probability = 0;
 		var probability = 0;
 
 
 		if ( isActive ) {
 		if ( isActive ) {

+ 1 - 2
examples/jsm/objects/LightningStorm.js

@@ -37,7 +37,7 @@
  *
  *
  * @param {Object} lightningParameters The parameters for created rays. See LightningStrike (geometry)
  * @param {Object} lightningParameters The parameters for created rays. See LightningStrike (geometry)
  *
  *
- * @param {Material} lightningMaterial The Material used for the created rays.
+ * @param {Material} lightningMaterial The THREE.Material used for the created rays.
  *
  *
  * @param {function} onRayPosition Optional callback with two Vector3 parameters (source, dest). You can set here the start and end points for each created ray, using the standard size, minHeight, etc parameters and other values in your algorithm.
  * @param {function} onRayPosition Optional callback with two Vector3 parameters (source, dest). You can set here the start and end points for each created ray, using the standard size, minHeight, etc parameters and other values in your algorithm.
  *
  *
@@ -47,7 +47,6 @@
 */
 */
 
 
 import {
 import {
-	Material,
 	Math as _Math,
 	Math as _Math,
 	Mesh,
 	Mesh,
 	MeshBasicMaterial,
 	MeshBasicMaterial,

+ 0 - 2
examples/jsm/utils/SkeletonUtils.js

@@ -15,8 +15,6 @@ import {
 	VectorKeyframeTrack
 	VectorKeyframeTrack
 } from "../../../build/three.module.js";
 } from "../../../build/three.module.js";
 
 
-'use strict';
-
 var SkeletonUtils = {
 var SkeletonUtils = {
 
 
 	retarget: function () {
 	retarget: function () {

+ 4 - 8
examples/webgl_animation_multiple.html

@@ -156,13 +156,9 @@
 
 
 								var mixer = startAnimation( clonedMesh, model.animations, u.animationName );
 								var mixer = startAnimation( clonedMesh, model.animations, u.animationName );
 
 
-								if ( mixer ) {
-
-									// Save the animation mixer in the list, will need it in the animation loop
-									mixers.push( mixer );
-									numSuccess ++;
-
-								}
+								// Save the animation mixer in the list, will need it in the animation loop
+								mixers.push( mixer );
+								numSuccess ++;
 
 
 							}
 							}
 
 
@@ -281,7 +277,7 @@
 
 
 					console.log( "Done loading model", model.name );
 					console.log( "Done loading model", model.name );
 
 
-					onLoaded( model );
+					onLoaded();
 
 
 				} );
 				} );
 
 

+ 1 - 2
examples/webgl_helpers.html

@@ -19,7 +19,7 @@
 
 
 			var scene, renderer;
 			var scene, renderer;
 			var camera, light;
 			var camera, light;
-			var fnh, vnh;
+			var vnh;
 
 
 			init();
 			init();
 			animate();
 			animate();
@@ -126,7 +126,6 @@
 				light.position.y = Math.cos( time * 1.5 ) * 400;
 				light.position.y = Math.cos( time * 1.5 ) * 400;
 				light.position.z = Math.cos( time * 1.3 ) * 300;
 				light.position.z = Math.cos( time * 1.3 ) * 300;
 
 
-				if ( fnh ) fnh.update();
 				if ( vnh ) vnh.update();
 				if ( vnh ) vnh.update();
 
 
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );

+ 2 - 2
utils/modularize.js

@@ -54,7 +54,7 @@ var files = [
 	{ path: 'geometries/BoxLineGeometry.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/BoxLineGeometry.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/ConvexGeometry.js', dependencies: [ { name: 'ConvexHull', path: 'math/ConvexHull.js' } ], ignoreList: [] },
 	{ path: 'geometries/ConvexGeometry.js', dependencies: [ { name: 'ConvexHull', path: 'math/ConvexHull.js' } ], ignoreList: [] },
 	{ path: 'geometries/DecalGeometry.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/DecalGeometry.js', dependencies: [], ignoreList: [] },
-	{ path: 'geometries/LightningStrike.js', dependencies: [ { name: 'SimplexNoise', path: 'math/SimplexNoise.js' } ], ignoreList: [] },
+	{ path: 'geometries/LightningStrike.js', dependencies: [ { name: 'SimplexNoise', path: 'math/SimplexNoise.js' } ], ignoreList: [ 'Mesh' ] },
 	{ path: 'geometries/ParametricGeometries.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/ParametricGeometries.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/TeapotBufferGeometry.js', dependencies: [], ignoreList: [] },
 	{ path: 'geometries/TeapotBufferGeometry.js', dependencies: [], ignoreList: [] },
 
 
@@ -143,7 +143,7 @@ var files = [
 
 
 	{ path: 'objects/Fire.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Fire.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Lensflare.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Lensflare.js', dependencies: [], ignoreList: [] },
-	{ path: 'objects/LightningStorm.js', dependencies: [ { name: 'LightningStrike', path: 'geometries/LightningStrike.js' } ], ignoreList: [] },
+	{ path: 'objects/LightningStorm.js', dependencies: [ { name: 'LightningStrike', path: 'geometries/LightningStrike.js' } ], ignoreList: [ 'Material' ] },
 	{ path: 'objects/MarchingCubes.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/MarchingCubes.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Reflector.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Reflector.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Refractor.js', dependencies: [], ignoreList: [] },
 	{ path: 'objects/Refractor.js', dependencies: [], ignoreList: [] },