mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Display camera coordinates in the 3D viewport's information pane
This commit is contained in:
		
							parent
							
								
									ffe158ae85
								
							
						
					
					
						commit
						621a5457ed
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		|  | @ -2218,8 +2218,21 @@ void SpatialEditorViewport::_notification(int p_what) { | |||
| 		bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION)); | ||||
| 		info_label->set_visible(show_info); | ||||
| 
 | ||||
| 		Camera *current_camera; | ||||
| 
 | ||||
| 		if (previewing) { | ||||
| 			current_camera = previewing; | ||||
| 		} else { | ||||
| 			current_camera = camera; | ||||
| 		} | ||||
| 
 | ||||
| 		if (show_info) { | ||||
| 			String text; | ||||
| 			text += "X: " + rtos(current_camera->get_translation().x).pad_decimals(1) + "\n"; | ||||
| 			text += "Y: " + rtos(current_camera->get_translation().y).pad_decimals(1) + "\n"; | ||||
| 			text += "Z: " + rtos(current_camera->get_translation().z).pad_decimals(1) + "\n"; | ||||
| 			text += TTR("Pitch") + ": " + itos(Math::round(current_camera->get_rotation_degrees().x)) + "\n"; | ||||
| 			text += TTR("Yaw") + ": " + itos(Math::round(current_camera->get_rotation_degrees().y)) + "\n\n"; | ||||
| 			text += TTR("Objects Drawn") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_OBJECTS_IN_FRAME)) + "\n"; | ||||
| 			text += TTR("Material Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_MATERIAL_CHANGES_IN_FRAME)) + "\n"; | ||||
| 			text += TTR("Shader Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_SHADER_CHANGES_IN_FRAME)) + "\n"; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Hugo Locurcio
						Hugo Locurcio