You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Clean up the XR editor logic
- Coalesce common logic into the `main` flavor to avoid duplication - Code cleanup
This commit is contained in:
@@ -68,7 +68,7 @@ public interface GodotRenderView {
|
||||
* @return true if pointer capture is supported.
|
||||
*/
|
||||
default boolean canCapturePointer() {
|
||||
// Pointer capture is not supported on Horizon OS
|
||||
return !DeviceUtils.isHorizonOSDevice() && getInputHandler().canCapturePointer();
|
||||
// Pointer capture is not supported on native XR devices.
|
||||
return !DeviceUtils.isNativeXRDevice(getView().getContext()) && getInputHandler().canCapturePointer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,13 +35,14 @@
|
||||
|
||||
package org.godotengine.godot.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
|
||||
/**
|
||||
* Returns true if running on Meta Horizon OS.
|
||||
*/
|
||||
fun isHorizonOSDevice(): Boolean {
|
||||
return "Oculus".equals(Build.BRAND, true)
|
||||
fun isHorizonOSDevice(context: Context): Boolean {
|
||||
return context.packageManager.hasSystemFeature("oculus.hardware.standalone_vr")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,6 +55,6 @@ fun isPicoOSDevice(): Boolean {
|
||||
/**
|
||||
* Returns true if running on a native Android XR device.
|
||||
*/
|
||||
fun isNativeXRDevice(): Boolean {
|
||||
return isHorizonOSDevice() || isPicoOSDevice()
|
||||
fun isNativeXRDevice(context: Context): Boolean {
|
||||
return isHorizonOSDevice(context) || isPicoOSDevice()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user