diff options
Diffstat (limited to 'modules/webxr')
| -rw-r--r-- | modules/webxr/doc_classes/WebXRInterface.xml | 2 | ||||
| -rw-r--r-- | modules/webxr/native/library_godot_webxr.js | 7 | ||||
| -rw-r--r-- | modules/webxr/webxr_interface_js.cpp | 10 | ||||
| -rw-r--r-- | modules/webxr/webxr_interface_js.h | 1 |
4 files changed, 15 insertions, 5 deletions
diff --git a/modules/webxr/doc_classes/WebXRInterface.xml b/modules/webxr/doc_classes/WebXRInterface.xml index d7a2596abe..ed162b1da2 100644 --- a/modules/webxr/doc_classes/WebXRInterface.xml +++ b/modules/webxr/doc_classes/WebXRInterface.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="WebXRInterface" inherits="XRInterface" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> +<class name="WebXRInterface" inherits="XRInterface" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> XR interface using WebXR. </brief_description> diff --git a/modules/webxr/native/library_godot_webxr.js b/modules/webxr/native/library_godot_webxr.js index 7d797e11d9..fe47de02b0 100644 --- a/modules/webxr/native/library_godot_webxr.js +++ b/modules/webxr/native/library_godot_webxr.js @@ -589,12 +589,11 @@ const GodotWebXR = { } const buf = GodotRuntime.malloc(point_count * 3 * 4); - GodotRuntime.setHeapValue(buf, point_count, 'i32'); for (let i = 0; i < point_count; i++) { const point = GodotWebXR.space.boundsGeometry[i]; - GodotRuntime.setHeapValue(buf + ((i * 3) + 1) * 4, point.x, 'float'); - GodotRuntime.setHeapValue(buf + ((i * 3) + 2) * 4, point.y, 'float'); - GodotRuntime.setHeapValue(buf + ((i * 3) + 3) * 4, point.z, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 0) * 4, point.x, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 1) * 4, point.y, 'float'); + GodotRuntime.setHeapValue(buf + ((i * 3) + 2) * 4, point.z, 'float'); } GodotRuntime.setHeapValue(r_points, buf, 'i32'); diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 9c8b08cf04..e1df2ea94e 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -325,6 +325,16 @@ void WebXRInterfaceJS::uninitialize() { }; }; +Dictionary WebXRInterfaceJS::get_system_info() { + Dictionary dict; + + // TODO get actual information from WebXR to return here + dict[SNAME("XRRuntimeName")] = String("WebXR"); + dict[SNAME("XRRuntimeVersion")] = String(""); + + return dict; +} + Transform3D WebXRInterfaceJS::_js_matrix_to_transform(float *p_js_matrix) { Transform3D transform; diff --git a/modules/webxr/webxr_interface_js.h b/modules/webxr/webxr_interface_js.h index b9582eef89..d85eb8cad7 100644 --- a/modules/webxr/webxr_interface_js.h +++ b/modules/webxr/webxr_interface_js.h @@ -112,6 +112,7 @@ public: virtual bool is_initialized() const override; virtual bool initialize() override; virtual void uninitialize() override; + virtual Dictionary get_system_info() override; virtual Size2 get_render_target_size() override; virtual uint32_t get_view_count() override; |
