diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-11 05:26:02 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-12 03:00:09 +0200 |
commit | 906672eb43fcef95a53a0a825628018752ff2c00 (patch) | |
tree | eefb0b9b3ff2cae3f271a17bb2b4e69462c06477 /chart2 | |
parent | 3b367b5453b24949374154ecbb1f13276df469f6 (diff) |
this does not need to be a member variable
Change-Id: I9be286f8e10d43c8c5ce89bb6b52ebddce48bb6b
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/GL3DRenderer.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx index 242cb5213bb0..5337384c787f 100644 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -235,8 +235,6 @@ private: glm::mat4 m_3DMVP; - glm::mat4 m_TranslationMatrix; - GLint m_3DProID; GLuint m_3DProjectionID; diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index 87248d016652..e8de12b8ed60 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -62,8 +62,7 @@ GLfloat texCoords[] = { } OpenGL3DRenderer::OpenGL3DRenderer(): - m_TranslationMatrix(glm::translate(m_Model, glm::vec3(0.0f, 0.0f, 0.0f))) - , m_TextProID(0) + m_TextProID(0) , m_TextMatrixID(0) , m_TextVertexID(0) , m_TextTexCoordID(0) @@ -1030,9 +1029,9 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, PosVecf3 trans = {extrude3D.xTransform,//m_Extrude3DInfo.xTransform + 140, -extrude3D.yTransform, extrude3D.zTransform}; - m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); + glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); glm::mat4 flatScale = glm::scale(xzScale, xzScale, xzScale); - m_Model = m_TranslationMatrix * extrude3D.rotation * flatScale; + m_Model = aTranslationMatrix * extrude3D.rotation * flatScale; glm::mat3 normalMatrix(m_Model); glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); glUniformMatrix4fv(m_3DModelID, 1, GL_FALSE, &m_Model[0][0]); @@ -1063,8 +1062,8 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D { glm::mat4 topTrans = glm::translate(glm::vec3(0.0, -actualYTrans, 0.0)); glm::mat4 topScale = glm::scale(xzScale, xzScale, xzScale); - m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); - m_Model = m_TranslationMatrix * extrude3D.rotation * topTrans * topScale; + glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); + m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale; } glm::mat3 normalMatrix(m_Model); glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); @@ -1092,8 +1091,8 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D else { glm::mat4 scale = glm::scale(xzScale, actualYScale, xzScale); - m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); - m_Model = m_TranslationMatrix * extrude3D.rotation * scale; + glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); + m_Model = aTranslationMatrix * extrude3D.rotation * scale; } if (extrude3D.reverse) @@ -1125,8 +1124,8 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) glm::mat4 orgTrans = glm::translate(glm::vec3(0.0, -1.0, 0.0)); glm::mat4 scale = glm::scale(xzScale, yScale, xzScale); //MoveModelf(trans, angle, scale); - m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); - m_Model = m_TranslationMatrix * extrude3D.rotation * scale * orgTrans; + glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); + m_Model = aTranslationMatrix * extrude3D.rotation * scale * orgTrans; } else { @@ -1134,8 +1133,8 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) glm::mat4 orgTrans = glm::translate(glm::vec3(0.0, -1.0, 0.0)); glm::mat4 topTrans = glm::translate(glm::vec3(0.0, actualYTrans, 0.0)); glm::mat4 topScale = glm::scale(xzScale, xzScale, xzScale); - m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); - m_Model = m_TranslationMatrix * extrude3D.rotation * topTrans * topScale * orgTrans; + glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z)); + m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale * orgTrans; } glm::mat3 normalMatrix(m_Model); glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix); |