Renamed ComputeVerticesAABB function to ComputeAABB

Former-commit-id: 5e8381f8d09f583f6ef9b2919b082f3418644bce
This commit is contained in:
Lynix 2015-01-26 17:20:27 +01:00
parent 8f101812c3
commit 025fdf6846
3 changed files with 3 additions and 3 deletions

View File

@ -32,6 +32,7 @@ struct NzVertexPointers
NzSparsePtr<NzVector2f> uvPtr; NzSparsePtr<NzVector2f> uvPtr;
}; };
template<typename T> NzBoxf NzComputeAABB(const T* vertices, unsigned int vertexCount);
NAZARA_API void NzComputeBoxIndexVertexCount(const NzVector3ui& subdivision, unsigned int* indexCount, unsigned int* vertexCount); NAZARA_API void NzComputeBoxIndexVertexCount(const NzVector3ui& subdivision, unsigned int* indexCount, unsigned int* vertexCount);
NAZARA_API unsigned int NzComputeCacheMissCount(NzIndexIterator indices, unsigned int indexCount); NAZARA_API unsigned int NzComputeCacheMissCount(NzIndexIterator indices, unsigned int indexCount);
NAZARA_API void NzComputeConeIndexVertexCount(unsigned int subdivision, unsigned int* indexCount, unsigned int* vertexCount); NAZARA_API void NzComputeConeIndexVertexCount(unsigned int subdivision, unsigned int* indexCount, unsigned int* vertexCount);
@ -39,7 +40,6 @@ NAZARA_API void NzComputeCubicSphereIndexVertexCount(unsigned int subdivision, u
NAZARA_API void NzComputeIcoSphereIndexVertexCount(unsigned int recursionLevel, unsigned int* indexCount, unsigned int* vertexCount); NAZARA_API void NzComputeIcoSphereIndexVertexCount(unsigned int recursionLevel, unsigned int* indexCount, unsigned int* vertexCount);
NAZARA_API void NzComputePlaneIndexVertexCount(const NzVector2ui& subdivision, unsigned int* indexCount, unsigned int* vertexCount); NAZARA_API void NzComputePlaneIndexVertexCount(const NzVector2ui& subdivision, unsigned int* indexCount, unsigned int* vertexCount);
NAZARA_API void NzComputeUvSphereIndexVertexCount(unsigned int sliceCount, unsigned int stackCount, unsigned int* indexCount, unsigned int* vertexCount); NAZARA_API void NzComputeUvSphereIndexVertexCount(unsigned int sliceCount, unsigned int stackCount, unsigned int* indexCount, unsigned int* vertexCount);
template<typename T> NzBoxf NzComputeVerticesAABB(const T* vertices, unsigned int vertexCount);
///TODO: Remplacer le pointeur vertices par une structure composée de plusieurs SparsePtr ///TODO: Remplacer le pointeur vertices par une structure composée de plusieurs SparsePtr
NAZARA_API void NzGenerateBox(const NzVector3f& lengths, const NzVector3ui& subdivision, const NzMatrix4f& matrix, const NzRectf& textureCoords, NzVertexPointers vertexPointers, NzIndexIterator indices, NzBoxf* aabb = nullptr, unsigned int indexOffset = 0); NAZARA_API void NzGenerateBox(const NzVector3f& lengths, const NzVector3ui& subdivision, const NzMatrix4f& matrix, const NzRectf& textureCoords, NzVertexPointers vertexPointers, NzIndexIterator indices, NzBoxf* aabb = nullptr, unsigned int indexOffset = 0);

View File

@ -5,7 +5,7 @@
#include <Nazara/Utility/Debug.hpp> #include <Nazara/Utility/Debug.hpp>
template<typename T> template<typename T>
NzBoxf NzComputeVerticesAABB(const T* vertices, unsigned int vertexCount) NzBoxf NzComputeAABB(const T* vertices, unsigned int vertexCount)
{ {
NzBoxf aabb; NzBoxf aabb;
if (vertexCount > 0) if (vertexCount > 0)

View File

@ -68,7 +68,7 @@ bool NzStaticMesh::GenerateAABB()
{ {
// On lock le buffer pour itérer sur toutes les positions et composer notre AABB // On lock le buffer pour itérer sur toutes les positions et composer notre AABB
NzBufferMapper<NzVertexBuffer> mapper(m_vertexBuffer, nzBufferAccess_ReadOnly); NzBufferMapper<NzVertexBuffer> mapper(m_vertexBuffer, nzBufferAccess_ReadOnly);
m_aabb = NzComputeVerticesAABB(static_cast<const NzMeshVertex*>(mapper.GetPointer()), m_vertexBuffer->GetVertexCount()); m_aabb = NzComputeAABB(static_cast<const NzMeshVertex*>(mapper.GetPointer()), m_vertexBuffer->GetVertexCount());
return true; return true;
} }