Пример #1
0
NzVoxelChunkMesh::NzVoxelChunkMesh()
{
    m_vertexCount = 0;
    m_faceCount = 0;
    m_location = NzVector3i(0,0,0);
}
Пример #2
0
#include <Nazara/Math/Vector3.hpp>
#include <catch.hpp>

#include <Nazara/Math/Vector4.hpp>

SCENARIO("Vector3", "[MATH][VECTOR3]")
{
	GIVEN("Two same unit vector")
	{
		NzVector3f firstUnit(1.f, 1.f, 1.f);
		NzVector3f secondUnit(NzVector3i(NzVector4i(1, 1, 1, 5)));

		WHEN("We compare them")
		{
			THEN("They are the same")
			{
				REQUIRE(firstUnit == secondUnit);
			}
		}

		WHEN("We test the dot product")
		{
			NzVector3f tmp(-1.f, 0.f, 1.f);

			THEN("These results are expected")
			{
				REQUIRE(firstUnit.AbsDotProduct(tmp) == Approx(2.f));
				REQUIRE(firstUnit.DotProduct(tmp) == Approx(0.f));
				REQUIRE(firstUnit.AngleBetween(tmp) == Approx(90.f));
			}
		}