collision sphere previsualization

This commit is contained in:
2021-01-03 13:27:01 +01:00
parent 928d45c3fb
commit 7e0554bf65
6 changed files with 3256 additions and 6 deletions

View File

@ -21,8 +21,6 @@ OpenGLMesh::OpenGLMesh(QVector<float> verts, QOpenGLTexture *tex, QOpenGLShaderP
glf->glEnableVertexAttribArray(1);
glf->glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof (float), (void *) (6 * sizeof (float)));
glf->glEnableVertexAttribArray(2);
tex->bind();
glf->glBindVertexArray(0);
OpenGLWidget::instance->doneCurrent();
}
@ -31,7 +29,7 @@ void OpenGLMesh::draw(QOpenGLExtraFunctions *f, const QMatrix4x4 &mat) const {
program->bind();
program->setUniformValue("model", mat);
f->glBindVertexArray(vao);
tex->bind();
if (tex) tex->bind();
f->glDrawArrays(GL_TRIANGLES, 0, nverts);
tex->release();
if (tex) tex->release();
}