finally fixed rotation bug,
some performance,
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user