-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add meta scene capture api support (#53)
* Add support for the Meta scene capture API * Add Copyright notices. --------- Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
- Loading branch information
Showing
80 changed files
with
17,937 additions
and
20 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
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
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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
# Android Studio project files | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
|
||
# Visual Studio Code project files | ||
.vscode | ||
|
||
# Binaries | ||
*.o | ||
*.os | ||
*.so | ||
*.obj | ||
*.bc | ||
*.pyc | ||
*.dblite | ||
*.pdb | ||
*.lib | ||
|
||
# Misc | ||
.DS_Store |
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,3 @@ | ||
[submodule "thirdparty/godot-cpp"] | ||
path = thirdparty/godot-cpp | ||
url = https://github.com/godotengine/godot-cpp |
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
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
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
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
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,53 @@ | ||
#!/usr/bin/env python | ||
from glob import glob | ||
from pathlib import Path | ||
|
||
env = SConscript("thirdparty/godot-cpp/SConstruct") | ||
|
||
opts = Variables('custom.py') | ||
opts.Update(env) | ||
|
||
# Add source files. | ||
env.Append(CPPPATH=[ | ||
# Meta includes | ||
"godotopenxrmeta/src/main/cpp", | ||
"godotopenxrmeta/src/main/cpp/include", | ||
"godotopenxrmeta/libs/ovr_openxr_mobile_sdk/OpenXR/Include", | ||
# Common includes | ||
"thirdparty/openxr/include/", | ||
]) | ||
|
||
# Meta source files | ||
sources = Glob("godotopenxrmeta/src/main/cpp/*.cpp") | ||
|
||
meta_binary_path = 'demo/addons/godotopenxrvendors/meta/.bin' | ||
meta_project_name = 'godotopenxrmeta' | ||
|
||
# Create the library target | ||
if env["platform"] == "android": | ||
print("Use gradle to generate the Android binaries") | ||
Exit(255) | ||
elif env["platform"] == "macos": | ||
meta_library = env.SharedLibrary( | ||
"{0}/lib{1}.{2}.{3}.framework/{1}.{2}.{3}".format( | ||
meta_binary_path, | ||
meta_project_name, | ||
env["platform"], | ||
env["target"], | ||
), | ||
source=sources, | ||
) | ||
else: | ||
meta_library = env.SharedLibrary( | ||
"{}/lib{}.{}.{}.{}{}".format( | ||
meta_binary_path, | ||
meta_project_name, | ||
env["platform"], | ||
env["target"], | ||
env["arch"], | ||
env["SHLIBSUFFIX"], | ||
), | ||
source=sources, | ||
) | ||
|
||
Default(meta_library) |
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 @@ | ||
/build |
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,58 @@ | ||
cmake_minimum_required(VERSION 3.22.1) | ||
|
||
|
||
## Default configs | ||
# Default android abi is arm64-v8a | ||
if (NOT ANDROID_ABI) | ||
set(ANDROID_ABI "arm64-v8a") | ||
endif (NOT ANDROID_ABI) | ||
|
||
if (ANDROID_ABI STREQUAL "armeabi-v7a") | ||
set(GODOT_CPP_LIB_ABI "arm32") | ||
elseif (ANDROID_ABI STREQUAL "x86") | ||
set(GODOT_CPP_LIB_ABI "x86_32") | ||
elseif (ANDROID_ABI STREQUAL "x86_64") | ||
set(GODOT_CPP_LIB_ABI "x86_64") | ||
else () | ||
set(GODOT_CPP_LIB_ABI "arm64") | ||
endif () | ||
|
||
# Default build type is Debug | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
endif (NOT CMAKE_BUILD_TYPE) | ||
|
||
if (CMAKE_BUILD_TYPE MATCHES Debug) | ||
add_definitions(-D_DEBUG) | ||
set(GODOT_CPP_LIB_BUILD_TYPE debug) | ||
set(OPENXR_MOBILE_LIB_BUILD_TYPE Debug) | ||
else () | ||
add_definitions(-DNDEBUG) | ||
set(GODOT_CPP_LIB_BUILD_TYPE release) | ||
set(OPENXR_MOBILE_LIB_BUILD_TYPE Release) | ||
endif (CMAKE_BUILD_TYPE MATCHES Debug) | ||
|
||
|
||
project(common LANGUAGES CXX) | ||
|
||
## godot-cpp library | ||
set(GODOT_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/godot-cpp") | ||
set(GODOT-CPP "godot-cpp") | ||
|
||
# Use the godot-cpp prebuilt static binary | ||
set(GODOT_CPP_STATIC_LIB "${GODOT_CPP_DIR}/bin/libgodot-cpp.android.template_${GODOT_CPP_LIB_BUILD_TYPE}.${GODOT_CPP_LIB_ABI}.a") | ||
|
||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/include") | ||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/gen/include") | ||
list(APPEND GODOT_CPP_INCLUDE_DIRECTORIES "${GODOT_CPP_DIR}/gdextension") | ||
|
||
add_library(${GODOT-CPP} | ||
STATIC | ||
IMPORTED GLOBAL | ||
INTERFACE_INCLUDE_DIRECTORIES "${GODOT_CPP_INCLUDE_DIRECTORIES}" | ||
) | ||
set_target_properties(${GODOT-CPP} PROPERTIES IMPORTED_LOCATION ${GODOT_CPP_STATIC_LIB}) | ||
|
||
|
||
## OpenXR headers | ||
set(OPENXR_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/openxr/include") |
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,36 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
} | ||
|
||
android { | ||
namespace 'org.godotengine.openxr.vendors.common' | ||
compileSdk versions.compileSdk | ||
|
||
defaultConfig { | ||
minSdk versions.minSdk | ||
targetSdk versions.targetSdk | ||
} | ||
externalNativeBuild { | ||
cmake { | ||
path file('CMakeLists.txt') | ||
version versions.cmakeVersion | ||
} | ||
} | ||
|
||
packagingOptions { | ||
doNotStrip '**/*.so' | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility versions.javaVersion | ||
targetCompatibility versions.javaVersion | ||
} | ||
kotlinOptions { | ||
jvmTarget = versions.javaVersion | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "androidx.core:core-ktx:$versions.coreKtxVersion" | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
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
Oops, something went wrong.