提交 2eeb7a8f 编写于 作者: M Mugen87

Box3: .setFromObject() use Vector3.fromAttribute

上级 82d9f392
......@@ -165,9 +165,7 @@ Box3.prototype = {
for ( i = 0, l = attribute.count; i < l; i ++ ) {
v1.x = attribute.getX( i );
v1.y = attribute.getY( i );
v1.z = attribute.getZ( i );
v1.fromAttribute( attribute, i );
v1.applyMatrix4( node.matrixWorld );
scope.expandByPoint( v1 );
......
......@@ -87,7 +87,7 @@ Vector2.prototype = {
default: throw new Error( 'index is out of range: ' + index );
}
return this;
},
......@@ -453,14 +453,10 @@ Vector2.prototype = {
},
fromAttribute: function ( attribute, index, offset ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
fromAttribute: function ( attribute, index ) {
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
this.x = attribute.getX( index );
this.y = attribute.getY( index );
return this;
......
......@@ -761,15 +761,11 @@ Vector3.prototype = {
},
fromAttribute: function ( attribute, index, offset ) {
fromAttribute: function ( attribute, index ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
this.z = attribute.array[ index + 2 ];
this.x = attribute.getX( index );
this.y = attribute.getY( index );
this.z = attribute.getZ( index );
return this;
......
......@@ -86,7 +86,7 @@ Vector4.prototype = {
default: throw new Error( 'index is out of range: ' + index );
}
return this;
},
......@@ -611,16 +611,12 @@ Vector4.prototype = {
},
fromAttribute: function ( attribute, index, offset ) {
if ( offset === undefined ) offset = 0;
index = index * attribute.itemSize + offset;
fromAttribute: function ( attribute, index ) {
this.x = attribute.array[ index ];
this.y = attribute.array[ index + 1 ];
this.z = attribute.array[ index + 2 ];
this.w = attribute.array[ index + 3 ];
this.x = attribute.getX( index );
this.y = attribute.getY( index );
this.z = attribute.getZ( index );
this.w = attribute.getW( index );
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册