| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*  godot_webxr.h                                                         */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*                         This file is part of:                          */ | 
					
						
							|  |  |  | /*                             GODOT ENGINE                               */ | 
					
						
							|  |  |  | /*                        https://godotengine.org                         */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ | 
					
						
							|  |  |  | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining  */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the        */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including    */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,    */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to     */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to  */ | 
					
						
							|  |  |  | /* the following conditions:                                              */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be         */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.        */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-18 20:43:11 -06:00
										 |  |  | enum WebXRInputEvent { | 
					
						
							|  |  |  | 	WEBXR_INPUT_EVENT_SELECTSTART, | 
					
						
							|  |  |  | 	WEBXR_INPUT_EVENT_SELECTEND, | 
					
						
							|  |  |  | 	WEBXR_INPUT_EVENT_SQUEEZESTART, | 
					
						
							|  |  |  | 	WEBXR_INPUT_EVENT_SQUEEZEEND, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | typedef void (*GodotWebXRSupportedCallback)(char *p_session_mode, int p_supported); | 
					
						
							| 
									
										
										
										
											2024-06-26 21:40:07 -05:00
										 |  |  | typedef void (*GodotWebXRStartedCallback)(char *p_reference_space_type, char *p_enabled_features, char *p_environment_blend_mode); | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | typedef void (*GodotWebXREndedCallback)(); | 
					
						
							|  |  |  | typedef void (*GodotWebXRFailedCallback)(char *p_message); | 
					
						
							| 
									
										
										
										
											2022-11-18 20:43:11 -06:00
										 |  |  | typedef void (*GodotWebXRInputEventCallback)(int p_event_type, int p_input_source_id); | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | typedef void (*GodotWebXRSimpleEventCallback)(char *p_signal_name); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern int godot_webxr_is_supported(); | 
					
						
							|  |  |  | extern void godot_webxr_is_session_supported(const char *p_session_mode, GodotWebXRSupportedCallback p_callback); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern void godot_webxr_initialize( | 
					
						
							|  |  |  | 		const char *p_session_mode, | 
					
						
							|  |  |  | 		const char *p_required_features, | 
					
						
							|  |  |  | 		const char *p_optional_features, | 
					
						
							|  |  |  | 		const char *p_requested_reference_space_types, | 
					
						
							|  |  |  | 		GodotWebXRStartedCallback p_on_session_started, | 
					
						
							|  |  |  | 		GodotWebXREndedCallback p_on_session_ended, | 
					
						
							|  |  |  | 		GodotWebXRFailedCallback p_on_session_failed, | 
					
						
							|  |  |  | 		GodotWebXRInputEventCallback p_on_input_event, | 
					
						
							|  |  |  | 		GodotWebXRSimpleEventCallback p_on_simple_event); | 
					
						
							|  |  |  | extern void godot_webxr_uninitialize(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-25 08:35:26 -06:00
										 |  |  | extern int godot_webxr_get_view_count(); | 
					
						
							| 
									
										
										
										
											2022-11-18 20:43:11 -06:00
										 |  |  | extern bool godot_webxr_get_render_target_size(int *r_size); | 
					
						
							|  |  |  | extern bool godot_webxr_get_transform_for_view(int p_view, float *r_transform); | 
					
						
							|  |  |  | extern bool godot_webxr_get_projection_for_view(int p_view, float *r_transform); | 
					
						
							|  |  |  | extern unsigned int godot_webxr_get_color_texture(); | 
					
						
							|  |  |  | extern unsigned int godot_webxr_get_depth_texture(); | 
					
						
							|  |  |  | extern unsigned int godot_webxr_get_velocity_texture(); | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-18 20:43:11 -06:00
										 |  |  | extern bool godot_webxr_update_input_source( | 
					
						
							|  |  |  | 		int p_input_source_id, | 
					
						
							|  |  |  | 		float *r_target_pose, | 
					
						
							|  |  |  | 		int *r_target_ray_mode, | 
					
						
							|  |  |  | 		int *r_touch_index, | 
					
						
							|  |  |  | 		int *r_has_grip_pose, | 
					
						
							|  |  |  | 		float *r_grip_pose, | 
					
						
							|  |  |  | 		int *r_has_standard_mapping, | 
					
						
							|  |  |  | 		int *r_button_count, | 
					
						
							|  |  |  | 		float *r_buttons, | 
					
						
							|  |  |  | 		int *r_axes_count, | 
					
						
							| 
									
										
										
										
											2024-02-15 14:58:38 -06:00
										 |  |  | 		float *r_axes, | 
					
						
							|  |  |  | 		int *r_has_hand_data, | 
					
						
							|  |  |  | 		float *r_hand_joints, | 
					
						
							|  |  |  | 		float *r_hand_radii); | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | extern char *godot_webxr_get_visibility_state(); | 
					
						
							| 
									
										
										
										
											2022-11-18 20:43:11 -06:00
										 |  |  | extern int godot_webxr_get_bounds_geometry(float **r_points); | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-08 21:02:13 -06:00
										 |  |  | extern float godot_webxr_get_frame_rate(); | 
					
						
							|  |  |  | extern void godot_webxr_update_target_frame_rate(float p_frame_rate); | 
					
						
							|  |  |  | extern int godot_webxr_get_supported_frame_rates(float **r_frame_rates); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-26 17:15:21 -05:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 |