bump the senseglove unreal engine plugin to v2.7.0
This commit is contained in:
@@ -38,6 +38,8 @@ Resources/**/* filter=lfs diff=lfs merge=lfs -text
|
|||||||
|
|
||||||
# LFS: everything under Source/ThirdParty/
|
# LFS: everything under Source/ThirdParty/
|
||||||
Source/ThirdParty/**/* filter=lfs diff=lfs merge=lfs -text
|
Source/ThirdParty/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
# Except
|
||||||
|
Source/ThirdParty/**/*.Build.cs filter= diff= merge= text
|
||||||
|
|
||||||
# LFS: everything under Handbook/dist/
|
# LFS: everything under Handbook/dist/
|
||||||
Handbook/dist/**/* filter=lfs diff=lfs merge=lfs -text
|
Handbook/dist/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ Welcom to the SenseGlove Unreal Engine Handbook!
|
|||||||
- [SenseGlove SDK License](license/senseglove-sdk.md)
|
- [SenseGlove SDK License](license/senseglove-sdk.md)
|
||||||
- [SGBLE and SGBLExx Rust Dependencies Licenses](license/sgble-sgblexx-rust-dependencies.md)
|
- [SGBLE and SGBLExx Rust Dependencies Licenses](license/sgble-sgblexx-rust-dependencies.md)
|
||||||
- [Boost C++ Libraries License](license/boost-cpp-libraries.md)
|
- [Boost C++ Libraries License](license/boost-cpp-libraries.md)
|
||||||
|
- [{fmt} Formatting Library License](license/fmt-formatting-library.md)
|
||||||
|
- [Loguru Logging Library License](license/loguru-loggin-library.md)
|
||||||
- [Serial Communication Library License](license/serial-communication-library.md)
|
- [Serial Communication Library License](license/serial-communication-library.md)
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
|
|||||||
@@ -5,6 +5,84 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.7.0] - 2025-11-18
|
||||||
|
|
||||||
|
This minor release focuses on delivering performance improvements, made possible by major optimizations in the underlying proprietary SenseGlove libraries, while also introducing some breaking changes.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added support for UE `5.7`.
|
||||||
|
- Added support for Android NDK `r27c`, which is the recommend Android SDK since UE `5.6.1` and the default for UE `5.7+` for Android Standalone builds.
|
||||||
|
- Added support for Epic Cross and Native Toolchains `v26`, which is shipped with the UE `5.7` and GNU/Linux support.
|
||||||
|
- Added prebuilt binaries for third-party library [{fmt} Formatting Library](https://github.com/fmtlib/fmt) on all supported platforms. This third-party library is a required dependency of SenseGlove libraries >= `v2.300.0`.
|
||||||
|
- Added prebuilt binaries for third-party library: [Loguru Logging Library](https://github.com/emilk/loguru) on all supported platforms. This third-party library is a required dependency of SenseGlove libraries >= `v2.300.0`.
|
||||||
|
- Added third-party module `SGCommonThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGConnectShmThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGCoreShmThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGCoreThirdPartyHeaders`.
|
||||||
|
- Added third-party module `SGFmtThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGLogThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGLoguruThirdPartyLibs`.
|
||||||
|
- Added third-party module `SGWjwwoodSerialThirdPartyLibs` to replace `SGSerialThirdPartyLibs` while retaining `SGSerialThirdPartyLibs` for a different purpose. See the relevant comment in the Changed section below.
|
||||||
|
- Added UPROPERTY `USGTouchComponent::VibrotactileAmplitude`.
|
||||||
|
- Added UPROPERTY `USGTouchComponent::VibrotactileFrequency`.
|
||||||
|
- Added method `USGTouchComponent::GetVibrotactileAmplitude()`.
|
||||||
|
- Added method `USGTouchComponent::SetVibrotactileAmplitude()`.
|
||||||
|
- Added method `USGTouchComponent::GetVibrotactileFrequency()`.
|
||||||
|
- Added method `USGTouchComponent::SetVibrotactileFrequency()`.
|
||||||
|
- Added Blueprint-accessible method `USGTouchComponentKismetLibrary::GetVibrotactileAmplitude()`.
|
||||||
|
- Added Blueprint-accessible method `USGTouchComponentKismetLibrary::SetVibrotactileAmplitude()`.
|
||||||
|
- Added Blueprint-accessible method `USGTouchComponentKismetLibrary::GetVibrotactileFrequency()`.
|
||||||
|
- Added Blueprint-accessible method `USGTouchComponentKismetLibrary::SetVibrotactileFrequency()`.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix a typo in the function name `SGDeviceList::SenseCommRunning()`. This fix breaks ABI and API compatibility with previous versions of the plugin and affects both C++ and Blueprint code.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `SGDeviceList::SenseCommRunning()` has been renamed to `SGDeviceList::SenseComRunning()` due to a typo. This change breaks ABI and API compatibility with previous versions of the plugin and affects both C++ and Blueprint code.
|
||||||
|
- Bumped the SenseGlove libraries to `v2.305.3-17a820b6e`. This release of the SenseGlove libraries disables RTTI/Exceptions for the most parts and isolates it to a minor portion of the code base, which yields noticable performance gains. Futhermore, some optiomizations are done in the multi-threaded code, such as replacing Spinlocks with Adaptive Mutexes (a hybrid Mutex/Spinlock).
|
||||||
|
- As a result of SenseGlove libraries >= `v2.300.0` changing it's directory structure, the `ThirdParty` folder's directory structure has been revamped.
|
||||||
|
- Renamed third-party module `SGSerialThirdPartyLibs` to `SGWjwwoodSerialThirdPartyLibs` since SenseGlove libraries >= `v2.300.0` ships a new static library named `sgserial`. Thus, to avoid confusion and naming conflicts the third-party `serial` static library is now provided by the `SGWjwwoodSerialThirdPartyLibs` module and `sgserial` is provided by the `SGSerialThirdPartyLibs` module.
|
||||||
|
- `FSGGloveTrackingSettings::GloveConnectivityCheckInterval` settings have been renamed to `FSGGloveTrackingSettings::DataRetrievalRefreshRate` for adoption other than glove connectivity use cases.
|
||||||
|
- `USGVirtualHandComponent::GetMotionControllerData()` signature has changed.
|
||||||
|
- `USGVirtualHandComponent::GetHandTrackingState()` signature has changed.
|
||||||
|
- `USGWristTrackerComponent::GetMotionControllerData()` signature has changed.
|
||||||
|
- `USGWristTrackerComponent::GetHandTrackingState()` signature has changed.
|
||||||
|
- `USGVirtualHandComponentKismetLibrary::GetMotionControllerData()` signature has changed.
|
||||||
|
- `USGVirtualHandComponentKismetLibrary::GetHandTrackingState()` signature has changed.
|
||||||
|
- `SGPawn` and `SGTouchComponent` no longer use the legacy `QueueVibroLevels` method for applying vibrotactile feedback. Instead it's been replaced with `SendCustomWaveform`.
|
||||||
|
- Changed `USGTouchComponent::VibrotactileDuration` UPROPERTY's maximum value to `1.0f`. Previously it was uncapped, and now any value beyond `1.0f` seconds is clamped.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Dropped support for Unreal Engine `5.3`, which was already deprecated in the `v2.6.x` release series.
|
||||||
|
- Dropped support for MSVC `v142` (Visual Studio 2019), since UE `5.3` was the last supported version relying on it.
|
||||||
|
- Cleaned up remnants of the long-removed Unreal Engine `5.2` from third-party module `*.Build.cs` files.
|
||||||
|
- Cleaned up remnants of the long-removed Unreal Engine `5.2` from `SenseGlove.Build.cs`, `SenseGloveKismet.Build.cs`, `SenseGloveTracking.Build.cs`, files.
|
||||||
|
- Cleaned up remnants of the long-removed Unreal Engine `5.2` from `SenseGloveTracking` module.
|
||||||
|
- `USGVirtualHandComponent::GetMotionControllerState()` has been removed.
|
||||||
|
- `USGWristTrackerComponent::GetMotionControllerState()` has been removed.
|
||||||
|
- `USGVirtualHandComponentKismetLibrary::GetMotionControllerState()` has been removed.
|
||||||
|
- `USGWristTrackerComponentKismetLibrary::GetMotionControllerState()` has been removed.
|
||||||
|
- `USGTouchComponent::VibrotactileLevel` UPROPERTY has been removed.
|
||||||
|
- `USGTouchComponent::GetVibrotactileLevel()` method has been removed.
|
||||||
|
- `USGTouchComponent::SetVibrotactileLevel()` method has been removed.
|
||||||
|
- `USGTouchComponentKismetLibrary::GetVibrotactileLevel()` method has been removed and is no longer available to Blueprint.
|
||||||
|
- `USGTouchComponentKismetLibrary::SetVibrotactileLevel()` method has been removed and is no longer available to Blueprint.
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
|
||||||
|
- **This is the last major/minor release to support Unreal Engine `5.4`**, and its support will be removed in future minor or major releases. This is **important to keep in mind if your target development and deployment platform is [HTC VIVE in Standalone Mode](../getting-started/enabling-xr-ext-hand-tracking-vr-headsets/standalone-mode/index.html#htc-vive)**. Unfortunately, HTC has not released any updates to their HTC ViveOpenXR plugin since December 6, 2024. Their [latest release](https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/) [[1]](https://web.archive.org/web/20251113165658/https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/) [[2]](https://archive.ph/DlrLr), ViveOpenXR Plugin `v2.5.0`, supports only Unreal Engine `5.3` and `5.4`. [HTC VIVE PCVR Mode](../getting-started/enabling-xr-ext-hand-tracking-vr-headsets/pcvr-mode/index.html#htc-vive) is unaffected and will remain fully functional because, on Microsoft Windows, it is supported via the [OpenXRViveTracker Plugin](../getting-started/enabling-xr-ext-hand-tracking-vr-headsets/pcvr-mode/index.html#openxrvivetracker-plugin), which is bundled with Unreal Engine and officially maintained by Epic Games. If you still intend to target HTC in Standalone Mode, you are welcome to continue using the latest SenseGlove Unreal Engine Plugin `v2.7.x`, which will retain HTC Standalone Mode support. However, please keep in mind that once newer versions of the SenseGlove Unreal Engine Plugin are released and UE `5.4` is no longer supported, the latest release of the plugin supporting UE `5.4` will not receive new features, hardware support, or bug fixes. If at any point in the future HTC releases a new version of their ViveOpenXR plugin that supports any Unreal Engine version we actively support, [in accordance with our support policy and Platform Support Matrix](../appendix/platform-support-matrix.html), we will make every reasonable effort to reintroduce HTC Standalone Mode support.
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- Added [{fmt} Formatting Library License](../license/fmt-formatting-library.html) section.
|
||||||
|
- Added [Loguru Logging Library License](../license/loguru-loggin-library.html) section.
|
||||||
|
- Updated [Setting up the Touch System](../getting-started/setup-touch-system/index.html) section to reflect the recent touch system changes.
|
||||||
|
- Added [a third-party tutorial to the Android Standalone Mode Deployment](../misc/android-standalone-deployment/third-party-tutorials/) section for UE `5.7` which provides a one-click Android development and build environment setup, instructions on how to setup and use the new UE `5.7` project launcher, and how to enabled OpenXR hand-tracking support on Meta Quest and HTC VIVE devices.
|
||||||
|
|
||||||
## [2.6.3] - 2025-06-27
|
## [2.6.3] - 2025-06-27
|
||||||
|
|
||||||
This patch release contains no changes to the plugin code. It includes only documentation updates and improvements.
|
This patch release contains no changes to the plugin code. It includes only documentation updates and improvements.
|
||||||
|
|||||||
@@ -69,17 +69,17 @@
|
|||||||
│
|
│
|
||||||
├── include (header files)
|
├── include (header files)
|
||||||
│ │
|
│ │
|
||||||
│ ├── boost
|
│ └── SenseGlove
|
||||||
│ │
|
│ │
|
||||||
│ ├── SenseGlove
|
│ ├── BLE (SGBLE headers)
|
||||||
│ │ │
|
│ │
|
||||||
│ │ ├── BLE (SGBLE headers)
|
│ ├── Common (SGCommon headers)
|
||||||
│ │ │
|
│ │
|
||||||
│ │ ├── Connect (SGConnect headers)
|
│ ├── Connect (SGConnect headers)
|
||||||
│ │ │
|
│ │
|
||||||
│ │ └── Core (SGCoreCpp headers)
|
│ ├── Core (SGCore headers)
|
||||||
│ │
|
│ │
|
||||||
│ └── serial
|
│ └── Log (SGLog headers)
|
||||||
│
|
│
|
||||||
├── lib (platform-specific pre-built binary dependencies)
|
├── lib (platform-specific pre-built binary dependencies)
|
||||||
│ │
|
│ │
|
||||||
@@ -87,13 +87,13 @@
|
|||||||
│ │ │
|
│ │ │
|
||||||
│ │ └── r25b (Android NDK r25b dependencies for UE 5.1+)
|
│ │ └── r25b (Android NDK r25b dependencies for UE 5.1+)
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ ├── arm64 (64-bit ARM variant of Android)
|
│ │ ├── aarch64 (64-bit ARM variant of Android)
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ ├── debug
|
│ │ │ ├── debug
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ └── release
|
│ │ │ └── release
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ └── x64 (64-bit x86-64 variant of Android)
|
│ │ └── x86-64 (64-bit x86-64 variant of Android)
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ ├── debug
|
│ │ ├── debug
|
||||||
│ │ │
|
│ │ │
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ └── release
|
│ │ │ └── release
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ ├── v22 (UE 5.3 and 5.4 GNU/Linux dependencies)
|
│ │ ├── v22 (5.4 GNU/Linux dependencies)
|
||||||
│ │ │ │
|
│ │ │ │
|
||||||
│ │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture)
|
│ │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture)
|
||||||
│ │ │ │ │
|
│ │ │ │ │
|
||||||
@@ -157,25 +157,23 @@
|
|||||||
│ │ │
|
│ │ │
|
||||||
│ │ └── release
|
│ │ └── release
|
||||||
│ │
|
│ │
|
||||||
│ └── win64
|
│ └── windows
|
||||||
│ │
|
│ │
|
||||||
│ ├── msvc142 (Microsoft Visual Studio 2019 dependencies)
|
│ ├── v143 (Microsoft Visual Studio 2022 dependencies)
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ ├── debug
|
│ │ └── x86-64 (dependencies targeting Microsoft Windows x86-64 architecture)
|
||||||
│ │ │
|
│ │ │
|
||||||
│ │ └── release
|
│ │ ├── debug
|
||||||
│ │
|
│ │ │
|
||||||
│ ├── msvc143 (Microsoft Visual Studio 2022 dependencies)
|
│ │ └── release
|
||||||
│ │ │
|
|
||||||
│ │ ├── debug
|
|
||||||
│ │ │
|
|
||||||
│ │ └── release
|
|
||||||
│ │
|
│ │
|
||||||
│ └── rustc (Microsoft Windows binary dependencies built with Rust)
|
│ └── rustc (Microsoft Windows binary dependencies built with Rust)
|
||||||
│ │
|
│ │
|
||||||
│ ├── debug
|
│ └── x86-64 (dependencies targeting Microsoft Windows x86-64 architecture)
|
||||||
│ │
|
│ │
|
||||||
│ └── release
|
│ ├── debug
|
||||||
|
│ │
|
||||||
|
│ └── release
|
||||||
│
|
│
|
||||||
├── SGBleThirdPartyLibs (Third-party module providing SGBLE headers and libraries)
|
├── SGBleThirdPartyLibs (Third-party module providing SGBLE headers and libraries)
|
||||||
│
|
│
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## Planned Features Completion Status
|
## Planned Features Completion Status
|
||||||
|
|
||||||
### Implemented as of v2.6.x
|
### Implemented as of v2.7.x
|
||||||
|
|
||||||
- [X] Full SenseGlove low-level core API access through Unreal C++.
|
- [X] Full SenseGlove low-level core API access through Unreal C++.
|
||||||
- [X] Full SenseGlove low-level core API access through Blueprint.
|
- [X] Full SenseGlove low-level core API access through Blueprint.
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
- [X] Ability to automatically ask for the required permissions on Android when the plugin is enabled in any UE project.
|
- [X] Ability to automatically ask for the required permissions on Android when the plugin is enabled in any UE project.
|
||||||
- [X] `ViveOpenXR` plugin compatibility.
|
- [X] `ViveOpenXR` plugin compatibility.
|
||||||
|
|
||||||
### Upcoming features planned for the v2.6.x release
|
### Upcoming features planned for the v2.7.x release
|
||||||
|
|
||||||
### Planned features long-term
|
### Planned features long-term
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Meta Quest Standalone (Android NDK)** | **HTC VIVE Standalone (Android NDK)** | **Fab** | **Azure DevOps Version** |
|
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Meta Quest Standalone (Android NDK)** | **HTC VIVE Standalone (Android NDK)** | **Fab** | **Azure DevOps Version** |
|
||||||
|:--------:|-------------------------|-------------------------|-------------------------|:-----------------------------------:|:------------------------------------:|:---------------------------------------:|:-------------------------------------:|:--------:|:------------------------:|
|
|:--------:|-------------------------|-------------------------|-------------------------|:-----------------------------------:|:------------------------------------:|:---------------------------------------:|:-------------------------------------:|:--------:|:------------------------:|
|
||||||
| **5.6** | ❌ | ❌ | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x (r25b) | ❓ | ✅ v2.6.3 | ✅ v2.6.3 |
|
| **5.7** | ❌ | ❌ | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x (r25b) | ❓ | ✅ v2.7.0 | ✅ v2.7.0 |
|
||||||
| **5.5** | ❌ | ❌ | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x (r25b) | ❓ | ✅ v2.6.3 | ✅ v2.6.3 |
|
| **5.6** | ❌ | ❌ | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x (r25b) | ❓ | ✅ v2.7.0 | ✅ v2.7.0 |
|
||||||
| **5.4** | ❌ | ❌ | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x (r25b) | ✅ v2.6.x (r25b) | ✅ v2.6.3 | ✅ v2.6.3 |
|
| **5.5** | ❌ | ❌ | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x | ✅ v2.7.x (r25b) | ❓ | ✅ v2.7.0 | ✅ v2.7.0 |
|
||||||
| **5.3** | ❌ | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x | ✅ v2.6.x (r25b) | ✅ v2.6.x (r25b) | ✅ v2.6.3 | ✅ v2.6.3 |
|
| **5.4** | ❌ | ❌ | ⚠️ v2.7.x | ⚠️ v2.7.x | ⚠️ v2.7.x | ⚠️ v2.7.x (r25b) | ⚠️ v2.7.x (r25b) | ⚠️ v2.7.0 | ⚠️ v2.7.0 |
|
||||||
|
| **5.3** | ❌ | ⚠️ v2.6.x | ⚠️ v2.6.x | ⚠️ v2.6.x | ⚠️ v2.6.x | ⚠️ v2.6.x (r25b) | ⚠️ v2.6.x (r25b) | ⚠️ v2.6.3 | ⚠️ v2.6.3 |
|
||||||
| **5.2** | ❌ | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x (r25b) | ❓ | ⚠️ v2.4.2 | ⚠️ v2.4.2 |
|
| **5.2** | ❌ | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x | ⚠️ v2.4.x (r25b) | ❓ | ⚠️ v2.4.2 | ⚠️ v2.4.2 |
|
||||||
| **5.1** | ❌ | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x (r25b) | ❓ | ⚠️ v2.0.0 | ⚠️ v2.0.2 |
|
| **5.1** | ❌ | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x (r25b) | ❓ | ⚠️ v2.0.0 | ⚠️ v2.0.2 |
|
||||||
| **5.0** | ❌ | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x (r21e) | ❓ | ⚠️ v1.6.1 | ⚠️ v1.6.1 |
|
| **5.0** | ❌ | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x (r21e) | ❓ | ⚠️ v1.6.1 | ⚠️ v1.6.1 |
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||||
|
|
||||||
* <code>✅</code> Supported
|
* <code>✅</code> Supported
|
||||||
* <code>⚠️</code> Not supported by the latest release and might be lacking features
|
* <code>⚠️</code> End-of-life (EOL) release that is not supported anymore and might be lacking features
|
||||||
* <code>❌</code> Not supported at all
|
* <code>❌</code> Not supported at all
|
||||||
* <code>❓</code> Unknown or untested
|
* <code>❓</code> Unknown or untested
|
||||||
|
|
||||||
|
|||||||
+26
@@ -34,6 +34,32 @@ To set up `XR_EXT_hand_tracking` support on Meta Quest HMDs in Standalone mode,
|
|||||||
|
|
||||||
To set up `XR_EXT_hand_tracking` support on HTC VIVE HMDs in Standalone mode, additional plugins or configuration steps are required.
|
To set up `XR_EXT_hand_tracking` support on HTC VIVE HMDs in Standalone mode, additional plugins or configuration steps are required.
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> The SenseGlove Unreal Engine Plugin `v2.7.x` is the last release series to
|
||||||
|
> support Unreal Engine `5.4`, and its support will be removed in future minor
|
||||||
|
> or major releases. This is important to keep in mind if your target
|
||||||
|
> development and deployment platform is HTC VIVE in Standalone Mode.
|
||||||
|
> Unfortunately, HTC has not released any updates to their HTC ViveOpenXR
|
||||||
|
> plugin since December 6, 2024. Their
|
||||||
|
> [latest release](https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/)
|
||||||
|
> [[1]](https://web.archive.org/web/20251113165658/https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/)
|
||||||
|
> [[2]](https://archive.ph/DlrLr), ViveOpenXR Plugin `v2.5.0`, supports only
|
||||||
|
> Unreal Engine `5.3` and `5.4`.
|
||||||
|
> [HTC VIVE PCVR Mode](../pcvr-mode/index.html#htc-vive) is unaffected and will
|
||||||
|
> remain fully functional because, on Microsoft Windows, it is supported via the
|
||||||
|
> [OpenXRViveTracker Plugin](../pcvr-mode/index.html#openxrvivetracker-plugin),
|
||||||
|
> which is bundled with Unreal Engine and officially maintained by Epic Games.
|
||||||
|
> If you still intend to target HTC in Standalone Mode, you are welcome to
|
||||||
|
> continue using the latest SenseGlove Unreal Engine Plugin `v2.7.x`, which will
|
||||||
|
> retain HTC Standalone Mode support. However, please keep in mind that once
|
||||||
|
> newer versions of the SenseGlove Unreal Engine Plugin are released and UE
|
||||||
|
> `5.4` is no longer supported, the latest release of the plugin supporting UE
|
||||||
|
> `5.4` will not receive new features, hardware support, or bug fixes. If at any
|
||||||
|
> point in the future HTC releases a new version of their ViveOpenXR plugin that
|
||||||
|
> supports any Unreal Engine version we actively support,+
|
||||||
|
> [in accordance with our support policy and Platform Support Matrix](../../../appendix/platform-support-matrix.html),
|
||||||
|
> we will make every reasonable effort to reintroduce HTC Standalone Mode support.
|
||||||
|
|
||||||
### OpenXRViveTracker Plugin
|
### OpenXRViveTracker Plugin
|
||||||
|
|
||||||
Unlike the [PCVR-mode on Windows](../pcvr-mode/), the `OpenXRViveTracker` plugin is not required on Android since it only provides an implementation of the `XR_HTCX_vive_tracker_interaction` OpenXR extension which is necessary when we use VIVE Trackers on Windows or we [emulate the VIVE Wrist Trackers as VIVE Trackers on Windows](../pcvr-mode/#vive-business-streaming-app). Instead, we require the `XR_HTCX_vive_wrist_tracker_interaction` OpenXR extension to be able to use VIVE Wrist Trackers on Android, which is provided by the [`ViveOpenXR` plugin](#viveopenxr-plugin). So, you can safely ignore enabling this plugin for Android standalone deployments.
|
Unlike the [PCVR-mode on Windows](../pcvr-mode/), the `OpenXRViveTracker` plugin is not required on Android since it only provides an implementation of the `XR_HTCX_vive_tracker_interaction` OpenXR extension which is necessary when we use VIVE Trackers on Windows or we [emulate the VIVE Wrist Trackers as VIVE Trackers on Windows](../pcvr-mode/#vive-business-streaming-app). Instead, we require the `XR_HTCX_vive_wrist_tracker_interaction` OpenXR extension to be able to use VIVE Wrist Trackers on Android, which is provided by the [`ViveOpenXR` plugin](#viveopenxr-plugin). So, you can safely ignore enabling this plugin for Android standalone deployments.
|
||||||
|
|||||||
LFS
BIN
Binary file not shown.
+27
@@ -44,6 +44,33 @@ When running in PCVR mode, the functional wrist-tracking settings looks somethin
|
|||||||
|
|
||||||
### Standalone Mode
|
### Standalone Mode
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> The SenseGlove Unreal Engine Plugin `v2.7.x` is the last release series to
|
||||||
|
> support Unreal Engine `5.4`, and its support will be removed in future minor
|
||||||
|
> or major releases. This is important to keep in mind if your target
|
||||||
|
> development and deployment platform is
|
||||||
|
> [HTC VIVE in Standalone Mode](../enabling-xr-ext-hand-tracking-vr-headsets/standalone-mode/index.html#htc-vive).
|
||||||
|
> Unfortunately, HTC has not released any updates to their HTC ViveOpenXR
|
||||||
|
> plugin since December 6, 2024. Their
|
||||||
|
> [latest release](https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/)
|
||||||
|
> [[1]](https://web.archive.org/web/20251113165658/https://developer.vive.com/resources/openxr/unreal/unreal-download/latest/)
|
||||||
|
> [[2]](https://archive.ph/DlrLr), ViveOpenXR Plugin `v2.5.0`, supports only
|
||||||
|
> Unreal Engine `5.3` and `5.4`.
|
||||||
|
> [HTC VIVE PCVR Mode](../enabling-xr-ext-hand-tracking-vr-headsets/pcvr-mode/index.html#htc-vive) is unaffected and will
|
||||||
|
> remain fully functional because, on Microsoft Windows, it is supported via the
|
||||||
|
> [OpenXRViveTracker Plugin](../pcvr-mode/index.html#openxrvivetracker-plugin),
|
||||||
|
> which is bundled with Unreal Engine and officially maintained by Epic Games.
|
||||||
|
> If you still intend to target HTC in Standalone Mode, you are welcome to
|
||||||
|
> continue using the latest SenseGlove Unreal Engine Plugin `v2.7.x`, which will
|
||||||
|
> retain HTC Standalone Mode support. However, please keep in mind that once
|
||||||
|
> newer versions of the SenseGlove Unreal Engine Plugin are released and UE
|
||||||
|
> `5.4` is no longer supported, the latest release of the plugin supporting UE
|
||||||
|
> `5.4` will not receive new features, hardware support, or bug fixes. If at any
|
||||||
|
> point in the future HTC releases a new version of their ViveOpenXR plugin that
|
||||||
|
> supports any Unreal Engine version we actively support,+
|
||||||
|
> [in accordance with our support policy and Platform Support Matrix](../../appendix/platform-support-matrix.html),
|
||||||
|
> we will make every reasonable effort to reintroduce HTC Standalone Mode support.
|
||||||
|
|
||||||
When running in Standalone mode, the functional wrist-tracking settings looks something like this:
|
When running in Standalone mode, the functional wrist-tracking settings looks something like this:
|
||||||
|
|
||||||
")
|
")
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# {fmt} Formatting Library License
|
||||||
|
|
||||||
|
```
|
||||||
|
Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
--- Optional exception to the license ---
|
||||||
|
|
||||||
|
As an exception, if, as a result of your compiling your source code, portions
|
||||||
|
of this Software are embedded into a machine-executable object form of such
|
||||||
|
source code, you may redistribute such embedded portions in such object form
|
||||||
|
without including the above copyright and permission notices.
|
||||||
|
```
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Loguru Logging Library License
|
||||||
|
|
||||||
|
```
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <https://unlicense.org>
|
||||||
|
```
|
||||||
@@ -7,6 +7,8 @@ The following third-party software are used and shipped with the SenseGlove Unre
|
|||||||
- [The SenseGlove SDK (a.k.a. SenseGlove Backend Libraries, or SenseGlove Core Libraries)](senseglove-sdk.md)
|
- [The SenseGlove SDK (a.k.a. SenseGlove Backend Libraries, or SenseGlove Core Libraries)](senseglove-sdk.md)
|
||||||
- [SGBLE and SGBLExx Rust Dependencies](sgble-sgblexx-rust-dependencies.md)
|
- [SGBLE and SGBLExx Rust Dependencies](sgble-sgblexx-rust-dependencies.md)
|
||||||
- [The Boost C++ Libraries](boost-cpp-libraries.md)
|
- [The Boost C++ Libraries](boost-cpp-libraries.md)
|
||||||
|
- [The {fmt} Formatting Library](fmt-formatting-library.md)
|
||||||
|
- [The Loguru Logging Library License](loguru-loggin-library.md)
|
||||||
- [The Serial Communication Library](serial-communication-library.md)
|
- [The Serial Communication Library](serial-communication-library.md)
|
||||||
|
|
||||||
For more information consult their own respective open-source licenses, please.
|
For more information consult their own respective open-source licenses, please.
|
||||||
|
|||||||
+12
@@ -1,5 +1,17 @@
|
|||||||
# Third-Party Tutorials: Android Standalone Mode Deployment
|
# Third-Party Tutorials: Android Standalone Mode Deployment
|
||||||
|
|
||||||
|
## On-Click Unreal Engine 5.7 Android Packaging & APK Build Tutorial | Meta Quest & HTC VIVE Standalone
|
||||||
|
|
||||||
|
This tutorial provides a complete, streamlined guide to packaging and deploying Unreal Engine 5.7 projects to Android devices in standalone mode, with full support for Meta Quest and HTC VIVE headsets. Viewers learn how to correctly install and configure every required component, including Android Studio, SDK, NDK, JDK, and Visual Studio, using either a manual setup, or an open-source one-click PowerShell installer featured in the video.
|
||||||
|
|
||||||
|
The tutorial walks through creating a fresh Unreal Engine VR Template project, configuring Android project settings, enabling ADB device debugging, and generating a working APK using the updated Project Launcher workflow in UE 5.7. It also covers how to integrate the Meta XR and HTC VIVE OpenXR plugins to ensure proper VR recognition and hand-tracking functionality on each platform.
|
||||||
|
|
||||||
|
By the end, developers understand how to go from a blank project to a fully packaged and deployable Android APK, with functioning VR, correct device targeting, and reliable deployment pipelines on both Meta Quest and HTC VIVE standalone headsets.
|
||||||
|
|
||||||
|
<div style="margin: 0 auto; width: 560px;">
|
||||||
|
<iframe width="560" height="315" src="https://www.youtube.com/embed/SCtAfDeWXBM" frameborder="0" allowfullscreen></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
## Build & Deploy Unreal Engine 5.5 Projects APK to Android & Meta Quest 3S/3/Pro/2 in Standalone Mode
|
## Build & Deploy Unreal Engine 5.5 Projects APK to Android & Meta Quest 3S/3/Pro/2 in Standalone Mode
|
||||||
|
|
||||||
This video will guide you through the process of building and deploying an Unreal Engine 5.5 project (or any version newer than `4.24`) to Android Standalone Mode for Meta Quest 2 and Quest 3 devices. The steps outlined here should also apply to other Android-based VR headsets.
|
This video will guide you through the process of building and deploying an Unreal Engine 5.5 project (or any version newer than `4.24`) to Android Standalone Mode for Meta Quest 2 and Quest 3 devices. The steps outlined here should also apply to other Android-based VR headsets.
|
||||||
|
|||||||
@@ -110,4 +110,6 @@ The appendix contains various extra useful information:
|
|||||||
- [SenseGlove SDK License](../license/senseglove-sdk.md)
|
- [SenseGlove SDK License](../license/senseglove-sdk.md)
|
||||||
- [SGBLE and SGBLExx Rust Dependencies Licenses](../license/sgble-sgblexx-rust-dependencies.md)
|
- [SGBLE and SGBLExx Rust Dependencies Licenses](../license/sgble-sgblexx-rust-dependencies.md)
|
||||||
- [Boost C++ Libraries License](../license/boost-cpp-libraries.md)
|
- [Boost C++ Libraries License](../license/boost-cpp-libraries.md)
|
||||||
|
- [{fmt} Formatting Library License](../license/fmt-formatting-library.md)
|
||||||
|
- [Loguru Logging Library License](../license/loguru-loggin-library.md)
|
||||||
- [Serial Communication Library License](../license/serial-communication-library.md)
|
- [Serial Communication Library License](../license/serial-communication-library.md)
|
||||||
|
|||||||
BIN
Binary file not shown.
+3
-3
@@ -4,8 +4,8 @@ Provides the tracking settings related to SenseGlove devices.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## GloveConnectivityCheckInterval
|
## DataRetrievalRefreshRate
|
||||||
|
|
||||||
The interval in which the tracking module checks for glove connectivity.
|
The glove data retrieval refresh rate. This affects the interval in which the tracking module checks for glove connectivity and data retrieval.
|
||||||
|
|
||||||
The default is `16.666666f` which means `60` times per second.
|
The default is s `60Hz` (data retrieval operations per second).
|
||||||
@@ -42,10 +42,10 @@ Deploy:
|
|||||||
PasswordEnvVar: SGUM_PACKAGER_REPOSITORY_PASSWORD
|
PasswordEnvVar: SGUM_PACKAGER_REPOSITORY_PASSWORD
|
||||||
|
|
||||||
Branches:
|
Branches:
|
||||||
|
- "5.7"
|
||||||
- "5.6"
|
- "5.6"
|
||||||
- "5.5"
|
- "5.5"
|
||||||
- "5.4"
|
- "5.4"
|
||||||
- "5.3"
|
|
||||||
|
|
||||||
Exclusions:
|
Exclusions:
|
||||||
- .git
|
- .git
|
||||||
@@ -185,6 +185,11 @@ Rocket:
|
|||||||
|
|
||||||
EnginePaths:
|
EnginePaths:
|
||||||
|
|
||||||
|
- Branch: "5.7"
|
||||||
|
Path:
|
||||||
|
Linux: "/opt/UE57"
|
||||||
|
Windows: "C:\\OPT\\UE_5.7"
|
||||||
|
|
||||||
- Branch: "5.6"
|
- Branch: "5.6"
|
||||||
Path:
|
Path:
|
||||||
Linux: "/opt/UE56"
|
Linux: "/opt/UE56"
|
||||||
@@ -200,17 +205,17 @@ Rocket:
|
|||||||
Linux: "/opt/UE54"
|
Linux: "/opt/UE54"
|
||||||
Windows: "C:\\OPT\\UE_5.4"
|
Windows: "C:\\OPT\\UE_5.4"
|
||||||
|
|
||||||
- Branch: "5.3"
|
|
||||||
Path:
|
|
||||||
Linux: "/opt/UE53"
|
|
||||||
Windows: "C:\\OPT\\UE_5.3"
|
|
||||||
|
|
||||||
NDKPaths:
|
NDKPaths:
|
||||||
|
|
||||||
|
- Branch: "5.7"
|
||||||
|
Path:
|
||||||
|
Linux: "/opt/android/sdk/ndk/27.2.12479018"
|
||||||
|
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\27.2.12479018"
|
||||||
|
|
||||||
- Branch: "5.6"
|
- Branch: "5.6"
|
||||||
Path:
|
Path:
|
||||||
Linux: "/opt/android/sdk/ndk/25.1.8937393"
|
Linux: "/opt/android/sdk/ndk/27.2.12479018"
|
||||||
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\27.2.12479018"
|
||||||
|
|
||||||
- Branch: "5.5"
|
- Branch: "5.5"
|
||||||
Path:
|
Path:
|
||||||
@@ -222,11 +227,6 @@ Rocket:
|
|||||||
Linux: "/opt/android/sdk/ndk/25.1.8937393"
|
Linux: "/opt/android/sdk/ndk/25.1.8937393"
|
||||||
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
||||||
|
|
||||||
- Branch: "5.3"
|
|
||||||
Path:
|
|
||||||
Linux: "/opt/android/sdk/ndk/25.1.8937393"
|
|
||||||
Windows: "%LOCALAPPDATA%\\Android\\Sdk\\ndk\\25.1.8937393"
|
|
||||||
|
|
||||||
|
|
||||||
Rsync:
|
Rsync:
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion": 3,
|
||||||
"Version": 1,
|
"Version": 1,
|
||||||
"VersionName": "2.6.3",
|
"VersionName": "2.7.0",
|
||||||
"FriendlyName": "SenseGlove",
|
"FriendlyName": "SenseGlove",
|
||||||
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
|
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
|
||||||
"Category": "Virtual Reality",
|
"Category": "Virtual Reality",
|
||||||
|
|||||||
+4
-5
@@ -108,17 +108,16 @@ void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnim
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
const bool bGotHandTrackingState = VirtualHand->GetHandTrackingState(
|
HandTrackingState = VirtualHand->GetHandTrackingState();
|
||||||
EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
if (!HandTrackingState.bValid)
|
||||||
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
||||||
TEXT("Mismatched hand tracking state locations and rotations!"));
|
TEXT("Mismatched hand tracking state locations and rotations!"));
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
const bool bGotMotionControllerData = VirtualHand->GetMotionControllerData(MotionControllerData);
|
MotionControllerData = VirtualHand->GetMotionControllerData();
|
||||||
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
if (!MotionControllerData.bValid)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -103,8 +103,9 @@ USGTouchComponent::USGTouchComponent(const FObjectInitializer& ObjectInitializer
|
|||||||
{
|
{
|
||||||
ForceFeedbackLevel = 1.0f;
|
ForceFeedbackLevel = 1.0f;
|
||||||
|
|
||||||
VibrotactileDuration = 0.25f;
|
VibrotactileAmplitude = 1.0f;
|
||||||
VibrotactileLevel = 0.0f;
|
VibrotactileDuration = 1.0f;
|
||||||
|
VibrotactileFrequency= 180.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
|
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
|
||||||
|
|||||||
+60
-77
@@ -42,12 +42,12 @@
|
|||||||
#include "Engine/EngineTypes.h"
|
#include "Engine/EngineTypes.h"
|
||||||
#include "Engine/SkeletalMesh.h"
|
#include "Engine/SkeletalMesh.h"
|
||||||
#include "InputCoreTypes.h"
|
#include "InputCoreTypes.h"
|
||||||
#include "IXRTrackingSystem.h"
|
|
||||||
#include "Templates/UnrealTypeTraits.h"
|
#include "Templates/UnrealTypeTraits.h"
|
||||||
#include "UObject/ConstructorHelpers.h"
|
#include "UObject/ConstructorHelpers.h"
|
||||||
|
|
||||||
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
|
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
|
||||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||||
|
#include "SGBuildHacks/SGPlatform.h"
|
||||||
#include "SGCore/SGHapticGlove.h"
|
#include "SGCore/SGHapticGlove.h"
|
||||||
#include "SGDebug/SGDebugVirtualHand.h"
|
#include "SGDebug/SGDebugVirtualHand.h"
|
||||||
#include "SGLog/SGLog.h"
|
#include "SGLog/SGLog.h"
|
||||||
@@ -100,6 +100,14 @@ struct USGVirtualHandComponent::FImpl
|
|||||||
ECollisionEnabled::Type CachedCollisionEnabled;
|
ECollisionEnabled::Type CachedCollisionEnabled;
|
||||||
FCollisionResponseContainer CachedCollisionResponse;
|
FCollisionResponseContainer CachedCollisionResponse;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
FXRMotionControllerData MotionControllerData;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* Owner object
|
* Owner object
|
||||||
************************/
|
************************/
|
||||||
@@ -142,6 +150,8 @@ struct USGVirtualHandComponent::FImpl
|
|||||||
void DisableCollisionResponse();
|
void DisableCollisionResponse();
|
||||||
void RestoreCollisionResponse() const;
|
void RestoreCollisionResponse() const;
|
||||||
|
|
||||||
|
void UpdateXRData();
|
||||||
|
|
||||||
void SetVisibility(const bool bInVisible);
|
void SetVisibility(const bool bInVisible);
|
||||||
void UpdateVisibility();
|
void UpdateVisibility();
|
||||||
|
|
||||||
@@ -367,7 +377,7 @@ void USGVirtualHandComponent::InitializeComponent()
|
|||||||
Pimpl->SetDefaultMesh();
|
Pimpl->SetDefaultMesh();
|
||||||
}
|
}
|
||||||
|
|
||||||
Pimpl->UpdateVisibility();
|
Pimpl->UpdateXRData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGVirtualHandComponent::UninitializeComponent()
|
void USGVirtualHandComponent::UninitializeComponent()
|
||||||
@@ -387,7 +397,7 @@ void USGVirtualHandComponent::BeginPlay()
|
|||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
Pimpl->UpdateVisibility();
|
Pimpl->UpdateXRData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||||
@@ -416,7 +426,7 @@ void USGVirtualHandComponent::TickComponent(
|
|||||||
|
|
||||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||||
|
|
||||||
Pimpl->UpdateVisibility();
|
Pimpl->UpdateXRData();
|
||||||
|
|
||||||
if (Pimpl->ShouldDrawDebugVirtualHand())
|
if (Pimpl->ShouldDrawDebugVirtualHand())
|
||||||
{
|
{
|
||||||
@@ -439,7 +449,7 @@ void USGVirtualHandComponent::SetSkeletalMesh(USkeletalMesh* NewMesh, const bool
|
|||||||
void USGVirtualHandComponent::EditorTick(
|
void USGVirtualHandComponent::EditorTick(
|
||||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||||
{
|
{
|
||||||
Pimpl->UpdateVisibility();
|
Pimpl->UpdateXRData();
|
||||||
|
|
||||||
if (Pimpl->ShouldDrawDebugVirtualHand())
|
if (Pimpl->ShouldDrawDebugVirtualHand())
|
||||||
{
|
{
|
||||||
@@ -461,61 +471,11 @@ USGHapticGlove* USGVirtualHandComponent::GetConnectedGlove() const
|
|||||||
return Glove;
|
return Glove;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USGVirtualHandComponent::GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData)
|
|
||||||
{
|
|
||||||
OutMotionControllerData.bValid = false;
|
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
const bool bGotMotionControllerData =
|
|
||||||
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutMotionControllerData.bValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
const FXRHandTrackingState& USGVirtualHandComponent::GetHandTrackingState() const
|
||||||
bool USGVirtualHandComponent::GetMotionControllerState(
|
|
||||||
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState)
|
|
||||||
{
|
{
|
||||||
OutMotionControllerState.bValid = false;
|
return Pimpl->HandTrackingState;
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
const bool bGotMotionControllerState =
|
|
||||||
FSGXRTracker::GetMotionControllerState(
|
|
||||||
this, XRSpaceType, Hand, XRControllerPoseType, OutMotionControllerState);
|
|
||||||
if (!bGotMotionControllerState || !OutMotionControllerState.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutMotionControllerState.bValid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USGVirtualHandComponent::GetHandTrackingState(
|
|
||||||
const EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState)
|
|
||||||
{
|
|
||||||
OutHandTrackingState.bValid = false;
|
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
const bool bGotHandTrackingState =
|
|
||||||
FSGXRTracker::GetHandTrackingState(
|
|
||||||
this, XRSpaceType, Hand, OutHandTrackingState);
|
|
||||||
if (!bGotHandTrackingState || !OutHandTrackingState.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutHandTrackingState.bValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
const TArray<FName>& USGVirtualHandComponent::GetHandBoneNames() const
|
const TArray<FName>& USGVirtualHandComponent::GetHandBoneNames() const
|
||||||
@@ -785,6 +745,42 @@ void USGVirtualHandComponent::FImpl::RestoreCollisionResponse() const
|
|||||||
Owner->SetCollisionResponseToChannels(CachedCollisionResponse);
|
Owner->SetCollisionResponseToChannels(CachedCollisionResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void USGVirtualHandComponent::FImpl::UpdateXRData()
|
||||||
|
{
|
||||||
|
const EControllerHand Hand = Owner->IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
{
|
||||||
|
FXRMotionControllerData Data;
|
||||||
|
Data.bValid = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
const bool bGotMotionControllerData =
|
||||||
|
FSGXRTracker::GetMotionControllerData(Owner, Hand, Data);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
|
(void)
|
||||||
|
bGotMotionControllerData;
|
||||||
|
MotionControllerData = MoveTemp(Data);
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
{
|
||||||
|
FXRHandTrackingState State;
|
||||||
|
State.bValid = false;
|
||||||
|
const bool bGotHandTrackingState =
|
||||||
|
FSGXRTracker::GetHandTrackingState(
|
||||||
|
Owner, EXRSpaceType::UnrealWorldSpace, Hand, State);
|
||||||
|
|
||||||
|
(void) bGotHandTrackingState;
|
||||||
|
HandTrackingState = MoveTemp(State);
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
}
|
||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
||||||
{
|
{
|
||||||
Owner->SetHiddenInGame(!bInVisible, false);
|
Owner->SetHiddenInGame(!bInVisible, false);
|
||||||
@@ -803,23 +799,12 @@ void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible)
|
|||||||
|
|
||||||
void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
||||||
{
|
{
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
|
||||||
FXRHandTrackingState HandTrackingState;
|
|
||||||
const bool bGotHandTrackingState =
|
|
||||||
Owner->GetHandTrackingState(EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
|
||||||
FXRMotionControllerData MotionControllerData;
|
|
||||||
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
|
||||||
|
|
||||||
const bool bHandDataAvailable =
|
const bool bHandDataAvailable =
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
bGotHandTrackingState
|
HandTrackingState.bValid
|
||||||
&& HandTrackingState.bValid
|
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
bGotMotionControllerData
|
MotionControllerData.bValid
|
||||||
&& MotionControllerData.bValid
|
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand
|
||||||
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
;
|
;
|
||||||
const bool bHandVisible = Owner->IsVisible();
|
const bool bHandVisible = Owner->IsVisible();
|
||||||
@@ -881,18 +866,16 @@ void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
FXRHandTrackingState HandTrackingState;
|
if (!HandTrackingState.bValid)
|
||||||
const bool bGotHandTrackingState = Owner->GetHandTrackingState(EXRSpaceType::UnrealWorldSpace, HandTrackingState);
|
|
||||||
if (!bGotHandTrackingState || !HandTrackingState.bValid)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGDebugVirtualHand::Draw(World, HandTrackingState, Owner->GetVirtualHandSettings().DebuggingSettings);
|
FSGDebugVirtualHand::Draw(World, HandTrackingState, Owner->GetVirtualHandSettings().DebuggingSettings);
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
FXRMotionControllerData MotionControllerData;
|
|
||||||
const bool bGotMotionControllerData = Owner->GetMotionControllerData(MotionControllerData);
|
if (!MotionControllerData.bValid
|
||||||
if (!bGotMotionControllerData || !MotionControllerData.bValid)
|
|| MotionControllerData.DeviceVisualType == EXRVisualType::Hand)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+61
-58
@@ -36,9 +36,10 @@
|
|||||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||||
|
|
||||||
#include "IXRTrackingSystem.h"
|
#include "IXRTrackingSystem.h"
|
||||||
#include "MotionDelayBuffer.h"
|
|
||||||
|
|
||||||
|
#include "SGBuildHacks/SGPlatform.h"
|
||||||
#include "SGDebug/SGDebugGizmo.h"
|
#include "SGDebug/SGDebugGizmo.h"
|
||||||
|
#include "SGLog/SGLog.h"
|
||||||
#include "SGSettings/SGSettings.h"
|
#include "SGSettings/SGSettings.h"
|
||||||
#include "SGTracking/SGXRTracker.h"
|
#include "SGTracking/SGXRTracker.h"
|
||||||
|
|
||||||
@@ -56,6 +57,14 @@ struct USGWristTrackerComponent::FImpl
|
|||||||
|
|
||||||
bool bOverridePluginSettingsPropertyAlreadyModified;
|
bool bOverridePluginSettingsPropertyAlreadyModified;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
FXRMotionControllerData MotionControllerData;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
FXRHandTrackingState HandTrackingState;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* Owner object
|
* Owner object
|
||||||
************************/
|
************************/
|
||||||
@@ -85,7 +94,9 @@ struct USGWristTrackerComponent::FImpl
|
|||||||
void OverridePluginSettingsPropertyChanged();
|
void OverridePluginSettingsPropertyChanged();
|
||||||
|
|
||||||
void UpdateMotionSource() const;
|
void UpdateMotionSource() const;
|
||||||
|
void UpdateXRData();
|
||||||
void UpdateWristTrackingData() const;
|
void UpdateWristTrackingData() const;
|
||||||
|
|
||||||
void DrawDebugWristTracker() const;
|
void DrawDebugWristTracker() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -201,18 +212,18 @@ void USGWristTrackerComponent::InitializeComponent()
|
|||||||
{
|
{
|
||||||
Super::InitializeComponent();
|
Super::InitializeComponent();
|
||||||
|
|
||||||
Pimpl->UpdateWristTrackingData();
|
|
||||||
|
|
||||||
Pimpl->UpdateMotionSource();
|
Pimpl->UpdateMotionSource();
|
||||||
|
Pimpl->UpdateXRData();
|
||||||
|
Pimpl->UpdateWristTrackingData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGWristTrackerComponent::BeginPlay()
|
void USGWristTrackerComponent::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
Pimpl->UpdateWristTrackingData();
|
|
||||||
|
|
||||||
Pimpl->UpdateMotionSource();
|
Pimpl->UpdateMotionSource();
|
||||||
|
Pimpl->UpdateXRData();
|
||||||
|
Pimpl->UpdateWristTrackingData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGWristTrackerComponent::TickComponent(
|
void USGWristTrackerComponent::TickComponent(
|
||||||
@@ -228,77 +239,34 @@ void USGWristTrackerComponent::TickComponent(
|
|||||||
|
|
||||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||||
|
|
||||||
|
Pimpl->UpdateXRData();
|
||||||
|
Pimpl->UpdateWristTrackingData();
|
||||||
|
|
||||||
if (GetWristTrackingSettings().DebuggingSettings.bDrawDebugWristTracker)
|
if (GetWristTrackingSettings().DebuggingSettings.bDrawDebugWristTracker)
|
||||||
{
|
{
|
||||||
Pimpl->DrawDebugWristTracker();
|
Pimpl->DrawDebugWristTracker();
|
||||||
}
|
}
|
||||||
|
|
||||||
Pimpl->UpdateWristTrackingData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void USGWristTrackerComponent::EditorTick(
|
void USGWristTrackerComponent::EditorTick(
|
||||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||||
{
|
{
|
||||||
|
Pimpl->UpdateXRData();
|
||||||
Pimpl->UpdateWristTrackingData();
|
Pimpl->UpdateWristTrackingData();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USGWristTrackerComponent::GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData)
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
const FXRMotionControllerData& USGWristTrackerComponent::GetMotionControllerData() const
|
||||||
{
|
{
|
||||||
OutMotionControllerData.bValid = false;
|
return Pimpl->MotionControllerData;
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
const bool bGotMotionControllerData =
|
|
||||||
FSGXRTracker::GetMotionControllerData(this, Hand, OutMotionControllerData);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
|
|
||||||
if (!bGotMotionControllerData || !OutMotionControllerData.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutMotionControllerData.bValid;
|
|
||||||
}
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
const FXRHandTrackingState& USGWristTrackerComponent::GetHandTrackingState() const
|
||||||
bool USGWristTrackerComponent::GetMotionControllerState(
|
|
||||||
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState)
|
|
||||||
{
|
{
|
||||||
OutMotionControllerState.bValid = false;
|
return Pimpl->HandTrackingState;
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
const bool bGotMotionControllerState =
|
|
||||||
FSGXRTracker::GetMotionControllerState(
|
|
||||||
this, XRSpaceType, Hand, XRControllerPoseType, OutMotionControllerState);
|
|
||||||
if (!bGotMotionControllerState || !OutMotionControllerState.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutMotionControllerState.bValid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USGWristTrackerComponent::GetHandTrackingState(
|
|
||||||
const EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState)
|
|
||||||
{
|
|
||||||
OutHandTrackingState.bValid = false;
|
|
||||||
|
|
||||||
const EControllerHand Hand = IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
|
||||||
const bool bGotHandTrackingState =
|
|
||||||
FSGXRTracker::GetHandTrackingState(
|
|
||||||
this, XRSpaceType, Hand, OutHandTrackingState);
|
|
||||||
if (!bGotHandTrackingState || !OutHandTrackingState.bValid)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OutHandTrackingState.bValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner)
|
USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner)
|
||||||
@@ -359,6 +327,41 @@ void USGWristTrackerComponent::FImpl::UpdateMotionSource() const
|
|||||||
Owner->SetTrackingMotionSource(TrackingMotionSource);
|
Owner->SetTrackingMotionSource(TrackingMotionSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void USGWristTrackerComponent::FImpl::UpdateXRData()
|
||||||
|
{
|
||||||
|
const EControllerHand Hand = Owner->IsRight() ? EControllerHand::Right : EControllerHand::Left;
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
{
|
||||||
|
FXRMotionControllerData Data;
|
||||||
|
Data.bValid = false;
|
||||||
|
|
||||||
|
|
||||||
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
const bool bGotMotionControllerData =
|
||||||
|
FSGXRTracker::GetMotionControllerData(Owner, Hand, Data);
|
||||||
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
|
(void)
|
||||||
|
bGotMotionControllerData;
|
||||||
|
MotionControllerData = MoveTemp(Data);
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
{
|
||||||
|
FXRHandTrackingState State;
|
||||||
|
State.bValid = false;
|
||||||
|
const bool bGotHandTrackingState =
|
||||||
|
FSGXRTracker::GetHandTrackingState(
|
||||||
|
Owner, EXRSpaceType::UnrealWorldSpace, Hand, State);
|
||||||
|
|
||||||
|
(void) bGotHandTrackingState;
|
||||||
|
HandTrackingState = MoveTemp(State);
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
}
|
||||||
|
|
||||||
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
|
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
|
||||||
{
|
{
|
||||||
FVector NewWristLocation{Owner->GetComponentLocation()};
|
FVector NewWristLocation{Owner->GetComponentLocation()};
|
||||||
|
|||||||
+56
-139
@@ -36,8 +36,6 @@
|
|||||||
#include "SenseGlove/GameFramework/SGPlayerController.h"
|
#include "SenseGlove/GameFramework/SGPlayerController.h"
|
||||||
|
|
||||||
#include "Runtime/Launch/Resources/Version.h"
|
#include "Runtime/Launch/Resources/Version.h"
|
||||||
#include "Engine/TimerHandle.h"
|
|
||||||
#include "TimerManager.h"
|
|
||||||
|
|
||||||
#include "SenseGlove/Components/SGTouchComponent.h"
|
#include "SenseGlove/Components/SGTouchComponent.h"
|
||||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||||
@@ -45,6 +43,7 @@
|
|||||||
#include "SenseGlove/Haptics/SGGrabState.h"
|
#include "SenseGlove/Haptics/SGGrabState.h"
|
||||||
#include "SenseGlove/Haptics/SGTouchState.h"
|
#include "SenseGlove/Haptics/SGTouchState.h"
|
||||||
#include "SGBuildHacks/SGPlatform.h"
|
#include "SGBuildHacks/SGPlatform.h"
|
||||||
|
#include "SGCore/SGCustomWaveform.h"
|
||||||
#include "SGCore/SGHapticGlove.h"
|
#include "SGCore/SGHapticGlove.h"
|
||||||
|
|
||||||
struct ASGPlayerController::FImpl
|
struct ASGPlayerController::FImpl
|
||||||
@@ -55,11 +54,6 @@ struct ASGPlayerController::FImpl
|
|||||||
|
|
||||||
static float GetForceFeedbackLevel(const AActor* Actor);
|
static float GetForceFeedbackLevel(const AActor* Actor);
|
||||||
|
|
||||||
static float GetVibrotactileDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
|
|
||||||
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
|
|
||||||
const AActor* ActorPinkyTouching);
|
|
||||||
static float GetVibrotactileLevel(const AActor* Actor);
|
|
||||||
|
|
||||||
static TArray<float> GetForceFeedbackLevels(
|
static TArray<float> GetForceFeedbackLevels(
|
||||||
const AActor* ActorThumbTouching,
|
const AActor* ActorThumbTouching,
|
||||||
const AActor* ActorIndexTouching,
|
const AActor* ActorIndexTouching,
|
||||||
@@ -67,19 +61,10 @@ struct ASGPlayerController::FImpl
|
|||||||
const AActor* ActorRingTouching,
|
const AActor* ActorRingTouching,
|
||||||
const AActor* ActorPinkyTouching);
|
const AActor* ActorPinkyTouching);
|
||||||
|
|
||||||
static TArray<float> GetVibrotactileLevels(
|
|
||||||
const AActor* ActorThumbTouching,
|
|
||||||
const AActor* ActorIndexTouching,
|
|
||||||
const AActor* ActorMiddleTouching,
|
|
||||||
const AActor* ActorRingTouching,
|
|
||||||
const AActor* ActorPinkyTouching);
|
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* Member variables
|
* Member variables
|
||||||
************************/
|
************************/
|
||||||
|
|
||||||
FTimerHandle TouchVibrotactileStopTimer;
|
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* Owner object
|
* Owner object
|
||||||
************************/
|
************************/
|
||||||
@@ -104,6 +89,8 @@ struct ASGPlayerController::FImpl
|
|||||||
* Methods
|
* Methods
|
||||||
************************/
|
************************/
|
||||||
|
|
||||||
|
USGCustomWaveform* GetCustomWaveform(const AActor* Actor);
|
||||||
|
|
||||||
void UpdateHapticsFeedback(const FSGTouchState& TouchState);
|
void UpdateHapticsFeedback(const FSGTouchState& TouchState);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -121,74 +108,6 @@ float ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
|
|||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float ASGPlayerController::FImpl::GetVibrotactileDuration(const AActor* ActorThumbTouching,
|
|
||||||
const AActor* ActorIndexTouching,
|
|
||||||
const AActor* ActorMiddleTouching,
|
|
||||||
const AActor* ActorRingTouching,
|
|
||||||
const AActor* ActorPinkyTouching)
|
|
||||||
{
|
|
||||||
if (IsValid(ActorThumbTouching))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorThumbTouching);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsValid(ActorIndexTouching))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorIndexTouching);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsValid(ActorMiddleTouching))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorMiddleTouching);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsValid(ActorRingTouching))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorRingTouching);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsValid(ActorPinkyTouching))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorPinkyTouching);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ASGPlayerController::FImpl::GetVibrotactileLevel(const AActor* Actor)
|
|
||||||
{
|
|
||||||
if (IsValid(Actor))
|
|
||||||
{
|
|
||||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
|
|
||||||
if (IsValid(TouchComponent))
|
|
||||||
{
|
|
||||||
return TouchComponent->GetVibrotactileLevel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
|
TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
|
||||||
const AActor* ActorThumbTouching,
|
const AActor* ActorThumbTouching,
|
||||||
const AActor* ActorIndexTouching,
|
const AActor* ActorIndexTouching,
|
||||||
@@ -213,30 +132,6 @@ TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
|
|||||||
return ForceFeedbackLevels;
|
return ForceFeedbackLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<float> ASGPlayerController::FImpl::GetVibrotactileLevels(
|
|
||||||
const AActor* ActorThumbTouching,
|
|
||||||
const AActor* ActorIndexTouching,
|
|
||||||
const AActor* ActorMiddleTouching,
|
|
||||||
const AActor* ActorRingTouching,
|
|
||||||
const AActor* ActorPinkyTouching)
|
|
||||||
{
|
|
||||||
const float ThumbVibrotactileLevel = GetVibrotactileLevel(ActorThumbTouching);
|
|
||||||
const float IndexVibrotactileLevel = GetVibrotactileLevel(ActorIndexTouching);
|
|
||||||
const float MiddleVibrotactileLevel = GetVibrotactileLevel(ActorMiddleTouching);
|
|
||||||
const float RingVibrotactileLevel = GetVibrotactileLevel(ActorRingTouching);
|
|
||||||
const float PinkyVibrotactileLevel = GetVibrotactileLevel(ActorPinkyTouching);
|
|
||||||
|
|
||||||
const TArray<float> ForceFeedbackLevels{
|
|
||||||
ThumbVibrotactileLevel,
|
|
||||||
IndexVibrotactileLevel,
|
|
||||||
MiddleVibrotactileLevel,
|
|
||||||
RingVibrotactileLevel,
|
|
||||||
PinkyVibrotactileLevel,
|
|
||||||
};
|
|
||||||
|
|
||||||
return ForceFeedbackLevels;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer)
|
ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer)
|
||||||
: Super(ObjectInitializer),
|
: Super(ObjectInitializer),
|
||||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||||
@@ -330,6 +225,29 @@ ASGPlayerController::FImpl::FImpl(ASGPlayerController* InOwner)
|
|||||||
|
|
||||||
ASGPlayerController::FImpl::~FImpl() = default;
|
ASGPlayerController::FImpl::~FImpl() = default;
|
||||||
|
|
||||||
|
USGCustomWaveform* ASGPlayerController::FImpl::GetCustomWaveform(const AActor* Actor)
|
||||||
|
{
|
||||||
|
float Amplitude = 0.0f;
|
||||||
|
float Duration = 0.0f;
|
||||||
|
float Frequency = 0.0f;
|
||||||
|
|
||||||
|
if (IsValid(Actor))
|
||||||
|
{
|
||||||
|
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
|
||||||
|
if (IsValid(TouchComponent))
|
||||||
|
{
|
||||||
|
Amplitude = TouchComponent->GetVibrotactileAmplitude();
|
||||||
|
Duration = TouchComponent->GetVibrotactileDuration();
|
||||||
|
Frequency = TouchComponent->GetVibrotactileFrequency();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
USGCustomWaveform* CustomWaveform{
|
||||||
|
USGCustomWaveform::NewCustomWaveform(Owner, Amplitude, Duration, Frequency)
|
||||||
|
};
|
||||||
|
return CustomWaveform;
|
||||||
|
}
|
||||||
|
|
||||||
void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState)
|
void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState)
|
||||||
{
|
{
|
||||||
static const TArray<float> VibrotactileOffCommand{0.0f, 0.0f, 0.0, 0.0, 0.0f};
|
static const TArray<float> VibrotactileOffCommand{0.0f, 0.0f, 0.0, 0.0, 0.0f};
|
||||||
@@ -359,44 +277,43 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
|
|||||||
};
|
};
|
||||||
Glove->QueueForceFeedbackLevels(MoveTemp(ForceFeedbackLevels));
|
Glove->QueueForceFeedbackLevels(MoveTemp(ForceFeedbackLevels));
|
||||||
|
|
||||||
// Queue the Vibrotactile command...
|
|
||||||
TArray<float> VibrotactileLevels{
|
|
||||||
GetVibrotactileLevels(
|
|
||||||
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
|
|
||||||
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
|
|
||||||
};
|
|
||||||
Glove->QueueVibroLevels(MoveTemp(VibrotactileLevels));
|
|
||||||
|
|
||||||
// Send the haptics commands!
|
// Send the haptics commands!
|
||||||
Glove->SendHaptics();
|
Glove->SendHaptics();
|
||||||
|
|
||||||
// Stop the Vibrotactile command after the timeout if any haptic feedback is ongoing.
|
// Send Vibrotactile to the thumb finger if it's touching an actor...
|
||||||
const float VibrotactileDuration = FImpl::GetVibrotactileDuration(
|
if (IsValid(TouchState.ActorThumbTouching))
|
||||||
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
|
|
||||||
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching);
|
|
||||||
|
|
||||||
Owner->GetWorldTimerManager().ClearTimer(TouchVibrotactileStopTimer);
|
|
||||||
|
|
||||||
FTimerDelegate TouchVibrotactileStopHandler;
|
|
||||||
TouchVibrotactileStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
|
|
||||||
{
|
{
|
||||||
if (!IsValid(Glove))
|
USGCustomWaveform* CustomWaveform(GetCustomWaveform(TouchState.ActorThumbTouching));
|
||||||
{
|
Glove->SendCustomWaveform(CustomWaveform, ESGHapticLocation::ThumbTip);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const bool bGloveConnected = Glove->IsConnected();
|
// Send Vibrotactile to the index finger if it's touching an actor...
|
||||||
if (!bGloveConnected)
|
if (IsValid(TouchState.ActorIndexTouching))
|
||||||
{
|
{
|
||||||
return;
|
USGCustomWaveform* CustomWaveform(GetCustomWaveform(TouchState.ActorIndexTouching));
|
||||||
}
|
Glove->SendCustomWaveform(CustomWaveform, ESGHapticLocation::IndexTip);
|
||||||
|
}
|
||||||
|
|
||||||
Glove->QueueVibroLevels(VibrotactileOffCommand);
|
// Send Vibrotactile to the middle finger if it's touching an actor...
|
||||||
Glove->SendHaptics();
|
if (IsValid(TouchState.ActorMiddleTouching))
|
||||||
});
|
{
|
||||||
|
USGCustomWaveform* CustomWaveform(GetCustomWaveform(TouchState.ActorMiddleTouching));
|
||||||
|
Glove->SendCustomWaveform(CustomWaveform, ESGHapticLocation::MiddleTip);
|
||||||
|
}
|
||||||
|
|
||||||
Owner->GetWorldTimerManager().SetTimer(
|
// Send Vibrotactile to the ring finger if it's touching an actor...
|
||||||
TouchVibrotactileStopTimer, TouchVibrotactileStopHandler, VibrotactileDuration, false, -1.0f);
|
if (IsValid(TouchState.ActorRingTouching))
|
||||||
|
{
|
||||||
|
USGCustomWaveform* CustomWaveform(GetCustomWaveform(TouchState.ActorRingTouching));
|
||||||
|
Glove->SendCustomWaveform(CustomWaveform, ESGHapticLocation::RingTip);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send Vibrotactile to the pinky finger if it's touching an actor...
|
||||||
|
if (IsValid(TouchState.ActorPinkyTouching))
|
||||||
|
{
|
||||||
|
USGCustomWaveform* CustomWaveform(GetCustomWaveform(TouchState.ActorPinkyTouching));
|
||||||
|
Glove->SendCustomWaveform(CustomWaveform, ESGHapticLocation::PinkyTip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASGPlayerController::FImplDeleter::operator()(const FImpl* P) const
|
void ASGPlayerController::FImplDeleter::operator()(const FImpl* P) const
|
||||||
|
|||||||
+23
-7
@@ -57,12 +57,17 @@ private:
|
|||||||
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
|
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
|
||||||
float ForceFeedbackLevel;
|
float ForceFeedbackLevel;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false", ClampMin = "0.0", UIMin = "0.0"))
|
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
||||||
|
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
|
||||||
|
float VibrotactileAmplitude;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
||||||
|
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
|
||||||
float VibrotactileDuration;
|
float VibrotactileDuration;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
||||||
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "100.0", UIMin = "0.0", UIMax = "100.0"))
|
meta=(AllowPrivateAccess="false", ClampMin = "10.0", ClampMax = "500.0", UIMin = "10.0", UIMax = "500.0"))
|
||||||
float VibrotactileLevel;
|
float VibrotactileFrequency;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct FImpl;
|
struct FImpl;
|
||||||
@@ -86,6 +91,16 @@ public:
|
|||||||
ForceFeedbackLevel = Level;
|
ForceFeedbackLevel = Level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCEINLINE float GetVibrotactileAmplitude() const
|
||||||
|
{
|
||||||
|
return VibrotactileAmplitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCEINLINE void SetVibrotactileAmplitude(const float Amplitude)
|
||||||
|
{
|
||||||
|
VibrotactileAmplitude = Amplitude;
|
||||||
|
}
|
||||||
|
|
||||||
FORCEINLINE float GetVibrotactileDuration() const
|
FORCEINLINE float GetVibrotactileDuration() const
|
||||||
{
|
{
|
||||||
return VibrotactileDuration;
|
return VibrotactileDuration;
|
||||||
@@ -95,13 +110,14 @@ public:
|
|||||||
{
|
{
|
||||||
VibrotactileDuration = Duration;
|
VibrotactileDuration = Duration;
|
||||||
}
|
}
|
||||||
FORCEINLINE float GetVibrotactileLevel() const
|
|
||||||
|
FORCEINLINE float GetVibrotactileFrequency() const
|
||||||
{
|
{
|
||||||
return VibrotactileLevel;
|
return VibrotactileFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE void SetVibrotactileLevel(const float Level)
|
FORCEINLINE void SetVibrotactileFrequency(const float Frequency)
|
||||||
{
|
{
|
||||||
VibrotactileLevel = Level;
|
VibrotactileFrequency = Frequency;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
+1
-9
@@ -181,16 +181,8 @@ public:
|
|||||||
bool IsGloveConnected() const;
|
bool IsGloveConnected() const;
|
||||||
USGHapticGlove* GetConnectedGlove() const;
|
USGHapticGlove* GetConnectedGlove() const;
|
||||||
|
|
||||||
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
|
||||||
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
bool GetMotionControllerState(
|
const FXRHandTrackingState& GetHandTrackingState() const;
|
||||||
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState);
|
|
||||||
bool GetHandTrackingState(
|
|
||||||
EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState);
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
+1
-9
@@ -165,15 +165,7 @@ protected:
|
|||||||
FActorComponentTickFunction* ThisTickFunction);
|
FActorComponentTickFunction* ThisTickFunction);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
|
||||||
bool GetMotionControllerData(FXRMotionControllerData& OutMotionControllerData);
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
bool GetMotionControllerState(
|
const FXRHandTrackingState& GetHandTrackingState() const;
|
||||||
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState);
|
|
||||||
bool GetHandTrackingState(
|
|
||||||
EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState);
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
};
|
};
|
||||||
@@ -54,12 +54,7 @@ public class SenseGlove : ModuleRules
|
|||||||
"InputCore",
|
"InputCore",
|
||||||
"InputDevice",
|
"InputDevice",
|
||||||
"OpenXRHMD",
|
"OpenXRHMD",
|
||||||
// NOTE
|
|
||||||
// UE 5.3+ provides UXRDeviceVisualizationComponent as part of the XRBase plugin.
|
|
||||||
// UE 5.2 provides UXRDeviceVisualizationComponent as part of the HeadMountDisplay module.
|
|
||||||
#if UE_5_3_OR_LATER
|
|
||||||
"XRBase",
|
"XRBase",
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class SenseGloveBuildHacks : ModuleRules
|
|||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
"SGConnectThirdPartyHeaders",
|
"SGConnectThirdPartyHeaders",
|
||||||
|
"SGCoreThirdPartyHeaders",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
{
|
{
|
||||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
bEnableExceptions = true;
|
bEnableExceptions = false;
|
||||||
bUseRTTI = true;
|
bUseRTTI = false;
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(
|
PrivateDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
@@ -58,8 +58,13 @@ public class SenseGloveConnectImpl : ModuleRules
|
|||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
"SGBleThirdPartyLibs",
|
"SGBleThirdPartyLibs",
|
||||||
|
"SGCommonThirdPartyLibs",
|
||||||
|
"SGConnectShmThirdPartyLibs",
|
||||||
"SGConnectThirdPartyLibs",
|
"SGConnectThirdPartyLibs",
|
||||||
"SGSerialThirdPartyLibs",
|
"SGSerialThirdPartyLibs",
|
||||||
|
"SGFmtThirdPartyLibs",
|
||||||
|
"SGLoguruThirdPartyLibs",
|
||||||
|
"SGWjwwoodSerialThirdPartyLibs",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ int32 FSGDeviceList::ActiveDevices()
|
|||||||
return SGCoreImpl_FSGDeviceListImpl_ActiveDevices();
|
return SGCoreImpl_FSGDeviceListImpl_ActiveDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FSGDeviceList::SenseCommRunning()
|
bool FSGDeviceList::SenseComRunning()
|
||||||
{
|
{
|
||||||
return SGCoreImpl_FSGDeviceListImpl_SenseCommRunning();
|
return SGCoreImpl_FSGDeviceListImpl_SenseComRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSGDeviceList::Dispose()
|
void FSGDeviceList::Dispose()
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns true if the SenseCom program is running.
|
* Returns true if the SenseCom program is running.
|
||||||
*/
|
*/
|
||||||
static bool SenseCommRunning();
|
static bool SenseComRunning();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the device list, and block any further attempt to add to it until ReInitialize is called.
|
* Clear the device list, and block any further attempt to add to it until ReInitialize is called.
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ public class SenseGloveCore : ModuleRules
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(
|
PrivateDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-3
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#include "SGCoreImpl/SGBetaDeviceImpl.h"
|
#include "SGCoreImpl/SGBetaDeviceImpl.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "Containers/StringConv.h"
|
#include "Containers/StringConv.h"
|
||||||
#include "Misc/AssertionMacros.h"
|
#include "Misc/AssertionMacros.h"
|
||||||
|
|
||||||
@@ -70,7 +72,7 @@ TSharedRef<FSGBetaDeviceImpl> FSGBetaDeviceImpl::Parse(const FString& String)
|
|||||||
FSGDevicePtrType SGDevicePtr{FBetaDeviceType::Parse(TCHAR_TO_UTF8(*String))};
|
FSGDevicePtrType SGDevicePtr{FBetaDeviceType::Parse(TCHAR_TO_UTF8(*String))};
|
||||||
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
||||||
const TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl{
|
const TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl{
|
||||||
MakeShared<FSGBetaDeviceImpl>(std::dynamic_pointer_cast<FBetaDeviceType>(MoveTemp(SGDevicePtr)))
|
MakeShared<FSGBetaDeviceImpl>(std::static_pointer_cast<FBetaDeviceType>(MoveTemp(SGDevicePtr)))
|
||||||
};
|
};
|
||||||
return BetaDeviceImpl;
|
return BetaDeviceImpl;
|
||||||
}
|
}
|
||||||
@@ -133,12 +135,12 @@ FSGBetaDeviceImpl::FBetaDeviceType FSGBetaDeviceImpl::ToBetaDevice() const
|
|||||||
|
|
||||||
FSGBetaDeviceImpl::FBetaDevicePtrType FSGBetaDeviceImpl::ToBetaDevicePtr() const
|
FSGBetaDeviceImpl::FBetaDevicePtrType FSGBetaDeviceImpl::ToBetaDevicePtr() const
|
||||||
{
|
{
|
||||||
return std::dynamic_pointer_cast<FBetaDeviceType>(ToSGDevicePtr());
|
return std::static_pointer_cast<FBetaDeviceType>(ToSGDevicePtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGBetaDeviceImpl::FBetaDevicePtrType FSGBetaDeviceImpl::ToBetaDevicePtrChecked() const
|
FSGBetaDeviceImpl::FBetaDevicePtrType FSGBetaDeviceImpl::ToBetaDevicePtrChecked() const
|
||||||
{
|
{
|
||||||
FBetaDevicePtrType BetaDevice = std::dynamic_pointer_cast<FBetaDeviceType>(ToSGDevicePtr());
|
FBetaDevicePtrType BetaDevice = std::static_pointer_cast<FBetaDeviceType>(ToSGDevicePtr());
|
||||||
ensureAlwaysMsgf(BetaDevice.get(), TEXT("Invalid BetaDevice"));
|
ensureAlwaysMsgf(BetaDevice.get(), TEXT("Invalid BetaDevice"));
|
||||||
return BetaDevice;
|
return BetaDevice;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "SGCoreImpl/SGDeviceImpl.h"
|
#include "SGCoreImpl/SGDeviceImpl.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Containers/StringConv.h"
|
#include "Containers/StringConv.h"
|
||||||
@@ -157,35 +158,35 @@ TSharedRef<FSGDeviceImpl> FSGDeviceImpl::ToSGDeviceImplRef()
|
|||||||
|
|
||||||
TSharedRef<FSGBetaDeviceImpl> FSGDeviceImpl::ToBetaDeviceImplRef()
|
TSharedRef<FSGBetaDeviceImpl> FSGDeviceImpl::ToBetaDeviceImplRef()
|
||||||
{
|
{
|
||||||
FSGBetaDeviceImpl* BetaDevice{dynamic_cast<FSGBetaDeviceImpl*>(this)};
|
FSGBetaDeviceImpl* BetaDevice{static_cast<FSGBetaDeviceImpl*>(this)};
|
||||||
ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!"));
|
ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!"));
|
||||||
return SharedThis(BetaDevice);
|
return SharedThis(BetaDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSharedRef<FSGHapticGloveImpl> FSGDeviceImpl::ToHapticGloveImplRef()
|
TSharedRef<FSGHapticGloveImpl> FSGDeviceImpl::ToHapticGloveImplRef()
|
||||||
{
|
{
|
||||||
FSGHapticGloveImpl* HapticGlove{dynamic_cast<FSGHapticGloveImpl*>(this)};
|
FSGHapticGloveImpl* HapticGlove{static_cast<FSGHapticGloveImpl*>(this)};
|
||||||
ensureAlwaysMsgf(HapticGlove, TEXT("Invalid HapticGlove!"));
|
ensureAlwaysMsgf(HapticGlove, TEXT("Invalid HapticGlove!"));
|
||||||
return SharedThis(HapticGlove);
|
return SharedThis(HapticGlove);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSharedRef<FSGNova2GloveImpl> FSGDeviceImpl::ToNova2GloveImplRef()
|
TSharedRef<FSGNova2GloveImpl> FSGDeviceImpl::ToNova2GloveImplRef()
|
||||||
{
|
{
|
||||||
FSGNova2GloveImpl* Nova2Glove{dynamic_cast<FSGNova2GloveImpl*>(this)};
|
FSGNova2GloveImpl* Nova2Glove{static_cast<FSGNova2GloveImpl*>(this)};
|
||||||
ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove!"));
|
ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove!"));
|
||||||
return SharedThis(Nova2Glove);
|
return SharedThis(Nova2Glove);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSharedRef<FSGNovaGloveImpl> FSGDeviceImpl::ToNovaGloveImplRef()
|
TSharedRef<FSGNovaGloveImpl> FSGDeviceImpl::ToNovaGloveImplRef()
|
||||||
{
|
{
|
||||||
FSGNovaGloveImpl* NovaGlove{dynamic_cast<FSGNovaGloveImpl*>(this)};
|
FSGNovaGloveImpl* NovaGlove{static_cast<FSGNovaGloveImpl*>(this)};
|
||||||
ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove!"));
|
ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove!"));
|
||||||
return SharedThis(NovaGlove);
|
return SharedThis(NovaGlove);
|
||||||
}
|
}
|
||||||
|
|
||||||
TSharedRef<FSGSenseGloveImpl> FSGDeviceImpl::ToSenseGloveImplRef()
|
TSharedRef<FSGSenseGloveImpl> FSGDeviceImpl::ToSenseGloveImplRef()
|
||||||
{
|
{
|
||||||
FSGSenseGloveImpl* SenseGlove{dynamic_cast<FSGSenseGloveImpl*>(this)};
|
FSGSenseGloveImpl* SenseGlove{static_cast<FSGSenseGloveImpl*>(this)};
|
||||||
ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove!"));
|
ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove!"));
|
||||||
return SharedThis(SenseGlove);
|
return SharedThis(SenseGlove);
|
||||||
}
|
}
|
||||||
@@ -193,7 +194,7 @@ TSharedRef<FSGSenseGloveImpl> FSGDeviceImpl::ToSenseGloveImplRef()
|
|||||||
bool FSGDeviceImpl::IsABetaDevice() const
|
bool FSGDeviceImpl::IsABetaDevice() const
|
||||||
{
|
{
|
||||||
const FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice{
|
const FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice{
|
||||||
std::dynamic_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
return BetaDevice != nullptr;
|
return BetaDevice != nullptr;
|
||||||
}
|
}
|
||||||
@@ -201,7 +202,7 @@ bool FSGDeviceImpl::IsABetaDevice() const
|
|||||||
bool FSGDeviceImpl::IsAHapticGlove() const
|
bool FSGDeviceImpl::IsAHapticGlove() const
|
||||||
{
|
{
|
||||||
const FSGHapticGloveImpl::FHapticGlovePtrType HapticGlove{
|
const FSGHapticGloveImpl::FHapticGlovePtrType HapticGlove{
|
||||||
std::dynamic_pointer_cast<FSGHapticGloveImpl::FHapticGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGHapticGloveImpl::FHapticGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
return HapticGlove != nullptr;
|
return HapticGlove != nullptr;
|
||||||
}
|
}
|
||||||
@@ -209,7 +210,7 @@ bool FSGDeviceImpl::IsAHapticGlove() const
|
|||||||
bool FSGDeviceImpl::IsANova2Glove() const
|
bool FSGDeviceImpl::IsANova2Glove() const
|
||||||
{
|
{
|
||||||
const FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove{
|
const FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove{
|
||||||
std::dynamic_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
return Nova2Glove != nullptr;
|
return Nova2Glove != nullptr;
|
||||||
}
|
}
|
||||||
@@ -217,7 +218,7 @@ bool FSGDeviceImpl::IsANova2Glove() const
|
|||||||
bool FSGDeviceImpl::IsANovaGlove() const
|
bool FSGDeviceImpl::IsANovaGlove() const
|
||||||
{
|
{
|
||||||
const FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove{
|
const FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove{
|
||||||
std::dynamic_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
return NovaGlove != nullptr;
|
return NovaGlove != nullptr;
|
||||||
}
|
}
|
||||||
@@ -225,7 +226,7 @@ bool FSGDeviceImpl::IsANovaGlove() const
|
|||||||
bool FSGDeviceImpl::IsASenseGlove() const
|
bool FSGDeviceImpl::IsASenseGlove() const
|
||||||
{
|
{
|
||||||
const FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
const FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
||||||
std::dynamic_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
return SenseGlove != nullptr;
|
return SenseGlove != nullptr;
|
||||||
}
|
}
|
||||||
@@ -233,7 +234,7 @@ bool FSGDeviceImpl::IsASenseGlove() const
|
|||||||
TSharedPtr<FSGBetaDeviceImpl> FSGDeviceImpl::AsBetaDevice() const
|
TSharedPtr<FSGBetaDeviceImpl> FSGDeviceImpl::AsBetaDevice() const
|
||||||
{
|
{
|
||||||
const FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice{
|
const FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice{
|
||||||
std::dynamic_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!"));
|
ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!"));
|
||||||
return MakeShared<FSGBetaDeviceImpl>(BetaDevice);
|
return MakeShared<FSGBetaDeviceImpl>(BetaDevice);
|
||||||
@@ -242,7 +243,7 @@ TSharedPtr<FSGBetaDeviceImpl> FSGDeviceImpl::AsBetaDevice() const
|
|||||||
TSharedPtr<FSGHapticGloveImpl> FSGDeviceImpl::AsHapticGlove() const
|
TSharedPtr<FSGHapticGloveImpl> FSGDeviceImpl::AsHapticGlove() const
|
||||||
{
|
{
|
||||||
const FSGHapticGloveImpl::FHapticGlovePtrType HapticGlove{
|
const FSGHapticGloveImpl::FHapticGlovePtrType HapticGlove{
|
||||||
std::dynamic_pointer_cast<FSGHapticGloveImpl::FHapticGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGHapticGloveImpl::FHapticGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
ensureAlwaysMsgf(HapticGlove, TEXT("Invalid HapticGlove!"));
|
ensureAlwaysMsgf(HapticGlove, TEXT("Invalid HapticGlove!"));
|
||||||
return MakeShared<FSGHapticGloveImpl>(HapticGlove);
|
return MakeShared<FSGHapticGloveImpl>(HapticGlove);
|
||||||
@@ -251,7 +252,7 @@ TSharedPtr<FSGHapticGloveImpl> FSGDeviceImpl::AsHapticGlove() const
|
|||||||
TSharedPtr<FSGNova2GloveImpl> FSGDeviceImpl::AsNova2Glove() const
|
TSharedPtr<FSGNova2GloveImpl> FSGDeviceImpl::AsNova2Glove() const
|
||||||
{
|
{
|
||||||
const FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove{
|
const FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove{
|
||||||
std::dynamic_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove!"));
|
ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove!"));
|
||||||
return MakeShared<FSGNova2GloveImpl>(Nova2Glove);
|
return MakeShared<FSGNova2GloveImpl>(Nova2Glove);
|
||||||
@@ -260,7 +261,7 @@ TSharedPtr<FSGNova2GloveImpl> FSGDeviceImpl::AsNova2Glove() const
|
|||||||
TSharedPtr<FSGNovaGloveImpl> FSGDeviceImpl::AsNovaGlove() const
|
TSharedPtr<FSGNovaGloveImpl> FSGDeviceImpl::AsNovaGlove() const
|
||||||
{
|
{
|
||||||
const FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove{
|
const FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove{
|
||||||
std::dynamic_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove!"));
|
ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove!"));
|
||||||
return MakeShared<FSGNovaGloveImpl>(NovaGlove);
|
return MakeShared<FSGNovaGloveImpl>(NovaGlove);
|
||||||
@@ -269,7 +270,7 @@ TSharedPtr<FSGNovaGloveImpl> FSGDeviceImpl::AsNovaGlove() const
|
|||||||
TSharedPtr<FSGSenseGloveImpl> FSGDeviceImpl::AsSenseGlove() const
|
TSharedPtr<FSGSenseGloveImpl> FSGDeviceImpl::AsSenseGlove() const
|
||||||
{
|
{
|
||||||
const FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
const FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
||||||
std::dynamic_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(ToSGDevicePtr())
|
std::static_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(ToSGDevicePtr())
|
||||||
};
|
};
|
||||||
ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove!"));
|
ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove!"));
|
||||||
return MakeShared<FSGSenseGloveImpl>(SenseGlove);
|
return MakeShared<FSGSenseGloveImpl>(SenseGlove);
|
||||||
|
|||||||
+7
-6
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include "SGCoreImpl/SGDeviceListImpl.h"
|
#include "SGCoreImpl/SGDeviceListImpl.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Containers/StringConv.h"
|
#include "Containers/StringConv.h"
|
||||||
@@ -56,7 +57,7 @@ int32 FSGDeviceListImpl::ActiveDevices()
|
|||||||
return FDeviceListType::ActiveDevices();
|
return FDeviceListType::ActiveDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FSGDeviceListImpl::SenseCommRunning()
|
bool FSGDeviceListImpl::SenseComRunning()
|
||||||
{
|
{
|
||||||
return FDeviceListType::SenseComRunning();
|
return FDeviceListType::SenseComRunning();
|
||||||
}
|
}
|
||||||
@@ -83,7 +84,7 @@ TArray<TSharedRef<FSGDeviceImpl>> FSGDeviceListImpl::GetDevices()
|
|||||||
case ESGDeviceType::BetaDevice:
|
case ESGDeviceType::BetaDevice:
|
||||||
{
|
{
|
||||||
FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice =
|
FSGBetaDeviceImpl::FBetaDevicePtrType BetaDevice =
|
||||||
std::dynamic_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(Device);
|
std::static_pointer_cast<FSGBetaDeviceImpl::FBetaDeviceType>(Device);
|
||||||
if (ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!")))
|
if (ensureAlwaysMsgf(BetaDevice, TEXT("Invalid BetaDevice!")))
|
||||||
{
|
{
|
||||||
TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl{
|
TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl{
|
||||||
@@ -97,7 +98,7 @@ TArray<TSharedRef<FSGDeviceImpl>> FSGDeviceListImpl::GetDevices()
|
|||||||
case ESGDeviceType::Nova2:
|
case ESGDeviceType::Nova2:
|
||||||
{
|
{
|
||||||
FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove =
|
FSGNova2GloveImpl::FNova2GlovePtrType Nova2Glove =
|
||||||
std::dynamic_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(Device);
|
std::static_pointer_cast<FSGNova2GloveImpl::FNova2GloveType>(Device);
|
||||||
if (ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove device!")))
|
if (ensureAlwaysMsgf(Nova2Glove, TEXT("Invalid Nova2Glove device!")))
|
||||||
{
|
{
|
||||||
TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl{MakeShared<FSGNova2GloveImpl>(Nova2Glove)};
|
TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl{MakeShared<FSGNova2GloveImpl>(Nova2Glove)};
|
||||||
@@ -109,7 +110,7 @@ TArray<TSharedRef<FSGDeviceImpl>> FSGDeviceListImpl::GetDevices()
|
|||||||
case ESGDeviceType::Nova:
|
case ESGDeviceType::Nova:
|
||||||
{
|
{
|
||||||
FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove =
|
FSGNovaGloveImpl::FNovaGlovePtrType NovaGlove =
|
||||||
std::dynamic_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(Device);
|
std::static_pointer_cast<FSGNovaGloveImpl::FNovaGloveType>(Device);
|
||||||
if (ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove device!")))
|
if (ensureAlwaysMsgf(NovaGlove, TEXT("Invalid NovaGlove device!")))
|
||||||
{
|
{
|
||||||
TSharedRef<FSGNovaGloveImpl> NovaGloveImpl{MakeShared<FSGNovaGloveImpl>(NovaGlove)};
|
TSharedRef<FSGNovaGloveImpl> NovaGloveImpl{MakeShared<FSGNovaGloveImpl>(NovaGlove)};
|
||||||
@@ -121,7 +122,7 @@ TArray<TSharedRef<FSGDeviceImpl>> FSGDeviceListImpl::GetDevices()
|
|||||||
case ESGDeviceType::SenseGlove:
|
case ESGDeviceType::SenseGlove:
|
||||||
{
|
{
|
||||||
FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
FSGSenseGloveImpl::FSenseGlovePtrType SenseGlove{
|
||||||
std::dynamic_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(Device)};
|
std::static_pointer_cast<FSGSenseGloveImpl::FSenseGloveType>(Device)};
|
||||||
if (ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove device!")))
|
if (ensureAlwaysMsgf(SenseGlove, TEXT("Invalid SenseGlove device!")))
|
||||||
{
|
{
|
||||||
TSharedRef<FSGSenseGloveImpl> SenseGloveImpl{
|
TSharedRef<FSGSenseGloveImpl> SenseGloveImpl{
|
||||||
@@ -134,7 +135,7 @@ TArray<TSharedRef<FSGDeviceImpl>> FSGDeviceListImpl::GetDevices()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
SGLOG_WARNING(
|
SGLOG_WARNING(
|
||||||
FString::Printf(TEXT("Unknown SenseGlove device '%s'!"), UTF8_TO_TCHAR(typeid(Device).name())),
|
FString::Printf(TEXT("Unknown SenseGlove device '%s'!"), *UEnum::GetValueAsString(FSGCoreEnumCast::ToESGDeviceType(Device->GetDeviceType()))),
|
||||||
FString::Printf(TEXT("Device ID: '%s'!"), UTF8_TO_TCHAR(Device->GetDeviceId().c_str())),
|
FString::Printf(TEXT("Device ID: '%s'!"), UTF8_TO_TCHAR(Device->GetDeviceId().c_str())),
|
||||||
FString::Printf(TEXT("Hardware Version: '%s'!"), UTF8_TO_TCHAR(Device->GetHardwareVersion().c_str())),
|
FString::Printf(TEXT("Hardware Version: '%s'!"), UTF8_TO_TCHAR(Device->GetHardwareVersion().c_str())),
|
||||||
FString::Printf(TEXT("Firmware Version: '%d'!"), Device->GetFirmwareVersion()),
|
FString::Printf(TEXT("Firmware Version: '%d'!"), Device->GetFirmwareVersion()),
|
||||||
|
|||||||
+2
-2
@@ -1322,9 +1322,9 @@ int32 SGCoreImpl_FSGDeviceListImpl_ActiveDevices()
|
|||||||
return FSGDeviceListImpl::ActiveDevices();
|
return FSGDeviceListImpl::ActiveDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SGCoreImpl_FSGDeviceListImpl_SenseCommRunning()
|
bool SGCoreImpl_FSGDeviceListImpl_SenseComRunning()
|
||||||
{
|
{
|
||||||
return FSGDeviceListImpl::SenseCommRunning();
|
return FSGDeviceListImpl::SenseComRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SGCoreImpl_FSGDeviceListImpl_Dispose()
|
void SGCoreImpl_FSGDeviceListImpl_Dispose()
|
||||||
|
|||||||
+3
-3
@@ -140,7 +140,7 @@ FSGHapticGloveImpl::FSGHapticGloveImpl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
FSGHapticGloveImpl::FSGHapticGloveImpl(const FHapticGlovePtrType HapticGlove)
|
FSGHapticGloveImpl::FSGHapticGloveImpl(const FHapticGlovePtrType HapticGlove)
|
||||||
: FSGDeviceImpl(std::dynamic_pointer_cast<FSGDeviceType>(HapticGlove)),
|
: FSGDeviceImpl(std::static_pointer_cast<FSGDeviceType>(HapticGlove)),
|
||||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -168,12 +168,12 @@ FSGHapticGloveImpl& FSGHapticGloveImpl::operator=(FSGHapticGloveImpl&& Rhs) SG_N
|
|||||||
|
|
||||||
FSGHapticGloveImpl::FHapticGlovePtrType FSGHapticGloveImpl::ToHapticGlovePtr() const
|
FSGHapticGloveImpl::FHapticGlovePtrType FSGHapticGloveImpl::ToHapticGlovePtr() const
|
||||||
{
|
{
|
||||||
return std::dynamic_pointer_cast<FHapticGloveType>(ToSGDevicePtr());
|
return std::static_pointer_cast<FHapticGloveType>(ToSGDevicePtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGHapticGloveImpl::FHapticGlovePtrType FSGHapticGloveImpl::ToHapticGlovePtrChecked() const
|
FSGHapticGloveImpl::FHapticGlovePtrType FSGHapticGloveImpl::ToHapticGlovePtrChecked() const
|
||||||
{
|
{
|
||||||
FHapticGlovePtrType HapticGlove = std::dynamic_pointer_cast<FHapticGloveType>(ToSGDevicePtr());
|
FHapticGlovePtrType HapticGlove = std::static_pointer_cast<FHapticGloveType>(ToSGDevicePtr());
|
||||||
ensureAlwaysMsgf(HapticGlove.get(), TEXT("Invalid HapticGlove"));
|
ensureAlwaysMsgf(HapticGlove.get(), TEXT("Invalid HapticGlove"));
|
||||||
return HapticGlove;
|
return HapticGlove;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -93,7 +93,7 @@ TSharedRef<FSGDeviceImpl> FSGNova2GloveImpl::Parse(const FString& ConstantsStrin
|
|||||||
FSGDevicePtrType SGDevicePtr{FNova2GloveType::Parse(MoveTemp(ConstantsStdString))};
|
FSGDevicePtrType SGDevicePtr{FNova2GloveType::Parse(MoveTemp(ConstantsStdString))};
|
||||||
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
||||||
const TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl{
|
const TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl{
|
||||||
MakeShared<FSGNova2GloveImpl>(std::dynamic_pointer_cast<FNova2GloveType>(MoveTemp(SGDevicePtr)))
|
MakeShared<FSGNova2GloveImpl>(std::static_pointer_cast<FNova2GloveType>(MoveTemp(SGDevicePtr)))
|
||||||
};
|
};
|
||||||
return Nova2GloveImpl;
|
return Nova2GloveImpl;
|
||||||
}
|
}
|
||||||
@@ -275,12 +275,12 @@ const FSGNova2GloveImpl::FNova2GloveType& FSGNova2GloveImpl::ToNova2Glove() cons
|
|||||||
|
|
||||||
FSGNova2GloveImpl::FNova2GlovePtrType FSGNova2GloveImpl::ToNova2GlovePtr() const
|
FSGNova2GloveImpl::FNova2GlovePtrType FSGNova2GloveImpl::ToNova2GlovePtr() const
|
||||||
{
|
{
|
||||||
return std::dynamic_pointer_cast<FNova2GloveType>(ToSGDevicePtr());
|
return std::static_pointer_cast<FNova2GloveType>(ToSGDevicePtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGNova2GloveImpl::FNova2GlovePtrType FSGNova2GloveImpl::ToNova2GlovePtrChecked() const
|
FSGNova2GloveImpl::FNova2GlovePtrType FSGNova2GloveImpl::ToNova2GlovePtrChecked() const
|
||||||
{
|
{
|
||||||
FNova2GlovePtrType Nova2Glove = std::dynamic_pointer_cast<FNova2GloveType>(ToSGDevicePtr());
|
FNova2GlovePtrType Nova2Glove = std::static_pointer_cast<FNova2GloveType>(ToSGDevicePtr());
|
||||||
ensureAlwaysMsgf(Nova2Glove.get(), TEXT("Invalid Nova2Glove"));
|
ensureAlwaysMsgf(Nova2Glove.get(), TEXT("Invalid Nova2Glove"));
|
||||||
return Nova2Glove;
|
return Nova2Glove;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ TSharedRef<FSGDeviceImpl> FSGNovaGloveImpl::Parse(const FString& ConstantsString
|
|||||||
FSGDevicePtrType SGDevicePtr{FNovaGloveType::Parse(MoveTemp(ConstantsStdString))};
|
FSGDevicePtrType SGDevicePtr{FNovaGloveType::Parse(MoveTemp(ConstantsStdString))};
|
||||||
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
||||||
const TSharedRef<FSGNovaGloveImpl> NovaGloveImpl{MakeShared<FSGNovaGloveImpl>(
|
const TSharedRef<FSGNovaGloveImpl> NovaGloveImpl{MakeShared<FSGNovaGloveImpl>(
|
||||||
std::dynamic_pointer_cast<FNovaGloveType>(MoveTemp(SGDevicePtr)))};
|
std::static_pointer_cast<FNovaGloveType>(MoveTemp(SGDevicePtr)))};
|
||||||
return NovaGloveImpl;
|
return NovaGloveImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,12 +288,12 @@ const FSGNovaGloveImpl::FNovaGloveType& FSGNovaGloveImpl::ToNovaGlove() const
|
|||||||
|
|
||||||
FSGNovaGloveImpl::FNovaGlovePtrType FSGNovaGloveImpl::ToNovaGlovePtr() const
|
FSGNovaGloveImpl::FNovaGlovePtrType FSGNovaGloveImpl::ToNovaGlovePtr() const
|
||||||
{
|
{
|
||||||
return std::dynamic_pointer_cast<FNovaGloveType>(ToSGDevicePtr());
|
return std::static_pointer_cast<FNovaGloveType>(ToSGDevicePtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGNovaGloveImpl::FNovaGlovePtrType FSGNovaGloveImpl::ToNovaGlovePtrChecked() const
|
FSGNovaGloveImpl::FNovaGlovePtrType FSGNovaGloveImpl::ToNovaGlovePtrChecked() const
|
||||||
{
|
{
|
||||||
FNovaGlovePtrType NovaGlove{std::dynamic_pointer_cast<FNovaGloveType>(ToSGDevicePtr())};
|
FNovaGlovePtrType NovaGlove{std::static_pointer_cast<FNovaGloveType>(ToSGDevicePtr())};
|
||||||
ensureAlwaysMsgf(NovaGlove.get(), TEXT("Invalid NovaGlove"));
|
ensureAlwaysMsgf(NovaGlove.get(), TEXT("Invalid NovaGlove"));
|
||||||
return NovaGlove;
|
return NovaGlove;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -93,7 +93,7 @@ TSharedRef<FSGDeviceImpl> FSGSenseGloveImpl::Parse(const FString& ConstantsStrin
|
|||||||
FSGDevicePtrType SGDevicePtr{FSenseGloveType::Parse(MoveTemp(ConstantsStdString))};
|
FSGDevicePtrType SGDevicePtr{FSenseGloveType::Parse(MoveTemp(ConstantsStdString))};
|
||||||
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
ensureAlwaysMsgf(SGDevicePtr, TEXT("Invalid SGDevice!"));
|
||||||
const TSharedRef<FSGSenseGloveImpl> SenseGloveImpl{
|
const TSharedRef<FSGSenseGloveImpl> SenseGloveImpl{
|
||||||
MakeShared<FSGSenseGloveImpl>(std::dynamic_pointer_cast<FSenseGloveType>(MoveTemp(SGDevicePtr)))
|
MakeShared<FSGSenseGloveImpl>(std::static_pointer_cast<FSenseGloveType>(MoveTemp(SGDevicePtr)))
|
||||||
};
|
};
|
||||||
return SenseGloveImpl;
|
return SenseGloveImpl;
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ FSGSenseGloveImpl::FSGSenseGloveImpl(const FSenseGloveType SenseGlove)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FSGSenseGloveImpl::FSGSenseGloveImpl(const FSenseGlovePtrType SenseGlove)
|
FSGSenseGloveImpl::FSGSenseGloveImpl(const FSenseGlovePtrType SenseGlove)
|
||||||
: FSGHapticGloveImpl(std::dynamic_pointer_cast<FHapticGloveType>(SenseGlove)),
|
: FSGHapticGloveImpl(std::static_pointer_cast<FHapticGloveType>(SenseGlove)),
|
||||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -310,12 +310,12 @@ const FSGSenseGloveImpl::FSenseGloveType& FSGSenseGloveImpl::ToSenseGlove() cons
|
|||||||
|
|
||||||
FSGSenseGloveImpl::FSenseGlovePtrType FSGSenseGloveImpl::ToSenseGlovePtr() const
|
FSGSenseGloveImpl::FSenseGlovePtrType FSGSenseGloveImpl::ToSenseGlovePtr() const
|
||||||
{
|
{
|
||||||
return std::dynamic_pointer_cast<FSenseGloveType>(ToSGDevicePtr());
|
return std::static_pointer_cast<FSenseGloveType>(ToSGDevicePtr());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGSenseGloveImpl::FSenseGlovePtrType FSGSenseGloveImpl::ToSenseGlovePtrChecked() const
|
FSGSenseGloveImpl::FSenseGlovePtrType FSGSenseGloveImpl::ToSenseGlovePtrChecked() const
|
||||||
{
|
{
|
||||||
FSenseGlovePtrType SenseGlove = std::dynamic_pointer_cast<FSenseGloveType>(ToSGDevicePtr());
|
FSenseGlovePtrType SenseGlove = std::static_pointer_cast<FSenseGloveType>(ToSGDevicePtr());
|
||||||
ensureAlwaysMsgf(SenseGlove.get(), TEXT("Invalid SenseGlove"));
|
ensureAlwaysMsgf(SenseGlove.get(), TEXT("Invalid SenseGlove"));
|
||||||
return SenseGlove;
|
return SenseGlove;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
static int32 ActiveDevices();
|
static int32 ActiveDevices();
|
||||||
|
|
||||||
static bool SenseCommRunning();
|
static bool SenseComRunning();
|
||||||
|
|
||||||
static void Dispose();
|
static void Dispose();
|
||||||
|
|
||||||
@@ -64,15 +64,35 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static TArray<TSharedRef<FSGDeviceImpl>> GetDevices()
|
static TArray<TSharedRef<FSGDeviceImpl>> GetDevices()
|
||||||
{
|
{
|
||||||
const std::type_info& TType = typeid(T);
|
ESGDeviceType TargetType = ESGDeviceType::Unknown;
|
||||||
|
|
||||||
|
if constexpr (std::is_same_v<T, FSGNova2GloveImpl>)
|
||||||
|
{
|
||||||
|
TargetType = ESGDeviceType::Nova2;
|
||||||
|
}
|
||||||
|
else if constexpr (std::is_same_v<T, FSGNovaGloveImpl>)
|
||||||
|
{
|
||||||
|
TargetType = ESGDeviceType::Nova;
|
||||||
|
}
|
||||||
|
else if constexpr (std::is_same_v<T, FSGSenseGloveImpl>)
|
||||||
|
{
|
||||||
|
TargetType = ESGDeviceType::SenseGlove;
|
||||||
|
}
|
||||||
|
else if constexpr (std::is_same_v<T, FSGBetaDeviceImpl>)
|
||||||
|
{
|
||||||
|
TargetType = ESGDeviceType::BetaDevice;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static_assert(!sizeof(T), "Unsupported device type in GetDevices<T>()");
|
||||||
|
}
|
||||||
|
|
||||||
const TArray<TSharedRef<FSGDeviceImpl>> CurrentDevices = GetDevices();
|
const TArray<TSharedRef<FSGDeviceImpl>> CurrentDevices = GetDevices();
|
||||||
TArray<TSharedRef<FSGDeviceImpl>> Devices;
|
TArray<TSharedRef<FSGDeviceImpl>> Devices;
|
||||||
|
|
||||||
for (TSharedRef<FSGDeviceImpl> Device : CurrentDevices)
|
for (TSharedRef<FSGDeviceImpl> Device : CurrentDevices)
|
||||||
{
|
{
|
||||||
auto &d = Device.Get();
|
if (Device->GetDeviceType() == TargetType)
|
||||||
const std::type_info& DType = typeid(d);
|
|
||||||
if (DType.hash_code() == TType.hash_code())
|
|
||||||
{
|
{
|
||||||
Devices.Push(Device);
|
Devices.Push(Device);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -680,7 +680,7 @@ SENSEGLOVECOREIMPL_PUBLIC_API void SGCoreImpl_FSGDeviceImpl_ToString(
|
|||||||
|
|
||||||
SENSEGLOVECOREIMPL_PUBLIC_API int32 SGCoreImpl_FSGDeviceListImpl_ActiveDevices();
|
SENSEGLOVECOREIMPL_PUBLIC_API int32 SGCoreImpl_FSGDeviceListImpl_ActiveDevices();
|
||||||
|
|
||||||
SENSEGLOVECOREIMPL_PUBLIC_API bool SGCoreImpl_FSGDeviceListImpl_SenseCommRunning();
|
SENSEGLOVECOREIMPL_PUBLIC_API bool SGCoreImpl_FSGDeviceListImpl_SenseComRunning();
|
||||||
|
|
||||||
SENSEGLOVECOREIMPL_PUBLIC_API void SGCoreImpl_FSGDeviceListImpl_Dispose();
|
SENSEGLOVECOREIMPL_PUBLIC_API void SGCoreImpl_FSGDeviceListImpl_Dispose();
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public class SenseGloveCoreImpl : ModuleRules
|
|||||||
{
|
{
|
||||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
bEnableExceptions = true;
|
bEnableExceptions = false;
|
||||||
bUseRTTI = true;
|
bUseRTTI = false;
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(
|
PrivateDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
@@ -57,7 +57,12 @@ public class SenseGloveCoreImpl : ModuleRules
|
|||||||
PrivateDependencyModuleNames.AddRange(
|
PrivateDependencyModuleNames.AddRange(
|
||||||
new string[]
|
new string[]
|
||||||
{
|
{
|
||||||
|
"SGCommonThirdPartyLibs",
|
||||||
|
"SGCoreShmThirdPartyLibs",
|
||||||
"SGCoreThirdPartyLibs",
|
"SGCoreThirdPartyLibs",
|
||||||
|
"SGLogThirdPartyLibs",
|
||||||
|
"SGFmtThirdPartyLibs",
|
||||||
|
"SGLoguruThirdPartyLibs",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -43,9 +43,9 @@ int32 USGDeviceListKismetLibrary::ActiveDevices()
|
|||||||
return FSGDeviceList::ActiveDevices();
|
return FSGDeviceList::ActiveDevices();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USGDeviceListKismetLibrary::SenseCommRunning()
|
bool USGDeviceListKismetLibrary::SenseComRunning()
|
||||||
{
|
{
|
||||||
return FSGDeviceList::SenseCommRunning();
|
return FSGDeviceList::SenseComRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USGDeviceListKismetLibrary::Dispose()
|
void USGDeviceListKismetLibrary::Dispose()
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ public:
|
|||||||
* Returns true if the SenseCom program is running.
|
* Returns true if the SenseCom program is running.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Device List")
|
||||||
static bool SenseCommRunning();
|
static bool SenseComRunning();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the device list, and block any further attempt to add to it until ReInitialize is called.
|
* Clear the device list, and block any further attempt to add to it until ReInitialize is called.
|
||||||
|
|||||||
@@ -44,49 +44,32 @@
|
|||||||
#include "SGDebug/SGDebugCube.h"
|
#include "SGDebug/SGDebugCube.h"
|
||||||
#include "SGDebug/SGDebugGizmo.h"
|
#include "SGDebug/SGDebugGizmo.h"
|
||||||
|
|
||||||
void FSGDebugVirtualHand::Draw(const UWorld* World,
|
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
|
||||||
const FSGVirtualHandDebuggingSettings& Settings)
|
|
||||||
{
|
|
||||||
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
|
||||||
TEXT("Invalid virtual hand drawing mode!"));
|
|
||||||
|
|
||||||
ensureAlwaysMsgf(MotionControllerData.bValid,
|
|
||||||
TEXT("Invalid motion controller data!"));
|
|
||||||
|
|
||||||
ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(),
|
|
||||||
TEXT("Mismatched motion controller data positions and rotations!"));
|
|
||||||
|
|
||||||
for (TArray<FVector>::SizeType HandKeyIndex = 0;
|
|
||||||
HandKeyIndex < MotionControllerData.HandKeyPositions.Num(); ++HandKeyIndex)
|
|
||||||
{
|
|
||||||
const FVector& HandKeyPosition{MotionControllerData.HandKeyPositions[HandKeyIndex]};
|
|
||||||
const FQuat& HandKeyRotation{MotionControllerData.HandKeyRotations[HandKeyIndex]};
|
|
||||||
|
|
||||||
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
|
|
||||||
{
|
|
||||||
FSGDebugCube::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugCubicHandSettings);
|
|
||||||
}
|
|
||||||
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
|
|
||||||
{
|
|
||||||
FSGDebugGizmo::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugGizmoHandSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
void FSGDebugVirtualHand::Draw(const UWorld* World,
|
void FSGDebugVirtualHand::Draw(
|
||||||
const FXRHandTrackingState& HandTrackingState,
|
const UWorld* World,
|
||||||
const FSGVirtualHandDebuggingSettings& Settings)
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
const FSGVirtualHandDebuggingSettings& Settings)
|
||||||
{
|
{
|
||||||
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
if (!ensureAlwaysMsgf(
|
||||||
TEXT("Invalid virtual hand drawing mode!"));
|
Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||||
|
TEXT("Invalid virtual hand drawing mode!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
ensureAlwaysMsgf(HandTrackingState.bValid,
|
if (!ensureAlwaysMsgf(
|
||||||
TEXT("Invalid hand tracking state!"));
|
HandTrackingState.bValid,
|
||||||
|
TEXT("Invalid hand tracking state!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
if (!ensureAlwaysMsgf(
|
||||||
TEXT("Mismatched hand tracking state locations and rotations!"));
|
HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
||||||
|
TEXT("Mismatched hand tracking state locations and rotations!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
for (TArray<FVector>::SizeType HandKeyIndex = 0;
|
for (TArray<FVector>::SizeType HandKeyIndex = 0;
|
||||||
HandKeyIndex < HandTrackingState.HandKeyLocations.Num(); ++HandKeyIndex)
|
HandKeyIndex < HandTrackingState.HandKeyLocations.Num(); ++HandKeyIndex)
|
||||||
|
|||||||
@@ -48,12 +48,6 @@ class UWorld;
|
|||||||
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
|
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UE_DEPRECATED(5.5, "Deprecated in favor of the variant that accepts FXRHandTrackingState")
|
|
||||||
static void Draw(
|
|
||||||
const UWorld* World,
|
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
|
||||||
const FSGVirtualHandDebuggingSettings& Settings);
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
static void Draw(
|
static void Draw(
|
||||||
const UWorld* World,
|
const UWorld* World,
|
||||||
|
|||||||
-12
@@ -37,18 +37,6 @@
|
|||||||
|
|
||||||
#include "SGDebug/SGDebugVirtualHand.h"
|
#include "SGDebug/SGDebugVirtualHand.h"
|
||||||
|
|
||||||
void USGDebugVirtualHandKismetLibrary::Draw_FXRMotionControllerData(
|
|
||||||
UObject* WorldContextObject,
|
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
|
||||||
const FSGVirtualHandDebuggingSettings& Settings)
|
|
||||||
{
|
|
||||||
ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!"));
|
|
||||||
|
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
FSGDebugVirtualHand::Draw(WorldContextObject->GetWorld(), MotionControllerData, Settings);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
}
|
|
||||||
|
|
||||||
void USGDebugVirtualHandKismetLibrary::Draw_FXRHandTrackingState(
|
void USGDebugVirtualHandKismetLibrary::Draw_FXRHandTrackingState(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
const FXRHandTrackingState& HandTrackingState,
|
const FXRHandTrackingState& HandTrackingState,
|
||||||
|
|||||||
-7
@@ -50,13 +50,6 @@ class SENSEGLOVEDEBUGKISMET_API USGDebugVirtualHandKismetLibrary final : public
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand",
|
|
||||||
meta=(WorldContext="WorldContextObject"))
|
|
||||||
static void Draw_FXRMotionControllerData(
|
|
||||||
UObject* WorldContextObject,
|
|
||||||
const FXRMotionControllerData& MotionControllerData,
|
|
||||||
const FSGVirtualHandDebuggingSettings& Settings);
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand",
|
UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand",
|
||||||
meta=(WorldContext="WorldContextObject"))
|
meta=(WorldContext="WorldContextObject"))
|
||||||
static void Draw_FXRHandTrackingState(
|
static void Draw_FXRHandTrackingState(
|
||||||
|
|||||||
+15
-4
@@ -60,14 +60,14 @@ void UTouchComponentKismetLibrary::SetForceFeedbackLevel(USGTouchComponent* Touc
|
|||||||
TouchComponent->SetForceFeedbackLevel(Level);
|
TouchComponent->SetForceFeedbackLevel(Level);
|
||||||
}
|
}
|
||||||
|
|
||||||
float UTouchComponentKismetLibrary::GetVibrotactileLevel(const USGTouchComponent* TouchComponent)
|
float UTouchComponentKismetLibrary::GetVibrotactileAmplitude(const USGTouchComponent* TouchComponent)
|
||||||
{
|
{
|
||||||
return TouchComponent->GetVibrotactileLevel();
|
return TouchComponent->GetVibrotactileAmplitude();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UTouchComponentKismetLibrary::SetVibrotactileLevel(USGTouchComponent* TouchComponent, const float Level)
|
void UTouchComponentKismetLibrary::SetVibrotactileAmplitude(USGTouchComponent* TouchComponent, const float Amplitude)
|
||||||
{
|
{
|
||||||
TouchComponent->SetVibrotactileLevel(Level);
|
TouchComponent->SetVibrotactileAmplitude(Amplitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
float UTouchComponentKismetLibrary::GetVibrotactileDuration(const USGTouchComponent* TouchComponent)
|
float UTouchComponentKismetLibrary::GetVibrotactileDuration(const USGTouchComponent* TouchComponent)
|
||||||
@@ -79,3 +79,14 @@ void UTouchComponentKismetLibrary::SetVibrotactileDuration(USGTouchComponent* To
|
|||||||
{
|
{
|
||||||
TouchComponent->SetVibrotactileDuration(Duration);
|
TouchComponent->SetVibrotactileDuration(Duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float UTouchComponentKismetLibrary::GetVibrotactileFrequency(const USGTouchComponent* TouchComponent)
|
||||||
|
{
|
||||||
|
return TouchComponent->GetVibrotactileFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UTouchComponentKismetLibrary::SetVibrotactileFrequency(USGTouchComponent* TouchComponent, const float Frequency)
|
||||||
|
{
|
||||||
|
TouchComponent->SetVibrotactileFrequency(Frequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-19
@@ -110,26 +110,10 @@ USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove(
|
|||||||
return VirtualHandComponent->GetConnectedGlove();
|
return VirtualHandComponent->GetConnectedGlove();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UVirtualHandComponentKismetLibrary::GetMotionControllerData(
|
const FXRHandTrackingState& UVirtualHandComponentKismetLibrary::GetHandTrackingState(
|
||||||
USGVirtualHandComponent* VirtualHandComponent, FXRMotionControllerData& OutMotionControllerData)
|
USGVirtualHandComponent* VirtualHandComponent)
|
||||||
{
|
{
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
return VirtualHandComponent->GetHandTrackingState();
|
||||||
return VirtualHandComponent->GetMotionControllerData(OutMotionControllerData);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UVirtualHandComponentKismetLibrary::GetMotionControllerState(USGVirtualHandComponent* VirtualHandComponent,
|
|
||||||
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState)
|
|
||||||
{
|
|
||||||
return VirtualHandComponent->GetMotionControllerState(
|
|
||||||
XRSpaceType, XRControllerPoseType, OutMotionControllerState);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UVirtualHandComponentKismetLibrary::GetHandTrackingState(USGVirtualHandComponent* VirtualHandComponent,
|
|
||||||
const EXRSpaceType XRSpaceType, FXRHandTrackingState& OutHandTrackingState)
|
|
||||||
{
|
|
||||||
return VirtualHandComponent->GetHandTrackingState(XRSpaceType, OutHandTrackingState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetHandBoneNames(
|
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetHandBoneNames(
|
||||||
|
|||||||
+3
-22
@@ -90,27 +90,8 @@ const FRotator& UWristTrackerComponentKismetLibrary::GetWristRotation(
|
|||||||
return WristTrackerComponent->GetWristRotation();
|
return WristTrackerComponent->GetWristRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UWristTrackerComponentKismetLibrary::GetMotionControllerData(
|
const FXRHandTrackingState& UWristTrackerComponentKismetLibrary::GetHandTrackingState(
|
||||||
USGWristTrackerComponent* WristTrackerComponent, FXRMotionControllerData& OutMotionControllerData)
|
USGWristTrackerComponent* WristTrackerComponent)
|
||||||
{
|
{
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
return WristTrackerComponent->GetHandTrackingState();
|
||||||
return WristTrackerComponent->GetMotionControllerData(OutMotionControllerData);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UWristTrackerComponentKismetLibrary::GetMotionControllerState(
|
|
||||||
USGWristTrackerComponent* WristTrackerComponent,
|
|
||||||
const EXRSpaceType XRSpaceType, const EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState)
|
|
||||||
{
|
|
||||||
return WristTrackerComponent->GetMotionControllerState(
|
|
||||||
XRSpaceType, XRControllerPoseType, OutMotionControllerState);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UWristTrackerComponentKismetLibrary::GetHandTrackingState(
|
|
||||||
USGWristTrackerComponent* WristTrackerComponent,
|
|
||||||
const EXRSpaceType XRSpaceType, FXRHandTrackingState& OutHandTrackingState)
|
|
||||||
{
|
|
||||||
return WristTrackerComponent->GetHandTrackingState(
|
|
||||||
XRSpaceType, OutHandTrackingState);
|
|
||||||
}
|
}
|
||||||
+8
-2
@@ -61,14 +61,20 @@ public:
|
|||||||
static void SetForceFeedbackLevel(UPARAM(ref) USGTouchComponent* TouchComponent, float Level);
|
static void SetForceFeedbackLevel(UPARAM(ref) USGTouchComponent* TouchComponent, float Level);
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||||
static float GetVibrotactileLevel(const USGTouchComponent* TouchComponent);
|
static float GetVibrotactileAmplitude(const USGTouchComponent* TouchComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||||
static void SetVibrotactileLevel(UPARAM(ref) USGTouchComponent* TouchComponent, float Level);
|
static void SetVibrotactileAmplitude(UPARAM(ref) USGTouchComponent* TouchComponent, float Amplitude);
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||||
static float GetVibrotactileDuration(const USGTouchComponent* TouchComponent);
|
static float GetVibrotactileDuration(const USGTouchComponent* TouchComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||||
static void SetVibrotactileDuration(UPARAM(ref) USGTouchComponent* TouchComponent, float Duration);
|
static void SetVibrotactileDuration(UPARAM(ref) USGTouchComponent* TouchComponent, float Duration);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||||
|
static float GetVibrotactileFrequency(const USGTouchComponent* TouchComponent);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||||
|
static void SetVibrotactileFrequency(UPARAM(ref) USGTouchComponent* TouchComponent, float Frequency);
|
||||||
};
|
};
|
||||||
+2
-12
@@ -103,18 +103,8 @@ public:
|
|||||||
static USGHapticGlove* GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent);
|
static USGHapticGlove* GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||||
static bool GetMotionControllerData(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
static const FXRHandTrackingState& GetHandTrackingState(
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
|
||||||
static bool GetMotionControllerState(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
|
||||||
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState);
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
|
||||||
static bool GetHandTrackingState(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
|
||||||
EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState);
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||||
static const TArray<FName>& GetHandBoneNames(const USGVirtualHandComponent* VirtualHandComponent);
|
static const TArray<FName>& GetHandBoneNames(const USGVirtualHandComponent* VirtualHandComponent);
|
||||||
|
|||||||
+2
-12
@@ -84,16 +84,6 @@ public:
|
|||||||
static const FRotator& GetWristRotation(const USGWristTrackerComponent* WristTrackerComponent);
|
static const FRotator& GetWristRotation(const USGWristTrackerComponent* WristTrackerComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||||
static bool GetMotionControllerData(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
static const FXRHandTrackingState& GetHandTrackingState(
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
|
||||||
static bool GetMotionControllerState(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
|
||||||
EXRSpaceType XRSpaceType, EXRControllerPoseType XRControllerPoseType,
|
|
||||||
FXRMotionControllerState& OutMotionControllerState);
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
|
||||||
static bool GetHandTrackingState(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
|
||||||
EXRSpaceType XRSpaceType,
|
|
||||||
FXRHandTrackingState& OutHandTrackingState);
|
|
||||||
};
|
};
|
||||||
@@ -49,12 +49,7 @@ public class SenseGloveKismet : ModuleRules
|
|||||||
"CoreUObject",
|
"CoreUObject",
|
||||||
"Engine",
|
"Engine",
|
||||||
"HeadMountedDisplay",
|
"HeadMountedDisplay",
|
||||||
// NOTE
|
|
||||||
// UE 5.3+ provides UXRDeviceVisualizationComponent as part of the XRBase plugin.
|
|
||||||
// UE 5.2 provides UXRDeviceVisualizationComponent as part of the HeadMountDisplay module.
|
|
||||||
#if UE_5_3_OR_LATER
|
|
||||||
"XRBase",
|
"XRBase",
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -37,13 +37,13 @@
|
|||||||
|
|
||||||
FSGGloveTrackingSettings::FSGGloveTrackingSettings()
|
FSGGloveTrackingSettings::FSGGloveTrackingSettings()
|
||||||
: FSGGloveTrackingSettings{
|
: FSGGloveTrackingSettings{
|
||||||
1000.0f / 60.0f
|
60.0f
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FSGGloveTrackingSettings::FSGGloveTrackingSettings(
|
FSGGloveTrackingSettings::FSGGloveTrackingSettings(
|
||||||
const float InGloveConnectivityCheckInterval)
|
const float InDataRetrievalRefreshRate)
|
||||||
: GloveConnectivityCheckInterval(InGloveConnectivityCheckInterval)
|
: DataRetrievalRefreshRate(InDataRetrievalRefreshRate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
+5
-4
@@ -51,16 +51,17 @@ struct SENSEGLOVESETTINGS_API FSGGloveTrackingSettings
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* The interval in which the tracking module checks for glove connectivity (in milliseconds).
|
* The glove data retrieval refresh rate. This affects the interval in which
|
||||||
|
* the tracking module checks for glove connectivity and data retrieval.
|
||||||
*
|
*
|
||||||
* The default is 16.666666f which means 60 times per second.
|
* The default is s 60Hz (data retrieval operations per second).
|
||||||
*/
|
*/
|
||||||
UPROPERTY(Config, EditDefaultsOnly, Category="Glove Tracking")
|
UPROPERTY(Config, EditDefaultsOnly, Category="Glove Tracking")
|
||||||
float GloveConnectivityCheckInterval;
|
float DataRetrievalRefreshRate;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FSGGloveTrackingSettings();
|
FSGGloveTrackingSettings();
|
||||||
|
|
||||||
explicit FSGGloveTrackingSettings(
|
explicit FSGGloveTrackingSettings(
|
||||||
float InGloveConnectivityCheckInterval);
|
float InDataRetrievalRefreshRate);
|
||||||
};
|
};
|
||||||
@@ -58,7 +58,7 @@ struct USGGloveTracker::FImpl
|
|||||||
{
|
{
|
||||||
const USGSettings* Settings{USGSettings::GetInstance()};
|
const USGSettings* Settings{USGSettings::GetInstance()};
|
||||||
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
|
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
|
||||||
return Settings->GetTrackingSettings().GloveTrackingSettings.GloveConnectivityCheckInterval * 0.001f;
|
return 1.0f / Settings->GetTrackingSettings().GloveTrackingSettings.DataRetrievalRefreshRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
@@ -124,24 +124,24 @@ void USGGloveTracker::Initialize(FSubsystemCollectionBase& Collection)
|
|||||||
{
|
{
|
||||||
SGLOG("Starting the glove connectivity check timer...");
|
SGLOG("Starting the glove connectivity check timer...");
|
||||||
|
|
||||||
const float GloveConnectivityCheckInterval = FImpl::GetGloveConnectivityCheckInterval();
|
const float Interval = FImpl::GetGloveConnectivityCheckInterval();
|
||||||
|
|
||||||
FTimerDelegate GloveConnectivityCheckHandler;
|
FTimerDelegate Handler;
|
||||||
GloveConnectivityCheckHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
|
Handler.BindLambda([= SG_CAPTURE_THIS]()-> void
|
||||||
{
|
{
|
||||||
Pimpl->UpdateGloves();
|
Pimpl->UpdateGloves();
|
||||||
});
|
});
|
||||||
|
|
||||||
FTimerManager& TimerManager = World->GetTimerManager();
|
FTimerManager& TimerManager = World->GetTimerManager();
|
||||||
TimerManager.SetTimer(
|
TimerManager.SetTimer(
|
||||||
Pimpl->GloveConnectivityCheckTimer, GloveConnectivityCheckHandler, GloveConnectivityCheckInterval,
|
Pimpl->GloveConnectivityCheckTimer, Handler, Interval,
|
||||||
true, -1.0f);
|
true, -1.0f);
|
||||||
|
|
||||||
if (ensureAlwaysMsgf(TimerManager.IsTimerActive(Pimpl->GloveConnectivityCheckTimer),
|
if (ensureAlwaysMsgf(TimerManager.IsTimerActive(Pimpl->GloveConnectivityCheckTimer),
|
||||||
TEXT("GloveConnectivityCheckTimer is not active")))
|
TEXT("GloveConnectivityCheckTimer is not active")))
|
||||||
{
|
{
|
||||||
SGLOG("The glove connectivity check timer has been started successfully!");
|
SGLOG("The glove connectivity check timer has been started successfully!");
|
||||||
SGLOG("The glove connectivity timer interval is: ", GloveConnectivityCheckInterval);
|
SGLOG("The glove connectivity timer interval is: ", Interval);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,9 +56,6 @@
|
|||||||
#include "Misc/Timespan.h"
|
#include "Misc/Timespan.h"
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
|
||||||
#include "OpenXRCore.h"
|
#include "OpenXRCore.h"
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3
|
|
||||||
#include "OpenXRHMD.h"
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 */
|
|
||||||
|
|
||||||
#include "SGCore/SGHapticGlove.h"
|
#include "SGCore/SGHapticGlove.h"
|
||||||
#include "SGLog/SGLog.h"
|
#include "SGLog/SGLog.h"
|
||||||
@@ -71,20 +68,6 @@
|
|||||||
#include "SGUtils/SGEngineUtils.h"
|
#include "SGUtils/SGEngineUtils.h"
|
||||||
#include "SGUtils/SGPluginUtils.h"
|
#include "SGUtils/SGPluginUtils.h"
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3
|
|
||||||
void EnumerateOpenXRApiLayers(TArray<XrApiLayerProperties>& OutProperties)
|
|
||||||
{
|
|
||||||
uint32 Count = 0;
|
|
||||||
XR_ENSURE(xrEnumerateApiLayerProperties(0, &Count, nullptr));
|
|
||||||
OutProperties.SetNum(Count);
|
|
||||||
for (auto& Prop: OutProperties)
|
|
||||||
{
|
|
||||||
Prop = XrApiLayerProperties{XR_TYPE_API_LAYER_PROPERTIES};
|
|
||||||
}
|
|
||||||
XR_ENSURE(xrEnumerateApiLayerProperties(Count, &Count, OutProperties.GetData()));
|
|
||||||
}
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 3 */
|
|
||||||
|
|
||||||
struct FSGXRTracker::FImpl
|
struct FSGXRTracker::FImpl
|
||||||
{
|
{
|
||||||
/************************
|
/************************
|
||||||
@@ -667,6 +650,10 @@ struct FSGXRTracker::FImpl
|
|||||||
|
|
||||||
void BuildMotionSourceToKeypointMap();
|
void BuildMotionSourceToKeypointMap();
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7
|
||||||
|
void CreateHandTracker(XrSession InSession, XrHandEXT HandEXT, FSGXRHandState& HandState) const;
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
|
|
||||||
bool CanOutputTrackingData(EControllerHand Hand) const;
|
bool CanOutputTrackingData(EControllerHand Hand) const;
|
||||||
|
|
||||||
bool UpdateXRHandTrackingData(FSGXRHandState& OutHandState, const XrHandJointsLocateInfoEXT& LocateInfo) const;
|
bool UpdateXRHandTrackingData(FSGXRHandState& OutHandState, const XrHandJointsLocateInfoEXT& LocateInfo) const;
|
||||||
@@ -1026,6 +1013,8 @@ FTransform FSGXRTracker::FImpl::GetMeshFingerStartBoneRefTransform(
|
|||||||
return Transform;
|
return Transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
|
|
||||||
bool FSGXRTracker::GetMotionControllerData(
|
bool FSGXRTracker::GetMotionControllerData(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
const EControllerHand Hand,
|
const EControllerHand Hand,
|
||||||
@@ -1251,6 +1240,8 @@ bool FSGXRTracker::GetMotionControllerData(
|
|||||||
return OutMotionControllerData.bValid;
|
return OutMotionControllerData.bValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
|
|
||||||
bool FSGXRTracker::GetMotionControllerState(
|
bool FSGXRTracker::GetMotionControllerState(
|
||||||
@@ -1495,6 +1486,7 @@ bool FSGXRTracker::GetHandTrackingState(
|
|||||||
OutHandTrackingState.HandKeyRadii,
|
OutHandTrackingState.HandKeyRadii,
|
||||||
bTracked);
|
bTracked);
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7
|
||||||
/// TODO
|
/// TODO
|
||||||
// Begin backward compatibility with the deprecated function, remove this block along with the deprecated
|
// Begin backward compatibility with the deprecated function, remove this block along with the deprecated
|
||||||
// GetAllKeypointStates.
|
// GetAllKeypointStates.
|
||||||
@@ -1511,6 +1503,7 @@ bool FSGXRTracker::GetHandTrackingState(
|
|||||||
// The inability to distinguish this is the reason for the deprecation.
|
// The inability to distinguish this is the reason for the deprecation.
|
||||||
}
|
}
|
||||||
// End backward compability.
|
// End backward compability.
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */
|
||||||
|
|
||||||
if (!ensureAlwaysMsgf(
|
if (!ensureAlwaysMsgf(
|
||||||
!OutHandTrackingState.bValid
|
!OutHandTrackingState.bValid
|
||||||
@@ -1606,7 +1599,7 @@ bool FSGXRTracker::GetRequiredExtensions(TArray<const ANSICHAR*>& OutExtensions)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OutExtensions.Add("XR_EXT_hand_tracking");
|
OutExtensions.Add(XR_EXT_HAND_TRACKING_EXTENSION_NAME);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1655,21 +1648,29 @@ const void* FSGXRTracker::OnBeginSession(const XrSession InSession, const void*
|
|||||||
|
|
||||||
// Create a hand tracker for the left hand that tracks default set of hand joints.
|
// Create a hand tracker for the left hand that tracks default set of hand joints.
|
||||||
FSGXRHandState& LeftHandState{Pimpl->GetLeftHandState()};
|
FSGXRHandState& LeftHandState{Pimpl->GetLeftHandState()};
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7
|
||||||
|
Pimpl->CreateHandTracker(InSession, XR_HAND_LEFT_EXT, LeftHandState);
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
{
|
{
|
||||||
XrHandTrackerCreateInfoEXT CreateInfo{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT};
|
XrHandTrackerCreateInfoEXT CreateInfo{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT};
|
||||||
CreateInfo.hand = XR_HAND_LEFT_EXT;
|
CreateInfo.hand = XR_HAND_LEFT_EXT;
|
||||||
CreateInfo.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT;
|
CreateInfo.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT;
|
||||||
XR_ENSURE(Pimpl->XRCreateHandTrackerEXT(InSession, &CreateInfo, &LeftHandState.HandTracker));
|
XR_ENSURE(Pimpl->XRCreateHandTrackerEXT(InSession, &CreateInfo, &LeftHandState.HandTracker));
|
||||||
}
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
|
|
||||||
// Create a hand tracker for the right hand that tracks default set of hand joints.
|
// Create a hand tracker for the right hand that tracks default set of hand joints.
|
||||||
FSGXRHandState& RightHandState{Pimpl->GetRightHandState()};
|
FSGXRHandState& RightHandState{Pimpl->GetRightHandState()};
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7
|
||||||
|
Pimpl->CreateHandTracker(InSession, XR_HAND_RIGHT_EXT, RightHandState);
|
||||||
|
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
{
|
{
|
||||||
XrHandTrackerCreateInfoEXT CreateInfo{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT};
|
XrHandTrackerCreateInfoEXT CreateInfo{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT};
|
||||||
CreateInfo.hand = XR_HAND_RIGHT_EXT;
|
CreateInfo.hand = XR_HAND_RIGHT_EXT;
|
||||||
CreateInfo.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT;
|
CreateInfo.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT;
|
||||||
XR_ENSURE(Pimpl->XRCreateHandTrackerEXT(InSession, &CreateInfo, &RightHandState.HandTracker));
|
XR_ENSURE(Pimpl->XRCreateHandTrackerEXT(InSession, &CreateInfo, &RightHandState.HandTracker));
|
||||||
}
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
}
|
}
|
||||||
|
|
||||||
return InNext;
|
return InNext;
|
||||||
@@ -1726,15 +1727,9 @@ void FSGXRTracker::UpdateDeviceLocations(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3
|
|
||||||
bool FSGXRTracker::GetControllerOrientationAndPosition(const int32 ControllerIndex, const FName MotionSource,
|
bool FSGXRTracker::GetControllerOrientationAndPosition(const int32 ControllerIndex, const FName MotionSource,
|
||||||
FRotator& OutOrientation, FVector& OutPosition,
|
FRotator& OutOrientation, FVector& OutPosition,
|
||||||
const float WorldToMetersScale) const
|
const float WorldToMetersScale) const
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
bool FSGXRTracker::GetControllerOrientationAndPosition(const int32 ControllerIndex, const EControllerHand DeviceHand,
|
|
||||||
FRotator& OutOrientation, FVector& OutPosition,
|
|
||||||
const float WorldToMetersScale) const
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
{
|
{
|
||||||
if (!IsHandTrackingStateValid())
|
if (!IsHandTrackingStateValid())
|
||||||
{
|
{
|
||||||
@@ -1753,10 +1748,6 @@ bool FSGXRTracker::GetControllerOrientationAndPosition(const int32 ControllerInd
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 2
|
|
||||||
const FName& MotionSource{FImpl::GetControllerHandEnumName(DeviceHand)};
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 2 */
|
|
||||||
|
|
||||||
FTransform ControllerTransform;
|
FTransform ControllerTransform;
|
||||||
bool bMotionSourceHandTracking;
|
bool bMotionSourceHandTracking;
|
||||||
const bool bGotTransform = Pimpl->GetControllerTransform(MotionSource, WorldToMetersScale,
|
const bool bGotTransform = Pimpl->GetControllerTransform(MotionSource, WorldToMetersScale,
|
||||||
@@ -1769,22 +1760,13 @@ bool FSGXRTracker::GetControllerOrientationAndPosition(const int32 ControllerInd
|
|||||||
return bGotTransform;
|
return bGotTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3
|
|
||||||
ETrackingStatus FSGXRTracker::GetControllerTrackingStatus(const int32 ControllerIndex, const FName MotionSource) const
|
ETrackingStatus FSGXRTracker::GetControllerTrackingStatus(const int32 ControllerIndex, const FName MotionSource) const
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
ETrackingStatus FSGXRTracker::GetControllerTrackingStatus(const int32 ControllerIndex,
|
|
||||||
const EControllerHand DeviceHand) const
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
{
|
{
|
||||||
if (!IsHandTrackingStateValid())
|
if (!IsHandTrackingStateValid())
|
||||||
{
|
{
|
||||||
return ETrackingStatus::NotTracked;
|
return ETrackingStatus::NotTracked;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 2
|
|
||||||
const FName& MotionSource{FImpl::GetControllerHandEnumName(DeviceHand)};
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 2 */
|
|
||||||
|
|
||||||
const FImpl::FSGMotionSourceInfo* KeyPointInfoPtr{Pimpl->MotionSourceToKeypointMap.Find(MotionSource)};
|
const FImpl::FSGMotionSourceInfo* KeyPointInfoPtr{Pimpl->MotionSourceToKeypointMap.Find(MotionSource)};
|
||||||
if (!KeyPointInfoPtr)
|
if (!KeyPointInfoPtr)
|
||||||
{
|
{
|
||||||
@@ -2066,6 +2048,27 @@ void FSGXRTracker::FImpl::BuildMotionSourceToKeypointMap()
|
|||||||
RightHandSGMotionSourceName, FSGMotionSourceInfo(EHandKeypoint::Wrist, false));
|
RightHandSGMotionSourceName, FSGMotionSourceInfo(EHandKeypoint::Wrist, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7
|
||||||
|
void FSGXRTracker::FImpl::CreateHandTracker(XrSession InSession, XrHandEXT HandEXT, FSGXRHandState& HandState) const
|
||||||
|
{
|
||||||
|
XrHandTrackerCreateInfoEXT CreateInfo{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT};
|
||||||
|
CreateInfo.hand = HandEXT;
|
||||||
|
CreateInfo.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT;
|
||||||
|
|
||||||
|
IOpenXRHMD* OpenXRHMD{XRTrackingSystem ? XRTrackingSystem->GetIOpenXRHMD() : nullptr};
|
||||||
|
if (OpenXRHMD)
|
||||||
|
{
|
||||||
|
TArray<IOpenXRExtensionPlugin*> ExtensionPlugins{OpenXRHMD->GetExtensionPlugins()};
|
||||||
|
for (IOpenXRExtensionPlugin* Plugin : ExtensionPlugins)
|
||||||
|
{
|
||||||
|
CreateInfo.next = Plugin->OnCreateHandTracker(CreateInfo.next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XR_ENSURE(XRCreateHandTrackerEXT(InSession, &CreateInfo, &HandState.HandTracker));
|
||||||
|
}
|
||||||
|
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 7 */
|
||||||
|
|
||||||
bool FSGXRTracker::FImpl::CanOutputTrackingData(const EControllerHand Hand) const
|
bool FSGXRTracker::FImpl::CanOutputTrackingData(const EControllerHand Hand) const
|
||||||
{
|
{
|
||||||
const bool bFallbackToHandTrackingIfNoGloveDetected = ShouldFallbackToHandTrackingIfNoGloveDetected();
|
const bool bFallbackToHandTrackingIfNoGloveDetected = ShouldFallbackToHandTrackingIfNoGloveDetected();
|
||||||
|
|||||||
@@ -55,12 +55,6 @@ class SENSEGLOVETRACKING_API FSGXRTracker final : public IOpenXRExtensionPlugin,
|
|||||||
public IHandTracker
|
public IHandTracker
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState")
|
|
||||||
static bool GetMotionControllerData(
|
|
||||||
UObject* WorldContextObject,
|
|
||||||
EControllerHand Hand,
|
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||||
static bool GetMotionControllerState(
|
static bool GetMotionControllerState(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
@@ -136,19 +130,11 @@ public:
|
|||||||
public:
|
public:
|
||||||
// The IMotionController interface.
|
// The IMotionController interface.
|
||||||
|
|
||||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3
|
|
||||||
virtual bool GetControllerOrientationAndPosition(const int32 ControllerIndex, const FName MotionSource,
|
virtual bool GetControllerOrientationAndPosition(const int32 ControllerIndex, const FName MotionSource,
|
||||||
FRotator& OutOrientation, FVector& OutPosition,
|
FRotator& OutOrientation, FVector& OutPosition,
|
||||||
float WorldToMetersScale) const override;
|
float WorldToMetersScale) const override;
|
||||||
virtual ETrackingStatus GetControllerTrackingStatus(const int32 ControllerIndex,
|
virtual ETrackingStatus GetControllerTrackingStatus(const int32 ControllerIndex,
|
||||||
const FName MotionSource) const override;
|
const FName MotionSource) const override;
|
||||||
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
virtual bool GetControllerOrientationAndPosition(const int32 ControllerIndex, const EControllerHand DeviceHand,
|
|
||||||
FRotator& OutOrientation, FVector& OutPosition,
|
|
||||||
float WorldToMetersScale) const override;
|
|
||||||
virtual ETrackingStatus GetControllerTrackingStatus(const int32 ControllerIndex,
|
|
||||||
const EControllerHand DeviceHand) const override;
|
|
||||||
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 3 */
|
|
||||||
virtual FName GetMotionControllerDeviceTypeName() const override;
|
virtual FName GetMotionControllerDeviceTypeName() const override;
|
||||||
virtual void EnumerateSources(TArray<FMotionControllerSource>& SourcesOut) const override;
|
virtual void EnumerateSources(TArray<FMotionControllerSource>& SourcesOut) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -55,15 +55,9 @@ public class SenseGloveTracking : ModuleRules
|
|||||||
"InputDevice",
|
"InputDevice",
|
||||||
"OpenXRHMD",
|
"OpenXRHMD",
|
||||||
"OpenXRInput",
|
"OpenXRInput",
|
||||||
// NOTE
|
|
||||||
// Only UE 5.3+ provides the XRBase plugin.
|
|
||||||
#if UE_5_3_OR_LATER
|
|
||||||
"XRBase",
|
|
||||||
#else
|
|
||||||
"OpenXR",
|
|
||||||
#endif
|
|
||||||
"Slate",
|
"Slate",
|
||||||
"SlateCore",
|
"SlateCore",
|
||||||
|
"XRBase",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
-8
@@ -39,14 +39,6 @@
|
|||||||
|
|
||||||
#include "SGTracking/SGXRTracker.h"
|
#include "SGTracking/SGXRTracker.h"
|
||||||
|
|
||||||
bool USGXRTrackerKismetLibrary::GetMotionControllerData(
|
|
||||||
UObject* WorldContextObject, const EControllerHand Hand, FXRMotionControllerData& OutMotionControllerData)
|
|
||||||
{
|
|
||||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
||||||
return FSGXRTracker::GetMotionControllerData(WorldContextObject, Hand, OutMotionControllerData);
|
|
||||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
||||||
}
|
|
||||||
|
|
||||||
bool USGXRTrackerKismetLibrary::GetMotionControllerState(
|
bool USGXRTrackerKismetLibrary::GetMotionControllerState(
|
||||||
UObject* WorldContextObject,
|
UObject* WorldContextObject,
|
||||||
const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType,
|
const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType,
|
||||||
|
|||||||
-7
@@ -51,13 +51,6 @@ class SENSEGLOVETRACKINGKISMET_API USGXRTrackerKismetLibrary final : public USGB
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
|
||||||
meta=(WorldContext="WorldContextObject"))
|
|
||||||
static bool GetMotionControllerData(
|
|
||||||
UObject* WorldContextObject,
|
|
||||||
EControllerHand Hand,
|
|
||||||
FXRMotionControllerData& OutMotionControllerData);
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker",
|
||||||
meta=(WorldContext="WorldContextObject"))
|
meta=(WorldContext="WorldContextObject"))
|
||||||
static bool GetMotionControllerState(
|
static bool GetMotionControllerState(
|
||||||
|
|||||||
BIN
Binary file not shown.
Vendored
+175
@@ -0,0 +1,175 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGCommonThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGCommonThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "sgcommon";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+175
@@ -0,0 +1,175 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGConnectShmThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGConnectShmThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "sgconnectshm";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
LFS
Vendored
BIN
Binary file not shown.
LFS
Vendored
BIN
Binary file not shown.
Vendored
+175
@@ -0,0 +1,175 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGCoreShmThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGCoreShmThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "sgcoreshm";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+53
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CoreION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGCoreThirdPartyHeaders : ModuleRules
|
||||||
|
{
|
||||||
|
public SGCoreThirdPartyHeaders(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
|
||||||
|
PublicIncludePaths.Add(IncludePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
LFS
Vendored
BIN
Binary file not shown.
+180
@@ -0,0 +1,180 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGFmtThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGFmtThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "fmt";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryName += "d";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+175
@@ -0,0 +1,175 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGLogThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGLogThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "sglog";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+180
@@ -0,0 +1,180 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGLoguruThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGLoguruThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "loguru";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryName += "d";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
LFS
Vendored
BIN
Binary file not shown.
+175
@@ -0,0 +1,175 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||||
|
*
|
||||||
|
* @section LICENSE
|
||||||
|
*
|
||||||
|
* (The MIT License)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 - 2025 SenseGlove
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*
|
||||||
|
* @section DESCRIPTION
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class SGWjwwoodSerialThirdPartyLibs : ModuleRules
|
||||||
|
{
|
||||||
|
public SGWjwwoodSerialThirdPartyLibs(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
Type = ModuleType.External;
|
||||||
|
|
||||||
|
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, ".."));
|
||||||
|
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||||
|
string LibraryPathAnroidAArch64 = "";
|
||||||
|
string LibraryPathAnroidX64 = "";
|
||||||
|
string LibraryName = "serial";
|
||||||
|
|
||||||
|
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
|
||||||
|
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
|
||||||
|
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
|
||||||
|
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
|
||||||
|
Target.WindowsPlatform.Architecture == UnrealArch.X64;
|
||||||
|
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r27c"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinux)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_7_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v26"));
|
||||||
|
#elif UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsLinuxArm64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||||
|
|
||||||
|
#if UE_5_6_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25"));
|
||||||
|
#elif UE_5_5_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23"));
|
||||||
|
#elif UE_5_4_OR_LATER
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22"));
|
||||||
|
#else
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||||
|
}
|
||||||
|
else if (bIsWin64)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "windows"));
|
||||||
|
switch (Target.WindowsPlatform.Compiler)
|
||||||
|
{
|
||||||
|
case WindowsCompiler.VisualStudio2022:
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v143"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
|
||||||
|
|
||||||
|
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Assert(false, "Unsupported platform!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||||
|
PrivateIncludePaths.Add(IncludePath);
|
||||||
|
|
||||||
|
if (bIsAndroid)
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "debug"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, "release"));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPathAnroidAArch64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidAArch64, LibraryName));
|
||||||
|
LibraryPathAnroidX64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidX64, LibraryName));
|
||||||
|
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidAArch64);
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPathAnroidX64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bIsDebugBuild)
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||||
|
}
|
||||||
|
|
||||||
|
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||||
|
PublicAdditionalLibraries.Add(LibraryPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user