Преглед на файлове

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.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize();
 		this.object.quaternion.multiply( this.tmpQuaternion );
 		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 );
 
 
 
 
 	};
 	};