GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
83 stars 17 forks source link

Add support for sharing and bulk saving (and sharing) of spatial anchors #128

Closed dsnopek closed 2 months ago

dsnopek commented 2 months ago

Builds on top of PR https://github.com/GodotVR/godot_openxr_vendors/pull/121 (marking this one as draft until that one is merged)

This PR adds support for sharing and bulk saving (and sharing) of developer-created spatial anchors.

I was able to fully test bulk saving, but only partially test sharing. To really test sharing would need a dedicated sample project, because it would require using Meta's Platform SDK as well as implement some kind of multiplayer networking. That's out of scope for the simple demo here.

SixArne commented 2 months ago

@dsnopek If you want I can write a demo project on this. I have been wanting these features and would gladly test these out!

---- Demo flow ----

Does this sound okay for a demo project?

Feel free to add more requirements to the demo :-)

dsnopek commented 2 months ago

If you want I can write a demo project on this. I have been wanting these features and would gladly test these out!

Thanks, that'd be really cool!

Regarding the demo flow: so, would you store and share anchors with everyone who has ever opened the app? I think we'd ideally only want the users who are physically in the same place to share anchors with each other, and we really don't need to store the anchors longer than the "game session". So, if we could have some kind of "session code" or something the players could both enter, and then the anchors are only shared among that group, and then the sessions could be cleaned up after some time.

SixArne commented 2 months ago

If you want I can write a demo project on this. I have been wanting these features and would gladly test these out!

Thanks, that'd be really cool!

Regarding the demo flow: so, would you store and share anchors with everyone who has ever opened the app? I think we'd ideally only want the users who are physically in the same place to share anchors with each other, and we really don't need to store the anchors longer than the "game session". So, if we could have some kind of "session code" or something the players could both enter, and then the anchors are only shared among that group, and then the sessions could be cleaned up after some time.

So, keep it session based so that the anchor uuid is not available when the session has been closed off. Do you expect full multiplayer or just 2 players entering a session code to send and retrieve anchor uuids based on the session?

I don't know if Godot has a relay for networking like Unity, so non-peer to peer might be hard to pull off as I still have to delve into Godot multiplayer.

