浏览代码

MMDLoader: Clean up. See #11348.

Mr.doob 8 年之前
父节点
当前提交
8b3bd828c4
共有 1 个文件被更改,包括 11 次插入22 次删除
  1. 11 22
      examples/js/loaders/MMDLoader.js

+ 11 - 22
examples/js/loaders/MMDLoader.js

@@ -427,13 +427,9 @@ THREE.MMDLoader.prototype.pourVmdIntoCamera = function ( camera, vmd, name ) {
 
 		var clip = new THREE.AnimationClip( name === undefined ? THREE.Math.generateUUID() : name, -1, tracks );
 
-		if ( clip != null ) {
-
-			if ( camera.center === undefined ) camera.center = new THREE.Vector3( 0, 0, 0 );
-			if ( camera.animations === undefined ) camera.animations = [];
-			camera.animations.push( clip );
-
-		}
+		if ( camera.center === undefined ) camera.center = new THREE.Vector3( 0, 0, 0 );
+		if ( camera.animations === undefined ) camera.animations = [];
+		camera.animations.push( clip );
 
 	};
 
@@ -1587,12 +1583,8 @@ THREE.MMDLoader.prototype.createAnimation = function ( mesh, vmd, name ) {
 
 		var clip = new THREE.AnimationClip( name === undefined ? THREE.Math.generateUUID() : name, -1, tracks );
 
-		if ( clip != null ) {
-
-			if ( mesh.geometry.animations === undefined ) mesh.geometry.animations = [];
-			mesh.geometry.animations.push( clip );
-
-		}
+		if ( mesh.geometry.animations === undefined ) mesh.geometry.animations = [];
+		mesh.geometry.animations.push( clip );
 
 	};
 
@@ -1629,12 +1621,8 @@ THREE.MMDLoader.prototype.createAnimation = function ( mesh, vmd, name ) {
 
 		var clip = new THREE.AnimationClip( name === undefined ? THREE.Math.generateUUID() : name + 'Morph', -1, tracks );
 
-		if ( clip != null ) {
-
-			if ( mesh.geometry.animations === undefined ) mesh.geometry.animations = [];
-			mesh.geometry.animations.push( clip );
-
-		}
+		if ( mesh.geometry.animations === undefined ) mesh.geometry.animations = [];
+		mesh.geometry.animations.push( clip );
 
 	};
 
@@ -1652,10 +1640,11 @@ THREE.MMDLoader.DataCreationHelper.prototype = {
 	constructor: THREE.MMDLoader.DataCreationHelper,
 
 	/*
-         * Note: Sometimes to use Japanese Unicode characters runs into problems in Three.js.
+	 * Note: Sometimes to use Japanese Unicode characters runs into problems in Three.js.
 	 *       In such a case, use this method to convert it to Unicode hex charcode strings,
-         *       like 'あいう' -> '0x30420x30440x3046'
-         */
+	 *       like 'あいう' -> '0x30420x30440x3046'
+	 */
+
 	toCharcodeStrings: function ( s ) {
 
 		var str = '';