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

Reordering stuff in Object3D.

上级 02002210
......@@ -92,6 +92,18 @@ THREE.Object3D.prototype = {
},
localToWorld: function ( vector ) {
return this.matrixWorld.multiplyVector3( vector );
},
worldToLocal: function ( vector ) {
return THREE.Object3D.__m1.getInverse( this.matrixWorld ).multiplyVector3( vector );
},
lookAt: function ( vector ) {
// TODO: Add hierarchy support.
......@@ -227,13 +239,13 @@ THREE.Object3D.prototype = {
this.matrix.setPosition( this.position );
if ( this.useQuaternion === true ) {
if ( this.useQuaternion === false ) {
this.matrix.setRotationFromQuaternion( this.quaternion );
this.matrix.setRotationFromEuler( this.rotation, this.eulerOrder );
} else {
this.matrix.setRotationFromEuler( this.rotation, this.eulerOrder );
this.matrix.setRotationFromQuaternion( this.quaternion );
}
......@@ -254,13 +266,13 @@ THREE.Object3D.prototype = {
if ( this.matrixWorldNeedsUpdate === true || force === true ) {
if ( this.parent !== undefined ) {
if ( this.parent === undefined ) {
this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix );
this.matrixWorld.copy( this.matrix );
} else {
this.matrixWorld.copy( this.matrix );
this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix );
}
......@@ -280,18 +292,6 @@ THREE.Object3D.prototype = {
},
worldToLocal: function ( vector ) {
return THREE.Object3D.__m1.getInverse( this.matrixWorld ).multiplyVector3( vector );
},
localToWorld: function ( vector ) {
return this.matrixWorld.multiplyVector3( vector );
},
clone: function () {
// TODO
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册