Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gizmo fixes #6763

Merged
merged 11 commits into from
Jun 28, 2024
Prev Previous commit
Next Next commit
removed aspect ratio scaling
  • Loading branch information
kpal81xd committed Jun 27, 2024
commit 48d1da2ede25a90552e56434e21a69a2bfd0e7d2
2 changes: 1 addition & 1 deletion src/extras/gizmo/gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class Gizmo extends EventHandler {
const gizmoPos = this.root.getPosition();
const cameraPos = this._camera.entity.getPosition();
const dist = gizmoPos.sub(cameraPos).length();
this._scale = Math.tan(0.5 * this._camera.fov * math.DEG_TO_RAD * Math.max(1, 1 / this._camera.aspectRatio)) * dist * PERS_SCALE_RATIO;
this._scale = Math.tan(0.5 * this._camera.fov * math.DEG_TO_RAD) * dist * PERS_SCALE_RATIO;
} else {
this._scale = this._camera.orthoHeight * ORTHO_SCALE_RATIO;
}
Expand Down