mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 19:30:25 +00:00
boost math constants
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user