PS: I tried to build the branch you made with the setup in the README.md but I ran into some issues:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':godotopenxrkhronos:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\GodotOpenSource\godot_openxr_vendors\godotopenxrkhronos\.cxx\Debug\2c5b28v6\arm64-v8a'
  [1/5] Building CXX object CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity_query.cpp.o
  [2/5] Building CXX object CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_scene_manager.cpp.o
  [3/5] Building CXX object CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity.cpp.o
  [4/5] Building CXX object CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o
  [5/5] Linking CXX shared library ..\..\..\..\build\intermediates\cxx\Debug\2c5b28v6\obj\arm64-v8a\libgodotopenxrvendors.so
  FAILED: ../../../../build/intermediates/cxx/Debug/2c5b28v6/obj/arm64-v8a/libgodotopenxrvendors.so
  cmd.exe /C "cd . && C:\Users\sixar\AppData\Local\Android\Sdk\ndk\23.2.8568313\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --gcc-toolchain=C:/Users/sixar/AppData/Local/Android/Sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/sixar/AppData/Local/Android/Sdk/ndk/23.2.8568313/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments   -Wl -shared -Wl,-soname,libgodotopenxrvendors.so -o ..\..\..\..\build\intermediates\cxx\Debug\2c5b28v6\obj\arm64-v8a\libgodotopenxrvendors.so CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_hand_tracking_mesh.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_passthrough_geometry.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_render_model.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_scene_manager.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity_query.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_meta_passthrough_color_lut.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/export/export_plugin.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/export/khronos_export_plugin.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/export/lynx_export_plugin.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/export/meta_export_plugin.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/export/pico_export_plugin.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_body_tracking_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/fa7c5edc4290f5902517ca4b076c991a/src/main/cpp/extensions/openxr_fb_composition_layer_secure_content_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_face_tracking_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_hand_tracking_aim_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/ac45f2af4304af6d396ddde662877119/common/src/main/cpp/extensions/openxr_fb_hand_tracking_capsules_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_hand_tracking_mesh_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_passthrough_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_render_model_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_scene_capture_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_scene_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/ac45f2af4304af6d396ddde662877119/common/src/main/cpp/extensions/openxr_fb_spatial_entity_container_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_spatial_entity_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_fb_spatial_entity_query_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/ac45f2af4304af6d396ddde662877119/common/src/main/cpp/extensions/openxr_fb_spatial_entity_storage_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/extensions/openxr_htc_facial_tracking_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/ac45f2af4304af6d396ddde662877119/common/src/main/cpp/extensions/openxr_meta_spatial_entity_mesh_extension_wrapper.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/util.cpp.o  -landroid  -llog  C:/GodotOpenSource/godot_openxr_vendors/common/../thirdparty/godot-cpp/bin/libgodot-cpp.android.template_debug.arm64.a  ../../../../../thirdparty/khronos_openxr_sdk/arm64-v8a/libopenxr_loader.so  -latomic -lm && cd ."
  ld: error: undefined symbol: OpenXRFbSpatialEntitySharingExtensionWrapper::get_singleton()
  >>> referenced by openxr_fb_spatial_entity.cpp:448 (C:/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes\openxr_fb_spatial_entity.cpp:448)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity.cpp.o:(godot::OpenXRFbSpatialEntity::share_with_users(godot::TypedArray<godot::OpenXRFbSpatialEntityUser> const&))
  >>> referenced by register_types.cpp:95 (C:/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp\register_types.cpp:95)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(initialize_plugin_module(godot::ModuleInitializationLevel))

  ld: error: undefined symbol: OpenXRFbSpatialEntitySharingExtensionWrapper::share_spaces(XrSpaceShareInfoFB const*, void (*)(XrResult, void*), void*)
  >>> referenced by openxr_fb_spatial_entity.cpp:448 (C:/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes\openxr_fb_spatial_entity.cpp:448)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/classes/openxr_fb_spatial_entity.cpp.o:(godot::OpenXRFbSpatialEntity::share_with_users(godot::TypedArray<godot::OpenXRFbSpatialEntityUser> const&))

  ld: error: undefined symbol: OpenXRFbSpatialEntityStorageBatchExtensionWrapper::get_singleton()
  >>> referenced by register_types.cpp:101 (C:/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp\register_types.cpp:101)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(initialize_plugin_module(godot::ModuleInitializationLevel))

  ld: error: undefined symbol: OpenXRFbSpatialEntityUserExtensionWrapper::get_singleton()
  >>> referenced by register_types.cpp:110 (C:/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp\register_types.cpp:110)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(initialize_plugin_module(godot::ModuleInitializationLevel))

  ld: error: undefined symbol: OpenXRFbSpatialEntitySharingExtensionWrapper::OpenXRFbSpatialEntitySharingExtensionWrapper()
  >>> referenced by class_db.hpp:118 (C:/GodotOpenSource/godot_openxr_vendors/common/../thirdparty/godot-cpp/include\godot_cpp/core\class_db.hpp:118)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(void* godot::ClassDB::_create_instance_func<OpenXRFbSpatialEntitySharingExtensionWrapper>(void*))

  ld: error: undefined symbol: OpenXRFbSpatialEntitySharingExtensionWrapper::_bind_methods()
  >>> referenced by openxr_fb_spatial_entity_sharing_extension_wrapper.h:42 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_sharing_extension_wrapper.h:42)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntitySharingExtensionWrapper::initialize_class())
  >>> referenced by openxr_fb_spatial_entity_sharing_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_sharing_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntitySharingExtensionWrapper::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_entity_sharing_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_sharing_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntitySharingExtensionWrapper::_get_bind_methods())

  ld: error: undefined symbol: OpenXRFbSpatialEntityStorageBatchExtensionWrapper::OpenXRFbSpatialEntityStorageBatchExtensionWrapper()
  >>> referenced by class_db.hpp:118 (C:/GodotOpenSource/godot_openxr_vendors/common/../thirdparty/godot-cpp/include\godot_cpp/core\class_db.hpp:118)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(void* godot::ClassDB::_create_instance_func<OpenXRFbSpatialEntityStorageBatchExtensionWrapper>(void*))

  ld: error: undefined symbol: OpenXRFbSpatialEntityStorageBatchExtensionWrapper::_bind_methods()
  >>> referenced by openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:42 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:42)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityStorageBatchExtensionWrapper::initialize_class())
  >>> referenced by openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityStorageBatchExtensionWrapper::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_storage_batch_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityStorageBatchExtensionWrapper::_get_bind_methods())

  ld: error: undefined symbol: OpenXRFbSpatialEntityUserExtensionWrapper::OpenXRFbSpatialEntityUserExtensionWrapper()
  >>> referenced by class_db.hpp:118 (C:/GodotOpenSource/godot_openxr_vendors/common/../thirdparty/godot-cpp/include\godot_cpp/core\class_db.hpp:118)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(void* godot::ClassDB::_create_instance_func<OpenXRFbSpatialEntityUserExtensionWrapper>(void*))

  ld: error: undefined symbol: OpenXRFbSpatialEntityUserExtensionWrapper::_bind_methods()
  >>> referenced by openxr_fb_spatial_entity_user_extension_wrapper.h:42 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_user_extension_wrapper.h:42)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityUserExtensionWrapper::initialize_class())
  >>> referenced by openxr_fb_spatial_entity_user_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_user_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityUserExtensionWrapper::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_entity_user_extension_wrapper.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\extensions\openxr_fb_spatial_entity_user_extension_wrapper.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(OpenXRFbSpatialEntityUserExtensionWrapper::_get_bind_methods())

  ld: error: undefined symbol: godot::OpenXRFbSpatialAnchorManager::_notification(int)
  >>> referenced by openxr_fb_spatial_anchor_manager.h:46 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:46)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::notification_bind(void*, int, unsigned char))
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::_get_notification())
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::_get_notification())

  ld: error: undefined symbol: godot::OpenXRFbSpatialAnchorManager::_bind_methods()
  >>> referenced by openxr_fb_spatial_anchor_manager.h:46 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:46)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::initialize_class())
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::_get_bind_methods())

  ld: error: undefined symbol: vtable for godot::OpenXRFbSpatialAnchorManager
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::OpenXRFbSpatialAnchorManager())
  >>> referenced by openxr_fb_spatial_anchor_manager.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_anchor_manager.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialAnchorManager::OpenXRFbSpatialAnchorManager())
  >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

  ld: error: undefined symbol: godot::OpenXRFbSpatialEntityBatch::_to_string() const
  >>> referenced by openxr_fb_spatial_entity_batch.h:41 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:41)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::to_string_bind(void*, unsigned char*, void*))
  >>> referenced by openxr_fb_spatial_entity_batch.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::_get_to_string())
  >>> referenced by openxr_fb_spatial_entity_batch.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::_get_to_string())

  ld: error: undefined symbol: godot::OpenXRFbSpatialEntityBatch::_bind_methods()
  >>> referenced by openxr_fb_spatial_entity_batch.h:41 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:41)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::initialize_class())
  >>> referenced by openxr_fb_spatial_entity_batch.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_entity_batch.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_batch.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityBatch::_get_bind_methods())

  ld: error: undefined symbol: godot::OpenXRFbSpatialEntityUser::_to_string() const
  >>> referenced by openxr_fb_spatial_entity_user.h:39 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:39)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::to_string_bind(void*, unsigned char*, void*))
  >>> referenced by openxr_fb_spatial_entity_user.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::_get_to_string())
  >>> referenced by openxr_fb_spatial_entity_user.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::_get_to_string())

  ld: error: undefined symbol: godot::OpenXRFbSpatialEntityUser::_bind_methods()
  >>> referenced by openxr_fb_spatial_entity_user.h:39 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:39)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::initialize_class())
  >>> referenced by openxr_fb_spatial_entity_user.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::_get_bind_methods())
  >>> referenced by openxr_fb_spatial_entity_user.h:0 (C:/GodotOpenSource/godot_openxr_vendors/common/../common/src/main/cpp/include\classes\openxr_fb_spatial_entity_user.h:0)
  >>>               CMakeFiles/godotopenxrvendors.dir/C_/GodotOpenSource/godot_openxr_vendors/common/src/main/cpp/register_types.cpp.o:(godot::OpenXRFbSpatialEntityUser::_get_bind_methods())
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\sixar\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\GodotOpenSource\\godot_openxr_vendors\\godotopenxrkhronos\\.cxx\\Debug\\2c5b28v6\\arm64-v8a" ^
        godotopenxrvendors
    from C:\GodotOpenSource\godot_openxr_vendors\godotopenxrkhronos

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 4m 28s
9 actionable tasks: 8 executed, 1 up-to-date
dsnopek commented 2 months ago

