Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
f54eda12
Unverified
Commit
f54eda12
authored
Jun 05, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 05, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39304 from m4gr3d/enable_focus_awareness
Add support for focus awareness
parents
50cb781b
2bf1f8e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
export.cpp
platform/android/export/export.cpp
+32
-0
AndroidManifest.xml
platform/android/java/app/AndroidManifest.xml
+3
-0
No files found.
platform/android/export/export.cpp
View file @
f54eda12
...
...
@@ -772,6 +772,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
bool
screen_support_xlarge
=
p_preset
->
get
(
"screen/support_xlarge"
);
int
xr_mode_index
=
p_preset
->
get
(
"xr_features/xr_mode"
);
bool
focus_awareness
=
p_preset
->
get
(
"xr_features/focus_awareness"
);
String
plugins_names
=
get_plugins_names
(
get_enabled_plugins
(
p_preset
));
...
...
@@ -928,6 +929,11 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
}
if
(
tname
==
"meta-data"
&&
attrname
==
"value"
&&
value
==
"oculus_focus_aware_value"
)
{
// Update the focus awareness meta-data value
string_table
.
write
[
attr_value
]
=
xr_mode_index
==
/* XRMode.OVR */
1
&&
focus_awareness
?
"true"
:
"false"
;
}
if
(
tname
==
"meta-data"
&&
attrname
==
"value"
&&
value
==
"plugins_value"
&&
!
plugins_names
.
empty
())
{
// Update the meta-data 'android:value' attribute with the list of enabled plugins.
string_table
.
write
[
attr_value
]
=
plugins_names
;
...
...
@@ -1449,6 +1455,7 @@ public:
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
INT
,
"xr_features/xr_mode"
,
PROPERTY_HINT_ENUM
,
"Regular,Oculus Mobile VR"
),
0
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
INT
,
"xr_features/degrees_of_freedom"
,
PROPERTY_HINT_ENUM
,
"None,3DOF and 6DOF,6DOF"
),
0
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
INT
,
"xr_features/hand_tracking"
,
PROPERTY_HINT_ENUM
,
"None,Optional,Required"
),
0
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
BOOL
,
"xr_features/focus_awareness"
),
false
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
BOOL
,
"one_click_deploy/clear_previous_install"
),
false
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
STRING
,
"custom_template/debug"
,
PROPERTY_HINT_GLOBAL_FILE
,
"*.apk"
),
""
));
r_options
->
push_back
(
ExportOption
(
PropertyInfo
(
Variant
::
STRING
,
"custom_template/release"
,
PROPERTY_HINT_GLOBAL_FILE
,
"*.apk"
),
""
));
...
...
@@ -1848,6 +1855,31 @@ public:
err
+=
"
\n
"
;
}
// Validate the Xr features are properly populated
int
xr_mode_index
=
p_preset
->
get
(
"xr_features/xr_mode"
);
int
degrees_of_freedom
=
p_preset
->
get
(
"xr_features/degrees_of_freedom"
);
int
hand_tracking
=
p_preset
->
get
(
"xr_features/hand_tracking"
);
bool
focus_awareness
=
p_preset
->
get
(
"xr_features/focus_awareness"
);
if
(
xr_mode_index
!=
/* XRMode.OVR*/
1
)
{
if
(
degrees_of_freedom
>
0
)
{
valid
=
false
;
err
+=
TTR
(
"
\"
Degrees Of Freedom
\"
is only valid when
\"
Xr Mode
\"
is
\"
Oculus Mobile VR
\"
."
);
err
+=
"
\n
"
;
}
if
(
hand_tracking
>
0
)
{
valid
=
false
;
err
+=
TTR
(
"
\"
Hand Tracking
\"
is only valid when
\"
Xr Mode
\"
is
\"
Oculus Mobile VR
\"
."
);
err
+=
"
\n
"
;
}
if
(
focus_awareness
)
{
valid
=
false
;
err
+=
TTR
(
"
\"
Focus Awareness
\"
is only valid when
\"
Xr Mode
\"
is
\"
Oculus Mobile VR
\"
."
);
err
+=
"
\n
"
;
}
}
r_error
=
err
;
return
valid
;
}
...
...
platform/android/java/app/AndroidManifest.xml
View file @
f54eda12
...
...
@@ -45,6 +45,9 @@
android:resizeableActivity=
"false"
tools:ignore=
"UnusedAttribute"
>
<!-- Focus awareness metadata populated at export time if the user enables it in the 'Xr Features' section. -->
<meta-data
android:name=
"com.oculus.vr.focusaware"
android:value=
"oculus_focus_aware_value"
/>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment