未验证 提交 1bc34d66 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20186 from WestLangley/dev_fly_controls

FlyControls: Removed unnecessary computation
......@@ -200,9 +200,6 @@ THREE.FlyControls = function ( object, domElement ) {
scope.tmpQuaternion.set( scope.rotationVector.x * rotMult, scope.rotationVector.y * rotMult, scope.rotationVector.z * rotMult, 1 ).normalize();
scope.object.quaternion.multiply( scope.tmpQuaternion );
// expose the rotation vector for convenience
scope.object.rotation.setFromQuaternion( scope.object.quaternion, scope.object.rotation.order );
if (
lastPosition.distanceToSquared( scope.object.position ) > EPS ||
8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS
......
......@@ -204,9 +204,6 @@ var FlyControls = function ( object, domElement ) {
scope.tmpQuaternion.set( scope.rotationVector.x * rotMult, scope.rotationVector.y * rotMult, scope.rotationVector.z * rotMult, 1 ).normalize();
scope.object.quaternion.multiply( scope.tmpQuaternion );
// expose the rotation vector for convenience
scope.object.rotation.setFromQuaternion( scope.object.quaternion, scope.object.rotation.order );
if (
lastPosition.distanceToSquared( scope.object.position ) > EPS ||
8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册