Do you expect full multiplayer or just 2 players entering a session code to send and retrieve anchor uuids based on the session?

I think just being able to spawn anchors in their shared environment is enough. The players will be in the same physical space, so they don't need avatars or anything else :-)

I don't know if Godot has a relay for networking like Unity, so non-peer to peer might be hard to pull off as I still have to delve into Godot multiplayer.

Peer-to-peer networking is possible via WebRTC. I think Meta has or had a relayed multiplayer service that was available via the Platform SDK, which could also be a possibility if that's still around?

Anyway, the multiplayer part is definitely one of the challenges of making a sample for this!

PS: I tried to build the branch you made with the setup in the README.md but I ran into some issues:

Try cleaning up some of the build artifacts:

rm -rf */.cxx */build

... and then rebuilding.

SixArne commented 2 months ago

Do you expect full multiplayer or just 2 players entering a session code to send and retrieve anchor uuids based on the session?

I think just being able to spawn anchors in their shared environment is enough. The players will be in the same physical space, so they don't need avatars or anything else :-)

I don't know if Godot has a relay for networking like Unity, so non-peer to peer might be hard to pull off as I still have to delve into Godot multiplayer.

Peer-to-peer networking is possible via WebRTC. I think Meta has or had a relayed multiplayer service that was available via the Platform SDK, which could also be a possibility if that's still around?

