Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
OpenSpace
Commits
43e115d6
Commit
43e115d6
authored
6 years ago
by
Emil Axelsson
Committed by
Alexander Bock
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add shortcut to change focus interpolation time (#707)
Closes #707
parent
04846e3a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
include/openspace/interaction/navigationhandler.h
+2
-0
include/openspace/interaction/navigationhandler.h
include/openspace/interaction/orbitalnavigator.h
+2
-0
include/openspace/interaction/orbitalnavigator.h
modules/imgui/src/guispacetimecomponent.cpp
+13
-0
modules/imgui/src/guispacetimecomponent.cpp
src/interaction/navigationhandler.cpp
+8
-0
src/interaction/navigationhandler.cpp
src/interaction/orbitalnavigator.cpp
+8
-0
src/interaction/orbitalnavigator.cpp
with
33 additions
and
0 deletions
+33
-0
include/openspace/interaction/navigationhandler.h
+
2
-
0
View file @
43e115d6
...
...
@@ -58,6 +58,7 @@ public:
void
setFocusNode
(
SceneGraphNode
*
node
);
void
setCamera
(
Camera
*
camera
);
void
resetCameraDirection
();
void
setInterpolationTime
(
float
durationInSeconds
);
void
setCameraStateFromDictionary
(
const
ghoul
::
Dictionary
&
cameraDict
);
...
...
@@ -72,6 +73,7 @@ public:
const
InputState
&
inputState
()
const
;
const
OrbitalNavigator
&
orbitalNavigator
()
const
;
KeyframeNavigator
&
keyframeNavigator
()
const
;
float
interpolationTime
()
const
;
// Callback functions
void
keyboardCallback
(
Key
key
,
KeyModifier
modifier
,
KeyAction
action
);
...
...
This diff is collapsed.
Click to expand it.
include/openspace/interaction/orbitalnavigator.h
+
2
-
0
View file @
43e115d6
...
...
@@ -55,6 +55,8 @@ public:
void
setFocusNode
(
SceneGraphNode
*
focusNode
);
void
startInterpolateCameraDirection
(
const
Camera
&
camera
);
float
rotateToFocusInterpolationTime
()
const
;
void
setRotateToFocusInterpolationTime
(
float
durationInSeconds
);
JoystickCameraStates
&
joystickStates
();
...
...
This diff is collapsed.
Click to expand it.
modules/imgui/src/guispacetimecomponent.cpp
+
13
-
0
View file @
43e115d6
...
...
@@ -153,6 +153,19 @@ void GuiSpaceTimeComponent::render() {
);
}
float
interpolationTime
=
global
::
navigationHandler
.
interpolationTime
();
const
bool
interpolationTimeChanged
=
ImGui
::
SliderFloat
(
"Interpolation Time"
,
&
interpolationTime
,
0.
f
,
10.
f
,
"%.1f seconds"
);
if
(
interpolationTimeChanged
)
{
global
::
navigationHandler
.
setInterpolationTime
(
interpolationTime
);
}
ImGui
::
SetCursorPosY
(
ImGui
::
GetCursorPosY
()
+
20.
f
);
ImGui
::
Separator
();
...
...
This diff is collapsed.
Click to expand it.
src/interaction/navigationhandler.cpp
+
8
-
0
View file @
43e115d6
...
...
@@ -135,6 +135,14 @@ KeyframeNavigator& NavigationHandler::keyframeNavigator() const {
return
*
_keyframeNavigator
;
}
float
NavigationHandler
::
interpolationTime
()
const
{
return
_orbitalNavigator
->
rotateToFocusInterpolationTime
();
}
void
NavigationHandler
::
setInterpolationTime
(
float
durationInSeconds
)
{
_orbitalNavigator
->
setRotateToFocusInterpolationTime
(
durationInSeconds
);
}
void
NavigationHandler
::
updateCamera
(
double
deltaTime
)
{
ghoul_assert
(
_inputState
!=
nullptr
,
"InputState must not be nullptr"
);
ghoul_assert
(
_camera
!=
nullptr
,
"Camera must not be nullptr"
);
...
...
This diff is collapsed.
Click to expand it.
src/interaction/orbitalnavigator.cpp
+
8
-
0
View file @
43e115d6
...
...
@@ -404,6 +404,14 @@ void OrbitalNavigator::startInterpolateCameraDirection(const Camera& camera) {
_cameraToSurfaceDistanceInterpolator
.
start
();
}
float
OrbitalNavigator
::
rotateToFocusInterpolationTime
()
const
{
return
_rotateToFocusInterpolationTime
;
}
void
OrbitalNavigator
::
setRotateToFocusInterpolationTime
(
float
durationInSeconds
)
{
_rotateToFocusInterpolationTime
=
durationInSeconds
;
}
bool
OrbitalNavigator
::
followingNodeRotation
()
const
{
return
_followRotationInterpolator
.
value
()
>=
1.0
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help