[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - chart2/source
Tomáš Chvátal
tchvatal at suse.cz
Tue Jun 17 02:28:12 PDT 2014
chart2/source/view/charttypes/GL3DBarChart.cxx | 4 ++--
chart2/source/view/main/GL3DRenderer.cxx | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit bd5ebeb67a7f672bb88c5bee0ad983546401e49b
Author: Tomáš Chvátal <tchvatal at suse.cz>
Date: Tue Jun 17 11:25:17 2014 +0200
Allow building with more recent glm versions
Use glm::scale(glm::vec3(x, y, z)) instead of glm::scale(x, y, z)
Cherry-pick of: 7da3ce7cdb05bcced9ba61724e33d7a395e44e10
Change-Id: Ib9ad6b57cb6b74c8c43c9f6b48f312bfc499ffbe
Reviewed-on: https://gerrit.libreoffice.org/9808
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 036939e..6b7054e 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -121,8 +121,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
float nXPos = nIndex * (nBarSizeX + nBarDistanceX);
- glm::mat4 aScaleMatrix = glm::scale(nBarSizeX, nBarSizeY, nVal);
- glm::mat4 aTranslationMatrix = glm::translate(nXPos, nYPos, 0.0f);
+ glm::mat4 aScaleMatrix = glm::scale(glm::vec3(nBarSizeX, nBarSizeY, nVal));
+ glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(nXPos, nYPos, 0.0f));
glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix;
maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId++));
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 8c0b449..91c2298 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1003,7 +1003,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC
m_Extrude3DInfo.yScale = glm::length(DirY);
m_Extrude3DInfo.zScale = glm::length(DirZ);
glm::mat4 transformMatrixInverse = glm::inverse(glm::translate(glm::vec3(tranform)));
- glm::mat4 scaleMatrixInverse = glm::inverse(glm::scale(m_Extrude3DInfo.xScale, m_Extrude3DInfo.yScale, m_Extrude3DInfo.zScale * crossZ));
+ glm::mat4 scaleMatrixInverse = glm::inverse(glm::scale(glm::vec3(m_Extrude3DInfo.xScale, m_Extrude3DInfo.yScale, m_Extrude3DInfo.zScale * crossZ)));
m_Extrude3DInfo.rotation = transformMatrixInverse * modelMatrix * scaleMatrixInverse;
//color
m_Extrude3DInfo.extrudeColor = getColorAsVector(nColor);
@@ -1109,7 +1109,7 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D,
extrude3D.yTransform,
extrude3D.zTransform};
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
- glm::mat4 flatScale = glm::scale(xyScale, xyScale, xyScale);
+ glm::mat4 flatScale = glm::scale(glm::vec3(xyScale, xyScale, xyScale));
m_Model = aTranslationMatrix * extrude3D.rotation * flatScale;
if(!mbPickingMode)
{
@@ -1150,7 +1150,7 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D
else
{
glm::mat4 topTrans = glm::translate(glm::vec3(0.0, 0.0, -actualZTrans));
- glm::mat4 topScale = glm::scale(xyScale, xyScale, xyScale);
+ glm::mat4 topScale = glm::scale(glm::vec3(xyScale, xyScale, xyScale));
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale;
}
@@ -1189,7 +1189,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D
}
else
{
- glm::mat4 scale = glm::scale(xyScale, xyScale,actualZScale);
+ glm::mat4 scale = glm::scale(glm::vec3(xyScale, xyScale,actualZScale));
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * scale;
}
@@ -1231,7 +1231,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D)
//yScale /= (float)(1 + BOTTOM_THRESHOLD);
zScale /= (float)(m_RoundBarMesh.bottomThreshold);
glm::mat4 orgTrans = glm::translate(glm::vec3(0.0, 0.0, -1.0));
- glm::mat4 scale = glm::scale(xyScale, xyScale, zScale);
+ glm::mat4 scale = glm::scale(glm::vec3(xyScale, xyScale, zScale));
//MoveModelf(trans, angle, scale);
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * scale * orgTrans;
@@ -1241,7 +1241,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D)
// use different matrices for different parts
glm::mat4 orgTrans = glm::translate(glm::vec3(0.0, 0.0, -1.0));
glm::mat4 topTrans = glm::translate(glm::vec3(0.0, 0.0, actualZTrans));
- glm::mat4 topScale = glm::scale(xyScale, xyScale, xyScale);
+ glm::mat4 topScale = glm::scale(glm::vec3(xyScale, xyScale, xyScale));
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale * orgTrans;
}
@@ -1269,7 +1269,7 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D)
float yScale = extrude3D.yScale;
float zScale = extrude3D.zScale;
glm::mat4 transformMatrix = glm::translate(glm::vec3(extrude3D.xTransform, extrude3D.yTransform, extrude3D.zTransform));
- glm::mat4 scaleMatrix = glm::scale(xScale, yScale, zScale);
+ glm::mat4 scaleMatrix = glm::scale(glm::vec3(xScale, yScale, zScale));
m_Model = transformMatrix * extrude3D.rotation * scaleMatrix;
if (extrude3D.reverse)
{
More information about the Libreoffice-commits
mailing list