diff --git a/docs/api/en/deprecated/DeprecatedList.html b/docs/api/en/deprecated/DeprecatedList.html index 7f18731ef6949e..298f7e86a2796e 100644 --- a/docs/api/en/deprecated/DeprecatedList.html +++ b/docs/api/en/deprecated/DeprecatedList.html @@ -253,7 +253,7 @@

[page:XHRLoader]

[page:JSONLoader]

JSONLoader has been removed from core.

-

Maths

+

Math

[page:Box2]

@@ -293,15 +293,15 @@

[page:Math]

[page:Matrix3]

- Matrix3.flattenToArrayOffset is deprecated. Use [page:Matrix3.toArray]() instead.

+ Matrix3.flattenToArrayOffset() is deprecated. Use [page:Matrix3.toArray]() instead.

- Matrix3.multiplyVector3 has been removed. Use vector.applyMatrix3( matrix ) instead.

+ Matrix3.multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.

- Matrix3.multiplyVector3Array has been renamed to [page:Matrix3.applyToVector3Array]( array ).

+ Matrix3.multiplyVector3Array() has been renamed to [page:Matrix3.applyToVector3Array]( array ).

- Matrix3.applyToBuffer has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.

+ Matrix3.applyToBufferAttribute() has been removed. Use [page:BufferAttribute.applyMatrix3]( matrix ) instead.

- Matrix3.applyToVector3Array has been removed. + Matrix3.applyToVector3Array() has been removed.

[page:Matrix4]

@@ -332,7 +332,7 @@

[page:Matrix4]

Matrix4.rotateByAxis() has been removed.

- Matrix4.applyToBuffer() has been removed. Use matrix.applyToBufferAttribute() instead.

+ Matrix4.applyToBufferAttribute() has been removed. Use [page:BufferAttribute.applyMatrix4]( matrix ) instead.

Matrix4.applyToVector3Array() has been removed.

diff --git a/docs/api/en/math/Matrix3.html b/docs/api/en/math/Matrix3.html index 4911fe002aa3d9..8590f476918786 100644 --- a/docs/api/en/math/Matrix3.html +++ b/docs/api/en/math/Matrix3.html @@ -65,14 +65,6 @@

[property:Array elements]

Methods

-

[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )

-

- [page:BufferAttribute attribute] - An attribute of floats that represent 3D vectors.

- - Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute]. -

- -

[method:Matrix3 clone]()

Creates a new Matrix3 and with identical elements to this one.

diff --git a/docs/api/en/math/Matrix4.html b/docs/api/en/math/Matrix4.html index 24211ca60709a0..514ce2f4e2c22c 100644 --- a/docs/api/en/math/Matrix4.html +++ b/docs/api/en/math/Matrix4.html @@ -101,14 +101,6 @@

[property:Array elements]

Methods

-

[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )

-

- [page:BufferAttribute attribute] - An attribute of floats that represent 3D vectors.

- - Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute]. -

- -

[method:Matrix4 clone]()

Creates a new Matrix4 with identical [page:.elements elements] to this one.

diff --git a/docs/api/zh/math/Matrix3.html b/docs/api/zh/math/Matrix3.html index 0f99e089766d11..289a7048eb14f2 100644 --- a/docs/api/zh/math/Matrix3.html +++ b/docs/api/zh/math/Matrix3.html @@ -62,14 +62,6 @@

[property:Array elements]

方法(Methods)

-

[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )

-

- [page:BufferAttribute attribute] - 表示三维向量缓存属性。

- - 用这个矩阵乘以缓存属性[page:BufferAttribute attribute]里的所有3d向量。 -

- -

[method:Matrix3 clone]()

创建一个新的矩阵,元素 [page:.elements elements] 与该矩阵相同。

diff --git a/docs/api/zh/math/Matrix4.html b/docs/api/zh/math/Matrix4.html index ce0322bdeec638..3facadee3855a6 100644 --- a/docs/api/zh/math/Matrix4.html +++ b/docs/api/zh/math/Matrix4.html @@ -93,14 +93,6 @@

[property:Array elements]

方法(Methods)

-

[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )

-

- [page:BufferAttribute attribute] - 表示三维向量缓存属性。

- - 用这个矩阵乘以缓存属性[page:BufferAttribute attribute]里的所有3d向量。 -

- -

[method:Matrix4 clone]()

创建一个新的矩阵,元素[page:.elements elements]与该矩阵相同。

