Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Support making hybrid apps for Pico headsets #246

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dsnopek
Copy link
Collaborator

@dsnopek dsnopek commented Jan 15, 2025

This builds on PR #245 to attempt to add hybrid app support for Pico headsets as well.

It almost works!

Switching from immersive to panel works fine. Switching from immersive to panel works-ish, but the panel is minimized, and you have to click it on the toolbar again for it to appear, but it will appear in a panel.

Marking as DRAFT until we can get it working a little better.

@dsnopek dsnopek added the enhancement New feature or request label Jan 15, 2025
@dsnopek dsnopek added this to the 4.x milestone Jan 15, 2025
@dsnopek dsnopek marked this pull request as draft January 15, 2025 22:55
@@ -59,9 +59,10 @@ func _process(_delta: float) -> void:
panel_switcher_layer.update_pointer(t.origin, -t.basis.z, pointer_pressed)

func _on_right_controller_pointer_button_pressed(p_name: String) -> void:
if p_name == 'trigger_click':
print("button: ", p_name)
if p_name == 'trigger_click' or p_name == 'select_button':
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's going on with this. I took a quick peek at the action map, and it seemed like I should be getting "trigger_click" for Pico 4 controllers, but instead I'm getting "select_button". Needs to be investigated more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be related to the issue mentioned in RC, where Pico defaults to a compat mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think it's the same thing, but I haven't had a chance to investigate further yet.

But we'll definitely want to have the action map working correctly before taking this out of draft.

@dsnopek
Copy link
Collaborator Author

dsnopek commented Jan 21, 2025

Rebased now that PR #245 has been merged

The diff is really quite small now!

Copy link
Collaborator

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -200,5 +205,25 @@ String PicoEditorExportPlugin::_get_android_manifest_application_element_content
contents += " <meta-data tools:node=\"replace\" android:name=\"Hand_Tracking_HighFrequency\" android:value=\"1\" />\n";
}

HybridType hybrid_type = _get_hybrid_app_setting_value();
if (hybrid_type != HYBRID_TYPE_DISABLED) {
contents += " <meta-data tools:node=\"replace\" android:name=\"pvr.app.type\" android:value=\"2d\" />\n";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this meta-data.. should its value be vr when we set the immersive activity as the default launcher?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might just control where the app is sorted in the library in headset. I need to experiment with that a bit.

But if that is correct, then, yeah, perhaps we should only set it when we start as panel, with the idea that the app is primarily a panel app.

@@ -245,3 +245,252 @@ pico_xr_features/face_tracking=0
pico_xr_features/hand_tracking=0
xr_features/enable_magicleap_plugin=false
magicleap_xr_features/hand_tracking=0
pico_xr_features/hybrid_app=0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover from previous logic

@@ -59,9 +59,10 @@ func _process(_delta: float) -> void:
panel_switcher_layer.update_pointer(t.origin, -t.basis.z, pointer_pressed)

func _on_right_controller_pointer_button_pressed(p_name: String) -> void:
if p_name == 'trigger_click':
print("button: ", p_name)
if p_name == 'trigger_click' or p_name == 'select_button':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be related to the issue mentioned in RC, where Pico defaults to a compat mode?

@m4gr3d m4gr3d mentioned this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants