fix collision detection
This commit is contained in:
parent
7e0554bf65
commit
0a6b133c19
@ -116,7 +116,7 @@ void DroneController::seek(int frame) {
|
|||||||
|
|
||||||
|
|
||||||
void DroneController::computeCollisions(double sphere_radius) {
|
void DroneController::computeCollisions(double sphere_radius) {
|
||||||
double sqDist = sphere_radius * sphere_radius * 2;
|
double sqDist = sphere_radius * sphere_radius * 4;
|
||||||
for (int i = 0; i < duration; i++) {
|
for (int i = 0; i < duration; i++) {
|
||||||
for (Drone &a : drones) {
|
for (Drone &a : drones) {
|
||||||
a.setTo(i);
|
a.setTo(i);
|
||||||
|
@ -92,8 +92,6 @@ void MainWindow::open(const QString &path) {
|
|||||||
settings_pane->setEnabled(true);
|
settings_pane->setEnabled(true);
|
||||||
|
|
||||||
glw.setPainter(dc);
|
glw.setPainter(dc);
|
||||||
|
|
||||||
dc->computeCollisions(.1);
|
|
||||||
pause();
|
pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
SettingsPane::SettingsPane(QWidget *parent)
|
SettingsPane::SettingsPane(QWidget *parent)
|
||||||
:QWidget(parent) {
|
:QWidget(parent) {
|
||||||
QDoubleSpinBox *sphere_radius = new QDoubleSpinBox();
|
QDoubleSpinBox *sphere_radius = new QDoubleSpinBox();
|
||||||
|
sphere_radius->setSingleStep(.1);
|
||||||
QCheckBox *show_trajectories = new QCheckBox();
|
QCheckBox *show_trajectories = new QCheckBox();
|
||||||
QCheckBox *show_support_lines = new QCheckBox();
|
QCheckBox *show_support_lines = new QCheckBox();
|
||||||
collisions = new QListWidget();
|
collisions = new QListWidget();
|
||||||
|
Loading…
Reference in New Issue
Block a user