Skip to content

Commit 9f60c1c

Browse files
committed
Merge remote-tracking branch 'WestLangley/dev-cleanup' into dev
2 parents 647fd93 + 50bff99 commit 9f60c1c

File tree

6 files changed

+17
-44
lines changed

6 files changed

+17
-44
lines changed

docs/api/math/Matrix4.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,14 @@ <h3>.scale( [page:Vector3 v] ) [page:Matrix4]</h3>
152152
Multiplies the columns of this matrix by vector *v*.
153153
</div>
154154

155-
<h3>.makeFromPositionQuaternionScale( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Matrix4]</h3>
155+
<h3>.compose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4]</h3>
156156
<div>
157-
Sets this matrix to the transformation composed of *translation*, *rotation* and *scale*.
157+
Sets this matrix to the transformation composed of *translation*, *quaternion* and *scale*.
158158
</div>
159159

160-
<h3>.makeFromPositionEulerScale( [page:Vector3 translation], [page:Vector3 rotation], eulerOrder, [page:Vector3 scale] ) [page:Matrix4]</h3>
160+
<h3>.decompose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Array]</h3>
161161
<div>
162-
Sets this matrix to the transformation composed of *translation*, *rotation* (as euler angle triple and order) and *scale*.
163-
</div>
164-
165-
<h3>.decompose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Array]</h3>
166-
<div>
167-
Decomposes this matrix into the *translation*, *rotation* and *scale* components.<br />
162+
Decomposes this matrix into the *translation*, *quaternion* and *scale* components.<br />
168163
If parameters are not passed, new instances will be created.
169164
</div>
170165

src/core/Object3D.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ THREE.Object3D.prototype = {
358358

359359
updateMatrix: function () {
360360

361-
this.matrix.makeFromPositionQuaternionScale( this.position, this.quaternion, this.scale );
361+
this.matrix.compose( this.position, this.quaternion, this.scale );
362362

363363
this.matrixWorldNeedsUpdate = true;
364364

src/extras/core/Gyroscope.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
2222

2323
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
2424

25-
this.matrixWorld.decompose( this.translationWorld, this.rotationWorld, this.scaleWorld );
26-
this.matrix.decompose( this.translationObject, this.rotationObject, this.scaleObject );
25+
this.matrixWorld.decompose( this.translationWorld, this.quaternionWorld, this.scaleWorld );
26+
this.matrix.decompose( this.translationObject, this.quaternionObject, this.scaleObject );
2727

28-
this.matrixWorld.makeFromPositionQuaternionScale( this.translationWorld, this.rotationObject, this.scaleWorld );
28+
this.matrixWorld.compose( this.translationWorld, this.quaternionObject, this.scaleWorld );
2929

3030

3131
} else {
@@ -53,8 +53,8 @@ THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
5353

5454
THREE.Gyroscope.prototype.translationWorld = new THREE.Vector3();
5555
THREE.Gyroscope.prototype.translationObject = new THREE.Vector3();
56-
THREE.Gyroscope.prototype.rotationWorld = new THREE.Quaternion();
57-
THREE.Gyroscope.prototype.rotationObject = new THREE.Quaternion();
56+
THREE.Gyroscope.prototype.quaternionWorld = new THREE.Quaternion();
57+
THREE.Gyroscope.prototype.quaternionObject = new THREE.Quaternion();
5858
THREE.Gyroscope.prototype.scaleWorld = new THREE.Vector3();
5959
THREE.Gyroscope.prototype.scaleObject = new THREE.Vector3();
6060

src/math/Matrix4.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -818,14 +818,6 @@ THREE.Matrix4.prototype = {
818818

819819
compose: function ( position, quaternion, scale ) {
820820

821-
console.warn( 'DEPRECATED: Matrix4\'s .compose() has been deprecated in favor of makeFromPositionQuaternionScale. Please update your code.' );
822-
823-
return this.makeFromPositionQuaternionScale( position, quaternion, scale );
824-
825-
},
826-
827-
makeFromPositionQuaternionScale: function ( position, quaternion, scale ) {
828-
829821
this.makeRotationFromQuaternion( quaternion );
830822
this.scale( scale );
831823
this.setPosition( position );
@@ -834,20 +826,6 @@ THREE.Matrix4.prototype = {
834826

835827
},
836828

837-
makeFromPositionEulerScale: function ( position, rotation, scale ) {
838-
839-
if( typeof rotation['order'] === undefined ) {
840-
console.error( 'ERROR: Matrix4\'s .makeFromPositionEulerScale() now expects a Euler rotation rather than a Vector3 and order. Please update your code.' );
841-
}
842-
843-
this.makeRotationFromEuler( rotation );
844-
this.scale( scale );
845-
this.setPosition( position );
846-
847-
return this;
848-
849-
},
850-
851829
makeFrustum: function ( left, right, bottom, top, near, far ) {
852830

853831
var te = this.elements;

src/math/Rotation.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* @author mrdoob / http://mrdoob.com/
33
* @author bhouston / http://exocortex.com/
4-
*/
4+
*/
55

66
THREE.Rotation = function ( quaternion ) {
77

88
this.euler = new THREE.Euler();
9-
this.quaternion = quaternion;
9+
this.__quaternion = quaternion;
1010

1111
this.updateEuler();
1212

@@ -113,7 +113,7 @@ THREE.Rotation.prototype = {
113113
setFromQuaternion: function ( quaternion, order ) {
114114

115115
this.euler.setFromQuaternion( quaternion, order );
116-
this.quaternion.copy( quaternion );
116+
this.__quaternion.copy( quaternion );
117117

118118
return this;
119119

@@ -122,7 +122,7 @@ THREE.Rotation.prototype = {
122122
copy: function ( rotation ) {
123123

124124
this.euler.copy( rotation.euler );
125-
this.quaternion.copy( rotation.quaternion );
125+
this.__quaternion.copy( rotation.quaternion );
126126

127127
return this;
128128

@@ -145,15 +145,15 @@ THREE.Rotation.prototype = {
145145

146146
updateEuler: function () {
147147

148-
this.euler.setFromQuaternion( this.quaternion );
148+
this.euler.setFromQuaternion( this.__quaternion );
149149

150150
return this;
151151

152152
},
153153

154154
updateQuaternion: function () {
155155

156-
this.quaternion.setFromEuler( this.euler );
156+
this.__quaternion.setFromEuler( this.euler );
157157

158158
return this;
159159

src/objects/Sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ THREE.Sprite.prototype.updateMatrix = function () {
2424

2525
this.rotation3d.set( 0, 0, this.rotation, this.rotation3d.order );
2626
this.quaternion.setFromEuler( this.rotation3d );
27-
this.matrix.makeFromPositionQuaternionScale( this.position, this.quaternion, this.scale );
27+
this.matrix.compose( this.position, this.quaternion, this.scale );
2828

2929
this.matrixWorldNeedsUpdate = true;
3030

0 commit comments

Comments
 (0)