Commit 11d64459 authored by Luis Peñaranda's avatar Luis Peñaranda

use mouse wheel to change fov

parent b9a7cf0f
......@@ -608,6 +608,13 @@ void OpenGLCanvas::mouseMoveEvent(QMouseEvent *event){
}
}
void OpenGLCanvas::wheelEvent(QWheelEvent *event){
if(event->orientation()==Qt::Vertical){
fov+=((double)event->delta())/60;
updateGL();
}
}
void OpenGLCanvas::paintGL(){
float fov_rads = (fov/180.f)*1.5708f;
......
......@@ -57,6 +57,7 @@ protected:
void setShaders();
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
signals:
void fps(QString newFPS);
......
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