Commit 8021f98c authored by Pierre Kraemer's avatar Pierre Kraemer

selection follows map frame

parent e6b9e147
...@@ -132,8 +132,11 @@ void Surface_Selection_Plugin::mousePress(View* view, QMouseEvent* event) ...@@ -132,8 +132,11 @@ void Surface_Selection_Plugin::mousePress(View* view, QMouseEvent* event)
qglviewer::Vec dir; qglviewer::Vec dir;
view->camera()->convertClickToLine(pixel, orig, dir); view->camera()->convertClickToLine(pixel, orig, dir);
PFP2::VEC3 rayA(orig.x, orig.y, orig.z); qglviewer::Vec orig_inv = mh->getFrame()->coordinatesOf(orig);
PFP2::VEC3 AB(dir.x, dir.y, dir.z); qglviewer::Vec dir_inv = mh->getFrame()->transformOf(dir);
PFP2::VEC3 rayA(orig_inv.x, orig_inv.y, orig_inv.z);
PFP2::VEC3 AB(dir_inv.x, dir_inv.y, dir_inv.z);
Dart d; Dart d;
PFP2::MAP* map = static_cast<MapHandler<PFP2>*>(mh)->getMap(); PFP2::MAP* map = static_cast<MapHandler<PFP2>*>(mh)->getMap();
...@@ -182,8 +185,11 @@ void Surface_Selection_Plugin::mouseMove(View* view, QMouseEvent* event) ...@@ -182,8 +185,11 @@ void Surface_Selection_Plugin::mouseMove(View* view, QMouseEvent* event)
qglviewer::Vec dir; qglviewer::Vec dir;
view->camera()->convertClickToLine(pixel, orig, dir); view->camera()->convertClickToLine(pixel, orig, dir);
PFP2::VEC3 rayA(orig.x, orig.y, orig.z); qglviewer::Vec orig_inv = mh->getFrame()->coordinatesOf(orig);
PFP2::VEC3 AB(dir.x, dir.y, dir.z); qglviewer::Vec dir_inv = mh->getFrame()->transformOf(dir);
PFP2::VEC3 rayA(orig_inv.x, orig_inv.y, orig_inv.z);
PFP2::VEC3 AB(dir_inv.x, dir_inv.y, dir_inv.z);
Dart d; Dart d;
PFP2::MAP* map = static_cast<MapHandler<PFP2>*>(mh)->getMap(); PFP2::MAP* map = static_cast<MapHandler<PFP2>*>(mh)->getMap();
......
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