summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorxukai <xukai@multicorewareinc.com>2014-09-22 20:06:32 +0800
committerKohei Yoshida <libreoffice@kohei.us>2014-09-23 15:03:55 +0000
commit192b360cfb1bf422f282f4c93e7d0fc0fe83f7db (patch)
tree2d111f78f1e541de78ff3703d73cb53a6c52526a /chart2
parent080bab41b64d9531c9d2ae9e5125fd4876bca0bb (diff)
overloaded function GetDiffOfTwoCameras
Change-Id: Ic195c846364ddf9c798d019eed23c27200713017 Reviewed-on: https://gerrit.libreoffice.org/11589 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'chart2')
-rwxr-xr-x[-rw-r--r--]chart2/source/view/inc/GL3DRenderer.hxx7
-rwxr-xr-x[-rw-r--r--]chart2/source/view/main/GL3DRenderer.cxx7
2 files changed, 11 insertions, 3 deletions
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 655120c5259e..b4597a14b816 100644..100755
--- 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
index c3397a43e30c..6b0004fe4fbe 100644..100755
--- 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;