Documentation for Primitive

Former-commit-id: 8f4e15d4e9131836545f8b112049a001638f411c
This commit is contained in:
Gawaboumga
2016-02-21 14:24:37 +01:00
parent 01d5f18d27
commit 1eebeceeea
3 changed files with 463 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include <Nazara/Core/PrimitiveList.hpp>
#include <Catch/catch.hpp>
SCENARIO("PrimitiveList", "[CORE][PRIMITIVELIST]")
{
GIVEN("An empty PrimitiveList")
{
Nz::PrimitiveList primitiveList;
WHEN("We add two primitives")
{
float size = 1.f;
unsigned int subdivision = 1;
unsigned int recursionLevel = 1;
Nz::Matrix4f identity = Nz::Matrix4f::Identity();
primitiveList.AddCubicSphere(size, subdivision, identity);
primitiveList.AddIcoSphere(size, subdivision, identity);
THEN("There must be two items")
{
REQUIRE(primitiveList.GetSize() == 2);
}
THEN("The first one is the cubic sphere")
{
REQUIRE(primitiveList(0).sphere.type == Nz::SphereType_Cubic);
}
}
}
}