Skip to content

Commit

Permalink
fix: 🚨 Attempt to fix math defines not available for MS compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
cszach committed Oct 2, 2024
1 parent 9af8324 commit 5c72e00
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/cameras/PerspectiveCamera.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define __USE_MATH_DEFINES
#include "cameras/Camera.hpp"
#include <cmath>

Expand Down Expand Up @@ -67,4 +68,4 @@ class PerspectiveCamera : public Camera {

} // namespace t

#endif // PERSPECTIVECAMERA_HPP
#endif // PERSPECTIVECAMERA_HPP
3 changes: 2 additions & 1 deletion include/materials/BlinnPhong.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define __USE_MATH_DEFINES
#include "materials/Material.hpp"
#include <cmath>

Expand Down Expand Up @@ -89,4 +90,4 @@ class BlinnPhong : public Material {

} // namespace t

#endif // BLINNPHONG_HPP
#endif // BLINNPHONG_HPP
3 changes: 2 additions & 1 deletion include/math/Matrix4x4.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define __USE_MATH_DEFINES
#include "EulerRotation.hpp"
#include "Matrix3x3.hpp"
#include "Vector3.hpp"
Expand Down Expand Up @@ -795,4 +796,4 @@ class Matrix4x4 {

} // namespace t

#endif // MATRIX4X4_HPP
#endif // MATRIX4X4_HPP
1 change: 1 addition & 0 deletions include/math/Vector3.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define __USE_MATH_DEFINES
#include "primitives/BufferAttribute.hpp"
#include <algorithm>
#include <cmath>
Expand Down
1 change: 1 addition & 0 deletions include/renderers/Rasterizer.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define __USE_MATH_DEFINES
#include "cameras/Camera.hpp"
#include "math/Matrix3x3.hpp"
#include "primitives/Fragment.hpp"
Expand Down

0 comments on commit 5c72e00

Please sign in to comment.