-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proxy methods to access newly added apis from gdscript and jni.
- Loading branch information
Showing
8 changed files
with
388 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
android/src/main/java/org/godotengine/plugin/vr/openxr/api/FoveationLevel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.godotengine.plugin.vr.openxr.api | ||
|
||
/** | ||
* For reference, see https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrFoveationLevelFB | ||
*/ | ||
enum class FoveationLevel(internal val value: Int) { | ||
/** | ||
* No foveation | ||
*/ | ||
NONE(0), | ||
|
||
/** | ||
* Less foveation (higher periphery visual fidelity, lower performance) | ||
*/ | ||
LOW(1), | ||
|
||
/** | ||
* Medium foveation (medium periphery visual fidelity, medium performance) | ||
*/ | ||
MEDIUM(2), | ||
|
||
/** | ||
* High foveation (lower periphery visual fidelity, higher performance) | ||
*/ | ||
HIGH(3); | ||
|
||
companion object { | ||
fun toFoveationLevel(value: Int): FoveationLevel { | ||
for (level in values()) { | ||
if (level.value == value) { | ||
return level | ||
} | ||
} | ||
return NONE | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
android/src/main/java/org/godotengine/plugin/vr/openxr/api/PerformanceSettingsLevel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.godotengine.plugin.vr.openxr.api | ||
|
||
/** | ||
* For reference, see https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrPerfSettingsLevelEXT | ||
*/ | ||
enum class PerformanceSettingsLevel(internal val value: Int) { | ||
/** | ||
* Used by the application to indicate that it enters a non-XR section | ||
* (head-locked / static screen), during which power savings are to be prioritized. | ||
*/ | ||
POWER_SAVINGS(0), | ||
|
||
/** | ||
* Used by the application to indicate that it enters a low and stable complexity section, | ||
* during which reducing power is more important than occasional late rendering frames. | ||
*/ | ||
SUSTAINED_LOW(25), | ||
|
||
/** | ||
* Used by the application to indicate that it enters a high or dynamic complexity section, | ||
* during which the XR Runtime strives for consistent XR compositing and frame rendering within | ||
* a thermally sustainable range(*). | ||
* | ||
* This is the default if the application does not specify its performance level. | ||
*/ | ||
SUSTAINED_HIGH(50), | ||
|
||
/** | ||
* Used to indicate that the application enters a section with very high complexity, | ||
* during which the XR Runtime is allowed to step up beyond the thermally sustainable range. | ||
* | ||
* This is meant to be used for short-term durations (< 30 seconds). | ||
*/ | ||
BOOST(75); | ||
|
||
companion object { | ||
fun toPerformanceSettingsLevel(value: Int): PerformanceSettingsLevel { | ||
for (level in values()) { | ||
if (level.value == value) { | ||
return level | ||
} | ||
} | ||
|
||
return SUSTAINED_HIGH | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
android/src/main/java/org/godotengine/plugin/vr/openxr/api/SystemType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.godotengine.plugin.vr.openxr.api | ||
|
||
/** | ||
* Represents OpenXR systems. | ||
*/ | ||
enum class SystemType(internal val systemName: String) { | ||
UNKNOWN(""), | ||
OCULUS_QUEST("Oculus Quest"), // TODO: Validate device name | ||
OCULUS_QUEST2("Oculus Quest2"); // TODO: Validate device name | ||
|
||
companion object { | ||
fun toSystemType(value: String?): SystemType { | ||
if (value == null) { | ||
return UNKNOWN | ||
} | ||
|
||
for (systemType in values()) { | ||
if (systemType.systemName == value) { | ||
return systemType | ||
} | ||
} | ||
return UNKNOWN | ||
} | ||
} | ||
} |
Oops, something went wrong.