Fix support for environment blend modes on WebXRInterface

This commit is contained in:
David Snopek
2024-06-26 21:40:07 -05:00
parent 374807f427
commit 2f001e6789
5 changed files with 59 additions and 3 deletions

View File

@@ -322,9 +322,12 @@ const GodotWebXR = {
const reference_space_c_str = GodotRuntime.allocString(reference_space_type);
const enabled_features = 'enabledFeatures' in session ? Array.from(session.enabledFeatures) : [];
const enabled_features_c_str = GodotRuntime.allocString(enabled_features.join(','));
onstarted(reference_space_c_str, enabled_features_c_str);
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);
}

View File

@@ -82,6 +82,11 @@ XRSession.prototype.supportedFrameRates;
*/
XRSession.prototype.enabledFeatures;
/**
* @type {string}
*/
XRSession.prototype.environmentBlendMode;
/**
* @type {?function (Event)}
*/