diff options
author | marynate <mary.w.nate@gmail.com> | 2014-03-31 17:28:59 +0800 |
---|---|---|
committer | marynate <mary.w.nate@gmail.com> | 2014-04-01 00:53:19 +0800 |
commit | 145d069da0e394c4b685a16fe0392fdcf931df4e (patch) | |
tree | 6c5a20a6f0925bfd02d3b1129514124c297e92c0 | |
parent | 4dbf26cba26811878cafff6b54ec91cece792b92 (diff) |
Hold shift to speedup pan/zoom in maya navigation scheme
-rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 9bd9a5cff0..3b8a068cac 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -1340,12 +1340,17 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { switch(nav_mode) { case NAVIGATION_PAN:{ + real_t pan_speed = 1/150.0; + int pan_speed_modifier = 10; + if (nav_scheme==NAVIGATION_MAYA && m.mod.shift) + pan_speed *= pan_speed_modifier; + Transform camera_transform; camera_transform.translate(cursor.pos); camera_transform.basis.rotate(Vector3(0,1,0),cursor.y_rot); camera_transform.basis.rotate(Vector3(1,0,0),cursor.x_rot); - Vector3 translation(-m.relative_x/150.0,m.relative_y/150.0,0); + Vector3 translation(-m.relative_x*pan_speed,m.relative_y*pan_speed,0); translation*=cursor.distance/DISTANCE_DEFAULT; camera_transform.translate(translation); cursor.pos=camera_transform.origin; @@ -1353,11 +1358,15 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } break; case NAVIGATION_ZOOM: { + real_t zoom_speed = 1/80.0; + int zoom_speed_modifier = 10; + if (nav_scheme==NAVIGATION_MAYA && m.mod.shift) + zoom_speed *= zoom_speed_modifier; if ( m.relative_y > 0) - cursor.distance*=1+m.relative_y/80.0; + cursor.distance*=1+m.relative_y*zoom_speed; else if (m.relative_y < 0) - cursor.distance/=1-m.relative_y/80.0; + cursor.distance/=1-m.relative_y*zoom_speed; } break; |