From 861d505606d612bc328534dba3257e9ef9a1c269 Mon Sep 17 00:00:00 2001 From: ccolin Date: Sat, 2 Jan 2021 01:10:54 +0100 Subject: add basic collision detection --- src/main_window.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main_window.cc') diff --git a/src/main_window.cc b/src/main_window.cc index 7bc7855..e63bf0e 100644 --- a/src/main_window.cc +++ b/src/main_window.cc @@ -5,6 +5,7 @@ #include #include #include +#include MainWindow::MainWindow(QWidget *parent) { @@ -25,6 +26,12 @@ MainWindow::MainWindow(QWidget *parent) { slider = new QSlider(Qt::Horizontal); bottom_tb.addWidget(slider); slider->setEnabled(false); + + QDockWidget *dock = new QDockWidget("Outils", this); + dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + settings_pane = new SettingsPane(); + dock->setWidget(settings_pane); + addDockWidget(Qt::RightDockWidgetArea, dock); } @@ -65,6 +72,8 @@ void MainWindow::open(const QString &path) { connect(slider, &QSlider::sliderReleased, dc, &DroneController::resume); connect(slider, &QSlider::valueChanged, dc, &DroneController::seek); connect(dc, &DroneController::frameChanged, slider, &QSlider::setValue); + connect(dc, &DroneController::collision, settings_pane, &SettingsPane::addCollision); + dc->computeCollisions(10); pause(); slider->setEnabled(true); } -- cgit v1.2.3-70-g09d2