MATH: Use floats where appropriate

This commit is contained in:
Helco
2025-10-31 19:01:45 +01:00
committed by Helco
parent 7199f2571a
commit c534a138e0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ public:
Math::Vector3d d(0, 1, 2);
Math::Ray r(o, d);
r.translate(Math::Vector3d(0.5, 0.2, 0.1));
r.translate(Math::Vector3d(0.5f, 0.2f, 0.1f));
TS_ASSERT(r.getDirection() == d);
Math::Vector3d o2 = r.getOrigin();
@@ -42,7 +42,7 @@ public:
const Math::Vector3d v3(0, 10, 20);
// A ray that points along the x axis, should hit the triangle at the origin
Math::Ray r(Math::Vector3d(-9.5, 0, 0.7), Math::Vector3d(1, 0, 0));
Math::Ray r(Math::Vector3d(-9.5f, 0, 0.7f), Math::Vector3d(1, 0, 0));
Math::Vector3d loc(7, 8, 9); // add values to ensure it's changed
float dist = 99.0f;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
Math::Vector3d v1(1, 0, 2);
Math::Vector3d v2(0, 5, 3);
Math::Vector3d int1 = Math::Vector3d::interpolate(v1, v2, 0.1);
Math::Vector3d int1 = Math::Vector3d::interpolate(v1, v2, 0.1f);
TS_ASSERT_DELTA(int1.x(), 0.9, 0.0001);
TS_ASSERT_DELTA(int1.y(), 0.5, 0.0001);
TS_ASSERT_DELTA(int1.z(), 2.1, 0.0001);