Improve math module (#396)
* Improve math module - Mark almost everything constexpr - Equality (a == b) is now exact, down to the bit level. If you want approximate equality use the new ApproxEqual method/static method - Rename Nz::Extend to Nz::Extent - Removed Make[] and Set[] methods in favor of their static counterpart and operator=
This commit is contained in:
@@ -28,9 +28,9 @@ SCENARIO("Vector2", "[MATH][VECTOR2]")
|
||||
{
|
||||
REQUIRE(firstUnit.AbsDotProduct(tmp) == Catch::Approx(2.f));
|
||||
REQUIRE(firstUnit.DotProduct(tmp) == Catch::Approx(0.f));
|
||||
REQUIRE(firstUnit.AngleBetween(tmp) == Nz::DegreeAnglef(90.f));
|
||||
REQUIRE(firstUnit.AngleBetween(tmp).ApproxEqual(Nz::DegreeAnglef(90.f)));
|
||||
Nz::Vector2f negativeUnitX = -Nz::Vector2f::UnitX();
|
||||
REQUIRE(negativeUnitX.AngleBetween(negativeUnitX + Nz::Vector2f(0, 0.0000001f)) == Nz::DegreeAnglef(360.f));
|
||||
REQUIRE(negativeUnitX.AngleBetween(negativeUnitX + Nz::Vector2f(0, 0.0000001f)).ApproxEqual(Nz::DegreeAnglef(360.f)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user