diff --git a/.github/workflows/scripts/clang_format.sh b/.github/workflows/scripts/clang_format.sh index f226577..1bc32ac 100644 --- a/.github/workflows/scripts/clang_format.sh +++ b/.github/workflows/scripts/clang_format.sh @@ -6,7 +6,7 @@ set -uo pipefail IFS=$'\n\t' -CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".glsl") +CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".kt" ".glsl") # Loops through all text files tracked by Git. git grep -zIl '' | diff --git a/README.md b/README.md index a94be0b..fcefc1d 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ## Usage -**Note:** [Android Studio](https://developer.android.com/studio) is the recommended IDE for -developing Godot Android plugins. +**Note:** [Android Studio](https://developer.android.com/studio) is the recommended IDE for +developing Godot Android plugins. You can install the latest version from https://developer.android.com/studio. -Clone the repository to your local machine, run the following command in the project root +Clone the repository to your local machine, run the following command in the project root directory to initialize the `godot-cpp` submodule: ``` git submodule update --init @@ -52,7 +52,7 @@ You can use the included [Godot demo project](plugin/demo/project.godot) to test - Open the demo in Godot (4.2 or higher) - Navigate to `Project` -> `Project Settings...` -> `Plugins`, and ensure the plugin is enabled - Install the Godot Android build template by clicking on `Project` -> `Install Android Build Template...` -- Open [`plugin/demo/main.gd`](plugin/demo/main.gd) and update the logic as needed to reference +- Open [`plugin/demo/main.gd`](plugin/demo/main.gd) and update the logic as needed to reference your plugin and its methods - Connect an Android device to your machine and run the demo on it @@ -81,7 +81,7 @@ scons platform=android target=template_release arch=x86_32 scons platform=android target=template_release arch=x86_64 ``` -When exporting the Godot app with the plugin enabled, don't forget to add the architectures to your build. +When exporting the Godot app with the plugin enabled, don't forget to add the architectures to your build. Open your project in the Godot Engine, navigate to `Project` -> `Export...` click on your Android Preset and under "Architectures" enable both `x86` and `x86_64` #### Tips @@ -118,13 +118,13 @@ func helloWorld(): ##### Support using the gdextension functionality in the Godot Editor -If planning to use the gdextension functionality in the Godot Editor, it is recommended that the -gdextension's native binaries are compiled not just for Android, but also for the OS onto which -developers / users intend to run the Godot Editor. Not doing so may prevent developers / +If planning to use the gdextension functionality in the Godot Editor, it is recommended that the +gdextension's native binaries are compiled not just for Android, but also for the OS onto which +developers / users intend to run the Godot Editor. Not doing so may prevent developers / users from writing code that accesses the plugin from within the Godot Editor. -This may involve creating dummy plugins for the host OS just so the API is published to the -editor. You can use the [godot-cpp-template](https://github.com/godotengine/godot-cpp-template) +This may involve creating dummy plugins for the host OS just so the API is published to the +editor. You can use the [godot-cpp-template](https://github.com/godotengine/godot-cpp-template) github template for reference on how to do so. ## Gotchas diff --git a/plugin/demo/main.gd b/plugin/demo/main.gd index 4cf1a86..613ed82 100644 --- a/plugin/demo/main.gd +++ b/plugin/demo/main.gd @@ -28,7 +28,7 @@ func _on_start_ar_button_pressed(): func get_tracking_state() -> String: var status = ARCoreInterfaceInstance.get_tracking_status() - + if status == XRInterface.XR_NOT_TRACKING: return "Not Tracking" elif status == XRInterface.XR_NORMAL_TRACKING: diff --git a/plugin/src/main/cpp/arcore_interface.cpp b/plugin/src/main/cpp/arcore_interface.cpp index 31360f4..674411e 100644 --- a/plugin/src/main/cpp/arcore_interface.cpp +++ b/plugin/src/main/cpp/arcore_interface.cpp @@ -55,7 +55,6 @@ bool ARCoreInterface::_initialize() { m_init_status = START_INITIALISE; if (m_ar_session == nullptr) { - // Get the android environment JNIEnv *env = ARCoreWrapper::get_env(); @@ -389,5 +388,4 @@ void ARCoreInterface::start() { } void ARCoreInterface::handleScreenOrientationChange() { - } diff --git a/plugin/src/main/java/org/godotengine/plugin/android/arcore/ARCorePlugin.kt b/plugin/src/main/java/org/godotengine/plugin/android/arcore/ARCorePlugin.kt index b01b1d4..f2d1c3d 100644 --- a/plugin/src/main/java/org/godotengine/plugin/android/arcore/ARCorePlugin.kt +++ b/plugin/src/main/java/org/godotengine/plugin/android/arcore/ARCorePlugin.kt @@ -28,7 +28,6 @@ import javax.microedition.khronos.egl.EGLConfig import javax.microedition.khronos.opengles.GL10 class ARCorePlugin(godot: Godot): GodotPlugin(godot) { - companion object { val TAG = ARCorePlugin::class.java.simpleName // TAG = "ARCorePlugin"