Commit 1df7cd5b authored by Frédéric Larue's avatar Frédéric Larue

Minor bugs fixed in the management of transform.

parent bac91c72
......@@ -985,15 +985,11 @@ void GLViewer::paintGL()
for( DisplayableList::iterator dinfo=dlist->second.begin(); dinfo!=dlist->second.end(); ++dinfo )
if( !m_Frustum.IsOutside( (*dinfo)->boundingBox, (*dinfo)->GetTransform() ) )
{
glPushMatrix();
glMultMatrixf( (*dinfo)->GetTransform().data() );
glPushAttrib( GL_ALL_ATTRIB_BITS );
(*dinfo)->displayable->onDisplay( *(*dinfo)->displayable->getSource()->GetDisplayOptions() );
//displayLabel( (*dinfo)->displayable );
if( (*dinfo)->currentSelectionMgr )
(*dinfo)->currentSelectionMgr->onDisplay( this, (*dinfo)->GetTransform() );
glPopAttrib();
glPopMatrix();
}
......
......@@ -69,10 +69,7 @@ void GLViewer::NavigationControl::mouseMoveEvent( double dx, double dy, QMouseEv
double scaledDX = dx * scaleFactor;
double scaledDY = dy * scaleFactor;
QVector3D fpoint = v.focusPoint();
fpoint[0] += scaledDY*v.viewRotationMatrix()(1,0) - scaledDX*v.viewRotationMatrix()(0,0);
fpoint[1] += scaledDY*v.viewRotationMatrix()(1,1) - scaledDX*v.viewRotationMatrix()(0,1);
fpoint[2] += scaledDY*v.viewRotationMatrix()(1,2) - scaledDX*v.viewRotationMatrix()(0,2);
QVector3D fpoint = v.focusPoint() + scaledDY*v.viewRotationMatrix().row(1).toVector3D() - scaledDX*v.viewRotationMatrix().row(0).toVector3D();
v.setFocusPoint( fpoint );
v.emitScreenSpaceTranslation( QVector2D(-scaledDX,scaledDY) );
......
......@@ -156,6 +156,10 @@ void SelectionManagerImageTexels::onDisplay( GLViewer *viewer,
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
glMultMatrixf( localTransfo.data() );
for( auto t=m_Tiles.begin(); t!=m_Tiles.end(); ++t )
{
if( t->tex.IsInstantiated() )
......@@ -175,6 +179,8 @@ void SelectionManagerImageTexels::onDisplay( GLViewer *viewer,
}
}
glPopMatrix();
glDisable( GL_BLEND );
m_DisplayShader.Unbind();
......
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