Anyway, the multiplayer part is definitely one of the challenges of making a sample for this!

PS: I tried to build the branch you made with the setup in the README.md but I ran into some issues:

Try cleaning up some of the build artifacts:

rm -rf */.cxx */build

... and then rebuilding.

I managed to build the plugin just fine this time! Thank you. Still a bit confused on where the output is and how the import process works for the plugin. Do I need godot 4.3 for this?

image

I Only see this and no other files (besides the hidden .bin directory). How would I drag in a node/use the plugin?

dsnopek commented 2 months ago

Do I need godot 4.3 for this?

At the moment, you need to use Godot's master branch, however, 4.3-dev6 should come out very soon (maybe even today!) which should work.

I Only see this and no other files (besides the hidden .bin directory). How would I drag in a node/use the plugin?

If the plugin has loaded correctly, you should be able to add any of the nodes defined in it just like you would add any native nodes, ie press Ctrl-A and find OpenXRFbSpatialAnchorManager on the list, for example.

Taking a look at the demo project would probably be a good way to get started. We don't have any documentation yet, although, that's also something we're hoping to fix soon. :-)

dsnopek commented 2 months ago

On Wed, May 1, 2024 at 3:13 AM Baka @.***> wrote:

I managed to get it to work but I do have some questions in regards to creating anchors and sharing/loading them:

func create_anchor(node: Node3D): spatial_anchor_manager.create_anchor(node.transform) // This returns void, and I don't see a way to get the created anchor to then share it.

image.png (view on web) https://github.com/GodotVR/godot_openxr_vendors/assets/67325807/fd192b69-f046-4d63-8303-32017c24b8aa

Take a look at the demo project - it creates anchors, uploads them to the cloud, and even has a commented out line that would share them with a given user.

Anyway, the short answer to your question is that almost everything with spatial anchors is done asynchronously (and sometimes in multiple steps) so you need to connect to signals to get the result of many actions. In this case, you'll want to connect to the openxr_fb_spatial_anchor_tracked signal. (I haven't rebased it yet, but the latest version of the PR this PR is built on now has an is_new argument on that signal, so you can tell the difference between created and loaded anchors.)

Message ID: @.***>

SixArne commented 2 months ago

On Wed, May 1, 2024 at 3:13 AM Baka @.> wrote: I managed to get it to work but I do have some questions in regards to creating anchors and sharing/loading them: func create_anchor(node: Node3D): spatial_anchor_manager.create_anchor(node.transform) // This returns void, and I don't see a way to get the created anchor to then share it. image.png (view on web) https://github.com/GodotVR/godot_openxr_vendors/assets/67325807/fd192b69-f046-4d63-8303-32017c24b8aa Take a look at the demo project - it creates anchors, uploads them to the cloud, and even has a commented out line that would share them with a given user. Anyway, the short answer to your question is that almost everything with spatial anchors is done asynchronously (and sometimes in multiple steps) so you need to connect to signals to get the result of many actions. In this case, you'll want to connect to the openxr_fb_spatial_anchor_tracked signal. (I haven't rebased it yet, but the latest version of the PR this PR is built on now has an is_new argument on that signal, so you can tell the difference between created and loaded anchors.) Message ID: @.>

