cloth stores the data in vectors, too;

removed the old unused code
This commit is contained in:
Anakin
2016-11-20 13:09:02 +01:00
parent 9ac1a25954
commit f81f03353d
4 changed files with 23 additions and 91 deletions

View File

@@ -120,7 +120,6 @@ void OpenGLController::deleteVectors()
cursor->segmLst.pop_back();
delete segmCuror->uv;
delete segmCuror->mesh; // not used when using vector
delete segmCuror->vertex;
while (!segmCuror->meshIndices.empty())
@@ -343,10 +342,10 @@ void OpenGLController::updateScene()
// give the MVP to the shader
glUniformMatrix4fv(gluiMatrixID, 1, GL_FALSE, &getMVPMatrix(modelIndex)[0][0]);
glDrawArrays(GL_TRIANGLES, instanceOffset, segIt->meshSize);
glDrawArrays(GL_TRIANGLES, instanceOffset, segIt->meshIndices.size() * 3);
// increase the offset
instanceOffset += segIt->meshSize;
instanceOffset += segIt->meshIndices.size() * 3;
}
}
@@ -377,39 +376,6 @@ void OpenGLController::loadMsh(const char * path)
// collect vertex data of all models
std::vector<Vertex> tempBufferData;
/*for (auto& modIt : vModels)
{
// don't draw bones, nulls, shadow mesh and hidden things
if (modIt->type == null || modIt->type == bone || modIt->type == shadowMesh || modIt->renderFlags == 1)
continue;
for (auto& segIt : modIt->segmLst)
{
for (unsigned int i = 0; i < segIt->meshSize; i++)
{
Vertex tempVertex;
tempVertex.position[0] = (GLfloat)segIt->vertex[segIt->mesh[i] * 3];
tempVertex.position[1] = (GLfloat)segIt->vertex[segIt->mesh[i] * 3 + 1];
tempVertex.position[2] = (GLfloat)segIt->vertex[segIt->mesh[i] * 3 + 2];
if (segIt->uv == NULL)
{
tempVertex.uv[0] = 1.0;
tempVertex.uv[1] = 1.0;
}
else
{
tempVertex.uv[0] = (GLfloat)segIt->uv[segIt->mesh[i] * 2];
tempVertex.uv[1] = (GLfloat)segIt->uv[segIt->mesh[i] * 2 + 1];
}
tempBufferData.push_back(tempVertex);
}
}
}*/
/////////////////////////////////////////////////////////////////////////////////////////
/////DEV ZONE
for (auto& modIt : vModels) // for every model chunk
{
for (auto& segIt : modIt->segmLst) // for every cluster
@@ -441,7 +407,7 @@ void OpenGLController::loadMsh(const char * path)
}
else if (mshIt->size() > 3) // needs to be triangulated
{
//triangulate;
//TODO: triangulate;
MessageBox(NULL, "Ooops!", "MeshViewer 2.0 Error", MB_OK | MB_ICONERROR);
}
else // this shouldn't happen (polygon with less then 3 vertex)
@@ -453,8 +419,6 @@ void OpenGLController::loadMsh(const char * path)
}
}
}
// think of delete the data from obj here. It's no longer needed
////////////////////////////////////////////////////////////////////////////////////////
// fill the buffer
glBindBuffer(GL_ARRAY_BUFFER, gluiVertexBufferID);