mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 23:21:15 +00:00 
			
		
		
		
	Fix launching XR apps from the Android editor
This commit is contained in:
		
							parent
							
								
									4788f54d97
								
							
						
					
					
						commit
						30a63396e5
					
				
					 3 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
					@ -2947,9 +2947,6 @@
 | 
				
			||||||
		<member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false">
 | 
							<member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false">
 | 
				
			||||||
			If [code]true[/code], Godot will setup and initialize OpenXR on startup.
 | 
								If [code]true[/code], Godot will setup and initialize OpenXR on startup.
 | 
				
			||||||
		</member>
 | 
							</member>
 | 
				
			||||||
		<member name="xr/openxr/enabled.editor" type="bool" setter="" getter="" default="false">
 | 
					 | 
				
			||||||
			If [code]true[/code], Godot will setup and initialize OpenXR on editor startup.
 | 
					 | 
				
			||||||
		</member>
 | 
					 | 
				
			||||||
		<member name="xr/openxr/environment_blend_mode" type="int" setter="" getter="" default=""0"">
 | 
							<member name="xr/openxr/environment_blend_mode" type="int" setter="" getter="" default=""0"">
 | 
				
			||||||
			Specify how OpenXR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
 | 
								Specify how OpenXR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
 | 
				
			||||||
		</member>
 | 
							</member>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2550,7 +2550,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// XR project settings.
 | 
						// XR project settings.
 | 
				
			||||||
	GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false);
 | 
						GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false);
 | 
				
			||||||
	GLOBAL_DEF_RST_BASIC("xr/openxr/enabled.editor", false);
 | 
					 | 
				
			||||||
	GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "xr/openxr/default_action_map", PROPERTY_HINT_FILE, "*.tres"), "res://openxr_action_map.tres");
 | 
						GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "xr/openxr/default_action_map", PROPERTY_HINT_FILE, "*.tres"), "res://openxr_action_map.tres");
 | 
				
			||||||
	GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/form_factor", PROPERTY_HINT_ENUM, "Head Mounted,Handheld"), "0");
 | 
						GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/form_factor", PROPERTY_HINT_ENUM, "Head Mounted,Handheld"), "0");
 | 
				
			||||||
	GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/view_configuration", PROPERTY_HINT_ENUM, "Mono,Stereo"), "1"); // "Mono,Stereo,Quad,Observer"
 | 
						GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/view_configuration", PROPERTY_HINT_ENUM, "Mono,Stereo"), "1"); // "Mono,Stereo,Quad,Observer"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -273,7 +273,9 @@ Vector<OpenXRExtensionWrapper *> OpenXRAPI::registered_extension_wrappers;
 | 
				
			||||||
bool OpenXRAPI::openxr_is_enabled(bool p_check_run_in_editor) {
 | 
					bool OpenXRAPI::openxr_is_enabled(bool p_check_run_in_editor) {
 | 
				
			||||||
	if (XRServer::get_xr_mode() == XRServer::XRMODE_DEFAULT) {
 | 
						if (XRServer::get_xr_mode() == XRServer::XRMODE_DEFAULT) {
 | 
				
			||||||
		if (Engine::get_singleton()->is_editor_hint() && p_check_run_in_editor) {
 | 
							if (Engine::get_singleton()->is_editor_hint() && p_check_run_in_editor) {
 | 
				
			||||||
			return GLOBAL_GET("xr/openxr/enabled.editor");
 | 
								// For now, don't start OpenXR when the editor starts up. In the future, this may change
 | 
				
			||||||
 | 
								// if we want to integrate more XR features into the editor experience.
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			return GLOBAL_GET("xr/openxr/enabled");
 | 
								return GLOBAL_GET("xr/openxr/enabled");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue