Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plugin-Plane
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenFlipper-Free
Plugin-Plane
Commits
7f582102
Commit
7f582102
authored
4 years ago
by
Zain Selman
Browse files
Options
Downloads
Patches
Plain Diff
refactors some variables and members
parent
54ebdf56
No related branches found
No related tags found
1 merge request
!2
Plane interaction
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
PlanePlugin.cc
+7
-7
7 additions, 7 deletions
PlanePlugin.cc
PlanePlugin.hh
+2
-2
2 additions, 2 deletions
PlanePlugin.hh
with
9 additions
and
9 deletions
PlanePlugin.cc
+
7
−
7
View file @
7f582102
...
...
@@ -211,7 +211,7 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
double
u
=
-
1
,
v
=
-
1
,
w
=
-
1
;
rayPlaneIntersection
(
origin
,
viewDirection_
,
p0
,
p1
,
p2
,
u
,
v
);
w
=
1
-
(
u
+
v
);
result
_
=
(
w
*
p0
)
+
(
u
*
p1
)
+
(
v
*
p2
);
wMouseDownPosition
_
=
(
w
*
p0
)
+
(
u
*
p1
)
+
(
v
*
p2
);
}
if
(
target_idx
==
0
)
...
...
@@ -265,17 +265,17 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
/// we dont really care about the result here
rayPlaneIntersection
(
origin
,
dir
,
p0
,
p1
,
p2
,
u
,
v
);
const
auto
w
=
1.
-
(
u
+
v
);
c
urr
World
Pos_
=
(
w
*
p0
)
+
(
u
*
p1
)
+
(
v
*
p2
);
wC
urr
Mouse
Pos_
=
(
w
*
p0
)
+
(
u
*
p1
)
+
(
v
*
p2
);
}
/// relative to plane
const
auto
c
urr
World
Pos
=
c
urr
World
Pos_
-
plane
.
position
;
const
auto
result
=
result
_
-
plane
.
position
;
const
auto
wC
urr
Mouse
Pos
=
wC
urr
Mouse
Pos_
-
plane
.
position
;
const
auto
wMouseDownPosition
=
wMouseDownPosition
_
-
plane
.
position
;
/// update vector in worldspace
const
auto
worldSpaceUpdate
=
(
c
urr
World
Pos
-
result
)
/
2.
;
const
auto
worldSpaceUpdate
=
(
wC
urr
Mouse
Pos
-
wMouseDownPosition
)
/
2.
;
const
auto
distClickOrigin
=
result
;
const
auto
distClickOrigin
=
wMouseDownPosition
;
/// scale by half updates length
auto
scale
=
(
worldSpaceUpdate
+
distClickOrigin
)
/
distClickOrigin
;
...
...
@@ -303,7 +303,7 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
// Stop dragging operation reset all properties
dragging_
=
false
;
pickedCorner_
=
0
;
result
_
=
ACG
::
Vec3d
{
.0
};
wMouseDownPosition
_
=
ACG
::
Vec3d
{
.0
};
viewStartCoord_
=
ACG
::
Vec3d
{
.0
};
curPlane_
=
nullptr
;
lastObjId_
=
-
1
;
...
...
This diff is collapsed.
Click to expand it.
PlanePlugin.hh
+
2
−
2
View file @
7f582102
...
...
@@ -142,8 +142,8 @@ private:
int
pickedCorner_
;
// world space coords of the dragging start position (through raycast)
ACG
::
Vec3d
result
_
{
.0
};
ACG
::
Vec3d
c
urr
World
Pos_
{
.0
};
ACG
::
Vec3d
wMouseDownPosition
_
{
.0
};
ACG
::
Vec3d
wC
urr
Mouse
Pos_
{
.0
};
// view space coords of the dragging start position
ACG
::
Vec3d
viewStartCoord_
{
.0
};
ACG
::
Vec3d
viewDirection_
{
.0
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment