Skip to content
Snippets Groups Projects
Commit 9d0682ea authored by Zain Selman's avatar Zain Selman :speech_balloon:
Browse files

additional cleanup

parent 7f582102
No related branches found
No related tags found
1 merge request!2Plane interaction
......@@ -182,16 +182,6 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
origPlane_ = curPlane_->plane();
QPoint position = _event->pos();
/// view coords in screenspace, with flipped y-axis at depth of
/// plane
const auto viewCoords = ACG::Vec3d(
position.x(),
PluginFunctions::viewerProperties().glState().context_height() -
position.y(),
.5);
viewStartCoord_ = viewCoords;
/// obtain the ray for intersecting with the quad/plane
ACG::Vec3d origin;
PluginFunctions::viewerProperties().glState().viewing_ray(
......@@ -284,7 +274,6 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
const auto xscale = scale[0] * plane.xDirection.length();
const auto yscale = scale[1] * plane.yDirection.length();
plane.setSize(xscale, yscale);
plane.position += worldSpaceUpdate;
curPlane_->plane() = plane; /// overwrite plane
......@@ -292,19 +281,17 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
if (lastObjId_ > 0)
emit updatedObject(lastObjId_, UPDATE_GEOMETRY);
else
std::cerr << "COULD NOT UPDATE OBJECT" << std::endl;
emit log(LOGERR, tr("COULD NOT UPDATE OBJECT"));
}
break;
}
case QEvent::MouseButtonRelease: {
std::cerr << "Mouse_Release" << std::endl;
// Stop dragging operation reset all properties
dragging_ = false;
pickedCorner_ = 0;
wMouseDownPosition_ = ACG::Vec3d{.0};
viewStartCoord_ = ACG::Vec3d{.0};
curPlane_ = nullptr;
lastObjId_ = -1;
......
......@@ -135,6 +135,7 @@ private:
QAction *planeNodeAction_;
/// additional information
// In Picking Mode for plane resize, are we currently dragging or not
bool dragging_;
......@@ -144,12 +145,12 @@ private:
// world space coords of the dragging start position (through raycast)
ACG::Vec3d wMouseDownPosition_{.0};
ACG::Vec3d wCurrMousePos_{.0};
// view space coords of the dragging start position
ACG::Vec3d viewStartCoord_{.0};
ACG::Vec3d viewDirection_{.0};
// currently dragged plane
PlaneObject *curPlane_ = nullptr;
// copy of the plane, to avoid getting lost in floating point error realm
Plane origPlane_;
// needed for notifying the renderer to draw the plane correctly
int lastObjId_ = -1;
/** @} */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment