summaryrefslogtreecommitdiff
path: root/servers/xr/xr_interface.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-03 06:24:30 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-03 06:24:30 +0100
commit8ef01ee5df5865191f17e9ea931e452754a02d94 (patch)
treebbd3e6e8141219623f30a391e0f82a74fe7da1a3 /servers/xr/xr_interface.cpp
parentd8c3fc1f563424283e89116e92a02b3d956b5eef (diff)
parentd7d171c45c31a53b06ea319928cf1434460f97cf (diff)
Merge pull request #72604 from rbessems/rbessems/env_blend_mode
Add XR Environment Blend Mode Support
Diffstat (limited to 'servers/xr/xr_interface.cpp')
-rw-r--r--servers/xr/xr_interface.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/servers/xr/xr_interface.cpp b/servers/xr/xr_interface.cpp
index 9968a47b0c..7f3d8668a4 100644
--- a/servers/xr/xr_interface.cpp
+++ b/servers/xr/xr_interface.cpp
@@ -75,6 +75,10 @@ void XRInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_transform_for_view", "view", "cam_transform"), &XRInterface::get_transform_for_view);
ClassDB::bind_method(D_METHOD("get_projection_for_view", "view", "aspect", "near", "far"), &XRInterface::get_projection_for_view);
+ /** environment blend mode. */
+ ClassDB::bind_method(D_METHOD("get_supported_environment_blend_modes"), &XRInterface::get_supported_environment_blend_modes);
+ ClassDB::bind_method(D_METHOD("set_environment_blend_mode", "mode"), &XRInterface::set_environment_blend_mode);
+
ADD_GROUP("AR", "ar_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ar_is_anchor_detection_enabled"), "set_anchor_detection_is_enabled", "get_anchor_detection_is_enabled");
@@ -97,6 +101,10 @@ void XRInterface::_bind_methods() {
BIND_ENUM_CONSTANT(XR_PLAY_AREA_SITTING);
BIND_ENUM_CONSTANT(XR_PLAY_AREA_ROOMSCALE);
BIND_ENUM_CONSTANT(XR_PLAY_AREA_STAGE);
+
+ BIND_ENUM_CONSTANT(XR_ENV_BLEND_MODE_OPAQUE);
+ BIND_ENUM_CONSTANT(XR_ENV_BLEND_MODE_ADDITIVE);
+ BIND_ENUM_CONSTANT(XR_ENV_BLEND_MODE_ALPHA_BLEND);
};
bool XRInterface::is_primary() {
@@ -273,3 +281,9 @@ XRInterface::TrackingStatus XRInterface::get_tracking_status() const {
void XRInterface::trigger_haptic_pulse(const String &p_action_name, const StringName &p_tracker_name, double p_frequency, double p_amplitude, double p_duration_sec, double p_delay_sec) {
}
+
+Array XRInterface::get_supported_environment_blend_modes() {
+ Array default_blend_modes;
+ default_blend_modes.push_back(XR_ENV_BLEND_MODE_OPAQUE);
+ return default_blend_modes;
+}