chart2/source/view/inc/GL3DRenderer.hxx | 7 ++++--- chart2/source/view/main/GL3DRenderer.cxx | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-)
New commits: commit 192b360cfb1bf422f282f4c93e7d0fc0fe83f7db Author: xukai <xu...@multicorewareinc.com> Date: Mon Sep 22 20:06:32 2014 +0800 overloaded function GetDiffOfTwoCameras Change-Id: Ic195c846364ddf9c798d019eed23c27200713017 Reviewed-on: https://gerrit.libreoffice.org/11589 Reviewed-by: Kohei Yoshida <libreoff...@kohei.us> Tested-by: Kohei Yoshida <libreoff...@kohei.us> diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx old mode 100644 new mode 100755 index 655120c..b4597a1 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -220,6 +220,10 @@ public: glm::mat4 GetProjectionMatrix(); glm::mat4 GetViewMatrix(); glm::mat4 GetGlobalScaleMatrix(); + glm::mat4 GetDiffOfTwoCameras(const glm::vec3& rBeginPos, const glm::vec3& rEndPos, const glm::vec3& rBeginDirection, const glm::vec3& rEndDirection); + glm::mat4 GetDiffOfTwoCameras(const glm::vec3& rEndPos, const glm::vec3& rEndDirection); + void AddMatrixDiff(const glm::mat4& aMat); + void ResetMatrixDiff(); private: void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale); @@ -282,9 +286,6 @@ private: void SetHighLightBar(BatchBarInfo &barInfo); void DisableHighLightBar(BatchBarInfo &barInfo); void CalcScrollMoveMatrix(bool bNewScene); - glm::mat4 GetDiffOfTwoCameras(const glm::vec3& rBeginPos, const glm::vec3& rEndPos, const glm::vec3& rBeginDirection, const glm::vec3& rEndDirection); - void AddMatrixDiff(const glm::mat4& aMat); - void ResetMatrixDiff(); private: struct ShaderResources diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx old mode 100644 new mode 100755 index c3397a4..6b0004f --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -2463,6 +2463,13 @@ glm::mat4 OpenGL3DRenderer::GetDiffOfTwoCameras(const glm::vec3& rBeginPos, cons return aEnd - aBegin; } +glm::mat4 OpenGL3DRenderer::GetDiffOfTwoCameras(const glm::vec3& rEndPos, const glm::vec3& rEndDirection) +{ + glm::mat4 aEnd = glm::lookAt(glm::vec3(m_GlobalScaleMatrix * glm::vec4(rEndPos, 1.0)), + glm::vec3(m_GlobalScaleMatrix * glm::vec4(rEndDirection, 1.0)),glm::vec3(0, 0, 1)); + return aEnd - m_3DView; +} + glm::mat4 OpenGL3DRenderer::GetProjectionMatrix() { return m_3DProjection; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits