Use our own constants instead of M_PI, M_*, etc. (#1733)

These constants are not part of the standard. We instead use our own
constexpr definitions in the filament::math namespace, as part of
the scalar.h include.
This commit is contained in:
Romain Guy
2019-10-02 15:31:38 -07:00
committed by GitHub
parent 7ea7d1d5f2
commit a4a1bf07aa
22 changed files with 218 additions and 193 deletions

View File

@@ -19,6 +19,7 @@
#include <gtest/gtest.h>
#include <math/vec4.h>
#include <math/scalar.h>
using namespace filament::math;
@@ -27,7 +28,7 @@ protected:
};
TEST_F(VecTest, Constexpr) {
constexpr float a = M_PI;
constexpr float a = F_PI;
constexpr float2 Z2{};
constexpr float2 A2 = a;
constexpr float2 B2 = { a, a };