Fix GetFov methods

This commit is contained in:
Georg Hagen
2024-07-07 00:21:49 +02:00
parent d6850821d3
commit fcecdd63a3

View File

@@ -80,12 +80,12 @@ namespace OpenVulkano::Math
[[nodiscard]] float GetFovX(float imageWidth) const [[nodiscard]] float GetFovX(float imageWidth) const
{ {
return 2 * atanf(imageWidth * 0.5f / Fx()); return 2 * atanf((Fx() / imageWidth) * 0.5f);
} }
[[nodiscard]] float GetFovY(float imageHeight) const [[nodiscard]] float GetFovY(float imageHeight) const
{ {
return 2 * atanf(imageHeight * 0.5f / Fy()); return 2 * atanf((Fy() / imageHeight) * 0.5f);
} }
[[nodiscard]] Math::Vector3f ProjectTo3D(Math::Vector2i pixelCoordinates, float depth) const [[nodiscard]] Math::Vector3f ProjectTo3D(Math::Vector2i pixelCoordinates, float depth) const