提交 8b3bd828 编写于 作者: M Mr.doob

MMDLoader: Clean up. See #11348.

上级 62c93cc6
......@@ -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 = '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册