Skip to content

Commit

Permalink
fixup! feat: add horizontal FOV converter
Browse files Browse the repository at this point in the history
  • Loading branch information
wertiop121 committed Jul 28, 2024
1 parent f7fe817 commit 20c7786
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/pages/settings/fov.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Fov {
return Number.NaN;
}

// based on https://casualhacks.net/Source-FOV-calculator.html
static fovToHorizontal(fov) {
const ratioRatio = this.aspectRatio() / (4 / 3);
return 2 * rad2deg(Math.atan(Math.tan(deg2rad(fov) / 2) * ratioRatio));
Expand Down

0 comments on commit 20c7786

Please sign in to comment.