Alrighty, thank you

I managed to set up some anchor creation and saving code already, is the PlatformSDK from meta already in this project? If not I will see if I can write some GDExtension for what I need

dsnopek commented 2 months ago

is the PlatformSDK from meta already in this project?

No, although, there is a community maintained integration here:

https://github.com/decacis/godot_oculus_platform

I suspect there will be an official one from Meta sometime in the near future :-)

SixArne commented 2 months ago

is the PlatformSDK from meta already in this project?

No, although, there is a community maintained integration here:

https://github.com/decacis/godot_oculus_platform

I suspect there will be an official one from Meta sometime in the near future :-)

Alrighty, I have just finished writing the logic for the PlatformSDK + Database in order to test the spatial anchors. Small issue: Godot 4.3 dev needs an android export template, and I have no clue on where to get those

devloglogan commented 2 months ago

Alrighty, I have just finished writing the logic for the PlatformSDK + Database in order to test the spatial anchors. Small issue: Godot 4.3 dev needs an android export template, and I have no clue on where to get those

I believe you'll need to create them yourself, this page in the docs is relevant. When testing things in the godot_openxr_vendors demo and needing to update the export templates, I have a script that does the following in my local godot repo:

scons platform=android target=template_debug arch=arm64
cd platform/android/java
./gradlew generateGodotTemplates

This creates android_source.zip in the bin directory. Then it takes the contents of that zip and then, now moving to the godot_openxr_vendors directory, pastes all of its contents in demo/android/build, overriding the other files there (not deleting .gdignore). Then in the file demo/android/.build_version, I'll set the version to 4.3.dev.

Hopefully that helps you out!

dsnopek commented 2 months ago

I believe you'll need to create them yourself

Actually, since Godot 4.3-dev6 was just released today, you should be able to use that rather than compiling Godot yourself:

https://godotengine.org/article/dev-snapshot-godot-4-3-dev-6/

SixArne commented 2 months ago

Alrighty, that will probably work out better than. Where can I post the demo project when it is done?

On Wed, May 1, 2024, 22:58 David Snopek @.***> wrote:

I believe you'll need to create them yourself

Actually, since Godot 4.3-dev6 was just released today, you should be able to use that rather than compiling Godot yourself:

https://godotengine.org/article/dev-snapshot-godot-4-3-dev-6/

— Reply to this email directly, view it on GitHub https://github.com/GodotVR/godot_openxr_vendors/pull/128#issuecomment-2089130463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBU633IR2M5OMPKJ6M6VYLZAFJQNAVCNFSM6AAAAABGTM2CSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZGEZTANBWGM . You are receiving this because you commented.Message ID: @.***>

SixArne commented 2 months ago

I will be working on this during my free time but I'll try to finish it by next sunday so the anchors can be tested properly.

On Wed, May 1, 2024, 23:06 Arne Six @.***> wrote:

Alrighty, that will probably work out better than. Where can I post the demo project when it is done?

On Wed, May 1, 2024, 22:58 David Snopek @.***> wrote:

I believe you'll need to create them yourself

Actually, since Godot 4.3-dev6 was just released today, you should be able to use that rather than compiling Godot yourself:

https://godotengine.org/article/dev-snapshot-godot-4-3-dev-6/

— Reply to this email directly, view it on GitHub https://github.com/GodotVR/godot_openxr_vendors/pull/128#issuecomment-2089130463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBU633IR2M5OMPKJ6M6VYLZAFJQNAVCNFSM6AAAAABGTM2CSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZGEZTANBWGM . You are receiving this because you commented.Message ID: @.***>

dsnopek commented 2 months ago

Where can I post the demo project when it is done?

Maybe you could make a new repo on GitHub?

I will be working on this during my free time but I'll try to finish it by next sunday so the anchors can be tested properly.

Wow, that's quite fast! But don't stress yourself out if you find out that you need some more time :-)

m4gr3d commented 2 months ago

https://github.com/GodotVR/godot_openxr_vendors/pull/121 was merged, so this PR can come out of draft!

dsnopek commented 2 months ago

Rebased and taken out of draft!