-
Notifications
You must be signed in to change notification settings - Fork 38
/
OQ_UI2DVRSettings.gd
63 lines (43 loc) · 2.61 KB
/
OQ_UI2DVRSettings.gd
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
extends Spatial
var foveation_level_option_button : OptionButton = null;
var extra_latency_option_button : OptionButton = null;
var tracking_space_option_button : OptionButton = null;
var boundary_visible_check_button : CheckButton = null;
var ipd_info_label : Label = null;
func _setup_ui_elements():
var r = $OQ_UI2DCanvas;
foveation_level_option_button = r.find_node("FoveationLevel_OptionButton", true, false);
foveation_level_option_button.add_item("Off");
foveation_level_option_button.add_item("Low");
foveation_level_option_button.add_item("Medium");
foveation_level_option_button.add_item("High");
foveation_level_option_button.add_item("HighTop");
foveation_level_option_button.select(vr.oculus_mobile_settings_cache["foveation_level"]);
extra_latency_option_button = r.find_node("ExtraLatency_OptionButton", true, false);
extra_latency_option_button.add_item("Off");
extra_latency_option_button.add_item("On");
extra_latency_option_button.add_item("Dynamic");
extra_latency_option_button.select(vr.oculus_mobile_settings_cache["extra_latency_mode"]);
tracking_space_option_button = r.find_node("TrackingSpace_OptionButton", true, false);
tracking_space_option_button.add_item("LOCAL", vr.ovrVrApiTypes.OvrTrackingSpace.VRAPI_TRACKING_SPACE_LOCAL);
tracking_space_option_button.add_item("LOCAL_FLOOR", vr.ovrVrApiTypes.OvrTrackingSpace.VRAPI_TRACKING_SPACE_LOCAL_FLOOR);
tracking_space_option_button.add_item("LOCAL_TILTED", vr.ovrVrApiTypes.OvrTrackingSpace.VRAPI_TRACKING_SPACE_LOCAL_TILTED);
tracking_space_option_button.add_item("STAGE", vr.ovrVrApiTypes.OvrTrackingSpace.VRAPI_TRACKING_SPACE_STAGE);
tracking_space_option_button.add_item("LOCAL_FIXED_YAW", vr.ovrVrApiTypes.OvrTrackingSpace.VRAPI_TRACKING_SPACE_LOCAL_FIXED_YAW);
tracking_space_option_button.select(vr.oculus_mobile_settings_cache["tracking_space"]);
boundary_visible_check_button = r.find_node("BoundaryVisible_CheckButton", true, false);
boundary_visible_check_button.pressed = vr.oculus_mobile_settings_cache["boundary_visible"]
ipd_info_label = r.find_node("IPDInfo_Label", true, false);
func _ready():
_setup_ui_elements();
func _process(delta):
if (is_visible_in_tree() && vr.ovrUtilities):
ipd_info_label.set_text("Current IPD: %.1fmm" % (vr.get_ipd() * 1000.0));
func _on_FoveationLevel_OptionButton_item_selected(id):
vr.set_foveation_level(id);
func _on_ExtraLatency_OptionButton_item_selected(id):
vr.set_extra_latency_mode(id);
func _on_TrackingSpace_OptionButton_item_selected(id):
vr.set_tracking_space(id);
func _on_BoundaryVisible_CheckButton_toggled(button_pressed):
vr.request_boundary_visible(button_pressed);