Skip to content

Commit

Permalink
Vector3: Simplified setFromMatrixPosition().
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 17, 2017
1 parent 5e756e4 commit 6df71f7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/math/Vector3.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,13 @@ Object.assign( Vector3.prototype, {

setFromMatrixPosition: function ( m ) {

return this.setFromMatrixColumn( m, 3 );
var e = m.elements;

this.x = e[ 12 ];
this.y = e[ 13 ];
this.z = e[ 14 ];

return this;

},

Expand All @@ -672,7 +678,6 @@ Object.assign( Vector3.prototype, {

setFromMatrixColumn: function ( m, index ) {


return this.fromArray( m.elements, index * 4 );

},
Expand Down

0 comments on commit 6df71f7

Please sign in to comment.