General bug fixes (#142)
* Core/Bitset: Fix TestAll method * Fix documentation * Fix color and their conversions * Core/ByteStream: Fix return of Write * Fix compiler warnings * Math/Algorithm: Fix angle normalization * Math/BoundingVolume: Fix lerp * Math: Fix relation between Matrix4 and Quaternion * More tests * X11/Window: Fix mouse moved event generated when doing Mouse::SetPosition * Update ChangeLog * Should fix compilation on Windows * Should fix compilation on Windows Forgot to include array for Windows
This commit is contained in:
committed by
Jérôme Leclercq
parent
f2506ee918
commit
f991a9529e
@@ -12,9 +12,9 @@ SCENARIO("Rect", "[MATH][RECT]")
|
||||
{
|
||||
THEN("They should be")
|
||||
{
|
||||
REQUIRE(firstCenterAndUnit == secondCenterAndUnit);
|
||||
REQUIRE(firstCenterAndUnit.GetCenter() == secondCenterAndUnit.GetCenter());
|
||||
REQUIRE(firstCenterAndUnit.GetCorner(Nz::RectCorner_LeftBottom) == secondCenterAndUnit.GetCorner(Nz::RectCorner_LeftBottom));
|
||||
CHECK(firstCenterAndUnit == secondCenterAndUnit);
|
||||
CHECK(firstCenterAndUnit.GetCenter() == secondCenterAndUnit.GetCenter());
|
||||
CHECK(firstCenterAndUnit.GetCorner(Nz::RectCorner_LeftBottom) == secondCenterAndUnit.GetCorner(Nz::RectCorner_LeftBottom));
|
||||
CHECK(firstCenterAndUnit.IsValid());
|
||||
}
|
||||
}
|
||||
@@ -43,16 +43,24 @@ SCENARIO("Rect", "[MATH][RECT]")
|
||||
{
|
||||
THEN("These results are expected")
|
||||
{
|
||||
REQUIRE(firstCenterAndUnit.GetLengths() == Nz::Vector2f::Unit());
|
||||
REQUIRE(firstCenterAndUnit.GetMaximum() == Nz::Vector2f::Unit());
|
||||
REQUIRE(firstCenterAndUnit.GetMinimum() == Nz::Vector2f::Zero());
|
||||
REQUIRE(firstCenterAndUnit.GetNegativeVertex(Nz::Vector2f::Unit()) == Nz::Vector2f::Zero());
|
||||
REQUIRE(firstCenterAndUnit.GetPosition() == Nz::Vector2f::Zero());
|
||||
REQUIRE(firstCenterAndUnit.GetPositiveVertex(Nz::Vector2f::Unit()) == Nz::Vector2f::Unit());
|
||||
CHECK(firstCenterAndUnit.GetLengths() == Nz::Vector2f::Unit());
|
||||
CHECK(firstCenterAndUnit.GetMaximum() == Nz::Vector2f::Unit());
|
||||
CHECK(firstCenterAndUnit.GetMinimum() == Nz::Vector2f::Zero());
|
||||
CHECK(firstCenterAndUnit.GetNegativeVertex(Nz::Vector2f::Unit()) == Nz::Vector2f::Zero());
|
||||
CHECK(firstCenterAndUnit.GetPosition() == Nz::Vector2f::Zero());
|
||||
CHECK(firstCenterAndUnit.GetPositiveVertex(Nz::Vector2f::Unit()) == Nz::Vector2f::Unit());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
WHEN("We ask for intersection")
|
||||
{
|
||||
Nz::Rectf intersection;
|
||||
CHECK(firstCenterAndUnit.Intersect(secondCenterAndUnit, &intersection));
|
||||
CHECK(intersection == Nz::Rectf(1.f, 1.f));
|
||||
CHECK(intersection == Nz::Rectf(Nz::Vector2f(1.f, 1.f)));
|
||||
}
|
||||
|
||||
WHEN("We try to lerp")
|
||||
{
|
||||
THEN("Compilation should be fine")
|
||||
|
||||
Reference in New Issue
Block a user