提交 5d2ae4bc 编写于 作者: M Mr.doob

Clean up.

上级 2e123b1e
......@@ -83,17 +83,16 @@ THREE.LensFlare.prototype.clone = function ( object ) {
if ( object === undefined ) object = new THREE.LensFlare();
THREE.Object3D.prototype.clone.call( this, object );
object.positionScreen.copy(this.positionScreen);
object.positionScreen.copy( this.positionScreen );
object.customUpdateCallback = this.customUpdateCallback;
object.lensFlares = [];
for ( var i = 0, l = this.lensFlares.length; i < l; i ++ ) {
object.lensFlares.push(this.lensFlares[i]);
object.lensFlares.push( this.lensFlares[ i ] );
}
return object;
};
\ No newline at end of file
};
......@@ -20,16 +20,16 @@ THREE.Skeleton = function ( bones, boneInverses, useVertexTexture ) {
// create a bone texture or an array of floats
if ( this.useVertexTexture ) {
// layout (1 matrix = 4 pixels)
// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)
// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)
// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)
// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)
// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)
var size = THREE.Math.nextPowerOfTwo( Math.sqrt( this.bones.length * 4 ) ); // 4 pixels needed for 1 matrix
this.boneTextureWidth = size;
this.boneTextureHeight = size;
......@@ -144,7 +144,7 @@ THREE.Skeleton.prototype.pose = function () {
THREE.Skeleton.prototype.update = ( function () {
var offsetMatrix = new THREE.Matrix4();
return function () {
// flatten bone matrices to array
......@@ -165,15 +165,13 @@ THREE.Skeleton.prototype.update = ( function () {
this.boneTexture.needsUpdate = true;
}
};
} )();
THREE.Skeleton.prototype.clone = function ( ) {
THREE.Skeleton.prototype.clone = function () {
var object = new THREE.Skeleton(this.bones, this.boneInverses, this.useVertexTexture);
return object;
return new THREE.Skeleton( this.bones, this.boneInverses, this.useVertexTexture );
};
\ No newline at end of file
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册