提交 f5830756 编写于 作者: J Josiah Konrad 提交者: Mr.doob

add offset to Matrix4.fromArray for consistency with all other fromArray functions (#9611)

* add offset to fromArray for consistency with all other fromArray functions in the ThreeJS math library.

* Added matrix3/fixed whitespace
上级 068472f6
......@@ -274,7 +274,13 @@ Matrix3.prototype = {
fromArray: function ( array ) {
this.elements.set( array );
if ( offset === undefined ) offset = 0;
for( var i = 0; i < 9; i ++ ) {
this.elements[ i ] = array[ i + offset ];
}
return this;
......
......@@ -934,9 +934,15 @@ Matrix4.prototype = {
},
fromArray: function ( array ) {
fromArray: function ( array, offset ) {
this.elements.set( array );
if ( offset === undefined ) offset = 0;
for( var i = 0; i < 16; i ++ ) {
this.elements[ i ] = array[ i + offset ];
}
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册