Minor fixes
This commit is contained in:
@@ -208,7 +208,7 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
|
||||
|
||||
THEN("We should retrieve it")
|
||||
{
|
||||
CHECK(identity.GetScale() == scale);
|
||||
CHECK(identity.GetScale().ApproxEqual(scale));
|
||||
CHECK(identity.GetSquaredScale() == squaredScale);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ SCENARIO("Plane", "[MATH][PLANE]")
|
||||
|
||||
THEN("It must be equal to XZ distance 1")
|
||||
{
|
||||
REQUIRE(xy == Nz::Planef(Nz::Vector3f::UnitY(), -1.f));
|
||||
REQUIRE(xy.ApproxEqual(Nz::Planef(Nz::Vector3f::UnitY(), -1.f)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ SCENARIO("Plane", "[MATH][PLANE]")
|
||||
Nz::Planef xy(Nz::Vector3f(0.f, 1.f, 0.f), Nz::Vector3f(1.f, 1.f, 1.f), Nz::Vector3f(-1.f, 1.f, 0.f));
|
||||
THEN("It must be equal to XZ distance 1")
|
||||
{
|
||||
REQUIRE(xy == Nz::Planef(-Nz::Vector3f::UnitY(), 1.f));
|
||||
REQUIRE(xy.ApproxEqual(Nz::Planef(-Nz::Vector3f::UnitY(), 1.f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ SCENARIO("Quaternion", "[MATH][QUATERNION]")
|
||||
THEN("They are the same and the proprieties of quaternions are respected")
|
||||
{
|
||||
REQUIRE(firstQuaternion.ApproxEqual(secondQuaternion));
|
||||
REQUIRE(firstQuaternion.ComputeW() == secondQuaternion.Normalize());
|
||||
REQUIRE(firstQuaternion.ComputeW().ApproxEqual(secondQuaternion.Normalize()));
|
||||
REQUIRE(firstQuaternion.Conjugate() == secondQuaternion.Inverse());
|
||||
REQUIRE(firstQuaternion.DotProduct(secondQuaternion) == Catch::Approx(1.f));
|
||||
}
|
||||
@@ -200,7 +200,7 @@ SCENARIO("Quaternion", "[MATH][QUATERNION]")
|
||||
Nz::Vector3f origin(1.f, 0.f, 1.f);
|
||||
Nz::Vector3f extremity(-1.f, 0.f, 1.f);
|
||||
Nz::Quaternionf rotation = Nz::Quaternionf::RotationBetween(origin, extremity);
|
||||
REQUIRE((rotation * origin).ApproxEqual(extremity));
|
||||
REQUIRE((rotation * origin).ApproxEqual(extremity, 0.0001f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ SCENARIO("Ray", "[MATH][RAY]")
|
||||
Nz::BoundingVolumef infiniteVolume(Nz::Extent::Infinite);
|
||||
CHECK(ray.Intersect(infiniteVolume, &tmpClosest, &tmpFurthest));
|
||||
CHECK(tmpClosest == Catch::Approx(0.f));
|
||||
CHECK(tmpFurthest == std::numeric_limits<float>::infinity());
|
||||
CHECK(std::isinf(tmpFurthest));
|
||||
}
|
||||
|
||||
THEN("For the triangle collision's")
|
||||
|
||||
@@ -56,7 +56,7 @@ SCENARIO("Vector2", "[MATH][VECTOR2]")
|
||||
THEN("For normal cases should be normal")
|
||||
{
|
||||
Nz::Vector2f normalized = firstUnit.GetNormal(&ratio);
|
||||
REQUIRE(normalized == (Nz::Vector2f::Unit() / std::sqrt(2.f)));
|
||||
REQUIRE(normalized.ApproxEqual(Nz::Vector2f::Unit() / std::sqrt(2.f)));
|
||||
REQUIRE(ratio == Catch::Approx(std::sqrt(2.f)));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ SCENARIO("Vector3", "[MATH][VECTOR3]")
|
||||
REQUIRE(firstUnit.AbsDotProduct(tmp) == Catch::Approx(2.f));
|
||||
REQUIRE(firstUnit.DotProduct(tmp) == Catch::Approx(0.f));
|
||||
REQUIRE(firstUnit.AngleBetween(tmp).ApproxEqual(Nz::DegreeAnglef(90.f)));
|
||||
REQUIRE(firstUnit.AngleBetween(-firstUnit).ApproxEqual(Nz::DegreeAnglef(180.f)));
|
||||
REQUIRE(firstUnit.AngleBetween(-firstUnit).ApproxEqual(Nz::DegreeAnglef(180.f), 0.001f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user