Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
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
Ruiliang Gao
iMSTK
Commits
2e0dd710
Commit
2e0dd710
authored
8 years ago
by
Alexis Girault
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Correct controller invert flags
was mirroring axis, not inverting rotations
parent
d16a8208
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Base/Scene/Controllers/imstkTrackingController.cpp
+3
-3
3 additions, 3 deletions
Base/Scene/Controllers/imstkTrackingController.cpp
Examples/Sandbox/main.cpp
+4
-1
4 additions, 1 deletion
Examples/Sandbox/main.cpp
with
7 additions
and
4 deletions
Base/Scene/Controllers/imstkTrackingController.cpp
+
3
−
3
View file @
2e0dd710
...
...
@@ -44,9 +44,9 @@ TrackingController::computeTrackingData(Vec3d& p, Quatd& r)
if
(
m_invertFlags
&
InvertFlag
::
transX
)
p
[
0
]
=
-
p
[
0
];
if
(
m_invertFlags
&
InvertFlag
::
transY
)
p
[
1
]
=
-
p
[
1
];
if
(
m_invertFlags
&
InvertFlag
::
transZ
)
p
[
2
]
=
-
p
[
2
];
if
(
m_invertFlags
&
InvertFlag
::
rotX
)
std
::
swap
(
r
.
y
()
,
r
.
z
()
);
if
(
m_invertFlags
&
InvertFlag
::
rotY
)
std
::
swap
(
r
.
x
()
,
r
.
z
()
);
if
(
m_invertFlags
&
InvertFlag
::
rotZ
)
std
::
swap
(
r
.
x
()
,
r
.
y
()
);
if
(
m_invertFlags
&
InvertFlag
::
rotX
)
r
.
x
()
=
-
r
.
x
(
);
if
(
m_invertFlags
&
InvertFlag
::
rotY
)
r
.
y
()
=
-
r
.
y
(
);
if
(
m_invertFlags
&
InvertFlag
::
rotZ
)
r
.
z
()
=
-
r
.
z
(
);
// Apply Offsets
p
=
m_rotationOffset
*
p
*
m_scaling
+
m_translationOffset
;
...
...
This diff is collapsed.
Click to expand it.
Examples/Sandbox/main.cpp
+
4
−
1
View file @
2e0dd710
...
...
@@ -123,6 +123,8 @@ void testTwoFalcons()
cam
->
setPosition
(
imstk
::
Vec3d
(
0
,
18
,
20
));
cam
->
setFocalPoint
(
imstk
::
UP_VECTOR
*
18
);
cam
->
setupController
(
hdk
);
cam
->
getController
()
->
setInversionFlags
(
imstk
::
CameraController
::
InvertFlag
::
rotY
|
imstk
::
CameraController
::
InvertFlag
::
rotZ
);
// Run
sdk
->
setCurrentScene
(
"FalconsTestScene"
);
...
...
@@ -199,7 +201,8 @@ void testCameraController()
// Set camera controller
cam
->
setupController
(
client
,
100
);
//LOG(INFO) << cam->getController()->getTranslationOffset(); // should be the same than initial cam position
//cam->getController()->setInversionFlags( (imstk::CameraController::InvertFlag::transX | imstk::CameraController::InvertFlag::transY) );
cam
->
getController
()
->
setInversionFlags
(
imstk
::
CameraController
::
InvertFlag
::
rotY
|
imstk
::
CameraController
::
InvertFlag
::
rotZ
);
// Run
sdk
->
setCurrentScene
(
"SceneTestDevice"
);
...
...
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