diff --git a/docs/api/en/math/Vector3.html b/docs/api/en/math/Vector3.html index 8f7be658855173fbc326a9645488561208e072fa..369fc21da5a1e1019ef6e2ef35e03478b944153e 100644 --- a/docs/api/en/math/Vector3.html +++ b/docs/api/en/math/Vector3.html @@ -358,8 +358,12 @@ var d = a.distanceTo( b );

[method:this setFromMatrixColumn]( [param:Matrix4 matrix], [param:Integer index] )

- Sets this vector's [page:.x x], [page:.y y] and [page:.z z] equal to the column of - the [page:Matrix4 matrix] specified by the [page:Integer index]. + Sets this vector's [page:.x x], [page:.y y] and [page:.z z] components from [page:Integer index] column of [page:Matrix4 matrix]. +

+ +

[method:this setFromMatrix3Column]( [param:Matrix3 matrix], [param:Integer index] )

+

+ Sets this vector's [page:.x x], [page:.y y] and [page:.z z] components from [page:Integer index] column of [page:Matrix3 matrix].

[method:this setFromMatrixPosition]( [param:Matrix4 m] )

diff --git a/src/math/Vector3.d.ts b/src/math/Vector3.d.ts index df16bbaafb5b32ed71c0ac36083ae0cc0845b0e1..dec154da4108f35b58ac8136d49bac1cd85d8016 100644 --- a/src/math/Vector3.d.ts +++ b/src/math/Vector3.d.ts @@ -244,6 +244,7 @@ export class Vector3 implements Vector { setFromMatrixPosition( m: Matrix4 ): this; setFromMatrixScale( m: Matrix4 ): this; setFromMatrixColumn( matrix: Matrix4, index: number ): this; + setFromMatrix3Column( matrix: Matrix3, index: number ): this; /** * Checks for strict equality of this vector and v. diff --git a/src/math/Vector3.js b/src/math/Vector3.js index d4a5a55df33cd6d54f0387f349039c18691e8f7c..0ce83cacfe85a63605a16413b3c45ab268172e15 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -659,6 +659,12 @@ Object.assign( Vector3.prototype, { }, + setFromMatrix3Column: function ( m, index ) { + + return this.fromArray( m.elements, index * 3 ); + + }, + equals: function ( v ) { return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );