diff options
Diffstat (limited to 'modules/webxr/native/library_godot_webxr.js')
-rw-r--r-- | modules/webxr/native/library_godot_webxr.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/webxr/native/library_godot_webxr.js b/modules/webxr/native/library_godot_webxr.js index 031530a047..155409f931 100644 --- a/modules/webxr/native/library_godot_webxr.js +++ b/modules/webxr/native/library_godot_webxr.js @@ -320,10 +320,14 @@ const GodotWebXR = { // next reference space. window.setTimeout(function () { const reference_space_c_str = GodotRuntime.allocString(reference_space_type); - const enabled_features_c_str = GodotRuntime.allocString(Array.from(session.enabledFeatures).join(',')); - onstarted(reference_space_c_str, enabled_features_c_str); + const enabled_features = 'enabledFeatures' in session ? Array.from(session.enabledFeatures) : []; + const enabled_features_c_str = GodotRuntime.allocString(enabled_features.join(',')); + const environment_blend_mode = 'environmentBlendMode' in session ? session.environmentBlendMode : ''; + const environment_blend_mode_c_str = GodotRuntime.allocString(environment_blend_mode); + onstarted(reference_space_c_str, enabled_features_c_str, environment_blend_mode_c_str); GodotRuntime.free(reference_space_c_str); GodotRuntime.free(enabled_features_c_str); + GodotRuntime.free(environment_blend_mode_c_str); }, 0); } |