Commit 84dbb3d7 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

bug in pickable & updatemtrices form GL

parent d90a7c09
...@@ -408,6 +408,8 @@ public: ...@@ -408,6 +408,8 @@ public:
static void pushTransfo() {s_current_matrices->pushTransfo();} static void pushTransfo() {s_current_matrices->pushTransfo();}
/// pop transformation matrix /// pop transformation matrix
static void popTransfo() {s_current_matrices->popTransfo();} static void popTransfo() {s_current_matrices->popTransfo();}
// apply a transformation given by its matrix
static void applyTransfo(const glm::mat4& m) { s_current_matrices->apply(m);}
}; };
......
...@@ -193,6 +193,11 @@ public: ...@@ -193,6 +193,11 @@ public:
*/ */
void draw(); void draw();
/**
* draw without applying transformation
*/
void drawNoTransfo();
/** /**
* return a ref on the transformation matrix * return a ref on the transformation matrix
*/ */
......
...@@ -1085,8 +1085,8 @@ void GLSLShader::updateAllFromGLMatrices() ...@@ -1085,8 +1085,8 @@ void GLSLShader::updateAllFromGLMatrices()
glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetDoublev( GL_PROJECTION_MATRIX, projection );
glm::mat4 model; glm::mat4& model = currentModelView();
glm::mat4 proj; glm::mat4& proj = currentProjection();
for (unsigned int i=0; i< 4; ++i) for (unsigned int i=0; i< 4; ++i)
{ {
......
...@@ -163,6 +163,12 @@ void Pickable::draw() ...@@ -163,6 +163,12 @@ void Pickable::draw()
Utils::GLSLShader::updateCurrentMatrices(); Utils::GLSLShader::updateCurrentMatrices();
} }
void Pickable::drawNoTransfo()
{
m_drawable->draw();
}
glm::mat4& Pickable::transfo() glm::mat4& Pickable::transfo()
{ {
......
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