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

Merge pull request #19116 from VJigouline/dev

Fix TransformControl zoom for OrthographicCamera
......@@ -1165,7 +1165,8 @@ THREE.TransformControlsGizmo = function () {
handle.rotation.set( 0, 0, 0 );
handle.position.copy( this.worldPosition );
var eyeDistance = this.worldPosition.distanceTo( this.cameraPosition );
var eyeDistance = this.camera.isOrthographicCamera ? 1000 / this.camera.zoom :
this.worldPosition.distanceTo( this.cameraPosition );
handle.scale.set( 1, 1, 1 ).multiplyScalar( eyeDistance * this.size / 7 );
// TODO: simplify helpers and consider decoupling from gizmo
......
......@@ -1188,7 +1188,8 @@ var TransformControlsGizmo = function () {
handle.rotation.set( 0, 0, 0 );
handle.position.copy( this.worldPosition );
var eyeDistance = this.worldPosition.distanceTo( this.cameraPosition );
var eyeDistance = this.camera.isOrthographicCamera ? 1000 / this.camera.zoom :
this.worldPosition.distanceTo( this.cameraPosition );
handle.scale.set( 1, 1, 1 ).multiplyScalar( eyeDistance * this.size / 7 );
// TODO: simplify helpers and consider decoupling from gizmo
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册