Skip to content

Commit

Permalink
Merge pull request #18449 from WestLangley/dev_rename_apply_matrix
Browse files Browse the repository at this point in the history
Core: rename .applyMatrix() to .applyMatrix4()
  • Loading branch information
WestLangley authored Jan 23, 2020
2 parents cf28da9 + fd8b70c commit 4587c92
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 50 deletions.
2 changes: 1 addition & 1 deletion docs/api/en/core/BufferGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h3>[method:null addGroup]( [param:Integer start], [param:Integer count], [param
</p>


<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>Bakes matrix transform directly into vertex coordinates.</p>

<h3>[method:BufferGeometry center] ()</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/core/Geometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ <h2>Methods</h2>

<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>

<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>Bakes matrix transform directly into vertex coordinates.</p>

<h3>[method:Geometry center] ()</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/core/Object3D.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h3>[method:this add]( [param:Object3D object], ... )</h3>
See [page:Group] for info on manually grouping objects.
</p>

<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>Applies the matrix transform to the object and updates the object's position, rotation and scale.</p>

<h3>[method:this applyQuaternion]( [param:Quaternion quaternion] )</h3>
Expand Down
29 changes: 18 additions & 11 deletions docs/api/en/deprecated/DeprecatedList.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,7 @@ <h3>[page:SplineCurve3]</h3>



<h2>Geometry</h2>

<p>
Geometry.computeTangents() has been removed.<br /><br />

Geometry.computeLineDistances() has been removed. Use [page:Line.computeLineDistances] instead.<br /><br />
</p>

<h3>[page:BufferGeometry]</h3>
<h2>[page:BufferGeometry]</h2>
<p>
BufferGeometry.addIndex has been renamed to [page:BufferGeometry.setIndex].<br /><br />

Expand All @@ -176,13 +168,25 @@ <h3>[page:BufferGeometry]</h3>

BufferGeometry.offsets has been renamed to [page:BufferGeometry.groups].<br /><br />

BufferGeometry.applyMatrix() has been renamed to [page:BufferGeometry.applyMatrix4]().
</p>




<h3>[page:CubeGeometry]</h3>
<p>CubeGeometry has been renamed to [page:BoxGeometry].</p>



<h3>[page:Geometry]</h3>
<p>Geometry.computeTangents() has been removed.</p>
<p>
Geometry.computeTangents() has been removed.<br /><br />

Geometry.computeLineDistances() has been removed. Use [page:Line.computeLineDistances] instead.<br /><br />

Geometry.applyMatrix() has been renamed to [page:Geometry.applyMatrix4]().
</p>

<h3>[page:GeometryUtils]</h3>
<p>
Expand Down Expand Up @@ -458,7 +462,10 @@ <h3>[page:Object3D]</h3>

Object3D.translate() has been removed. Use [page:Object3D.translateOnAxis]( axis, distance ) instead.<br /><br />

Object3D.useQuaternion has been removed. The library now uses quaternions by default.
Object3D.useQuaternion has been removed. The library now uses quaternions by default.<br /><br />

Object3D.applyMatrix() has been renamed to [page:Object3D.applyMatrix4]().

</p>

<h3>[page:LensFlare]</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/core/BufferGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h3>[method:null addGroup]( [param:Integer start], [param:Integer count], [param
</p>


<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p> 用给定矩阵转换几何体的顶点坐标。</p>

<h3>[method:BufferGeometry center] ()</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/core/Geometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h2>方法</h2>

<h3>[page:EventDispatcher EventDispatcher] 该类中可用的函数。</h3>

<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p> 将矩阵信息直接应用于几何体顶点坐标。</p>

<h3>[method:Geometry center] ()</h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/core/Object3D.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h3>[method:null add]( [param:Object3D object], ... )</h3>
请参阅[page:Group]来查看手动编组对象的相关信息。
</p>

<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
<h3>[method:null applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>对当前物体应用这个变换矩阵,并更新物体的位置、旋转和缩放。</p>

<h3>[method:Object3D applyQuaternion]( [param:Quaternion quaternion] )</h3>
Expand Down
10 changes: 9 additions & 1 deletion examples/js/lines/LineSegmentsGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.Insta

isLineSegmentsGeometry: true,

applyMatrix: function ( matrix ) {
applyMatrix4: function ( matrix ) {

var start = this.attributes.instanceStart;
var end = this.attributes.instanceEnd;
Expand Down Expand Up @@ -239,6 +239,14 @@ THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.Insta

// todo

},

applyMatrix: function ( matrix ) {

console.warn( 'THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().' );

return this.applyMatrix4( matrix );

}

} );
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineSegmentsGeometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class LineSegmentsGeometry extends InstancedBufferGeometry {
constructor();
readonly isLineSegmentsGeometry: true;

applyMatrix( matrix: Matrix4 ): this;
applyMatrix4( matrix: Matrix4 ): this;
computeBoundingBox(): void;
computeBoundingSphere(): void;
fromEdgesGeometry( geometry: WireframeGeometry ): this;
Expand Down
10 changes: 9 additions & 1 deletion examples/jsm/lines/LineSegmentsGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LineSegmentsGeometry.prototype = Object.assign( Object.create( InstancedBufferGe

isLineSegmentsGeometry: true,

applyMatrix: function ( matrix ) {
applyMatrix4: function ( matrix ) {

var start = this.attributes.instanceStart;
var end = this.attributes.instanceEnd;
Expand Down Expand Up @@ -250,6 +250,14 @@ LineSegmentsGeometry.prototype = Object.assign( Object.create( InstancedBufferGe

// todo

},

applyMatrix: function ( matrix ) {

console.warn( 'THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().' );

return this.applyMatrix4( matrix );

}

} );
Expand Down
19 changes: 19 additions & 0 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,12 @@ Object.assign( Geometry.prototype, {

console.error( 'THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.' );

},
applyMatrix: function ( matrix ) {

console.warn( 'THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4().' );
return this.applyMatrix4( matrix );

}

} );
Expand Down Expand Up @@ -957,6 +963,12 @@ Object.assign( Object3D.prototype, {

console.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' );

},
applyMatrix: function ( matrix ) {

console.warn( 'THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().' );
return this.applyMatrix4( matrix );

}

} );
Expand Down Expand Up @@ -1303,7 +1315,14 @@ Object.assign( BufferGeometry.prototype, {

return this.deleteAttribute( name );

},
applyMatrix: function ( matrix ) {

console.warn( 'THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().' );
return this.applyMatrix4( matrix );

}

} );

Object.defineProperties( BufferGeometry.prototype, {
Expand Down
2 changes: 1 addition & 1 deletion src/core/BufferGeometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class BufferGeometry extends EventDispatcher {
/**
* Bakes matrix transform directly into vertex coordinates.
*/
applyMatrix( matrix: Matrix4 ): BufferGeometry;
applyMatrix4( matrix: Matrix4 ): BufferGeometry;

rotateX( angle: number ): BufferGeometry;
rotateY( angle: number ): BufferGeometry;
Expand Down
14 changes: 7 additions & 7 deletions src/core/BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

},

applyMatrix: function ( matrix ) {
applyMatrix4: function ( matrix ) {

var position = this.attributes.position;

Expand Down Expand Up @@ -179,7 +179,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_m1.makeRotationX( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -191,7 +191,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_m1.makeRotationY( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -203,7 +203,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_m1.makeRotationZ( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -215,7 +215,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_m1.makeTranslation( x, y, z );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -227,7 +227,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_m1.makeScale( x, y, z );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -239,7 +239,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy

_obj.updateMatrix();

this.applyMatrix( _obj.matrix );
this.applyMatrix4( _obj.matrix );

return this;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Geometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class Geometry extends EventDispatcher {
/**
* Bakes matrix transform directly into vertex coordinates.
*/
applyMatrix( matrix: Matrix4 ): Geometry;
applyMatrix4( matrix: Matrix4 ): Geometry;

rotateX( angle: number ): Geometry;
rotateY( angle: number ): Geometry;
Expand Down
16 changes: 8 additions & 8 deletions src/core/Geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

isGeometry: true,

applyMatrix: function ( matrix ) {
applyMatrix4: function ( matrix ) {

var normalMatrix = new Matrix3().getNormalMatrix( matrix );

Expand Down Expand Up @@ -116,7 +116,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_m1.makeRotationX( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -128,7 +128,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_m1.makeRotationY( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -140,7 +140,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_m1.makeRotationZ( angle );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -152,7 +152,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_m1.makeTranslation( x, y, z );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -164,7 +164,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_m1.makeScale( x, y, z );

this.applyMatrix( _m1 );
this.applyMatrix4( _m1 );

return this;

Expand All @@ -176,7 +176,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

_obj.updateMatrix();

this.applyMatrix( _obj.matrix );
this.applyMatrix4( _obj.matrix );

return this;

Expand Down Expand Up @@ -351,7 +351,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
0, 0, 0, 1
);

this.applyMatrix( matrix );
this.applyMatrix4( matrix );

return this;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Object3D.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class Object3D extends EventDispatcher {
/**
* This updates the position, rotation and scale with the matrix.
*/
applyMatrix( matrix: Matrix4 ): void;
applyMatrix4( matrix: Matrix4 ): void;

applyQuaternion( quaternion: Quaternion ): this;

Expand Down
4 changes: 2 additions & 2 deletions src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
onBeforeRender: function () {},
onAfterRender: function () {},

applyMatrix: function ( matrix ) {
applyMatrix4: function ( matrix ) {

if ( this.matrixAutoUpdate ) this.updateMatrix();

Expand Down Expand Up @@ -394,7 +394,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

}

object.applyMatrix( _m1 );
object.applyMatrix4( _m1 );

object.updateWorldMatrix( false, false );

Expand Down
Loading

0 comments on commit 4587c92

Please sign in to comment.