Skip to content

Commit

Permalink
[FieldOfView] true aspectRatio formula
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthou committed Aug 27, 2023
1 parent 9ccc1f1 commit 72e88b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/overworld/BasicTypes/FieldOfView.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FieldOfView
clip_near_(clip_near),
clip_far_(clip_far)
{
opengl_ratio_ = std::sqrt(2) * std::tan(width_ / height_ * 0.6116);
opengl_ratio_ = std::tan(width_ * TO_HALF_RAD) / std::tan(height_ * TO_HALF_RAD);
}

double getHeight() const { return height_; }
Expand All @@ -28,7 +28,6 @@ class FieldOfView

double getRatio() const { return width_ / height_; }
double getRatioOpenGl() const { return opengl_ratio_; }
//double getRatioOpenGl() const { return 1.4227 * std::tan(width_ / height_ * 0.6105); }

/**
* @brief
Expand Down

0 comments on commit 72e88b3

Please sign in to comment.