Kaydet (Commit) 192b360c authored tarafından xukai's avatar xukai Kaydeden (comit) Kohei Yoshida

overloaded function GetDiffOfTwoCameras

Change-Id: Ic195c846364ddf9c798d019eed23c27200713017
Reviewed-on: https://gerrit.libreoffice.org/11589Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
Tested-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst 080bab41
...@@ -220,6 +220,10 @@ public: ...@@ -220,6 +220,10 @@ public:
glm::mat4 GetProjectionMatrix(); glm::mat4 GetProjectionMatrix();
glm::mat4 GetViewMatrix(); glm::mat4 GetViewMatrix();
glm::mat4 GetGlobalScaleMatrix(); 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: private:
void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale); void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale);
...@@ -282,9 +286,6 @@ private: ...@@ -282,9 +286,6 @@ private:
void SetHighLightBar(BatchBarInfo &barInfo); void SetHighLightBar(BatchBarInfo &barInfo);
void DisableHighLightBar(BatchBarInfo &barInfo); void DisableHighLightBar(BatchBarInfo &barInfo);
void CalcScrollMoveMatrix(bool bNewScene); 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: private:
struct ShaderResources struct ShaderResources
......
...@@ -2463,6 +2463,13 @@ glm::mat4 OpenGL3DRenderer::GetDiffOfTwoCameras(const glm::vec3& rBeginPos, cons ...@@ -2463,6 +2463,13 @@ glm::mat4 OpenGL3DRenderer::GetDiffOfTwoCameras(const glm::vec3& rBeginPos, cons
return aEnd - aBegin; 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() glm::mat4 OpenGL3DRenderer::GetProjectionMatrix()
{ {
return m_3DProjection; return m_3DProjection;
......
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