boost math constants

This commit is contained in:
Thomas Krijnen
2026-07-03 13:28:53 +02:00
parent cdd1ecd15c
commit 1e032d188f
2 changed files with 17 additions and 13 deletions
+3 -1
View File
@@ -31,6 +31,8 @@
#include <Eigen/Dense>
#include <boost/math/constants/constants.hpp>
#include <cmath>
inline Eigen::Matrix4f lookAtRH(const Eigen::Vector3f& eye,
@@ -48,7 +50,7 @@ inline Eigen::Matrix4f lookAtRH(const Eigen::Vector3f& eye,
inline Eigen::Matrix4f perspectiveYFovGL(float fovy_deg, float aspect,
float near_plane, float far_plane) {
const float fovy_rad = fovy_deg * float(M_PI) / 180.0f;
const float fovy_rad = fovy_deg * boost::math::constants::pi<float>() / 180.0f;
const float t = std::tan(fovy_rad * 0.5f);
Eigen::Matrix4f m = Eigen::Matrix4f::Zero();
m(0, 0) = 1.0f / (aspect * t);