提交 9f60c1ce 编写于 作者: M Mr.doob

Merge remote-tracking branch 'WestLangley/dev-cleanup' into dev

......@@ -152,19 +152,14 @@
Multiplies the columns of this matrix by vector *v*.
</div>
<h3>.makeFromPositionQuaternionScale( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Matrix4]</h3>
<h3>.compose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4]</h3>
<div>
Sets this matrix to the transformation composed of *translation*, *rotation* and *scale*.
Sets this matrix to the transformation composed of *translation*, *quaternion* and *scale*.
</div>
<h3>.makeFromPositionEulerScale( [page:Vector3 translation], [page:Vector3 rotation], eulerOrder, [page:Vector3 scale] ) [page:Matrix4]</h3>
<h3>.decompose( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Array]</h3>
<div>
Sets this matrix to the transformation composed of *translation*, *rotation* (as euler angle triple and order) and *scale*.
</div>
<h3>.decompose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Array]</h3>
<div>
Decomposes this matrix into the *translation*, *rotation* and *scale* components.<br />
Decomposes this matrix into the *translation*, *quaternion* and *scale* components.<br />
If parameters are not passed, new instances will be created.
</div>
......
......@@ -358,7 +358,7 @@ THREE.Object3D.prototype = {
updateMatrix: function () {
this.matrix.makeFromPositionQuaternionScale( this.position, this.quaternion, this.scale );
this.matrix.compose( this.position, this.quaternion, this.scale );
this.matrixWorldNeedsUpdate = true;
......
......@@ -22,10 +22,10 @@ THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
this.matrixWorld.decompose( this.translationWorld, this.rotationWorld, this.scaleWorld );
this.matrix.decompose( this.translationObject, this.rotationObject, this.scaleObject );
this.matrixWorld.decompose( this.translationWorld, this.quaternionWorld, this.scaleWorld );
this.matrix.decompose( this.translationObject, this.quaternionObject, this.scaleObject );
this.matrixWorld.makeFromPositionQuaternionScale( this.translationWorld, this.rotationObject, this.scaleWorld );
this.matrixWorld.compose( this.translationWorld, this.quaternionObject, this.scaleWorld );
} else {
......@@ -53,8 +53,8 @@ THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
THREE.Gyroscope.prototype.translationWorld = new THREE.Vector3();
THREE.Gyroscope.prototype.translationObject = new THREE.Vector3();
THREE.Gyroscope.prototype.rotationWorld = new THREE.Quaternion();
THREE.Gyroscope.prototype.rotationObject = new THREE.Quaternion();
THREE.Gyroscope.prototype.quaternionWorld = new THREE.Quaternion();
THREE.Gyroscope.prototype.quaternionObject = new THREE.Quaternion();
THREE.Gyroscope.prototype.scaleWorld = new THREE.Vector3();
THREE.Gyroscope.prototype.scaleObject = new THREE.Vector3();
......@@ -818,14 +818,6 @@ THREE.Matrix4.prototype = {
compose: function ( position, quaternion, scale ) {
console.warn( 'DEPRECATED: Matrix4\'s .compose() has been deprecated in favor of makeFromPositionQuaternionScale. Please update your code.' );
return this.makeFromPositionQuaternionScale( position, quaternion, scale );
},
makeFromPositionQuaternionScale: function ( position, quaternion, scale ) {
this.makeRotationFromQuaternion( quaternion );
this.scale( scale );
this.setPosition( position );
......@@ -834,20 +826,6 @@ THREE.Matrix4.prototype = {
},
makeFromPositionEulerScale: function ( position, rotation, scale ) {
if( typeof rotation['order'] === undefined ) {
console.error( 'ERROR: Matrix4\'s .makeFromPositionEulerScale() now expects a Euler rotation rather than a Vector3 and order. Please update your code.' );
}
this.makeRotationFromEuler( rotation );
this.scale( scale );
this.setPosition( position );
return this;
},
makeFrustum: function ( left, right, bottom, top, near, far ) {
var te = this.elements;
......
/**
* @author mrdoob / http://mrdoob.com/
* @author bhouston / http://exocortex.com/
*/
*/
THREE.Rotation = function ( quaternion ) {
this.euler = new THREE.Euler();
this.quaternion = quaternion;
this.__quaternion = quaternion;
this.updateEuler();
......@@ -113,7 +113,7 @@ THREE.Rotation.prototype = {
setFromQuaternion: function ( quaternion, order ) {
this.euler.setFromQuaternion( quaternion, order );
this.quaternion.copy( quaternion );
this.__quaternion.copy( quaternion );
return this;
......@@ -122,7 +122,7 @@ THREE.Rotation.prototype = {
copy: function ( rotation ) {
this.euler.copy( rotation.euler );
this.quaternion.copy( rotation.quaternion );
this.__quaternion.copy( rotation.quaternion );
return this;
......@@ -145,7 +145,7 @@ THREE.Rotation.prototype = {
updateEuler: function () {
this.euler.setFromQuaternion( this.quaternion );
this.euler.setFromQuaternion( this.__quaternion );
return this;
......@@ -153,7 +153,7 @@ THREE.Rotation.prototype = {
updateQuaternion: function () {
this.quaternion.setFromEuler( this.euler );
this.__quaternion.setFromEuler( this.euler );
return this;
......
......@@ -24,7 +24,7 @@ THREE.Sprite.prototype.updateMatrix = function () {
this.rotation3d.set( 0, 0, this.rotation, this.rotation3d.order );
this.quaternion.setFromEuler( this.rotation3d );
this.matrix.makeFromPositionQuaternionScale( this.position, this.quaternion, this.scale );
this.matrix.compose( this.position, this.quaternion, this.scale );
this.matrixWorldNeedsUpdate = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册