(VertexMapper) Updated interface

Added access parameter
Removed useless GetVertexCount method


Former-commit-id: 670d16ed9668eb5df476a592929ed9c364b1f11a
This commit is contained in:
Lynix
2015-01-26 17:11:00 +01:00
parent ab538e0e2d
commit 5e3fdbca89
4 changed files with 11 additions and 22 deletions

View File

@@ -25,12 +25,12 @@ void NzStaticMesh::Center()
{
NzVector3f offset(m_aabb.x + m_aabb.width/2.f, m_aabb.y + m_aabb.height/2.f, m_aabb.z + m_aabb.depth/2.f);
NzVertexMapper mapper(this);
NzVertexMapper mapper(m_vertexBuffer);
NzSparsePtr<NzVector3f> position = mapper.GetComponentPtr<NzVector3f>(nzVertexComponent_Position);
unsigned int vertexCount = mapper.GetVertexCount();
unsigned int vertexCount = m_vertexBuffer->GetVertexCount();
for (unsigned int i = 0; i < vertexCount; ++i)
position[i] -= offset;
*position++ -= offset;
m_aabb.x -= offset.x;
m_aabb.y -= offset.y;