Code: Alles auswählen
void RenderWindow::mouseMoveEvent(QMouseEvent* event)
{
static QPoint LastPos;
Vector2f MouseDiff=Vector2f((event->pos()-LastPos).x(), (event->pos()-LastPos).y());
event->modifiers();
//
Mrl::Matrix *Mat=NULL;
if(event->modifiers() && Qt::ShiftModifier)
Mat=&m_CameraRotation;
else
Mat=&m_ModelRotation;
if(event->buttons() && Qt::LeftButton)
{
Mat->RotateMatrix(MouseDiff.x/100.0f, MouseDiff.y/100.0f, 0.f);
}
if(event->buttons() && Qt::RightButton)
{
Mat->RotateMatrix(0.0f, 0.0f, -MouseDiff.x/100.0f);
}
LastPos=event->pos();
updateGL();
}