浏览代码

FlyControls improvement suggested by @WestLangley in #2992.

Mr.doob 12 年之前
父节点
当前提交
d4157b3cda
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      examples/js/controls/FlyControls.js

+ 2 - 3
examples/js/controls/FlyControls.js

@@ -194,9 +194,8 @@ THREE.FlyControls = function ( object, domElement ) {
 		this.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize();
 		this.object.quaternion.multiply( this.tmpQuaternion );
 
-		this.object.matrix.setPosition( this.object.position );
-		this.object.matrix.setRotationFromQuaternion( this.object.quaternion );
-		this.object.matrixWorldNeedsUpdate = true;
+		// expose the rotation vector for convenience
+		this.object.rotation.setEulerFromQuaternion( this.object.quaternion, this.object.eulerOrder );
 
 
 	};