Switch from Nz prefix to namespace Nz
What a huge commit Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
This commit is contained in:
@@ -5,25 +5,25 @@ SCENARIO("Frustum", "[MATH][FRUSTUM]")
|
||||
{
|
||||
GIVEN("One frustum (90, 1, 1, 1000, (0, 0, 0), (1, 0, 0))")
|
||||
{
|
||||
NzFrustumf frustum;
|
||||
frustum.Build(NzFromDegrees(90.f), 1.f, 1.f, 1000.f, NzVector3f::Zero(), NzVector3f::UnitX());
|
||||
Nz::Frustumf frustum;
|
||||
frustum.Build(Nz::FromDegrees(90.f), 1.f, 1.f, 1000.f, Nz::Vector3f::Zero(), Nz::Vector3f::UnitX());
|
||||
|
||||
WHEN("We ask for intersection with objects outside the frustum")
|
||||
{
|
||||
THEN("These results are expected")
|
||||
{
|
||||
NzBoundingVolumef bv(NzVector3f::Zero(), NzVector3f::Unit());
|
||||
bv.Update(NzMatrix4f::Identity());
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(bv));
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(NzBoxf(NzVector3f::Zero(), NzVector3f::Unit() * 0.9f)));
|
||||
NzOrientedBoxf obb(NzVector3f::Zero(), NzVector3f::Unit() * 0.9f);
|
||||
obb.Update(NzMatrix4f::Identity());
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(obb));
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(NzSpheref(NzVector3f::Zero(), 0.5f)));
|
||||
NzVector3f tmp = NzVector3f::Zero();
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(&tmp, 1));
|
||||
tmp = NzVector3f::UnitX() * -10.f;
|
||||
REQUIRE(nzIntersectionSide_Outside == frustum.Intersect(&tmp, 1));
|
||||
Nz::BoundingVolumef bv(Nz::Vector3f::Zero(), Nz::Vector3f::Unit());
|
||||
bv.Update(Nz::Matrix4f::Identity());
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(bv));
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(Nz::Boxf(Nz::Vector3f::Zero(), Nz::Vector3f::Unit() * 0.9f)));
|
||||
Nz::OrientedBoxf obb(Nz::Vector3f::Zero(), Nz::Vector3f::Unit() * 0.9f);
|
||||
obb.Update(Nz::Matrix4f::Identity());
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(obb));
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(Nz::Spheref(Nz::Vector3f::Zero(), 0.5f)));
|
||||
Nz::Vector3f tmp = Nz::Vector3f::Zero();
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(&tmp, 1));
|
||||
tmp = Nz::Vector3f::UnitX() * -10.f;
|
||||
REQUIRE(Nz::IntersectionSide_Outside == frustum.Intersect(&tmp, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,17 +31,17 @@ SCENARIO("Frustum", "[MATH][FRUSTUM]")
|
||||
{
|
||||
THEN("These results are expected")
|
||||
{
|
||||
NzBoundingVolumef bv(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
bv.Update(NzMatrix4f::Identity());
|
||||
Nz::BoundingVolumef bv(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
bv.Update(Nz::Matrix4f::Identity());
|
||||
|
||||
REQUIRE(nzIntersectionSide_Inside == frustum.Intersect(bv));
|
||||
REQUIRE(nzIntersectionSide_Inside == frustum.Intersect(NzBoxf(NzVector3f::UnitX() * 500.f, NzVector3f::Unit())));
|
||||
NzOrientedBoxf obb(NzVector3f::UnitX() * 100.f, NzVector3f::Unit());
|
||||
obb.Update(NzMatrix4f::Identity());
|
||||
REQUIRE(nzIntersectionSide_Inside == frustum.Intersect(obb));
|
||||
REQUIRE(nzIntersectionSide_Inside == frustum.Intersect(NzSpheref(NzVector3f::UnitX() * 100.f, 0.5f)));
|
||||
NzVector3f tmp = NzVector3f::UnitX() * 100.f;
|
||||
REQUIRE(nzIntersectionSide_Inside == frustum.Intersect(&tmp, 1));
|
||||
REQUIRE(Nz::IntersectionSide_Inside == frustum.Intersect(bv));
|
||||
REQUIRE(Nz::IntersectionSide_Inside == frustum.Intersect(Nz::Boxf(Nz::Vector3f::UnitX() * 500.f, Nz::Vector3f::Unit())));
|
||||
Nz::OrientedBoxf obb(Nz::Vector3f::UnitX() * 100.f, Nz::Vector3f::Unit());
|
||||
obb.Update(Nz::Matrix4f::Identity());
|
||||
REQUIRE(Nz::IntersectionSide_Inside == frustum.Intersect(obb));
|
||||
REQUIRE(Nz::IntersectionSide_Inside == frustum.Intersect(Nz::Spheref(Nz::Vector3f::UnitX() * 100.f, 0.5f)));
|
||||
Nz::Vector3f tmp = Nz::Vector3f::UnitX() * 100.f;
|
||||
REQUIRE(Nz::IntersectionSide_Inside == frustum.Intersect(&tmp, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,15 +49,15 @@ SCENARIO("Frustum", "[MATH][FRUSTUM]")
|
||||
{
|
||||
THEN("These results are expected")
|
||||
{
|
||||
NzBoundingVolumef bv(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f);
|
||||
bv.Update(NzMatrix4f::Identity());
|
||||
Nz::BoundingVolumef bv(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f);
|
||||
bv.Update(Nz::Matrix4f::Identity());
|
||||
CHECK(!frustum.Contains(bv));
|
||||
CHECK(!frustum.Contains(NzBoxf(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f)));
|
||||
NzOrientedBoxf obb(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f);
|
||||
obb.Update(NzMatrix4f::Identity());
|
||||
CHECK(!frustum.Contains(Nz::Boxf(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f)));
|
||||
Nz::OrientedBoxf obb(0.f, -0.25f, -0.25f, 0.5f, 0.5f, 0.5f);
|
||||
obb.Update(Nz::Matrix4f::Identity());
|
||||
CHECK(!frustum.Contains(obb));
|
||||
CHECK(!frustum.Contains(NzSpheref(NzVector3f::Zero(), 0.5f)));
|
||||
NzVector3f tmp = NzVector3f::Zero();
|
||||
CHECK(!frustum.Contains(Nz::Spheref(Nz::Vector3f::Zero(), 0.5f)));
|
||||
Nz::Vector3f tmp = Nz::Vector3f::Zero();
|
||||
CHECK(!frustum.Contains(&tmp, 1));
|
||||
}
|
||||
}
|
||||
@@ -66,15 +66,15 @@ SCENARIO("Frustum", "[MATH][FRUSTUM]")
|
||||
{
|
||||
THEN("These results are expected")
|
||||
{
|
||||
NzBoundingVolumef bv(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
bv.Update(NzMatrix4f::Identity());
|
||||
Nz::BoundingVolumef bv(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
bv.Update(Nz::Matrix4f::Identity());
|
||||
CHECK(frustum.Contains(bv));
|
||||
CHECK(frustum.Contains(NzBoxf(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f)));
|
||||
NzOrientedBoxf obb(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
obb.Update(NzMatrix4f::Identity());
|
||||
CHECK(frustum.Contains(Nz::Boxf(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f)));
|
||||
Nz::OrientedBoxf obb(500.f, -0.5f, -0.5f, 1.f, 1.f, 1.f);
|
||||
obb.Update(Nz::Matrix4f::Identity());
|
||||
CHECK(frustum.Contains(obb));
|
||||
CHECK(frustum.Contains(NzSpheref(NzVector3f::UnitX() * 500.f, 1.f)));
|
||||
NzVector3f tmp = NzVector3f::UnitX() * 500.f;
|
||||
CHECK(frustum.Contains(Nz::Spheref(Nz::Vector3f::UnitX() * 500.f, 1.f)));
|
||||
Nz::Vector3f tmp = Nz::Vector3f::UnitX() * 500.f;
|
||||
CHECK(frustum.Contains(&tmp, 1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user