diff --git a/src/Three.Legacy.js b/src/Three.Legacy.js index c208fa69fb7d2c..4b4303401c8c96 100644 --- a/src/Three.Legacy.js +++ b/src/Three.Legacy.js @@ -588,10 +588,10 @@ Object.assign( Matrix3.prototype, { console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' ); }, - applyToBuffer: function ( buffer /*, offset, length */ ) { + applyToBufferAttribute: function ( attribute ) { - console.warn( 'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); + console.warn( 'THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.' ); + return attribute.applyMatrix3( this ); }, applyToVector3Array: function ( /* array, offset, length */ ) { @@ -687,10 +687,10 @@ Object.assign( Matrix4.prototype, { console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); }, - applyToBuffer: function ( buffer /*, offset, length */ ) { + applyToBufferAttribute: function ( attribute ) { - console.warn( 'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); + console.warn( 'THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.' ); + return attribute.applyMatrix4( this ); }, applyToVector3Array: function ( /* array, offset, length */ ) { diff --git a/src/math/Matrix3.d.ts b/src/math/Matrix3.d.ts index 9879dfec95a360..590bddeefedad9 100644 --- a/src/math/Matrix3.d.ts +++ b/src/math/Matrix3.d.ts @@ -74,18 +74,6 @@ export class Matrix3 implements Matrix { clone(): this; copy( m: Matrix3 ): this; setFromMatrix4( m: Matrix4 ): Matrix3; - - /** - * @deprecated Use {@link Matrix3#applyToBufferAttribute matrix3.applyToBufferAttribute( attribute )} instead. - */ - applyToBuffer( - buffer: BufferAttribute, - offset?: number, - length?: number - ): BufferAttribute; - - applyToBufferAttribute( attribute: BufferAttribute ): BufferAttribute; - multiplyScalar( s: number ): Matrix3; determinant(): number; getInverse( matrix: Matrix3, throwOnDegenerate?: boolean ): Matrix3; diff --git a/src/math/Matrix3.js b/src/math/Matrix3.js index 5654a8d9fcd9c4..5062caf6ea3501 100644 --- a/src/math/Matrix3.js +++ b/src/math/Matrix3.js @@ -92,24 +92,6 @@ Object.assign( Matrix3.prototype, { }, - applyToBufferAttribute: function ( attribute ) { - - for ( var i = 0, l = attribute.count; i < l; i ++ ) { - - _vector.x = attribute.getX( i ); - _vector.y = attribute.getY( i ); - _vector.z = attribute.getZ( i ); - - _vector.applyMatrix3( this ); - - attribute.setXYZ( i, _vector.x, _vector.y, _vector.z ); - - } - - return attribute; - - }, - multiply: function ( m ) { return this.multiplyMatrices( this, m ); diff --git a/src/math/Matrix4.d.ts b/src/math/Matrix4.d.ts index 41dade6ab90a5e..aabc7648934106 100644 --- a/src/math/Matrix4.d.ts +++ b/src/math/Matrix4.d.ts @@ -98,17 +98,6 @@ export class Matrix4 implements Matrix { */ multiplyScalar( s: number ): Matrix4; - /** - * @deprecated Use {@link Matrix4#applyToBufferAttribute matrix4.applyToBufferAttribute( attribute )} instead. - */ - applyToBuffer( - buffer: BufferAttribute, - offset?: number, - length?: number - ): BufferAttribute; - - applyToBufferAttribute( attribute: BufferAttribute ): BufferAttribute; - /** * Computes determinant of this matrix. * Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm diff --git a/src/math/Matrix4.js b/src/math/Matrix4.js index b0d92b3b9305ab..c1e2260cadcb96 100644 --- a/src/math/Matrix4.js +++ b/src/math/Matrix4.js @@ -415,24 +415,6 @@ Object.assign( Matrix4.prototype, { }, - applyToBufferAttribute: function ( attribute ) { - - for ( var i = 0, l = attribute.count; i < l; i ++ ) { - - _v1.x = attribute.getX( i ); - _v1.y = attribute.getY( i ); - _v1.z = attribute.getZ( i ); - - _v1.applyMatrix4( this ); - - attribute.setXYZ( i, _v1.x, _v1.y, _v1.z ); - - } - - return attribute; - - }, - determinant: function () { var te = this.elements; diff --git a/test/unit/src/math/Matrix3.tests.js b/test/unit/src/math/Matrix3.tests.js index 7b53cda7dcfc07..c647d8ab2bf0d8 100644 --- a/test/unit/src/math/Matrix3.tests.js +++ b/test/unit/src/math/Matrix3.tests.js @@ -163,18 +163,6 @@ export default QUnit.module( 'Maths', () => { } ); - QUnit.test( "applyToBufferAttribute", ( assert ) => { - - var a = new Matrix3().set( 1, 2, 3, 4, 5, 6, 7, 8, 9 ); - var attr = new Float32BufferAttribute( [ 1, 2, 1, 3, 0, 3 ], 3 ); - var expected = new Float32Array( [ 8, 20, 32, 12, 30, 48 ] ); - - var applied = a.applyToBufferAttribute( attr ); - - assert.deepEqual( applied.array, expected, "Check resulting buffer" ); - - } ); - QUnit.test( "multiply/premultiply", ( assert ) => { // both simply just wrap multiplyMatrices diff --git a/test/unit/src/math/Matrix4.tests.js b/test/unit/src/math/Matrix4.tests.js index b28a5f5f9e6cee..bc9d17e20b778b 100644 --- a/test/unit/src/math/Matrix4.tests.js +++ b/test/unit/src/math/Matrix4.tests.js @@ -418,29 +418,6 @@ export default QUnit.module( 'Maths', () => { } ); - QUnit.test( "applyToBufferAttribute", ( assert ) => { - - var a = new Matrix4().set( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ); - var attr = new Float32BufferAttribute( [ 1, 2, 1, 3, 0, 3 ], 3 ); - var expected = new Float32BufferAttribute( [ - 0.1666666716337204, 0.4444444477558136, 0.7222222089767456, - 0.1599999964237213, 0.4399999976158142, 0.7200000286102295 - ], 3 ); - - var applied = a.applyToBufferAttribute( attr ); - - assert.strictEqual( expected.count, applied.count, "Applied buffer and expected buffer have the same number of entries" ); - - for ( var i = 0, l = expected.count; i < l; i ++ ) { - - assert.ok( Math.abs( applied.getX( i ) - expected.getX( i ) ) <= eps, "Check x" ); - assert.ok( Math.abs( applied.getY( i ) - expected.getY( i ) ) <= eps, "Check y" ); - assert.ok( Math.abs( applied.getZ( i ) - expected.getZ( i ) ) <= eps, "Check z" ); - - } - - } ); - QUnit.test( "determinant", ( assert ) => { var a = new Matrix4();