Added mesh generator functions

Added Mesh::Build


Former-commit-id: dcfc6587b67ab4ec350ab7ca04ae7f45475f6b1b
This commit is contained in:
Lynix
2013-05-30 13:25:45 +02:00
parent 65c08442ce
commit 714e3e01bc
5 changed files with 678 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
// Copyright (C) 2013 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Debug.hpp>
void NzTransformVertex(NzMeshVertex* vertex, const NzMatrix4f& matrix)
{
vertex->normal = matrix.Transform(vertex->normal, 0.f);
vertex->position = matrix.Transform(vertex->position);
vertex->tangent = matrix.Transform(vertex->tangent, 0.f);
vertex++;
}
void NzTransformVertices(NzMeshVertex* vertices, unsigned int vertexCount, const NzMatrix4f& matrix)
{
if (matrix.IsIdentity())
return;
for (unsigned int i = 0; i < vertexCount; ++i)
NzTransformVertex(vertices++, matrix);
}
#include <Nazara/Utility/DebugOff.hpp>