Browse Source

Minor tweaks.

Mr.doob 11 years ago
parent
commit
6cc2285223
2 changed files with 4 additions and 6 deletions
  1. 2 2
      src/core/BufferGeometryManipulator.js
  2. 2 4
      src/objects/Bone.js

+ 2 - 2
src/core/BufferGeometryManipulator.js

@@ -9,9 +9,9 @@ THREE.BufferGeometryManipulator = function ( bufferGeometry ) {
 	this.uvs = [];
 
 	var attributes = bufferGeometry.attributes;
-	var length = attributes.position.array.length;
+	var length = attributes.position.array.length / 3;
 
-	for ( var i = 0, l = length / 3; i < l; i ++ ) {
+	for ( var i = 0; i < length; i ++ ) {
 
 		this.vertices.push( new THREE.TypedVector3( attributes.position.array, i * 3 ) );
 		this.normals.push( new THREE.TypedVector3( attributes.normal.array, i * 3 ) );

+ 2 - 4
src/objects/Bone.js

@@ -28,7 +28,7 @@ THREE.Bone.prototype.update = function ( parentSkinMatrix, forceUpdate ) {
 
 	if ( forceUpdate || this.matrixWorldNeedsUpdate ) {
 
-		if( parentSkinMatrix ) {
+		if ( parentSkinMatrix ) {
 
 			this.skinMatrix.multiplyMatrices( parentSkinMatrix, this.matrix );
 
@@ -45,9 +45,7 @@ THREE.Bone.prototype.update = function ( parentSkinMatrix, forceUpdate ) {
 
 	// update children
 
-	var i, l = this.children.length;
-
-	for ( i = 0; i < l; i ++ ) {
+	for ( var i = 0, l = this.children.length; i < l; i ++ ) {
 
 		this.children[ i ].update( this.skinMatrix, forceUpdate );