mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-04 07:31:16 +00:00 
			
		
		
		
	Implement camera orbiting shortcuts.
Fixes godotengine/godot-proposals#2051. Relates to godotengine/godot-proposals#1215. Implements shortucts for adjusting the camera rotation in 15-degree increments, similar to Blender. I did not add corresponding menu entries for these, as I didn't feel like they would be too useful from a menu, and didn't want to make the menu too long.
This commit is contained in:
		
							parent
							
								
									dc6ed31675
								
							
						
					
					
						commit
						cb15ec20bb
					
				
					 1 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
					@ -2234,6 +2234,21 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
 | 
				
			||||||
		if (ED_IS_SHORTCUT("spatial_editor/right_view", p_event)) {
 | 
							if (ED_IS_SHORTCUT("spatial_editor/right_view", p_event)) {
 | 
				
			||||||
			_menu_option(VIEW_RIGHT);
 | 
								_menu_option(VIEW_RIGHT);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if (ED_IS_SHORTCUT("spatial_editor/orbit_view_down", p_event)) {
 | 
				
			||||||
 | 
								cursor.x_rot -= Math_PI / 12.0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (ED_IS_SHORTCUT("spatial_editor/orbit_view_up", p_event)) {
 | 
				
			||||||
 | 
								cursor.x_rot += Math_PI / 12.0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (ED_IS_SHORTCUT("spatial_editor/orbit_view_right", p_event)) {
 | 
				
			||||||
 | 
								cursor.y_rot -= Math_PI / 12.0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (ED_IS_SHORTCUT("spatial_editor/orbit_view_left", p_event)) {
 | 
				
			||||||
 | 
								cursor.y_rot += Math_PI / 12.0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (ED_IS_SHORTCUT("spatial_editor/orbit_view_180", p_event)) {
 | 
				
			||||||
 | 
								cursor.y_rot += Math_PI;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if (ED_IS_SHORTCUT("spatial_editor/focus_origin", p_event)) {
 | 
							if (ED_IS_SHORTCUT("spatial_editor/focus_origin", p_event)) {
 | 
				
			||||||
			_menu_option(VIEW_CENTER_TO_ORIGIN);
 | 
								_menu_option(VIEW_CENTER_TO_ORIGIN);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -7254,6 +7269,11 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/front_view", TTR("Front View"), KEY_KP_1);
 | 
						ED_SHORTCUT("spatial_editor/front_view", TTR("Front View"), KEY_KP_1);
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/left_view", TTR("Left View"), KEY_MASK_ALT + KEY_KP_3);
 | 
						ED_SHORTCUT("spatial_editor/left_view", TTR("Left View"), KEY_MASK_ALT + KEY_KP_3);
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/right_view", TTR("Right View"), KEY_KP_3);
 | 
						ED_SHORTCUT("spatial_editor/right_view", TTR("Right View"), KEY_KP_3);
 | 
				
			||||||
 | 
						ED_SHORTCUT("spatial_editor/orbit_view_down", TTR("Orbit View Down"), KEY_KP_2);
 | 
				
			||||||
 | 
						ED_SHORTCUT("spatial_editor/orbit_view_left", TTR("Orbit View Left"), KEY_KP_4);
 | 
				
			||||||
 | 
						ED_SHORTCUT("spatial_editor/orbit_view_right", TTR("Orbit View Right"), KEY_KP_6);
 | 
				
			||||||
 | 
						ED_SHORTCUT("spatial_editor/orbit_view_up", TTR("Orbit View Up"), KEY_KP_8);
 | 
				
			||||||
 | 
						ED_SHORTCUT("spatial_editor/orbit_view_180", TTR("Orbit View 180"), KEY_KP_9);
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/switch_perspective_orthogonal", TTR("Switch Perspective/Orthogonal View"), KEY_KP_5);
 | 
						ED_SHORTCUT("spatial_editor/switch_perspective_orthogonal", TTR("Switch Perspective/Orthogonal View"), KEY_KP_5);
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/insert_anim_key", TTR("Insert Animation Key"), KEY_K);
 | 
						ED_SHORTCUT("spatial_editor/insert_anim_key", TTR("Insert Animation Key"), KEY_K);
 | 
				
			||||||
	ED_SHORTCUT("spatial_editor/focus_origin", TTR("Focus Origin"), KEY_O);
 | 
						ED_SHORTCUT("spatial_editor/focus_origin", TTR("Focus Origin"), KEY_O);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue