More Math cleanup

This commit is contained in:
SirLynix
2022-12-18 16:33:05 +01:00
parent a1e62adb71
commit 5ca7b398c2
15 changed files with 104 additions and 454 deletions

View File

@@ -6,8 +6,8 @@ SCENARIO("OrientedBox", "[MATH][ORIENTEDBOX]")
{
GIVEN("Two center and unit oriented boxes")
{
Nz::OrientedBoxf firstCenterAndUnit(0.f, 0.f, 0.f, 1.f, 1.f, 1.f);
Nz::OrientedBoxf secondCenterAndUnit(Nz::OrientedBox<int>(Nz::Vector3i::Zero(), Nz::Vector3i::Unit()));
Nz::OrientedBoxf firstCenterAndUnit(Nz::Boxf(0.f, 0.f, 0.f, 1.f, 1.f, 1.f));
Nz::OrientedBoxf secondCenterAndUnit(Nz::OrientedBox<int>(Nz::Boxi(Nz::Vector3i::Zero(), Nz::Vector3i::Unit())));
firstCenterAndUnit.Update(Nz::Matrix4f::Identity());
secondCenterAndUnit.Update(Nz::Matrix4f::Identity());
@@ -33,7 +33,7 @@ SCENARIO("OrientedBox", "[MATH][ORIENTEDBOX]")
{
THEN("Results are different between operator * and update(ScaleMatrix) but corners are the same")
{
firstCenterAndUnit *= 2.f;
firstCenterAndUnit.localBox.Scale(2.f);
firstCenterAndUnit.Update(Nz::Matrix4f::Identity());
secondCenterAndUnit.Update(Nz::Matrix4f::Scale(Nz::Vector3f::Unit() * 2.f));
@@ -53,7 +53,7 @@ SCENARIO("OrientedBox", "[MATH][ORIENTEDBOX]")
Nz::OrientedBoxf centerAndUnit = firstCenterAndUnit;
nullOrientedBox.Update(Nz::Matrix4f::Identity());
centerAndUnit.Update(Nz::Matrix4f::Identity());
Nz::OrientedBoxf result(Nz::Vector3f::Zero(), Nz::Vector3f::Unit() * 0.5f);
Nz::OrientedBoxf result(Nz::Boxf(Nz::Vector3f::Zero(), Nz::Vector3f::Unit() * 0.5f));
result.Update(Nz::Matrix4f::Identity());
REQUIRE(Nz::OrientedBoxf::Lerp(nullOrientedBox, centerAndUnit, 0.5f) == result);