finally fixed rotation bug,

some performance,
This commit is contained in:
Anakin
2017-01-03 14:18:46 +01:00
parent 0fefc6168b
commit c28a12cd8f
5 changed files with 28 additions and 14 deletions

View File

@@ -10,8 +10,6 @@ GeometryEngine::GeometryEngine()
: m_indexBuf(QOpenGLBuffer::IndexBuffer)
{
initializeOpenGLFunctions();
loadFile("..\\Release\\Msh\\cubeTex.msh");
}
GeometryEngine::~GeometryEngine()
@@ -63,9 +61,10 @@ void GeometryEngine::loadFile(const char* filePath)
new_info.modelMatrix = modelIterator->m4x4Translation;
new_info.modelMatrix.rotate(modelIterator->quadRotation);
// add offset to indices
for (auto& it : segmentIterator->indices)
it += vertexOffset;
// add offset to indices, no need to do it for the first one (maybe it's very big)
if(vertexOffset != 0)
for (auto& it : segmentIterator->indices)
it += vertexOffset;
// save data
vertexData += segmentIterator->vertices;