Kaydet (Commit) 7dcc31ed authored tarafından weigao's avatar weigao Kaydeden (comit) Markus Mohrhard

pick bar path should use the IDs in pick resource

Change-Id: Ifd20a7a9ecb85ffc080204f4f3e9f200b07b9a9c
üst 00f097b6
...@@ -930,7 +930,7 @@ void OpenGL3DRenderer::RenderPolygon3D(const Polygon3DInfo& polygon) ...@@ -930,7 +930,7 @@ void OpenGL3DRenderer::RenderPolygon3D(const Polygon3DInfo& polygon)
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &polygon.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &polygon.id[0]);
} }
GLint maVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID; GLint maVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID;
// 1rst attribute buffer : vertices // 1rst attribute buffer : vertices
...@@ -1321,7 +1321,7 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, ...@@ -1321,7 +1321,7 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D,
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3D.id[0]);
} }
glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[surIndex])); glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[surIndex]));
...@@ -1365,7 +1365,7 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D ...@@ -1365,7 +1365,7 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3D.id[0]);
} }
glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[BOTTOM_SURFACE])); glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[BOTTOM_SURFACE]));
} }
...@@ -1410,7 +1410,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D ...@@ -1410,7 +1410,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3D.id[0]);
} }
glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[MIDDLE_SURFACE])); glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[MIDDLE_SURFACE]));
} }
...@@ -1455,7 +1455,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) ...@@ -1455,7 +1455,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D)
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3D.id[0]);
} }
glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[TOP_SURFACE])); glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[TOP_SURFACE]));
} }
...@@ -1485,7 +1485,7 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D) ...@@ -1485,7 +1485,7 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D)
{ {
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3D.id[0]);
} }
glDrawArrays(GL_TRIANGLES, 0, 36); glDrawArrays(GL_TRIANGLES, 0, 36);
} }
...@@ -1549,7 +1549,7 @@ void OpenGL3DRenderer::RenderExtrude3DObject() ...@@ -1549,7 +1549,7 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
GLuint normalBuf = extrude3DInfo.rounded ? m_CubeNormalBuf : m_BoundBoxNormal; GLuint normalBuf = extrude3DInfo.rounded ? m_CubeNormalBuf : m_BoundBoxNormal;
if(mbPickingMode) if(mbPickingMode)
glUniform4fv(maResources.m_2DColorID, 1, &extrude3DInfo.id[0]); glUniform4fv(maPickingResources.m_2DColorID, 1, &extrude3DInfo.id[0]);
// 1st attribute buffer : vertices // 1st attribute buffer : vertices
GLint aVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID; GLint aVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment