| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#ifdef __cplusplus |
| 34 |
extern "C" { |
| 35 |
#endif |
| 36 |
|
| 37 |
enum WebXRInputEvent { |
| 38 |
WEBXR_INPUT_EVENT_SELECTSTART, |
| 39 |
WEBXR_INPUT_EVENT_SELECTEND, |
| 40 |
WEBXR_INPUT_EVENT_SQUEEZESTART, |
| 41 |
WEBXR_INPUT_EVENT_SQUEEZEEND, |
| 42 |
}; |
| 43 |
|
| 44 |
typedef void (*GodotWebXRSupportedCallback)(char *p_session_mode, int p_supported); |
| 45 |
typedef void (*GodotWebXRStartedCallback)(char *p_reference_space_type, char *p_enabled_features, char *p_environment_blend_mode); |
| 46 |
typedef void (*GodotWebXREndedCallback)(); |
| 47 |
typedef void (*GodotWebXRFailedCallback)(char *p_message); |
| 48 |
typedef void (*GodotWebXRInputEventCallback)(int p_event_type, int p_input_source_id); |
| 49 |
typedef void (*GodotWebXRSimpleEventCallback)(char *p_signal_name); |
| 50 |
|
| 51 |
extern int godot_webxr_is_supported(); |
| 52 |
extern void godot_webxr_is_session_supported(const char *p_session_mode, GodotWebXRSupportedCallback p_callback); |
| 53 |
|
| 54 |
extern void godot_webxr_initialize( |
| 55 |
const char *p_session_mode, |
| 56 |
const char *p_required_features, |
| 57 |
const char *p_optional_features, |
| 58 |
const char *p_requested_reference_space_types, |
| 59 |
GodotWebXRStartedCallback p_on_session_started, |
| 60 |
GodotWebXREndedCallback p_on_session_ended, |
| 61 |
GodotWebXRFailedCallback p_on_session_failed, |
| 62 |
GodotWebXRInputEventCallback p_on_input_event, |
| 63 |
GodotWebXRSimpleEventCallback p_on_simple_event); |
| 64 |
extern void godot_webxr_uninitialize(); |
| 65 |
|
| 66 |
extern int godot_webxr_get_view_count(); |
| 67 |
extern bool godot_webxr_get_render_target_size(int *r_size); |
| 68 |
extern bool godot_webxr_get_transform_for_view(int p_view, float *r_transform); |
| 69 |
extern bool godot_webxr_get_projection_for_view(int p_view, float *r_transform); |
| 70 |
extern unsigned int godot_webxr_get_color_texture(); |
| 71 |
extern unsigned int godot_webxr_get_depth_texture(); |
| 72 |
extern unsigned int godot_webxr_get_velocity_texture(); |
| 73 |
|
| 74 |
extern bool godot_webxr_update_input_source( |
| 75 |
int p_input_source_id, |
| 76 |
float *r_target_pose, |
| 77 |
int *r_target_ray_mode, |
| 78 |
int *r_touch_index, |
| 79 |
int *r_has_grip_pose, |
| 80 |
float *r_grip_pose, |
| 81 |
int *r_has_standard_mapping, |
| 82 |
int *r_button_count, |
| 83 |
float *r_buttons, |
| 84 |
int *r_axes_count, |
| 85 |
float *r_axes, |
| 86 |
int *r_has_hand_data, |
| 87 |
float *r_hand_joints, |
| 88 |
float *r_hand_radii); |
| 89 |
|
| 90 |
extern char *godot_webxr_get_visibility_state(); |
| 91 |
extern int godot_webxr_get_bounds_geometry(float **r_points); |
| 92 |
|
| 93 |
extern float godot_webxr_get_frame_rate(); |
| 94 |
extern void godot_webxr_update_target_frame_rate(float p_frame_rate); |
| 95 |
extern int godot_webxr_get_supported_frame_rates(float **r_frame_rates); |
| 96 |
|
| 97 |
#ifdef __cplusplus |
| 98 |
} |
| 99 |
#endif |