Compare commits

..
90 Commits
Author SHA1 Message Date
Mamadou Babaei 2dc4499984 bump the plugin version to v2.0.8 2024-07-15 22:22:21 +02:00
Mamadou Babaei e21d92a3ca fix a bug where the sgpawn right-hand grab colliders' default size is mistakenly set to the default value for the left-hand grab colliders at cdo initialization time 2024-07-15 22:15:23 +02:00
Mamadou Babaei 1db86d9778 bump the plugin version to v2.0.7 2024-05-29 12:47:33 +02:00
Mamadou Babaei 0de86b508a make the allbreaker assets compatible with ue 5.1+ again 2024-05-29 12:46:51 +02:00
Mamadou Babaei 65a96a462b bump the plugin version to v2.0.6 2024-05-29 11:40:07 +02:00
Mamadou Babaei 6b7c28c379 bump the plugin version to v2.0.5 2024-05-22 17:32:43 +02:00
Mamadou Babaei af0be8c1f7 fix the wrong palm bone names on the allbreaker virtual hand models 2024-05-22 17:31:58 +02:00
Mamadou Babaei 49a12f64a4 bump the plugin version to v2.0.4 2024-05-17 11:39:57 +02:00
Mamadou Babaei 76d03b1fe8 bump the plugin version to v2.0.3 2024-05-16 20:00:18 +02:00
Mamadou Babaei d8ae5923d5 fix v2.0.2 UE 5.4 RunUAT build issues that mostly caused by missing headers 2024-05-15 04:34:46 +02:00
Mamadou Babaei befb07470e improve target platform detection when building SenseGloveConnectImpl and SenseGloveCoreImpl modules and also distinguish x64 builds from arm64 on windows 2024-05-15 04:34:38 +02:00
Mamadou Babaei b467c679de fix: asking CppCompileEnvironment for a single Architecture, but it has multiple Architectures (arm64, x64) 2024-05-15 04:34:30 +02:00
Mamadou Babaei 9afbd8e54f bump the plugin version to v2.0.2 2024-04-25 12:56:05 +02:00
Mamadou Babaei 4e0d01c3de bump the plugin version to v2.0.1 2024-04-15 15:03:17 +02:00
Mamadou Babaei 8681f78c22 do not call FSGHandLayer::ResetCalibration on every backend initialization 2024-04-15 14:52:20 +02:00
Mamadou Babaei 84e8f46d35 only instantiate the connected glove once instead of recreating and destroying it every frame 2024-04-15 14:52:14 +02:00
Mamadou Babaei 3f0dd4a5b9 bump senseglove libraries to v2.102.0-35d4de3f 2024-04-15 14:52:05 +02:00
Mamadou Babaei d0970504ce fix the wrong header file description sections for the header files 2024-04-15 14:51:58 +02:00
Mamadou Babaei 0c73eccc16 update the changelog with the unreleased changes 2024-04-15 14:51:52 +02:00
Mamadou Babaei f3b9155955 update the outdated platform support matrix remarks 2024-03-23 17:23:03 +01:00
Mamadou Babaei 45da7baa95 add ue 5.4 to the list of supported engines through azure devops 2024-03-23 16:57:47 +01:00
Mamadou Babaei 4550fda587 bump the plugin version to v2.0.0 2024-03-22 21:29:17 +01:00
Mamadou Babaei 560b9e65d3 update the changelog 2024-03-22 21:29:17 +01:00
Mamadou Babaei 8c8236c33c add missing modules to the directory structure 2024-03-22 21:29:17 +01:00
Mamadou Babaei 034d10355a update the planned features status 2024-03-22 20:57:53 +01:00
Mamadou Babaei 8127051da7 fix other build issues with non-unity builds 2024-03-22 20:57:53 +01:00
Mamadou Babaei 802a6b6d0b add the missing string header that causes build issues in non-unity builds 2024-03-22 20:57:53 +01:00
Mamadou Babaei 494f87f4cb remove the platform dependant build hacks inside FSGArrayUtils::FromStdVector as msvc is not able to deduce TArray<T>::SizeType 2024-03-22 20:57:52 +01:00
Mamadou Babaei def46777fa bump the senseglove libraries to v2.101.12-62b1be11 2024-03-22 20:57:52 +01:00
Mamadou Babaei d0c24aeda5 fix android build issue inside FSGArrayUtils::FromStdVector introduced by 0cdc7e03ac 2024-03-22 20:57:52 +01:00
Mamadou Babaei c0c5722f07 Revert "try to init/uninit the backend module at the module start/shutdown"
This reverts commit c45bcaf618.
2024-03-22 20:57:52 +01:00
Mamadou Babaei 8159c03526 fix a build issue inside FSGArrayUtils::FromStdVector introduced by newer msvc updates due to stricter implicit uint64 to int32 conversions 2024-03-22 20:57:51 +01:00
Mamadou Babaei 49eb2f2788 bump the senseglove backend libraries to v2.101.11-2d6fe9ce 2024-03-22 20:57:51 +01:00
Mamadou Babaei e0ea29ca18 correct the module logs grammars 2024-03-22 20:57:49 +01:00
Mamadou Babaei 17f5db48c6 try to init/uninit the backend module at the module start/shutdown 2024-03-22 20:57:49 +01:00
Mamadou Babaei d9647fc1c6 allow the c++ compiler the opportunity to perform rvo/nrvo if applicable 2024-03-22 20:57:48 +01:00
Mamadou Babaei 3995d6e0d9 bump senseglove libraries to v2.101.10-7e515114 2024-03-22 20:57:48 +01:00
Mamadou Babaei fe3bd91807 update the changelog with added quest 3 controllers support 2024-03-22 20:57:47 +01:00
Mamadou Babaei 3150bb6a8a integrate the virtual hand mesh from allbreaker 2024-03-22 20:57:45 +01:00
Mamadou Babaei b2c62b34a5 remove redundant headers 2024-03-22 20:54:55 +01:00
Mamadou Babaei 69bf6161f8 expose as little as dependencies as possible 2024-03-22 20:54:54 +01:00
Mamadou Babaei 560cb73db7 correct the hand mesh yaw rotation inside the sgpawn after the squat/sgvect3d changes 2024-03-22 20:54:54 +01:00
Mamadou Babaei b1ed6fa325 replace SupportedTargetPlatforms with PlatformAllowList 2024-03-22 20:54:53 +01:00
Mamadou Babaei 4bc0b6e6d3 clean up unsed unreal version headers 2024-03-22 20:54:53 +01:00
Mamadou Babaei d7fc6dd211 declare the openxr plugin as a dependency 2024-03-22 20:54:53 +01:00
Mamadou Babaei 8580c4a235 utilize UXRDeviceVisualizationComponent to display meshes on UE 5.2 onwards 2024-03-22 20:54:53 +01:00
Mamadou Babaei b11c329974 fix the changelog errors 2024-03-22 20:54:53 +01:00
Mamadou Babaei c098cade8c remove a changelog that is not valid anymore 2024-03-22 20:54:53 +01:00
Mamadou Babaei cbc3bcd1bd bump the senseglove libraries to v2.101.9-8abfc26d 2024-03-22 20:54:53 +01:00
Mamadou Babaei cb1c473136 bump the plugin version to v1.9.8 2024-03-22 20:54:49 +01:00
Mamadou Babaei 8f7148dd61 apply a temporary workaround in order to ameliorate the hand animation after sgquat, sgvect3d fixes 2024-03-22 20:54:49 +01:00
Mamadou Babaei 242eb35d16 make bones rotations a private field 2024-03-22 20:54:49 +01:00
Mamadou Babaei 5b7e2d5d1e update the changelog 2024-03-22 20:54:49 +01:00
Mamadou Babaei 4fc721fa55 proper angle conversions for vectors 2024-03-22 20:54:49 +01:00
Mamadou Babaei f138ab2ceb proper sgvect3d and squat conversions to fvector and fquat 2024-03-22 20:54:49 +01:00
Mamadou Babaei 68cc271461 apply senseglove/unreal angle conversions in the gloves' api 2024-03-22 20:54:49 +01:00
Mamadou Babaei 0a5553987f fix a crash when calling one of the SGHandInterpolatorImpl constructors which happens due to unintialized pimpl object 2024-03-22 20:54:43 +01:00
Mamadou Babaei 4a8812943b update the changelog 2024-03-22 20:54:43 +01:00
Mamadou Babaei a10b1ff034 bump senseglove libraries to v2.101.8-a2a2075b which resolves the android writehaptics crash 2024-03-22 20:54:42 +01:00
Mamadou Babaei b34c06eb00 update the change log with unreleased changes 2024-03-22 20:54:42 +01:00
Mamadou Babaei 73a4c79741 bump senseglove libraries to v2.101.7-3580cd9f 2024-03-22 20:54:41 +01:00
Mamadou Babaei 0c8d4ef350 bump senseglove libraries to v2.101.5-f0aff76b 2024-03-22 20:54:41 +01:00
Mamadou Babaei 88b337f066 bump senseglove libraries to v2.101.4-6c860c42 with android fixes and fix a android crash 2024-03-22 20:54:35 +01:00
Mamadou Babaei 310a4b148e bump senseglove libraries to v2.101.3-e583f6de 2024-03-22 20:54:34 +01:00
Mamadou Babaei 0061ea9cb6 implement the api updates and bump the senseglove libraries to v2.101.2-2eb7439f 2024-03-22 20:54:34 +01:00
Mamadou Babaei e2da098132 force glove recalibration on backend initialize 2024-03-22 20:54:16 +01:00
Mamadou Babaei c243525c0c add as*glove/device casting methods that resolves the sgpawn vibrotactile issues 2024-03-22 20:54:16 +01:00
Mamadou Babaei 86e283e700 use device impl casts 2024-03-22 20:54:16 +01:00
Mamadou Babaei a26f1d9e42 list nova 2 gloves in the get devices from the device list 2024-03-22 20:54:16 +01:00
Mamadou Babaei beadba4544 another attempt at improving the glove casts 2024-03-22 20:54:16 +01:00
Mamadou Babaei 40f27c227f try an alternative approach for glove instances upcasting at the lower levels of the api 2024-03-22 20:54:16 +01:00
Mamadou Babaei 5bc20edc25 try to add a solution for glove type-casting in higher levels of the api 2024-03-22 20:54:16 +01:00
Mamadou Babaei 4af682b617 fix the send custom waveform signature on the hand layer 2024-03-22 20:54:16 +01:00
Mamadou Babaei 5dbeef8627 fix a bug inside the ESGHapticLocation enum conversions 2024-03-22 20:54:16 +01:00
Mamadou Babaei da7e51e208 bump senseglove libraries for v2.101.1-edc1163a 2024-03-22 20:54:15 +01:00
Mamadou Babaei d83251a57c implement the nova2 api updates and bump the senseglove libraries to v2.101.0-3e1693fb 2024-03-22 20:54:09 +01:00
Mamadou Babaei 695d4f01ba bump the plugin version to v1.9.8 2024-03-12 20:31:34 +01:00
Mamadou Babaei 54e4db3ef6 make bones rotations a private field 2024-03-12 20:31:33 +01:00
Mamadou Babaei 2e653c2a81 fix a crash inside the USGHandPose::FromHandAngles in higher levels of the api 2024-03-12 20:31:33 +01:00
Mamadou Babaei 189c0e50df drop the prefix for internal typedefs 2024-03-12 20:31:32 +01:00
Mamadou Babaei 6eaac124ce add some performance optimizations by utilizing MoveTemp in return statements 2024-03-12 20:31:32 +01:00
Mamadou Babaei 6a5f200ee8 fix a bug where the right hand mesh is always hidden inside the game no matter whether the right glove is connected or not 2024-03-12 20:31:31 +01:00
Mamadou Babaei 5254a94441 fix a wrong variable name 2024-03-12 20:31:31 +01:00
Mamadou Babaei b087debc41 only include the sgconnect header if the build platform is android 2024-03-12 20:31:30 +01:00
Mamadou Babaei 3bae035ed3 bump the plugin version to v1.9.7 2024-02-18 20:29:14 +01:00
Mamadou Babaei 5ea2f1c5be apply vibrotactile and force-feedback fixes backported from next major release 2024-02-18 20:29:14 +01:00
Mamadou Babaei 5742f7f315 bump the plugin version to v1.9.6 2024-02-14 14:55:49 +01:00
Mamadou Babaei e29c037198 fix the NovaGlove class instantiation methods to initialize a NovaGloveImpl instead of a SenseGloveImpl 2024-02-14 14:55:49 +01:00
Mamadou Babaei 4a96590460 bump the plugin version to v1.9.5 2024-02-09 10:53:09 +01:00
Mamadou Babaei 01f74dd141 fix a potential segfault inside SGDeviceModel::ParseFirmware 2024-02-09 10:53:09 +01:00
664 changed files with 24259 additions and 28601 deletions
+168 -1
View File
@@ -5,6 +5,173 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.8] - 2024-07-15
This is a bugfix release that contains a somewhat important bugfix backported from the next release of the plugin as documented below.
### Fixed
- Fix a bug where the SGPawn right-hand grab colliders' default size is mistakenly set to the default value for the left-hand grab colliders at CDO initialization time.
## [2.0.7] - 2024-05-29
This is a bugfix release with no actual plugin code changes, only fixing issues with binary assets incompatible with UE versions earlier than 5.4.
### Fixed
- Make the Allbreaker assets compatible with UE5.1+ again as the v2.0.5 update breaks compatibility with UE versions earlier than 5.4, thus leaving the engine unable to load those assets.
## [2.0.6] - 2024-05-29
This is a bugfix release with no actual plugin code changes, only removing development/test assets from UE 5.3 that were never meant to be shipped.
### Removed
- Removed the dev/test virtual hand models that leaked into the 5.3 branch.
### Fixed
## [2.0.5] - 2024-05-22
This is a bugfix release with no actual plugin code changes, only focusing on fixing the Allbreaker virtual hand model issues.
### Fixed
- Fix the wrong palm bone names on the Allbreaker virtual hand models.
## [2.0.4] - 2024-05-17
This is a bugfix release with no actual plugin's code change.
### Fixed
- Fix our in-house Unreal Engine Marketplace submission tool's configurations where the Content folder (containing the Allbreaker hand model) is mistakenly ignored during the submission. This release reintroduces the Virtual Hand Model and its material missing from the previous release.
- Fix the SenseGlove.uproject's wrong versioning submitted to the Unreal Engine Marketplace.
## [2.0.3] - 2024-05-15
This is a bugfix release addressing mostly RunUAT build issues on Unreal Engine 5.4.
### Fixed
- Fix UE 5.4 RunUAT build issue: "Asking CppCompileEnvironment for a single Architecture, but it has multiple Architectures (arm64, x64)", affecting SenseGloveConnectImpl and SenseGloveCoreImpl modues.
- Improved target platform detection when building SenseGloveConnectImpl and SenseGloveCoreImpl modules and also distinguishing the x64 builds from arm64 on Microsoft Windows.
- Fix other UE 5.4 RunUAT build issues, mostly caused by missing headers.
### Removed
- Removed support for Android armeabi-v7a and x86 architectures as they are no longer supported by the supported engine versions.
## [2.0.2] - 2024-04-25
This is a patch release with no code changes.
### Added
- Introduce official Unreal Engine 5.4 support to the Unreal Engine Marketplace.
### Changed
- Updated the Platform Support Matrix with the latest changes. This is the last release to support Unreal Engine 5.1 as we no longer are able to push updates for this release to the Unreal Engine Marketplace. The v2.0.1 release for Unreal Engine 5.1 can be obtained from the Unreal Engine Marketplace, and v2.0.2 through our Microsoft Azure DevOps repositories. Please note that there are no actual code changes between these two releases and in terms of functionality they are almost identical.
## [2.0.1] - 2024-04-15
This is a bugfix release.
### Fixed
- Fix a bug inside both SGVirtualHandComponent and SGWristTrackerComponent where the connected glove's UObject instance gets destroyed and re-instantiated every frame. With this fix now the glove instance will be created or destroyed only when a glove connects to or disconnects from the system.
- Update the outdated Platform Support Matrix and its remarks section to reflect the latest status information.
- Fix the wrong header file description sections for the header files inside <code>SenseGloveKismet/Public/SGKismet/</code>.
### Changed
- SenseGlove libraries have been updated to v2.102.0-35d4de3f.
- Together, SenseGlove libraries v2.102.0-35d4de3f and SenseCom v1.6.1 remove the need to call ResetCalibration every time and are able to store and load calibration profiles from disk.
- SesenGloveBackend module is no longer calling FSGHandLayer::ResetCalibration on every backend initialization.
## [2.0.0] - 2024-03-22
This is the second major release of the SenseGlove Unreal Engine Plugin adding support for Nova 2 with enormous breaking changes to the current C++ and Blueprint APIs.
### Added
- Added support for the SenseGlove Nova 2 devices.
- Added support for Quest 3 controllers.
- Various classes have been added to the API in order to implement the new functionalities and features from the latest upstream SenseGlove libraries.
- Added initial support for the upcoming Unreal Engine 5.4 release.
- Added a pair of default production-ready virtual hand meshes for the left and right hands, courtesy of [Allbreaker LLC Columbia](https://www.allbreaker.co/). For usage and redistribution, please consult the [LICENSE-THIRD-PARTY.md](LICENSE-THIRD-PARTY.md) file.
### Fixed
- A few critical bug fixes that have already been backported to the v1.x.x series through v1.9.3 to v1.9.8 releases.
- Revamped the way we do FVector <-> SGVect3D, FQuat <-> SGQuat, and SenseGlove <-> Unreal Engine angles conversions in order to properly translate between the SenseGlove and Unreal Engine coordinate systems.
- Allow the C++ compiler the opportunity to perform RVO/NRVO if applicable.
- Fix the modules' order inside the .uplugin file.
- Fix a build issue inside FSGArrayUtils::FromStdVector introduced by newer MVSC updates due to stricter implicit uint64 to int32 conversions.
- Fix a build issues inside FSGArrayUtils when performing non-Unity builds due to the missing <string> header.
- Fix other build issues in USGDevice, USGNovaGloveSensorData, FSGDeviceImpl, and FSGSenseGloveVarsImpl when performing non-Unity builds due to the missing relevant headers.
- Fix changelog formatting.
- Some other improverment and fixes.
### Changed
- SenseGlove libraries have been updated to v2.101.12-62b1be11.
- The SenseGlove Unreal Engine Plugin now declares the OpenXR plugin as a dependency, so that the OpenXR plugin will be enabled automatically as soon as the SenseGlove Unreal Engine Plugin gets enabled.
- Various classes and parts of the API have been changed in order to reflect and adhere to upstream SenseGlove libraries.
- Reverse the Platform Support Matrix order from newer Unreal Engine versions to the older ones.
- Clarify the engine support policy in the main readme file by adding the corresponding references from the Epic Marketplace Guidelines and a URL to their guidelines page.
- The SGTouchComponent uproperties BuzzDuration and BuzzLevel now utilize different different names in order to correspond to the underlying API changes. They have been renamed to VibrotactileDuration and VibrotacktileLevel.
- The SGTouchComponent uproperties ForceFeedbackLevel and BuzzLevel (now VibrotacktileLevel) parameters type have changed from int32 to float with the value range varying between 0.0f to 1.0f instead of 1 to 100 in order to correspond to the underlying API changes.
- The SGVirtualHandComponent now assumes the default grab point's name as GenericGrabPoint instead of GrabPoint as default if not specified in the Unreal Blueprint Editor.
- The SGPawn on UE 5.2+ now utilizes UXRDeviceVisualizationComponent in order to properly display the controller meshes shipped with Unreal Engine's OpenXR plugin, or a user-provided mesh. On UE 5.1 this could still be set on the WristTrackerLeft and WristTrackerRight components. Please note that despite the fact that on UE 5.2+ it's still possible to utilize the WristTrackerLeft and WristTrackerRight for setting the controller meshes, this has been deprecated in UE 5.2+ and is no longer supported.
### Removed
- Various classes and parts of the API have been removed in order to reflect and adhere to upstream SenseGlove libraries.
- Removed the redundant SGIC_int32_Ref interop type.
## [1.9.8] - 2024-03-12
This is a bugfix release that contains bugfixes backported from the next major release of the plugin as documented below.
### Fixed
- Fix a bug where the right-hand mesh is always hidden inside the game no matter whether the right glove is connected or not.
- Fix a crash inside the USGHandPose::FromHandAngles method.
- Some performance optimizations by utilizing MoveTemp in return statements.
- Some improvements applied to the source code.
- Some other minor fixes.
### Changed
- The BonesRotations TMap is no longer a public field of FSGVirtualHandAnimInstanceProxy and instead could be retrieved by calling the GetBonesRotations() method.
## [1.9.7] - 2024-02-18
This is a bugfix release that contains bugfixes backported from the next major release of the plugin as documented below.
### Fixed
- Fix various bugs inside the SGPlayerController which occur when the thumb and pinky fingers are simultaneously touching different SGTouchComponents, or only one of them is in touch with such a component. In this case pinky's buzz and force-feedback levels are determined from the SGTouchComponent that is in collision with the thumb instead of the one that is touched by the pinky. Or, the pinky could ignore the buzz and force-feedback level if the thumb is not in collision with an SGTouchComponent. Or, the pinky could have reacted with a buzz or force feedback while only the thumb is in contact with an SGTouchComponent.
- Fix the BuzzDuration UPROPERTY range in order not to get clamped at 100.0f and also use float values for ClampMin and UIMin specifiers instead of integer values.
## [1.9.6] - 2024-02-14
This is a bugfix release.
### Fixed
- Fix a few critical bugs inside the NovaGlove class where the higher levels of the API including constructors, Parse, and NewNovaGlove methods mistakenly instantiate a SenseGloveImpl class instead of a NovaGloveImpl class.
## [1.9.5] - 2024-02-09
This is a bugfix release.
### Fixed
- Fix a wrong type-casting inside SGDeviceModel::ParseFirmware where OutMainVersion and OutSubVersion arguments are getting passed to the lower levels of the API. This could potentially result in a segfault at the FFI boundary between lower and higher levels of the API.
## [1.9.4] - 2024-02-08
This is a bugfix release addressing mostly Blueprint API issues with ABI breaking changes inside the Blueprint layer, backported from the next major release of the plugin as documented below.
@@ -387,4 +554,4 @@ This is a minor release focusing on adherence to the Unreal Engine Marketplace G
### Added
- Initial public release of the SenseGlove haptic API for Unreal Engine with support for Microsoft Windows and GNU/Linux.
- Initial public release of the SenseGlove haptic API for Unreal Engine with support for Microsoft Windows and GNU/Linux.
Binary file not shown.
+13
View File
@@ -85,3 +85,16 @@ 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.
```
## Allbreaker Virtual Hand Models
```
The virtual hand model mesh included in this plugin, situated within the
Contents/Meshes/Allbreaker folder, is graciously supplied by Allbreaker LLC
Colombia. This provision is made pursuant to an agreement between SenseGlove
B.V. and Allbreaker LLC. Users of this plugin are bound by the terms outlined in
the license agreement and are advised to review the terms and conditions
specified therein.
Please visit https://www.allbreaker.co/ to obtain information about the work of
Allbreaker.
```
+31 -58
View File
@@ -8,16 +8,17 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Android (NDK)** | **UE Marketplace Version** | **Azure DevOps Version** |
|----------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:-----------------:|:--------------------------:|:------------------------:|
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | | ❌ | | ⚠️ v1.0.4 |
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | | ⚠️ v1.0.4 |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | | ⚠️ v1.0.4 |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | ❌ | | ⚠️ v1.0.4 |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
| **5.4** | | ❌ | v2.0.x | ✅ v2.0.x | ✅ v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.8 | v2.0.8 |
| **5.3** | | v2.0.x | ✅ v2.0.x | v2.0.x | ✅ v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.8 | v2.0.8 |
| **5.2** | | v2.0.x | ✅ v2.0.x | v2.0.x | ✅ v2.0.x | ✅ v2.0.x (r25b) | ✅ v2.0.8 | v2.0.8 |
| **5.1** | | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x | ⚠️ v2.0.x (r25b) | ⚠️ v2.0.1 | ⚠️ 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.1** | | v1.9.x | v1.9.x | v1.9.x | v1.9.x | v1.9.x (r25b) | v1.9.4 | v1.9.4 |
| **5.2** | | v1.9.x | ✅ v1.9.x | v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.4 | v1.9.4 |
| **5.3** | | v1.9.x | ✅ v1.9.x | v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.4 | v1.9.4 |
| **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | ❌ | | ⚠️ v1.0.4 |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | | ⚠️ v1.0.4 |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.23** | ⚠️ 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> Not supported by the latest release and might be lacking features
@@ -25,12 +26,10 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
* <code>❓</code> Unknown or untested
Remarks:
* Per Epic's Marketplace policy regarding Code Plugins, we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps.
* Microsoft Visual Studio 2022 is not supported by Unreal Engine 4.22 through 4.26.
* Per [Epic's Marketplace Guidelines](https://www.unrealengine.com/en-US/marketplace-guidelines) in regards to Code Plugins (sections 2.6.3.d and 3.1.b), we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps.
* All third-party libraries on Windows built against Windows SDK 10.0.
* Oculus support is only provided through the recommended Android NDK versions by Epic Games.
* The Unreal Engine 4.27+ support is provided for Android/Oculus development.
* [wjwwood/serial](https://github.com/wjwwood/serial) requires Android NDK API Level 28+ in order to be built successfully, thus some older NDKs such as r14b.
* Oculus and VIVE support is only provided through the recommended Android NDK versions by Epic Games.
* [wjwwood/serial](https://github.com/wjwwood/serial) requires Android NDK API Level 28+ in order to be built successfully.
* All third-party libraries target Android NDK API Level 29, thus any project relying on the plug-in should be build with the same NDK API Level.
## Changelog
@@ -55,12 +54,13 @@ Please note that modules postfixed with **Impl** are intended for interal use an
## Planned Features Completion Status
### Implemented as of v1.9.4
### Implemented as of v2.0.8
- [X] Full SenseGlove low-level core API access through Unreal C++.
- [X] Full SenseGlove low-level core API access through Blueprint.
- [X] DK 1 Support.
- [X] Nova 1 Support.
- [X] Nova 2 Support.
- [X] Support for Microsoft Windows as a development platform.
- [X] Support for GNU/Linux as a development platform.
- [X] Support for Microsoft Windows as a deployment platform.
@@ -80,12 +80,19 @@ Please note that modules postfixed with **Impl** are intended for interal use an
- [X] Easy wrist/hand tracking debugging using the SenseGlove Debug module.
- [X] A generic Settings module with the ability to override settings.
- [X] C++/Blueprint interaction events such as OnGrabStateUpdated, OnTouchStateUpdated, OnActorGrabbed, OnActorReleased, OnActorBeginTouch, and OnActorEndTouch.
- [X] A default hand mesh rigged with the standard SenseGlove default hand pose.
### Upcoming features planned for the v2.0.0 release
### Upcoming features planned for the v2.1.0 release
- [ ] A default hand mesh rigged with the standard SenseGlove default hand pose.
- [ ] Hand tracking compatible with OpenXR (or other generic hand tracking format).
- [ ] Nova 2 Support.
- [ ] A fallback to HMD and wrist tracker hardware auto-detection mechanism when automatic detection of the wrist tracker hardware is desired.
- [ ] OpenXR-compatible hand tracking (XR_EXT_hand_tracking) support.
- [ ] FXRMotionControllerData compatible hand animation system.
- [ ] FXRMotionControllerData compatible wrist tracking system.
- [ ] FXRMotionControllerData compatible hand interaction manipulation system.
- [ ] Ability to fallback to hand tracking when a glove is not present and use the bare hands for interactions, or a combination of glove and hand tracking if no motion controller input is detected.
- [ ] The SenseGlove grab/touch sockets one-click-setup ability on any Epic-compliant virtual hand mesh from within the Unreal Editor's Content Browser, Skeleton Editor, or Skeletal Mesh Editor.
- [ ] A flexible virtual hand animation system that can take the mesh bone's transforms into account for a more reliable hand animation.
- [ ] Ability to manage the Engine Scalability Settings through the SenseGlove plugin in order to change the graphics settings on the fly.
### Planned features long-term
@@ -114,6 +121,10 @@ Please note that modules postfixed with **Impl** are intended for interal use an
├── SenseGloveAndroid (the Android-specific module)
├── SenseGloveBackend (responsible for initialization and deinitialization of the backend libraries)
├── SenseGloveBackendKismet (exposes Blueprints-specific functionality from the SenseGloveBackend module)
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
├── SenseGloveConnect (exposes part of the SGConnect low-level API to C++)
@@ -166,32 +177,6 @@ Please note that modules postfixed with **Impl** are intended for interal use an
├── android
│ │
│ ├── r21e (Android NDK r21e dependencies for UE 4.27 and 5.0)
│ │ │
│ │ ├── arm64 (64-bit ARM variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── armv7 (32-bit ARM variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── x64 (64-bit x86-64 variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ └── x86 (32-bit x86 variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── r25b (Android NDK r21b dependencies for UE 5.1)
│ │
│ ├── arm64 (64-bit ARM variant of Android)
@@ -200,19 +185,7 @@ Please note that modules postfixed with **Impl** are intended for interal use an
│ │ │
│ │ └── release
│ │
── armv7 (32-bit ARM variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ ├── x64 (64-bit x86-64 variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── x86 (32-bit x86 variant of Android)
── x64 (64-bit x86-64 variant of Android)
│ │
│ ├── debug
│ │
+24 -13
View File
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.9.4",
"VersionName": "2.0.8",
"FriendlyName": "SenseGlove",
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
"Category": "Virtual Reality",
@@ -42,17 +42,6 @@
"Win64"
]
},
{
"Name": "SenseGloveBuildHacks",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{
"Name": "SenseGloveBackend",
"Type": "Runtime",
@@ -75,6 +64,17 @@
"Win64"
]
},
{
"Name": "SenseGloveBuildHacks",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{
"Name": "SenseGloveConnect",
"Type": "Runtime",
@@ -239,5 +239,16 @@
"Win64"
]
}
],
"Plugins": [
{
"Name": "OpenXR",
"Enabled": true,
"PlatformAllowList": [
"Android",
"Linux",
"Win64"
]
}
]
}
}
@@ -35,6 +35,8 @@
#include "SenseGlove/Components/SGGrabComponent.h"
#include "GameFramework/Actor.h"
struct USGGrabComponent::FImpl
{
/************************
@@ -35,6 +35,8 @@
#include "SenseGlove/Components/SGTouchComponent.h"
#include "GameFramework/Actor.h"
struct USGTouchComponent::FImpl
{
/************************
@@ -99,10 +101,10 @@ USGTouchComponent::USGTouchComponent(const FObjectInitializer& ObjectInitializer
: Super(ObjectInitializer),
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
BuzzLevel = 0;
BuzzDuration = 0.25f;
ForceFeedbackLevel = 1.0f;
ForceFeedbackLevel = 100;
VibrotactileDuration = 0.25f;
VibrotactileLevel = 0.0f;
}
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
@@ -36,11 +36,9 @@
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "Animation/Skeleton.h"
#include "Components/SphereComponent.h"
#include "Components/SkeletalMeshComponent.h"
#include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UnrealTypeTraits.h"
#include "UObject/ConstructorHelpers.h"
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
@@ -59,29 +57,29 @@ struct USGVirtualHandComponent::FImpl
FORCEINLINE static const FString& GetDefaultLeftHandMeshPath()
{
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_VirtualHand_Left'")};
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Left.SK_Allbreaker_VirtualHand_Left'")};
return Path;
}
FORCEINLINE static const FString& GetDefaultLeftHandMeshPathOnly()
{
static const FString Path{TEXT("/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_VirtualHand_Left")};
static const FString Path{TEXT("/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Left.SK_Allbreaker_VirtualHand_Left")};
return Path;
}
FORCEINLINE static const FString& GetDefaultRightHandMeshPath()
{
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Right.SK_SenseGlove_VirtualHand_Right'")};
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Right.SK_Allbreaker_VirtualHand_Right'")};
return Path;
}
FORCEINLINE static const FString& GetDefaultRightHandMeshPathOnly()
{
static const FString Path{TEXT("/SenseGlove/Meshes/"
"SK_SenseGlove_VirtualHand_Right.SK_SenseGlove_VirtualHand_Right")};
static const FString Path{TEXT("/SenseGlove/Meshes/Allbreaker/"
"SK_Allbreaker_VirtualHand_Right.SK_Allbreaker_VirtualHand_Right")};
return Path;
}
@@ -213,7 +211,7 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
bAutoStopAllHapticsOnEndPlay = true;
GrabSocketName = FName{TEXT("GrabPoint")};
GrabSocketName = FName{TEXT("GenericGrabPoint")};
DefaultFingertipsGrabColliderSize = FVector{0.08f, 0.08f, 0.08f};
@@ -259,7 +257,7 @@ void USGVirtualHandComponent::SetRight(const bool bInRight)
void USGVirtualHandComponent::SetAnimClass(UClass* NewClass)
{
ensureAlwaysMsgf(Cast<USGVirtualHandAnimInstance>(NewClass),
ensureAlwaysMsgf((TIsDerivedFrom<decltype(NewClass), USGVirtualHandAnimInstance>::IsDerived),
TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!"));
Super::SetAnimClass(NewClass);
@@ -389,13 +387,7 @@ USGHandPose* USGVirtualHandComponent::GetHandPose()
if (IsValid(Glove))
{
#if ! PLATFORM_ANDROID
Glove->GetHandPose(this, HandPose);
#else /* ! PLATFORM_ANDROID */
const UWorld* World{GetWorld()};
const float DeltaTime = UGameplayStatics::GetWorldDeltaSeconds(World);
Glove->GetHandPose(this, DeltaTime, HandPose);
#endif /* ! PLATFORM_ANDROID */
}
return HandPose;
@@ -431,8 +423,8 @@ const FTransform& USGVirtualHandComponent::GetFingerBoneRefTransform(const int32
FRotator USGVirtualHandComponent::GetFingerBoneRefRotation(const int32 Finger, const int32 Joint) const
{
const FTransform BoneTransform{GetFingerBoneRefTransform(Finger, Joint)};
FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
return MoveTemp(BoneRotation);
const FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
return BoneRotation;
}
TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
@@ -441,16 +433,16 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
if (!IsGloveConnected())
{
return MoveTemp(Rotations);
return Rotations;
}
const USGHandPose* HandPose = GetHandPose();
if (!IsValid(HandPose))
{
return MoveTemp(Rotations);
return Rotations;
}
const TArray<TArray<FVector>> HandAngles{HandPose->GetHandAngles()};
const TArray<TArray<FVector>>& HandAngles{HandPose->GetHandAngles()};
for (int32 FingerIndex = 0; FingerIndex < HandAngles.Num(); ++FingerIndex)
{
@@ -459,7 +451,7 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
for (int32 JointIndex = 0; JointIndex < FingerJointAngles.Num(); ++JointIndex)
{
const FVector& JointAngle{FingerJointAngles[JointIndex]};
const FQuat JointRotation{FQuat::MakeFromEuler(JointAngle)};
const FQuat JointRotation{FQuat::MakeFromEuler(FVector{-JointAngle.Y, -JointAngle.X, -JointAngle.Z})};
const FTransform& BoneRefTransform{GetFingerBoneRefTransform(FingerIndex, JointIndex)};
@@ -471,7 +463,7 @@ TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
}
}
return MoveTemp(Rotations);
return Rotations;
}
USGVirtualHandComponent::FImpl::FImpl(USGVirtualHandComponent* InOwner)
@@ -505,7 +497,7 @@ FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
SkeletalMeshPath = GetDefaultLeftHandMeshPath();
}
return MoveTemp(SkeletalMeshPath);
return SkeletalMeshPath;
}
bool USGVirtualHandComponent::FImpl::IsUsingDefaultMesh() const
@@ -573,25 +565,12 @@ USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
{
// FIXME
// Since we dont ship a default virtual hand mesh at the moment, calling SetDefaultMesh causes the following failed
// assertion due the fact that the engine won't be able to find the asset at the default location:
// Assertion failed: IsInGameThread()
// Unable to load /SenseGlove/Meshes/SK_SenseGlove_VirtualHand_*. Objects and Packages can only be loaded from the
// One workaround would be disabling the async loading or as an alternative simply disabling this portion of the
// code should be a good-enough fix until we address this issue in it's own time.
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
}
USkeletalMesh* USGVirtualHandComponent::FImpl::GetMesh() const
{
return Owner->
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1
GetSkeletalMeshAsset()
#else /* ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 */
SkeletalMesh
#endif /* ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 */
;
return Owner->GetSkeletalMeshAsset();
}
USkeleton* USGVirtualHandComponent::FImpl::GetSkeleton() const
@@ -619,13 +598,18 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
}
}
const bool bGloveWasPresent = IsValid(Owner->Glove);
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bFoundGlove && bGloveWasPresent)
bool bGloveConnected;
if (!IsValid(Owner->Glove) || !Owner->Glove->IsConnected())
{
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
bGloveConnected = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bGloveConnected)
{
Owner->Glove = nullptr;
}
}
else
{
bGloveConnected = true;
}
const bool bIsEditor = IsEditor();
@@ -634,7 +618,7 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
const bool bIsVisible = Owner->IsVisible();
if (Owner->bHiddenInGameIfNoGloveDetected)
{
if (bFoundGlove)
if (bGloveConnected)
{
if (!bIsVisible)
{
@@ -658,7 +642,7 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
}
}
return bFoundGlove;
return bGloveConnected;
}
void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
@@ -250,21 +250,22 @@ bool USGWristTrackerComponent::FImpl::CheckGlove() const
}
}
const bool bGloveWasPresent = IsValid(Owner->Glove);
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bFoundGlove && bGloveWasPresent)
bool bGloveConnected;
if (!IsValid(Owner->Glove) || !Owner->Glove->IsConnected())
{
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
bGloveConnected = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
if (!bGloveConnected)
{
Owner->Glove = nullptr;
}
}
if (bFoundGlove)
else
{
bGloveConnected = true;
UpdateWristTrackingData();
}
return bFoundGlove;
return bGloveConnected;
}
void USGWristTrackerComponent::FImpl::UpdateMotionSource() const
@@ -39,7 +39,9 @@
#include "Components/PrimitiveComponent.h"
#include "Components/SphereComponent.h"
#include "Kismet/KismetMathLibrary.h"
#include "Runtime/Launch/Resources/Version.h"
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
#include "XRDeviceVisualizationComponent.h"
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
#include "UObject/UObjectGlobals.h"
#include "SenseGlove/Components/SGGrabComponent.h"
@@ -48,6 +50,8 @@
#include "SenseGlove/Components/SGWristTrackerComponent.h"
#include "SGLog/SGLog.h"
static constexpr float SG_HAND_MESH_YAW_CORRECTION_OFFSET = -90.0f;
struct ASGPawn::FImpl
{
/************************
@@ -173,6 +177,15 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
WristTrackerLeft->SetupAttachment(GetRootComponent());
WristTrackerLeft->SetRight(false);
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
ControllerVisualizerLeft = ObjectInitializer.CreateDefaultSubobject<UXRDeviceVisualizationComponent>(
this, TEXT("ControllerVisualizerLeft"));
ControllerVisualizerLeft->SetupAttachment(WristTrackerLeft);
ControllerVisualizerLeft->SetDisplayModelSource(FName("OpenXR"));
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
WristTrackerLeft->SetDisplayModelSource(FName("OpenXR"));
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
HandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandLeft"));
HandLeft->SetupAttachment(GetRootComponent());
HandLeft->SetCanEverAffectNavigation(false);
@@ -190,7 +203,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
HandLeft->SetRight(false);
HandLeft->SetHiddenIfNoGloveDetected(true);
HandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
HandLeft->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f},
false, nullptr, ETeleportType::None);
HandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
false, nullptr, ETeleportType::None);
@@ -214,7 +227,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RealHandLeft->SetRight(false);
Pimpl->SetVisibility(RealHandLeft, false);
RealHandLeft->SetHiddenIfNoGloveDetected(true);
RealHandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
RealHandLeft->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f},
false, nullptr, ETeleportType::None);
RealHandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
false, nullptr, ETeleportType::None);
@@ -391,6 +404,15 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
WristTrackerRight->SetupAttachment(GetRootComponent());
WristTrackerRight->SetRight(true);
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
ControllerVisualizerRight = ObjectInitializer.CreateDefaultSubobject<UXRDeviceVisualizationComponent>(
this, TEXT("ControllerVisualizerRight"));
ControllerVisualizerRight->SetupAttachment(WristTrackerRight);
ControllerVisualizerRight->SetDisplayModelSource(FName("OpenXR"));
#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
WristTrackerRight->SetDisplayModelSource(FName("OpenXR"));
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
HandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandRight"));
HandRight->SetupAttachment(GetRootComponent());
HandRight->SetCanEverAffectNavigation(false);
@@ -407,9 +429,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandRight->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Block);
HandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
HandRight->SetRight(true);
HandRight->SetHiddenInGame(true);
HandRight->SetHiddenIfNoGloveDetected(true);
HandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
HandRight->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f},
false, nullptr, ETeleportType::None);
HandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
false, nullptr, ETeleportType::None);
@@ -433,7 +454,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RealHandRight->SetRight(true);
Pimpl->SetVisibility(RealHandRight, false);
RealHandRight->SetHiddenIfNoGloveDetected(true);
RealHandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
RealHandRight->SetRelativeRotation(FRotator{0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET, 0.0f},
false, nullptr, ETeleportType::None);
RealHandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
false, nullptr, ETeleportType::None);
@@ -447,7 +468,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RightThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("RightThumbFingertipGrabCollider"));
RightThumbFingertipGrabCollider->SetRelativeScale3D(HandLeft->GetDefaultFingertipsGrabColliderSize());
RightThumbFingertipGrabCollider->SetRelativeScale3D(HandRight->GetDefaultFingertipsGrabColliderSize());
RightThumbFingertipGrabCollider->SetupAttachment(HandRight, HandRight->GetThumbFingertipGrabSocketName());
RightThumbFingertipGrabCollider->SetCastShadow(false);
RightThumbFingertipGrabCollider->bCastDynamicShadow = false;
@@ -467,7 +488,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RightIndexFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("RightIndexFingertipGrabCollider"));
RightIndexFingertipGrabCollider->SetRelativeScale3D(HandLeft->GetDefaultFingertipsGrabColliderSize());
RightIndexFingertipGrabCollider->SetRelativeScale3D(HandRight->GetDefaultFingertipsGrabColliderSize());
RightIndexFingertipGrabCollider->SetupAttachment(HandRight, HandRight->GetIndexFingertipGrabSocketName());
RightIndexFingertipGrabCollider->SetCastShadow(false);
RightIndexFingertipGrabCollider->bCastDynamicShadow = false;
@@ -487,7 +508,7 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RightMiddleFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("RightMiddleFingertipGrabCollider"));
RightMiddleFingertipGrabCollider->SetRelativeScale3D(HandLeft->GetDefaultFingertipsGrabColliderSize());
RightMiddleFingertipGrabCollider->SetRelativeScale3D(HandRight->GetDefaultFingertipsGrabColliderSize());
RightMiddleFingertipGrabCollider->SetupAttachment(HandRight, HandRight->GetMiddleFingertipGrabSocketName());
RightMiddleFingertipGrabCollider->SetCastShadow(false);
RightMiddleFingertipGrabCollider->bCastDynamicShadow = false;
@@ -1810,20 +1831,24 @@ void ASGPawn::FImpl::UpdateHandRotation(const bool bRight, const FRotator& Rotat
void ASGPawn::FImpl::UpdateLeftHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
{
static const FQuat Offset{FQuat::MakeFromEuler(FVector{0.0f, 0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET})};
const FQuat NewRotation{Rotation.Quaternion() * Offset};
if (bUpdateVirtualHand)
{
Owner->HandLeft->SetWorldRotation(Rotation);
Owner->HandLeft->SetWorldRotation(NewRotation);
}
Owner->RealHandLeft->SetWorldRotation(Rotation);
Owner->RealHandLeft->SetWorldRotation(NewRotation);
}
void ASGPawn::FImpl::UpdateRightHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
{
static const FQuat Offset{FQuat::MakeFromEuler(FVector{0.0f, 0.0f, SG_HAND_MESH_YAW_CORRECTION_OFFSET})};
const FQuat NewRotation{Rotation.Quaternion() * Offset};
if (bUpdateVirtualHand)
{
Owner->HandRight->SetWorldRotation(Rotation);
Owner->HandRight->SetWorldRotation(NewRotation);
}
Owner->RealHandRight->SetWorldRotation(Rotation);
Owner->RealHandRight->SetWorldRotation(NewRotation);
}
void ASGPawn::FImpl::UpdateHandLocationAndRotation(
@@ -45,14 +45,12 @@
#include "TimerManager.h"
#include "SenseGlove/Components/SGGrabComponent.h"
#include "SenseGlove/Components/SGTouchComponent.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "SenseGlove/GameFramework/SGPawn.h"
#include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGHapticGlove.h"
struct ASGPlayerController::FImpl
@@ -61,18 +59,32 @@ struct ASGPlayerController::FImpl
* Static methods
************************/
static int32 GetBuzzLevel(const AActor* Actor);
static float GetBuzzDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static float GetForceFeedbackLevel(const AActor* Actor);
static int32 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(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static TArray<float> GetVibrotactileLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
/************************
* Member variables
************************/
FTimerHandle TouchBuzzStopTimer;
FTimerHandle TouchVibrotactileStopTimer;
/************************
* Owner object
@@ -98,96 +110,137 @@ struct ASGPlayerController::FImpl
* Methods
************************/
USGBuzzCommand* GetBuzzCommand(
const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const;
USGForceFeedbackCommand* GetForceFeedbackCommand(
const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const;
void UpdateHapticsFeedback(const FSGTouchState& TouchState);
};
int32 ASGPlayerController::FImpl::GetBuzzLevel(const AActor* Actor)
float ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
{
if (IsValid(Actor))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
if (TouchComponent)
if (IsValid(TouchComponent))
{
return TouchComponent->GetBuzzLevel();
}
}
return 0;
}
float ASGPlayerController::FImpl::GetBuzzDuration(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 (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorIndexTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorIndexTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorMiddleTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorMiddleTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorRingTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorRingTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorPinkyTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorPinkyTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
return TouchComponent->GetForceFeedbackLevel();
}
}
return 0.0f;
}
int32 ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
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 (TouchComponent)
if (IsValid(TouchComponent))
{
return TouchComponent->GetForceFeedbackLevel();
return TouchComponent->GetVibrotactileLevel();
}
}
return 0;
return 0.0f;
}
TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
const float ThumbForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
const float IndexForceFeedbackLevel = GetForceFeedbackLevel(ActorIndexTouching);
const float MiddleForceFeedbackLevel = GetForceFeedbackLevel(ActorMiddleTouching);
const float RingForceFeedbackLevel = GetForceFeedbackLevel(ActorRingTouching);
const float PinkyForceFeedbackLevel = GetForceFeedbackLevel(ActorPinkyTouching);
const TArray<float> ForceFeedbackLevels{
ThumbForceFeedbackLevel,
IndexForceFeedbackLevel,
MiddleForceFeedbackLevel,
RingForceFeedbackLevel,
PinkyForceFeedbackLevel,
};
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)
@@ -251,69 +304,10 @@ ASGPlayerController::FImpl::FImpl(ASGPlayerController* InOwner)
ASGPlayerController::FImpl::~FImpl() = default;
USGBuzzCommand* ASGPlayerController::FImpl::GetBuzzCommand(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const
{
const int32 ThumbBuzzLevel = GetBuzzLevel(ActorThumbTouching);
const int32 IndexBuzzLevel = GetBuzzLevel(ActorIndexTouching);
const int32 MiddleBuzzLevel = GetBuzzLevel(ActorMiddleTouching);
const int32 RingBuzzLevel = GetBuzzLevel(ActorRingTouching);
const int32 PinkyBuzzLevel = GetBuzzLevel(ActorThumbTouching);
if (ThumbBuzzLevel <= 0 && IndexBuzzLevel <= 0 && MiddleBuzzLevel <= 0 && RingBuzzLevel <= 0 && PinkyBuzzLevel <= 0)
{
return nullptr;
}
USGBuzzCommand* BuzzCommand = USGBuzzCommand::NewBuzzCommand(
Owner,
GetBuzzLevel(ActorThumbTouching),
GetBuzzLevel(ActorIndexTouching),
GetBuzzLevel(ActorMiddleTouching),
GetBuzzLevel(ActorRingTouching),
GetBuzzLevel(ActorPinkyTouching)
);
return BuzzCommand;
}
USGForceFeedbackCommand* ASGPlayerController::FImpl::GetForceFeedbackCommand(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const
{
const int32 ThumbForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
const int32 IndexForceFeedbackLevel = GetForceFeedbackLevel(ActorIndexTouching);
const int32 MiddleForceFeedbackLevel = GetForceFeedbackLevel(ActorMiddleTouching);
const int32 RingForceFeedbackLevel = GetForceFeedbackLevel(ActorRingTouching);
const int32 PinkyForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
if (ThumbForceFeedbackLevel <= 0 && IndexForceFeedbackLevel <= 0 && MiddleForceFeedbackLevel <= 0
&& RingForceFeedbackLevel <= 0 && PinkyForceFeedbackLevel <= 0)
{
return nullptr;
}
USGForceFeedbackCommand* ForceFeedbackCommand = USGForceFeedbackCommand::NewForceFeedbackCommand(
Owner,
GetForceFeedbackLevel(ActorThumbTouching),
GetForceFeedbackLevel(ActorIndexTouching),
GetForceFeedbackLevel(ActorMiddleTouching),
GetForceFeedbackLevel(ActorRingTouching),
GetForceFeedbackLevel(ActorPinkyTouching)
);
return ForceFeedbackCommand;
}
void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState)
{
static const TArray<float> VibrotactileOffCommand{0.0f, 0.0f, 0.0, 0.0, 0.0f};
if (!IsValid(TouchState.Hand))
{
return;
@@ -325,48 +319,44 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
return;
}
const USGBuzzCommand* BuzzCommand{
GetBuzzCommand(
// Queue the Force-Feedback command...
TArray<float> ForceFeedbackLevels{
GetForceFeedbackLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching,TouchState.ActorPinkyTouching)
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
};
if (IsValid(BuzzCommand))
{
Glove->SendHaptics(BuzzCommand);
Glove->QueueForceFeedbackLevels(MoveTemp(ForceFeedbackLevels));
const float Duration = FImpl::GetBuzzDuration(
// Queue the Vibrotactile command...
TArray<float> VibrotactileLevels{
GetVibrotactileLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState. ActorRingTouching, TouchState.ActorPinkyTouching);
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
};
Glove->QueueVibroLevels(MoveTemp(VibrotactileLevels));
Owner->GetWorldTimerManager().ClearTimer(TouchBuzzStopTimer);
// Send the haptics commands!
Glove->SendHaptics();
FTimerDelegate TouchBuzzStopHandler;
TouchBuzzStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
// Stop the Vibrotactile command after the timeout if a.
const float VibrotactileDuration = FImpl::GetVibrotactileDuration(
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))
{
Glove->SendHaptics(USGBuzzCommand::Off(Owner));
});
Glove->QueueVibroLevels(VibrotactileOffCommand);
Glove->SendHaptics();
}
});
Owner->GetWorldTimerManager().SetTimer(
TouchBuzzStopTimer, TouchBuzzStopHandler, Duration, false, -1.0f);
}
else
{
Glove->SendHaptics(USGBuzzCommand::Off(Owner));
}
const USGForceFeedbackCommand* ForceFeedbackCommand{
GetForceFeedbackCommand(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState. ActorRingTouching, TouchState.ActorPinkyTouching)
};
if (IsValid(ForceFeedbackCommand))
{
Glove->SendHaptics(ForceFeedbackCommand);
}
else
{
Glove->SendHaptics(USGForceFeedbackCommand::Off(Owner));
}
Owner->GetWorldTimerManager().SetTimer(
TouchVibrotactileStopTimer, TouchVibrotactileStopHandler, VibrotactileDuration, false, -1.0f);
}
void ASGPlayerController::FImplDeleter::operator()(const FImpl* P) const
@@ -40,12 +40,12 @@
void FSenseGloveModule::StartupModule()
{
SGLOG("Starting up SenseGlove module...");
SGLOG("Starting up the SenseGlove module...");
}
void FSenseGloveModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGlove module...");
SGLOG("Unloading the SenseGlove module...");
}
void FSenseGloveModule::PostLoadCallback()
@@ -55,7 +55,7 @@ void FSenseGloveModule::PostLoadCallback()
void FSenseGloveModule::ShutdownModule()
{
SGLOG("Shutting down SenseGlove module...");
SGLOG("Shutting down the SenseGlove module...");
}
#undef LOCTEXT_NAMESPACE
@@ -46,13 +46,19 @@ struct SENSEGLOVE_API FSGVirtualHandAnimInstanceProxy : public FAnimInstanceProx
{
GENERATED_USTRUCT_BODY()
public:
private:
TMap<FName, FRotator> BonesRotations;
public:
FSGVirtualHandAnimInstanceProxy();
FSGVirtualHandAnimInstanceProxy(UAnimInstance* Instance);
public:
FORCEINLINE const TMap<FName, FRotator>& GetBonesRotations() const
{
return BonesRotations;
}
protected:
virtual void PreEvaluateAnimation(UAnimInstance* InAnimInstance) override;
@@ -54,16 +54,15 @@ public:
private:
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100"))
int32 BuzzLevel;
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
float ForceFeedbackLevel;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false", ClampMin = "0.0", UIMin = "0.0"))
float VibrotactileDuration;
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100"))
float BuzzDuration;
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100"))
int32 ForceFeedbackLevel;
meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "100.0", UIMin = "0.0", UIMax = "100.0"))
float VibrotactileLevel;
private:
struct FImpl;
@@ -77,33 +76,32 @@ private:
FImplDeleter PimplDeleter;
public:
FORCEINLINE int32 GetBuzzLevel() const
{
return BuzzLevel;
}
FORCEINLINE void SetBuzzLevel(const int32 Level)
{
BuzzLevel = Level;
}
FORCEINLINE float GetBuzzDuration() const
{
return BuzzDuration;
}
FORCEINLINE void SetBuzzDuration(const float Duration)
{
BuzzDuration = Duration;
}
FORCEINLINE int32 GetForceFeedbackLevel() const
FORCEINLINE float GetForceFeedbackLevel() const
{
return ForceFeedbackLevel;
}
FORCEINLINE void SetForceFeedbackLevel(const int32 Level)
FORCEINLINE void SetForceFeedbackLevel(const float Level)
{
ForceFeedbackLevel = Level;
}
FORCEINLINE float GetVibrotactileDuration() const
{
return VibrotactileDuration;
}
FORCEINLINE void SetVibrotactileDuration(const float Duration)
{
VibrotactileDuration = Duration;
}
FORCEINLINE float GetVibrotactileLevel() const
{
return VibrotactileLevel;
}
FORCEINLINE void SetVibrotactileLevel(const float Level)
{
VibrotactileLevel = Level;
}
};
@@ -37,7 +37,7 @@
#include "Containers/Array.h"
#include "GameFramework/Pawn.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SenseGlove/Haptics/SGGrabState.h"
@@ -48,6 +48,7 @@
class UCameraComponent;
class UPrimitiveComponent;
class USphereComponent;
class UXRDeviceVisualizationComponent;
class USGVirtualHandComponent;
class USGWristTrackerComponent;
@@ -129,6 +130,9 @@ private:
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGWristTrackerComponent* WristTrackerLeft;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
UXRDeviceVisualizationComponent* ControllerVisualizerLeft;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* HandLeft;
@@ -162,6 +166,9 @@ private:
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGWristTrackerComponent* WristTrackerRight;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
UXRDeviceVisualizationComponent* ControllerVisualizerRight;
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
USGVirtualHandComponent* HandRight;
@@ -244,6 +251,13 @@ public:
return WristTrackerLeft;
}
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
FORCEINLINE UXRDeviceVisualizationComponent* GetControllerVisualizerLeft() const
{
return ControllerVisualizerLeft;
}
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
FORCEINLINE USGVirtualHandComponent* GetHandLeft() const
{
return HandLeft;
@@ -299,6 +313,13 @@ public:
return WristTrackerRight;
}
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
FORCEINLINE UXRDeviceVisualizationComponent* GetControllerVisualizerRight() const
{
return ControllerVisualizerLeft;
}
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2 */
FORCEINLINE USGVirtualHandComponent* GetHandRight() const
{
return HandRight;
+9 -8
View File
@@ -42,21 +42,22 @@ public class SenseGlove : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"AnimGraphRuntime",
"Core",
"CoreUObject",
"Engine",
"HeadMountedDisplay",
"InputCore",
// NOTE
// UE 5.3+ provides UXRDeviceVisualizationComponent as part of the XRBase plugin.
// UE 5.2 provides UXRDeviceVisualizationComponent as part of the HeadMountDisplay module.
// UE 5.1 does not provide the UXRDeviceVisualizationComponent type.
#if UE_5_3_OR_LATER
"XRBase",
#endif
"SenseGloveBackend",
"SenseGloveConnect",
"SenseGloveCore",
@@ -74,4 +75,4 @@ public class SenseGlove : ModuleRules
}
);
}
}
}
@@ -50,6 +50,8 @@
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
#endif /* PLATFORM_ANDROID */
#include "SGLog/SGLog.h"
int32 FSGConnectJNI::Initialize()
{
int32 Result = -999999;
@@ -117,7 +117,7 @@ int32 FSGCoreJNI::Initialize()
SGLOG("FSGCoreJNI: attempting to find the Android JNI method 'WriteHaptics'...");
jmethodID WriteHapticsMethodID = Env->GetStaticMethodID(Class, "WriteHaptics", "(ILjava/lang/String;)I");
jmethodID WriteHapticsMethodID = Env->GetStaticMethodID(Class, "WriteHaptics", "(IILjava/lang/String;)I");
FAndroidApplication::CheckJavaException();
if (!WriteHapticsMethodID)
{
@@ -43,7 +43,7 @@
void FSenseGloveAndroidModule::StartupModule()
{
SGLOG("Starting up SenseGloveAndroid module...");
SGLOG("Starting up the SenseGloveAndroid module...");
#if PLATFORM_ANDROID
const int32 R1 = FSGConnectJNI::Initialize();
@@ -59,17 +59,17 @@ void FSenseGloveAndroidModule::StartupModule()
void FSenseGloveAndroidModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveAndroid module...");
SGLOG("Unloading the SenseGloveAndroid module...");
}
void FSenseGloveAndroidModule::PostLoadCallback()
{
SGLOG("Loading SenseGloveAndroid module has succeeded!");
SGLOG("Loading the SenseGloveAndroid module has succeeded!");
}
void FSenseGloveAndroidModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveAndroid module...");
SGLOG("Shutting down the SenseGloveAndroid module...");
}
#undef LOCTEXT_NAMESPACE
@@ -43,25 +43,25 @@ public class SenseGloveAndroid : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveConnectImpl",
"SenseGloveCoreImpl",
"SenseGloveInterop",
"SenseGloveLog",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveInterop",
}
);
if (Target.Platform == UnrealTargetPlatform.Android)
{
AdditionalPropertiesForReceipt.Add("AndroidPlugin",
@@ -37,9 +37,12 @@
#include "Engine/Engine.h"
#if PLATFORM_ANDROID
#include "SGConnect/SGConnect.h"
#endif /* PLATFORM_ANDROID */
#include "SGCore/SGDeviceList.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGCore/SGHandLayer.h"
#include "SGLog/SGLog.h"
struct USGBackend::FImpl
@@ -115,9 +118,6 @@ bool USGBackend::InitializeBackend()
FSGDeviceList::Dispose();
FSGDeviceList::Reinitialize();
// Load the latest hand profiles.
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
bBackendInitialized = true;
return true;
@@ -42,16 +42,10 @@ public class SenseGloveBackend : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
@@ -41,12 +41,12 @@
void FSenseGloveBackendKismetModule::StartupModule()
{
SGLOG("Starting up SenseGloveBackendKismet module...");
SGLOG("Starting up the SenseGloveBackendKismet module...");
}
void FSenseGloveBackendKismetModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveBackendKismet module...");
SGLOG("Unloading the SenseGloveBackendKismet module...");
}
void FSenseGloveBackendKismetModule::PostLoadCallback()
@@ -56,7 +56,7 @@ void FSenseGloveBackendKismetModule::PostLoadCallback()
void FSenseGloveBackendKismetModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveBackendKismet module...");
SGLOG("Shutting down the SenseGloveBackendKismet module...");
}
#undef LOCTEXT_NAMESPACE
@@ -42,16 +42,10 @@ public class SenseGloveBackendKismet : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveBackend",
@@ -33,4 +33,4 @@
*/
#include "SGBuildHacks/SGInclude_Core_SensorRange.h"
#include "SGBuildHacks/SGInclude_Core_CustomWaveform.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HandLayer.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticChannelInfo.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationCheck.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationSequence.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCommandBuffer.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveHandProfiles.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveQuickCalibration.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NormalizationState.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_Nova2Glove.h"
@@ -33,4 +33,4 @@
*/
#include "SGBuildHacks/SGInclude_Core_CalibrationDataPoint.h"
#include "SGBuildHacks/SGInclude_Core_Nova2GloveSensorData.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NovaGloveCalibration.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NovaGloveHandProfile.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SenseGloveHandProfile.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SenseGloveSensorNormalizer.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SensorNormalization.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_ThresholdCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_ThumperCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_TimedBuzzCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_TimedThumpCommand.h"
@@ -40,12 +40,12 @@
void FSenseGloveBuildHacksModule::StartupModule()
{
SGLOG("Starting up SenseGloveBuildHacks module...");
SGLOG("Starting up the SenseGloveBuildHacks module...");
}
void FSenseGloveBuildHacksModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveBuildHacks module...");
SGLOG("Unloading the SenseGloveBuildHacks module...");
}
void FSenseGloveBuildHacksModule::PostLoadCallback()
@@ -55,7 +55,7 @@ void FSenseGloveBuildHacksModule::PostLoadCallback()
void FSenseGloveBuildHacksModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveBuildHacks module...");
SGLOG("Shutting down the SenseGloveBuildHacks module...");
}
#undef LOCTEXT_NAMESPACE
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/FingerCommand.hpp"
#include "SenseGlove/Core/CustomWaveform.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/BuzzCommand.hpp"
#include "SenseGlove/Core/HandLayer.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticChannelInfo.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCalibrationCheck.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCalibrationSequence.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCommandBuffer.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveHandProfiles.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveQuickCalibration.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NormalizationState.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HandProfile.hpp"
#include "SenseGlove/Core/Nova2Glove.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/CalibrationDataPoint.hpp"
#include "SenseGlove/Core/Nova2GloveSensorData.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NovaGloveCalibration.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NovaGloveHandProfile.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SenseGloveHandProfile.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/ForceFeedbackCommand.hpp"
#include "SenseGlove/Core/SenseGloveSensorNormalizer.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SensorNormalization.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SensorRange.hpp"
#include "SenseGlove/Core/ThresholdCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/ThumperCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/TimedBuzzCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/TimedThumpCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -46,16 +46,12 @@ public class SenseGloveBuildHacks : ModuleRules
bEnableExceptions = true;
bUseRTTI = true;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveLog",
}
);
@@ -42,14 +42,14 @@
void FSenseGloveConnectModule::StartupModule()
{
SGLOG("Starting up SenseGloveConnect module...");
SGLOG("Starting up the SenseGloveConnect module...");
SGLOG(FString::Printf(TEXT("The Unreal Engine implementation of '%s' has been loaded successfully!"),
*FSGConnect::GetLibraryVersion()));
}
void FSenseGloveConnectModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveConnect module...");
SGLOG("Unloading the SenseGloveConnect module...");
}
void FSenseGloveConnectModule::PostLoadCallback()
@@ -59,7 +59,7 @@ void FSenseGloveConnectModule::PostLoadCallback()
void FSenseGloveConnectModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveConnect module...");
SGLOG("Shutting down the SenseGloveConnect module...");
}
#undef LOCTEXT_NAMESPACE
@@ -42,24 +42,25 @@ public class SenseGloveConnect : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveConnectImpl",
"SenseGloveInterop",
"SenseGloveLog",
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveInterop",
}
);
if (Target.Platform == UnrealTargetPlatform.Android)
{
PrivateDependencyModuleNames.AddRange(
@@ -37,6 +37,8 @@
#include <string>
#include "Containers/StringConv.h"
#include "SGBuildHacks/SGInclude_Connect_SGConnect.h"
int32 FSGConnectImpl::Init()
@@ -35,6 +35,7 @@
#include "SGConnectImpl/SGExportedFunctions.h"
#include "Containers/StringConv.h"
#include "Templates/UnrealTemplate.h"
#if PLATFORM_ANDROID
@@ -42,14 +42,14 @@
void FSenseGloveConnectImplModule::StartupModule()
{
SGLOG("Starting up SenseGloveConnectImpl module...");
SGLOG("Starting up the SenseGloveConnectImpl module...");
SGLOG(FString::Printf(TEXT("The low-level implementation of '%s' has been loaded successfully!"), *FSGConnectImpl::
GetLibraryVersion()));
}
void FSenseGloveConnectImplModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveConnectImpl module...");
SGLOG("Unloading the SenseGloveConnectImpl module...");
}
void FSenseGloveConnectImplModule::PostLoadCallback()
@@ -59,7 +59,7 @@ void FSenseGloveConnectImplModule::PostLoadCallback()
void FSenseGloveConnectImplModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveConnectImpl module...");
SGLOG("Shutting down the SenseGloveConnectImpl module...");
}
#undef LOCTEXT_NAMESPACE
@@ -36,11 +36,9 @@
#pragma once
/* Defines a C++ like static_assert. */
#if __cplusplus
#include <cassert>
#else
#if ! __cplusplus
#include <assert.h>
#endif /* __cplusplus */
#endif /* ! __cplusplus */
/* Contains __bool_true_false_are_defined macro that can be used in order to
check whether boolean type is supported by the compiler or not. */
@@ -58,7 +56,7 @@ static_assert(__bool_true_false_are_defined, "Error: bool, true, and false are n
#define SENSEGLOVECONNECTIMPL_PUBLIC_API DLLIMPORT
#endif /* defined ( SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE ) */
/* If C++ is used, switch to C mode in order to prevent C++'s name mangling of
/* If C++ is used, switch to C mode in order to prevent the C++ name mangling of
method names. */
#if __cplusplus
extern "C" {
@@ -48,21 +48,23 @@ public class SenseGloveConnectImpl : ModuleRules
bEnableExceptions = true;
bUseRTTI = true;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveBuildHacks",
"SenseGloveInterop",
"SenseGloveLog",
"SenseGloveTypes",
"SenseGloveUtils",
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveInterop",
}
);
@@ -79,70 +81,28 @@ public class SenseGloveConnectImpl : ModuleRules
string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source"));
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty"));
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
string LibraryPathAnroidArm64 = "";
string LibraryPathAnroidx64 = "";
string LibraryName = "sgconnect";
if (Target.Platform == UnrealTargetPlatform.Android)
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_1_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
#elif UE_5_0_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
#else
Debug.Assert(false, "Developing for Android on UE versions older than 5.0 is not supported!");
#endif
#if UE_5_2_OR_LATER
if (Target.Architecture == UnrealArch.Arm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
}
else if (Target.Architecture == UnrealArch.X64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
}
#else
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
foreach (string Arch in Architectures)
{
if (Arch == "-arm64")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
break;
}
else if (Arch == "-armv7")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "armv7"));
break;
}
else if (Arch == "-x64")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
break;
}
else if (Arch == "-86")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86"));
break;
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
break;
}
}
#endif
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
LibraryName = string.Format("lib{0}.a", LibraryName);
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
else if (bIsLinux)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -159,11 +119,7 @@ public class SenseGloveConnectImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
}
#if UE_5_0_OR_LATER
else if (Target.Platform == UnrealTargetPlatform.LinuxArm64)
#else
else if (Target.Platform == UnrealTargetPlatform.LinuxAArch64)
#endif
else if (bIsLinuxArm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -180,7 +136,7 @@ public class SenseGloveConnectImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
}
else if (Target.Platform == UnrealTargetPlatform.Win64)
else if (bIsWin64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
switch (Target.WindowsPlatform.Compiler)
@@ -189,6 +145,8 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2022:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
break;
#endif
#if ! UE_5_4_OR_LATER && UE_5_0_OR_LATER
case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break;
@@ -205,21 +163,42 @@ public class SenseGloveConnectImpl : ModuleRules
Debug.Assert(false, "Unsupported platform!");
}
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug);
if (bDebug)
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
PrivateIncludePaths.Add(IncludePath);
if (bIsAndroid)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
if (bIsDebugBuild)
{
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug"));
}
else
{
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release"));
}
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName));
PublicAdditionalLibraries.Add(LibraryPathAnroidArm64);
PublicAdditionalLibraries.Add(LibraryPathAnroidx64);
}
else
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
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);
}
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
PrivateIncludePaths.Add(IncludePath);
PublicAdditionalLibraries.Add(LibraryPath);
}
private void AddSerialLibrary(ReadOnlyTargetRules Target)
@@ -228,70 +207,28 @@ public class SenseGloveConnectImpl : ModuleRules
string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source"));
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty"));
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
string LibraryPathAnroidArm64 = "";
string LibraryPathAnroidx64 = "";
string LibraryName = "serial";
if (Target.Platform == UnrealTargetPlatform.Android)
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_1_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
#elif UE_4_5_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
#else
Debug.Assert(false, "Developing for Android on UE versions older than 5.0 is not supported!");
#endif
#if UE_5_2_OR_LATER
if (Target.Architecture == UnrealArch.Arm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
}
else if (Target.Architecture == UnrealArch.X64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
}
#else
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
foreach (string Arch in Architectures)
{
if (Arch == "-arm64")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
break;
}
else if (Arch == "-armv7")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "armv7"));
break;
}
else if (Arch == "-x64")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
break;
}
else if (Arch == "-86")
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86"));
break;
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
break;
}
}
#endif
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
LibraryName = string.Format("lib{0}.a", LibraryName);
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
else if (bIsLinux)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -308,11 +245,7 @@ public class SenseGloveConnectImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
}
#if UE_5_0_OR_LATER
else if (Target.Platform == UnrealTargetPlatform.LinuxArm64)
#else
else if (Target.Platform == UnrealTargetPlatform.LinuxAArch64)
#endif
else if (bIsLinuxArm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -329,7 +262,7 @@ public class SenseGloveConnectImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
}
else if (Target.Platform == UnrealTargetPlatform.Win64)
else if (bIsWin64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
switch (Target.WindowsPlatform.Compiler)
@@ -338,6 +271,8 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2022:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
break;
#endif
#if ! UE_5_4_OR_LATER && UE_5_0_OR_LATER
case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break;
@@ -354,20 +289,41 @@ public class SenseGloveConnectImpl : ModuleRules
Debug.Assert(false, "Unsupported platform!");
}
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug);
if (bDebug)
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
PrivateIncludePaths.Add(IncludePath);
if (bIsAndroid)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
if (bIsDebugBuild)
{
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug"));
}
else
{
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release"));
}
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName));
PublicAdditionalLibraries.Add(LibraryPathAnroidArm64);
PublicAdditionalLibraries.Add(LibraryPathAnroidx64);
}
else
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
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);
}
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
PrivateIncludePaths.Add(IncludePath);
PublicAdditionalLibraries.Add(LibraryPath);
}
}
@@ -40,12 +40,12 @@
void FSenseGloveConnectKismetModule::StartupModule()
{
SGLOG("Starting up SenseGloveConnectKismet module...");
SGLOG("Starting up the SenseGloveConnectKismet module...");
}
void FSenseGloveConnectKismetModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveConnectKismet module...");
SGLOG("Unloading the SenseGloveConnectKismet module...");
}
void FSenseGloveConnectKismetModule::PostLoadCallback()
@@ -55,7 +55,7 @@ void FSenseGloveConnectKismetModule::PostLoadCallback()
void FSenseGloveConnectKismetModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveConnectKismet module...");
SGLOG("Shutting down the SenseGloveConnectKismet module...");
}
#undef LOCTEXT_NAMESPACE
@@ -42,16 +42,10 @@ public class SenseGloveConnectKismet : ModuleRules
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"SenseGloveConnect",
@@ -68,6 +68,12 @@ float FSGAnatomy::GetThumbJointLimit(const bool bRightHanded, const int32 Joint,
return SGCoreImpl_FSGAnatomyImpl_GetThumbJointLimit(bRightHanded, Joint, Movement, bMax);
}
float FSGAnatomy::ClampJointAngle(
const float Value, const int32 Finger, const bool bRightHand, const int32 Joint, const int32 Movement)
{
return SGCoreImpl_FSGAnatomyImpl_ClampJointAngle(Value, Finger, bRightHand, Joint, Movement);
}
float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInDegrees)
{
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInDegrees);
@@ -82,26 +88,26 @@ TArray<TArray<FVector>> FSGAnatomy::GetDefaultHandAngles(const bool bRightHanded
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetDefaultHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
return OutAnglesContainer.Array;
}
TArray<TArray<FVector>> FSGAnatomy::GetFlatHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetFlatHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
return OutAnglesContainer.Array;
}
TArray<TArray<FVector>> FSGAnatomy::GetThumbsUpHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetThumbsUpHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
return OutAnglesContainer.Array;
}
TArray<TArray<FVector>> FSGAnatomy::GetFistHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetFistHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
return OutAnglesContainer.Array;
}
@@ -35,8 +35,6 @@
#include "SGCore/SGBasicHandModel.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FQuat.h"
@@ -208,21 +206,21 @@ TArray<TArray<float>> USGBasicHandModel::GetBaseFingerLengths()
{
FSGIC_TArray_TArray_float OutLengthsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetBaseFingerLengths(&OutLengthsContainer);
return MoveTemp(OutLengthsContainer.Array);
return OutLengthsContainer.Array;
}
TArray<FVector> USGBasicHandModel::GetBaseJointPositions()
{
FSGIC_TArray_FVector OutPositionsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetBaseJointPositions(&OutPositionsContainer);
return MoveTemp(OutPositionsContainer.Array);
return OutPositionsContainer.Array;
}
TArray<FVector> USGBasicHandModel::GetBaseJointAngles()
{
FSGIC_TArray_FVector OutRotationsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetBaseJointAngles(&OutRotationsContainer);
return MoveTemp(OutRotationsContainer.Array);
return OutRotationsContainer.Array;
}
USGBasicHandModel::USGBasicHandModel()
@@ -363,7 +361,7 @@ TArray<TArray<float>> USGBasicHandModel::GetFingerLengths() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_TArray_float OutLengthsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetFingerLengths(&InstanceContainer, &OutLengthsContainer);
return MoveTemp(OutLengthsContainer.Array);
return OutLengthsContainer.Array;
}
TArray<float> USGBasicHandModel::GetFingerLengths(const ESGFinger Finger) const
@@ -373,7 +371,7 @@ TArray<float> USGBasicHandModel::GetFingerLengths(const ESGFinger Finger) const
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_GetFingerLengths_Finger(&InstanceContainer, &OutLengthsContainer,
&FingerContainer);
return MoveTemp(OutLengthsContainer.Array);
return OutLengthsContainer.Array;
}
void USGBasicHandModel::SetFingerLengths(const ESGFinger Finger, const TArray<float>& Lengths)
@@ -397,7 +395,7 @@ TArray<TArray<float>> USGBasicHandModel::GetFingerRatios() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_TArray_float OutRatiosContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetFingerRatios(&InstanceContainer, &OutRatiosContainer);
return MoveTemp(OutRatiosContainer.Array);
return OutRatiosContainer.Array;
}
TArray<float> USGBasicHandModel::GetFingerRatios(const ESGFinger Finger) const
@@ -407,7 +405,7 @@ TArray<float> USGBasicHandModel::GetFingerRatios(const ESGFinger Finger) const
FSGIC_TArray_float OutRatiosContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetFingerRatios_Finger(&InstanceContainer, &OutRatiosContainer,
&FingerContainer);
return MoveTemp(OutRatiosContainer.Array);
return OutRatiosContainer.Array;
}
TArray<FVector> USGBasicHandModel::GetStartJointPositions() const
@@ -415,7 +413,7 @@ TArray<FVector> USGBasicHandModel::GetStartJointPositions() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_FVector OutPositionsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetStartJointPositions(&InstanceContainer, &OutPositionsContainer);
return MoveTemp(OutPositionsContainer.Array);
return OutPositionsContainer.Array;
}
void USGBasicHandModel::SetStartJointPosition(const ESGFinger Finger, const FVector& Position)
@@ -439,7 +437,7 @@ TArray<FQuat> USGBasicHandModel::GetStartJointRotationsQ() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetStartJointRotations(&InstanceContainer, &OutRotationsContainer);
return MoveTemp(OutRotationsContainer.Array);
return OutRotationsContainer.Array;
}
TArray<FRotator> USGBasicHandModel::GetStartJointRotations() const
@@ -456,7 +454,7 @@ FVector USGBasicHandModel::GetJointPosition(const ESGFinger Finger) const
FSGIC_FVector OutPositionContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_GetJointPosition(&InstanceContainer, &OutPositionContainer, &FingerContainer);
return MoveTemp(OutPositionContainer.Vector);
return OutPositionContainer.Vector;
}
void USGBasicHandModel::SetJointPosition(const FVector& NewPosition, const ESGFinger Finger)
@@ -473,7 +471,7 @@ FQuat USGBasicHandModel::GetJointRotationQ(const ESGFinger Finger) const
FSGIC_FQuat OutRotationContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_GetJointRotation(&InstanceContainer, &OutRotationContainer, &FingerContainer);
return MoveTemp(OutRotationContainer.Quat);
return OutRotationContainer.Quat;
}
FRotator USGBasicHandModel::GetJointRotation(const ESGFinger Finger) const
@@ -506,7 +504,7 @@ TArray<float> USGBasicHandModel::GetTotalLengths() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_float OutLengthsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetTotalLengths(&InstanceContainer, &OutLengthsContainer);
return MoveTemp(OutLengthsContainer.Array);
return OutLengthsContainer.Array;
}
float USGBasicHandModel::GetTotalLength(const ESGFinger Finger) const
@@ -523,7 +521,7 @@ TArray<FVector> USGBasicHandModel::Get3DLengths(const ESGFinger Finger) const
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_Get3DLengths(&InstanceContainer, &OutLengthsContainer,
&FingerContainer);
return MoveTemp(OutLengthsContainer.Array);
return OutLengthsContainer.Array;
}
bool USGBasicHandModel::Equals(const USGBasicHandModel* BasicHandModel) const
@@ -538,7 +536,7 @@ FString USGBasicHandModel::ToString() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGBasicHandModelImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
FString USGBasicHandModel::ToString(const bool bLengthsOnly) const
@@ -546,7 +544,7 @@ FString USGBasicHandModel::ToString(const bool bLengthsOnly) const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGBasicHandModelImpl_ToString_bLengthsOnly(&InstanceContainer, &OutStringContainer, bLengthsOnly);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
FString USGBasicHandModel::SGSerialize() const
@@ -554,7 +552,7 @@ FString USGBasicHandModel::SGSerialize() const
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGBasicHandModelImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
USGBasicHandModel::FImpl::FImpl(USGBasicHandModel* InOwner)
@@ -36,7 +36,6 @@
#include "SGCore/SGBetaDevice.h"
#include "Engine/World.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGDeviceImplCast.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
@@ -146,7 +145,7 @@ FString USGBetaDevice::GetDeviceId() const
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
FSGIC_FString OutIdContainer;
SGCoreImpl_FSGBetaDeviceImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
return MoveTemp(OutIdContainer.String);
return OutIdContainer.String;
}
FString USGBetaDevice::GetHardwareVersion() const
@@ -174,7 +173,7 @@ FString USGBetaDevice::GetConstantsString() const
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGBetaDeviceImpl_GetConstantsString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
FString USGBetaDevice::GetSensorData() const
@@ -182,7 +181,7 @@ FString USGBetaDevice::GetSensorData() const
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
FSGIC_FString OutDataContainer;
SGCoreImpl_FSGBetaDeviceImpl_GetSensorData(&InstanceContainer, &OutDataContainer);
return MoveTemp(OutDataContainer.String);
return OutDataContainer.String;
}
FString USGBetaDevice::GetLastCommand() const
@@ -190,7 +189,7 @@ FString USGBetaDevice::GetLastCommand() const
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
FSGIC_FString OutCommandContainer;
SGCoreImpl_FSGBetaDeviceImpl_GetLastCommand(&InstanceContainer, &OutCommandContainer);
return MoveTemp(OutCommandContainer.String);
return OutCommandContainer.String;
}
bool USGBetaDevice::SendHaptics(const FString& Command) const
@@ -205,5 +204,5 @@ FString USGBetaDevice::ToString() const
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGBetaDeviceImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
@@ -1,180 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGBuzzCommand.h"
#include "SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const FSGBuzzCommandImpl& BuzzCommandImpl)
{
USGBuzzCommand* Instance = NewObject<USGBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(BuzzCommandImpl);
return Instance;
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
{
USGBuzzCommand* Instance = NewObject<USGBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(MoveTemp(BuzzCommandImpl));
return Instance;
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const TArray<int32>& BuzzLevels)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
SGCoreImpl_FSGBuzzCommandImpl_ctor_BuzzLevels_MakeShared(
&OutSharedPtrContainer, &BuzzLevelsContainer);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const int32 Thumb, const int32 Index, const int32 Middle,
const int32 Ring, const int32 Pinky)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const ESGFinger Finger, const int32 BuzzLevel)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBuzzCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::Off(UObject* Outer)
{
FSGIC_FSGBuzzCommandImpl OutContainer;
SGCoreImpl_FSGBuzzCommandImpl_Off(&OutContainer);
return NewBuzzCommand(Outer, OutContainer.BuzzCommandImpl);
}
USGBuzzCommand::USGBuzzCommand()
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
: USGFingerCommand(BuzzLevels)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
SGCoreImpl_FSGBuzzCommandImpl_ctor_BuzzLevels_MakeShared(
&OutSharedPtrContainer, &BuzzLevelsContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBuzzCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
: USGFingerCommand(BuzzCommandImpl)
{
}
USGBuzzCommand::USGBuzzCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
: USGFingerCommand(MoveTemp(BuzzCommandImpl))
{
}
USGBuzzCommand::~USGBuzzCommand() = default;
TSharedRef<FSGBuzzCommandImpl> USGBuzzCommand::ToBuzzCommandImpl() const
{
return FSGFingerCommandImplCast::ToBuzzCommandImpl(ToFingerCommandImpl());
}
USGBuzzCommand* USGBuzzCommand::Copy(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl InstanceContainer{ToBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGBuzzCommandImpl_Copy(&InstanceContainer, &OutBuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
USGBuzzCommand* USGBuzzCommand::Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl InstanceContainer{ToBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandImplContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGBuzzCommandImpl_Merge(&InstanceContainer, &OutBuzzCommandImplContainer, &BuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
@@ -1,175 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGCalibrationDataPoint.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGCalibrationDataPointImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_FVector.h"
struct USGCalibrationDataPoint::FImpl
{
/************************
* Member variables
************************/
FSGCalibrationDataPointImpl CalibrationDataPointImpl;
/************************
* Owner object
************************/
USGCalibrationDataPoint* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGCalibrationDataPoint* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
UObject* Outer, const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
{
USGCalibrationDataPoint* Instance = NewObject<USGCalibrationDataPoint>(Outer);
Instance->SetCalibrationDataPointImpl(CalibrationDataPointImpl);
return Instance;
}
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(UObject* Outer)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
return NewCalibrationDataPoint(Outer, MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl));
}
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
UObject* Outer, const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_CurrentStage_CalibrationValues(
&OutCalibrationDataPointImplContainer, CurrentStage, &CalibrationValuesContainer);
return NewCalibrationDataPoint(Outer, MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl));
}
USGCalibrationDataPoint::USGCalibrationDataPoint()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
}
USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_CurrentStage_CalibrationValues(
&OutCalibrationDataPointImplContainer, CurrentStage, &CalibrationValuesContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
}
USGCalibrationDataPoint::USGCalibrationDataPoint(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetCalibrationDataPointImpl(CalibrationDataPointImpl);
}
USGCalibrationDataPoint::~USGCalibrationDataPoint() = default;
void USGCalibrationDataPoint::SetCalibrationDataPointImpl(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointContainer;
FSGIC_FSGCalibrationDataPointImpl RhsContainer{CalibrationDataPointImpl};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_copy(&OutCalibrationDataPointContainer, &RhsContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointContainer.CalibrationDataPointImpl);
}
const FSGCalibrationDataPointImpl& USGCalibrationDataPoint::ToCalibrationDataPointImpl() const
{
return Pimpl->CalibrationDataPointImpl;
}
TArray<FVector> USGCalibrationDataPoint::GetCalibrationValues() const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{ToCalibrationDataPointImpl()};
FSGIC_TArray_FVector OutValuesContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_GetCalibrationValues(&InstanceContainer, &OutValuesContainer);
return MoveTemp(OutValuesContainer.Array);
}
int32 USGCalibrationDataPoint::GetStage() const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{ToCalibrationDataPointImpl()};
return SGCoreImpl_FSGCalibrationDataPointImpl_GetStage(&InstanceContainer);
}
FString USGCalibrationDataPoint::ToLogData(const FString& Delimiter) const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{Pimpl->CalibrationDataPointImpl};
FSGIC_FString DelimiterContainer{Delimiter};
FSGIC_FString OutDataContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ToLogData(&InstanceContainer, &OutDataContainer, &DelimiterContainer);
return MoveTemp(OutDataContainer.String);
}
USGCalibrationDataPoint::FImpl::FImpl(USGCalibrationDataPoint* InOwner)
: Owner(InOwner)
{
}
USGCalibrationDataPoint::FImpl::~FImpl() = default;
void USGCalibrationDataPoint::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,340 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGCustomWaveform.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGWaveformType.h"
#include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGCustomWaveform::FImpl
{
/************************
* Member variables
************************/
FSGCustomWaveformImpl CustomWaveformImpl;
/************************
* Owner object
************************/
USGCustomWaveform* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGCustomWaveform* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer, const FSGCustomWaveformImpl& CustomWaveformImpl)
{
USGCustomWaveform* Instance = NewObject<USGCustomWaveform>(Outer);
Instance->SetCustomWaveformImpl(CustomWaveformImpl);
return Instance;
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor(&OutCustomWaveformImplContainer);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer, const float Amplitude, const float Duration)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration(
&OutCustomWaveformImplContainer, Amplitude, Duration);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(
UObject* Outer, const float Amplitude, const float Duration, const float Frequency)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration_Frequency(
&OutCustomWaveformImplContainer, Amplitude, Duration, Frequency);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
FString USGCustomWaveform::ToString(const ESGWaveformType Type)
{
FSGIC_ESGWaveformType TypeContainer{Type};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGCustomWaveformImpl_ToString_Type(&OutStringContainer, &TypeContainer);
return OutStringContainer.String;
}
USGCustomWaveform::USGCustomWaveform()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor(&OutCustomWaveformImplContainer);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const float Amplitude, const float Duration)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration(
&OutCustomWaveformImplContainer, Amplitude, Duration);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const float Amplitude, const float Duration, const float Frequency)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration_Frequency(
&OutCustomWaveformImplContainer, Amplitude, Duration, Frequency);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const FSGCustomWaveformImpl& CustomWaveformImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetCustomWaveformImpl(CustomWaveformImpl);
}
USGCustomWaveform::~USGCustomWaveform() = default;
void USGCustomWaveform::SetCustomWaveformImpl(const FSGCustomWaveformImpl& CustomWaveformImpl)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformContainer;
FSGIC_FSGCustomWaveformImpl RhsContainer{CustomWaveformImpl};
SGCoreImpl_FSGCustomWaveformImpl_ctor_copy(&OutCustomWaveformContainer, &RhsContainer);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformContainer.CustomWaveformImpl);
}
const FSGCustomWaveformImpl& USGCustomWaveform::ToCustomWaveformImpl() const
{
return Pimpl->CustomWaveformImpl;
}
float USGCustomWaveform::GetAmplitude() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetAmplitude(&InstanceContainer);
}
void USGCustomWaveform::SetAmplitude(const float Amplitude)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetAmplitude(&InstanceContainer, Amplitude);
}
ESGWaveformType USGCustomWaveform::GetWaveType() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_ESGWaveformType OutTypeContainer;
SGCoreImpl_FSGCustomWaveformImpl_GetWaveType(&InstanceContainer, &OutTypeContainer);
return OutTypeContainer.Type;
}
void USGCustomWaveform::SetWaveType(const ESGWaveformType Type)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_ESGWaveformType TypeContainer{Type};
SGCoreImpl_FSGCustomWaveformImpl_SetWaveType(&InstanceContainer, &TypeContainer);
}
bool USGCustomWaveform::IsInfinite() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_IsInfinite(&InstanceContainer);
}
void USGCustomWaveform::SetInfinite(const bool bInfinite)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetInfinite(&InstanceContainer, bInfinite);
}
int32 USGCustomWaveform::GetRepeatAmount() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetRepeatAmount(&InstanceContainer);
}
void USGCustomWaveform::SetRepeatAmount(const int32 Amount)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetRepeatAmount(&InstanceContainer, Amount);
}
float USGCustomWaveform::GetAttackTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetAttackTime(&InstanceContainer);
}
void USGCustomWaveform::SetAttackTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetAttackTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetSustainTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetSustainTime(&InstanceContainer);
}
void USGCustomWaveform::SetSustainTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetSustainTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetDecayTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetDecayTime(&InstanceContainer);
}
void USGCustomWaveform::SetDecayTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetDecayTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetFrequencyStart() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencyStart(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencyStart(const float Frequency)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencyStart(&InstanceContainer, Frequency);
}
float USGCustomWaveform::GetFrequencyEnd() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencyEnd(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencyEnd(const float Frequency)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencyEnd(&InstanceContainer, Frequency);
}
float USGCustomWaveform::GetFrequencySwitchTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencySwitchTime(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencySwitchTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencySwitchTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetFrequencySwitchFactor() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencySwitchFactor(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencySwitchFactor(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencySwitchFactor(&InstanceContainer, Time);
}
float USGCustomWaveform::GetEffectTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetEffectTime(&InstanceContainer);
}
float USGCustomWaveform::GetTotalEffectTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetTotalEffectTime(&InstanceContainer);
}
bool USGCustomWaveform::FrequencyJumps() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_FrequencyJumps(&InstanceContainer);
}
bool USGCustomWaveform::Equals(const USGCustomWaveform* CustomWaveform) const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_FSGCustomWaveformImpl CustomWaveformContainer{CustomWaveform->ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_Equals(&InstanceContainer, &CustomWaveformContainer);
}
FString USGCustomWaveform::ToString() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGCustomWaveformImpl_ToString(&InstanceContainer, &OutStringContainer);
return OutStringContainer.String;
}
USGCustomWaveform::FImpl::FImpl(USGCustomWaveform* InOwner)
: Owner(InOwner)
{
}
USGCustomWaveform::FImpl::~FImpl() = default;
void USGCustomWaveform::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -35,26 +35,38 @@
#include "SGCore/SGDevice.h"
#include "SGDeviceImplCast.h"
#include "Engine/Engine.h"
#include "Engine/GameViewportClient.h"
#include "Engine/World.h"
#include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
#include "SGCore/SGBetaDevice.h"
#include "SGCore/SGHapticChannelInfo.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGNova2Glove.h"
#include "SGCore/SGNovaGlove.h"
#include "SGCore/SGSenseGlove.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHapticChannelInfoImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGNova2GloveImpl.h"
#include "SGCoreImpl/SGNovaGloveImpl.h"
#include "SGCoreImpl/SGSenseGloveImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGConnectionType.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticChannelType.h"
#include "SGInterop/SGIC_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_FSGDeviceImpl.h"
#include "SGInterop/SGIC_FSGHapticChannelInfoImpl.h"
#include "SGInterop/SGIC_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
@@ -93,12 +105,30 @@ void USGDevice::ParseFirmware(const FString& RawFirmware, int32& OutMainVersion,
SGCoreImpl_FSGDeviceImpl_ParseFirmware(&RawFirmwareContainer, &OutMainVersion, &OutSubVersion);
}
bool USGDevice::FirmwareNewerThan(
const int32 MyFirmwareMain, const int32 MyFirmwareSub, const int32 ReferenceMain, const int32 ReferenceSub,
const bool bInclusive)
{
return
SGCoreImpl_FSGDeviceImpl_FirmwareNewerThan_MyFirmwareMain_MyFirmwareSub_ReferenceMain_ReferenceSub_bInclusive(
MyFirmwareMain, MyFirmwareSub, ReferenceMain, ReferenceSub, bInclusive);
}
bool USGDevice::FirmwareOlderThan(
const int32 MyFirmwareMain, const int32 MyFirmwareSub, const int32 ReferenceMain, const int32 ReferenceSub,
const bool bInclusive)
{
return
SGCoreImpl_FSGDeviceImpl_FirmwareOlderThan_MyFirmwareMain_MyFirmwareSub_ReferenceMain_ReferenceSub_bInclusive(
MyFirmwareMain, MyFirmwareSub, ReferenceMain, ReferenceSub, bInclusive);
}
FString USGDevice::ToString(const ESGDeviceType DeviceType)
{
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
FSGIC_FString OutString;
SGCoreImpl_FSGDeviceImpl_ToString(&DeviceTypeContainer, &OutString);
return MoveTemp(OutString.String);
return OutString.String;
}
USGDevice::USGDevice()
@@ -140,6 +170,16 @@ USGDevice::USGDevice(const FSGHapticGloveImpl& HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGDevice::USGDevice(const FSGNova2GloveImpl& Nova2GloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNova2GloveImpl RhsContainer{Nova2GloveImpl};
SGCoreImpl_FSGNova2GloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
@@ -178,6 +218,12 @@ USGDevice::USGDevice(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
}
USGDevice::USGDevice(TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->SGDeviceImpl = MoveTemp(Nova2GloveImpl);
}
USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
@@ -216,6 +262,14 @@ void USGDevice::SetSGDeviceImpl(const FSGHapticGloveImpl& HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGDevice::SetSGDeviceImpl(const FSGNova2GloveImpl& Nova2GloveImpl)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNova2GloveImpl RhsContainer{Nova2GloveImpl};
SGCoreImpl_FSGNovaGloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGDevice::SetSGDeviceImpl(const FSGNovaGloveImpl& NovaGloveImpl)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
@@ -247,6 +301,11 @@ void USGDevice::SetSGDeviceImpl(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
}
void USGDevice::SetSGDeviceImpl(TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
{
Pimpl->SGDeviceImpl = MoveTemp(Nova2GloveImpl);
}
void USGDevice::SetSGDeviceImpl(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
{
Pimpl->SGDeviceImpl = MoveTemp(NovaGloveImpl);
@@ -262,6 +321,91 @@ TSharedRef<FSGDeviceImpl> USGDevice::ToSGDeviceImpl() const
return Pimpl->SGDeviceImpl.ToSharedRef();
}
bool USGDevice::IsABetaDevice() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_IsABetaDevice(&InstanceContainer);
}
bool USGDevice::IsAHapticGlove() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_IsAHapticGlove(&InstanceContainer);
}
bool USGDevice::IsANova2Glove() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_IsANova2Glove(&InstanceContainer);
}
bool USGDevice::IsANovaGlove() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_IsANovaGlove(&InstanceContainer);
}
bool USGDevice::IsASenseGlove() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_IsASenseGlove(&InstanceContainer);
}
USGBetaDevice* USGDevice::AsBetaDevice(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtr;
SGCoreImpl_FSGDeviceImpl_AsBetaDevice(&InstanceContainer, &OutSharedPtr);
USGBetaDevice* BetaDevice = NewObject<USGBetaDevice>(Outer);
BetaDevice->SetSGDeviceImpl(OutSharedPtr.Ptr.ToSharedRef());
return BetaDevice;
}
USGHapticGlove* USGDevice::AsHapticGlove(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_TSharedPtr_FSGHapticGloveImpl OutSharedPtr;
SGCoreImpl_FSGDeviceImpl_AsHapticGlove(&InstanceContainer, &OutSharedPtr);
USGHapticGlove* HapticGlove = NewObject<USGHapticGlove>(Outer);
HapticGlove->SetSGDeviceImpl(OutSharedPtr.Ptr.ToSharedRef());
return HapticGlove;
}
USGNova2Glove* USGDevice::AsNova2Glove(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtr;
SGCoreImpl_FSGDeviceImpl_AsNova2Glove(&InstanceContainer, &OutSharedPtr);
USGNova2Glove* Nova2Glove = NewObject<USGNova2Glove>(Outer);
Nova2Glove->SetSGDeviceImpl(OutSharedPtr.Ptr.ToSharedRef());
return Nova2Glove;
}
USGNovaGlove* USGDevice::AsNovaGlove(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtr;
SGCoreImpl_FSGDeviceImpl_AsNovaGlove(&InstanceContainer, &OutSharedPtr);
USGNovaGlove* NovaGlove = NewObject<USGNovaGlove>(Outer);
NovaGlove->SetSGDeviceImpl(OutSharedPtr.Ptr.ToSharedRef());
return NovaGlove;
}
USGSenseGlove* USGDevice::AsSenseGlove(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtr;
SGCoreImpl_FSGDeviceImpl_AsSenseGlove(&InstanceContainer, &OutSharedPtr);
USGSenseGlove* SenseGlove = NewObject<USGSenseGlove>(Outer);
SenseGlove->SetSGDeviceImpl(OutSharedPtr.Ptr.ToSharedRef());
return SenseGlove;
}
ESGDeviceType USGDevice::GetDeviceType() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
@@ -281,7 +425,21 @@ FString USGDevice::GetFirmwareString() const
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGDeviceImpl_GetFirmwareString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
bool USGDevice::FirmwareNewerThan(int32 FirmwareMain, int32 FirmwareSub, bool bInclusive) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_FirmwareNewerThan_MyFirmwareMain_MyFirmwareSub_bInclusive(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
bool USGDevice::FirmwareOlderThan(int32 FirmwareMain, int32 FirmwareSub, bool bInclusive) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_FirmwareOlderThan_MyFirmwareMain_MyFirmwareSub_bInclusive(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
FString USGDevice::GetAddress() const
@@ -357,12 +515,32 @@ bool USGDevice::GetBatteryLevel(float& OutLevel)
return bResult;
}
void USGDevice::SetHapticChannels(const USGHapticChannelInfo* Channels)
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_FSGHapticChannelInfoImpl ChannelsContainer{Channels->ToHapticChannelInfoImpl()};
SGCoreImpl_FSGDeviceImpl_SetHapticChannels(&InstanceContainer, &ChannelsContainer);
}
int32 USGDevice::GetHapticChannelCount() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_GetHapticChannelCount(&InstanceContainer);
}
int32 USGDevice::GetHapticChannelCount(ESGHapticChannelType ChannelType) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_ESGHapticChannelType ChannelTypeContainer{ChannelType};
return SGCoreImpl_FSGDeviceImpl_GetHapticChannelCount_ChannelType(&InstanceContainer, &ChannelTypeContainer);
}
FString USGDevice::ToString() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGDeviceImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
USGDevice::FImpl::FImpl(USGDevice* InOwner)
@@ -39,11 +39,13 @@
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGNova2GloveImpl.h"
#include "SGCoreImpl/SGNovaGloveImpl.h"
#include "SGCoreImpl/SGSenseGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
@@ -63,6 +65,14 @@ TSharedRef<FSGHapticGloveImpl> FSGDeviceImplCast::ToHapticGloveImpl(TSharedRef<F
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGNova2GloveImpl> FSGDeviceImplCast::ToNova2GloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{MoveTemp(SGDeviceImpl)};
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGDeviceImpl_ToNova2GloveImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGNovaGloveImpl> FSGDeviceImplCast::ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{MoveTemp(SGDeviceImpl)};
@@ -40,6 +40,7 @@
class FSGBetaDeviceImpl;
class FSGDeviceImpl;
class FSGHapticGloveImpl;
class FSGNova2GloveImpl;
class FSGNovaGloveImpl;
class FSGSenseGloveImpl;
@@ -50,6 +51,8 @@ public:
static TSharedRef<FSGHapticGloveImpl> ToHapticGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGNova2GloveImpl> ToNova2GloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGNovaGloveImpl> ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGSenseGloveImpl> ToSenseGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
@@ -35,9 +35,12 @@
#include "SGCore/SGDeviceList.h"
#include "Templates/SubclassOf.h"
#include "SGCore/SGBetaDevice.h"
#include "SGCore/SGDevice.h"
#include "SGCore/SGDeviceImplCast.h"
#include "SGCore/SGNova2Glove.h"
#include "SGCore/SGNovaGlove.h"
#include "SGCore/SGSenseGlove.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
@@ -92,6 +95,12 @@ TArray<USGDevice*> FSGDeviceList::GetDevices(UObject* Outer)
Devices.Push(BetaDevice);
}
break;
case ESGDeviceType::Nova2:
{
TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl{FSGDeviceImplCast::ToNova2GloveImpl(DeviceImpl)};
USGNova2Glove* Nova2Glove = USGNova2Glove::NewNova2Glove(Outer, MoveTemp(Nova2GloveImpl));
Devices.Push(Nova2Glove);
}
case ESGDeviceType::Nova:
{
TSharedRef<FSGNovaGloveImpl> NovaGloveImpl{FSGDeviceImplCast::ToNovaGloveImpl(DeviceImpl)};
@@ -165,11 +174,12 @@ bool FSGDeviceList::GetSensorDataString(const int32 IpcIndex, const FString& Ipc
return bReturn;
}
bool FSGDeviceList::SendHaptics(const int32 IpcIndex, const FString& IpcAddress, const FString& Commands)
bool FSGDeviceList::SendHaptics(
const int32 IpcIndex, const FString& IpcAddress, const int32 ChannelIndex, const FString& Commands)
{
FSGIC_FString IpcAddressContainer{IpcAddress};
FSGIC_FString CommandsContainer{Commands};
return SGCoreImpl_FSGDeviceListImpl_SendHaptics(IpcIndex, &IpcAddressContainer, &CommandsContainer);
return SGCoreImpl_FSGDeviceListImpl_SendHaptics(IpcIndex, &IpcAddressContainer, ChannelIndex, &CommandsContainer);
}
FString FSGDeviceList::GetDeviceStringAt(const int32 IpcIndex, const FString& IpcAddress, const int32 Index)
@@ -35,8 +35,6 @@
#include "SGCore/SGDeviceModel.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGDeviceModelImpl.h"
#include "SGInterop/SGIC_FString.h"
@@ -103,7 +101,7 @@ TArray<bool> USGDeviceModel::ParseFunctions(const int32 Value, const int32 Size)
{
FSGIC_TArray_bool OutParseFunctionsContainer;
SGCoreImpl_FSGDeviceModelImpl_ParseFunctions(&OutParseFunctionsContainer, Value, Size);
return MoveTemp(OutParseFunctionsContainer.Array);
return OutParseFunctionsContainer.Array;
}
void USGDeviceModel::ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion)
@@ -165,7 +163,7 @@ FString USGDeviceModel::GetDeviceId() const
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
FSGIC_FString OutIdContainer;
SGCoreImpl_FSGDeviceModelImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
return MoveTemp(OutIdContainer.String);
return OutIdContainer.String;
}
FString USGDeviceModel::GetHardwareVersion() const
@@ -173,7 +171,7 @@ FString USGDeviceModel::GetHardwareVersion() const
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
FSGIC_FString OutVersionContainer;
SGCoreImpl_FSGDeviceModelImpl_GetHardwareVersion(&InstanceContainer, &OutVersionContainer);
return MoveTemp(OutVersionContainer.String);
return OutVersionContainer.String;
}
int32 USGDeviceModel::GetFirmwareVersion() const
@@ -188,6 +186,22 @@ int32 USGDeviceModel::GetSubFirmwareVersion() const
return SGCoreImpl_FSGDeviceModelImpl_GetSubFirmwareVersion(&InstanceContainer);
}
bool USGDeviceModel::FirmwareNewerThan(const int32 FirmwareMain, const int32 FirmwareSub,
const bool bInclusive) const
{
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
return SGCoreImpl_FSGDeviceModelImpl_FirmwareNewerThan(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
bool USGDeviceModel::FirmwareOlderThan(const int32 FirmwareMain, const int32 FirmwareSub,
const bool bInclusive) const
{
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
return SGCoreImpl_FSGDeviceModelImpl_FirmwareOlderThan(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
USGDeviceModel::FImpl::FImpl(USGDeviceModel* InOwner)
: Owner(InOwner)
{
@@ -1,274 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGFingerCommand.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedBuzzCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
struct USGFingerCommand::FImpl
{
/************************
* Member variables
************************/
TSharedPtr<FSGFingerCommandImpl> FingerCommandImpl;
/************************
* Owner object
************************/
USGFingerCommand* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGFingerCommand* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGFingerCommand::USGFingerCommand()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const TArray<int32>& InLevels)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 LevelsContainer{InLevels};
SGCoreImpl_FSGFingerCommandImpl_ctor_Levels_MakeShared(&OutSharedPtrContainer, &LevelsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
SGCoreImpl_FSGFingerCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
SGCoreImpl_FSGBuzzCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
}
USGFingerCommand::~USGFingerCommand() = default;
void USGFingerCommand::SetFingerCommandImpl(const FSGFingerCommandImpl& FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
SGCoreImpl_FSGFingerCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGBuzzCommandImpl& BuzzCommandImpl)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
SGCoreImpl_FSGBuzzCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
}
TSharedRef<FSGFingerCommandImpl> USGFingerCommand::ToFingerCommandImpl() const
{
return Pimpl->FingerCommandImpl.ToSharedRef();
}
TArray<int32> USGFingerCommand::GetLevels() const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_TArray_int32 OutLevelsContainer;
SGCoreImpl_FSGFingerCommandImpl_GetLevels(&InstanceContainer, &OutLevelsContainer);
return MoveTemp(OutLevelsContainer.Array);
}
int32 USGFingerCommand::GetLevel(const int32 Finger) const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
const int32 Level = SGCoreImpl_FSGFingerCommandImpl_GetLevel(&InstanceContainer, Finger);
return Level;
}
void USGFingerCommand::SetLevel(const int32 Finger, const int32 Value)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
SGCoreImpl_FSGFingerCommandImpl_SetLevel(&InstanceContainer, Finger, Value);
}
bool USGFingerCommand::Equals(const USGFingerCommand* FingerCommand) const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_FSGFingerCommandImpl FingerCommandImplContainer{FingerCommand->ToFingerCommandImpl().Get()};
const bool bEquals = SGCoreImpl_FSGFingerCommandImpl_Equals(&InstanceContainer, &FingerCommandImplContainer);
return bEquals;
}
FString USGFingerCommand::ToString() const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGFingerCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGFingerCommand::FImpl::FImpl(USGFingerCommand* InOwner)
: Owner(InOwner)
{
}
USGFingerCommand::FImpl::~FImpl() = default;
void USGFingerCommand::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,70 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
TSharedRef<FSGBuzzCommandImpl> FSGFingerCommandImplCast::ToBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToBuzzCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGForceFeedbackCommandImpl> FSGFingerCommandImplCast::ToForceFeedbackCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToForceFeedbackCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGTimedBuzzCommandImpl> FSGFingerCommandImplCast::ToTimedBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToTimedBuzzCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
@@ -1,55 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#pragma once
#include "Templates/SharedPointer.h"
class FSGFingerCommandImpl;
class FSGBuzzCommandImpl;
class FSGForceFeedbackCommandImpl;
class FSGTimedBuzzCommandImpl;
class SENSEGLOVECORE_API FSGFingerCommandImplCast
{
public:
static TSharedRef<FSGBuzzCommandImpl> ToBuzzCommandImpl(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
static TSharedRef<FSGForceFeedbackCommandImpl> ToForceFeedbackCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
static TSharedRef<FSGTimedBuzzCommandImpl> ToTimedBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
};
@@ -1,187 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer,
const FSGForceFeedbackCommandImpl&
ForceFeedbackCommandImpl)
{
USGForceFeedbackCommand* Instance = NewObject<USGForceFeedbackCommand>(Outer);
Instance->SetFingerCommandImpl(ForceFeedbackCommandImpl);
return Instance;
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer,
TSharedRef<FSGForceFeedbackCommandImpl>
ForceFeedbackCommandImpl)
{
USGForceFeedbackCommand* Instance = NewObject<USGForceFeedbackCommand>(Outer);
Instance->SetFingerCommandImpl(MoveTemp(ForceFeedbackCommandImpl));
return Instance;
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, const TArray<int32>& ForceFeedbackLevels)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_ForceFeedbackLevels_MakeShared(
&OutSharedPtrContainer, &ForceFeedbackLevelsContainer);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, ESGFinger Finger, const int32 BuzzLevel)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Off(UObject* Outer)
{
FSGIC_FSGForceFeedbackCommandImpl OutContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Off(&OutContainer);
return NewForceFeedbackCommand(Outer, OutContainer.ForceFeedbackCommandImpl);
}
USGForceFeedbackCommand::USGForceFeedbackCommand()
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedbackLevels)
: USGFingerCommand(ForceFeedbackLevels)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_ForceFeedbackLevels_MakeShared(
&OutSharedPtrContainer, &ForceFeedbackLevelsContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
: USGFingerCommand(ForceFeedbackCommandImpl)
{
}
USGForceFeedbackCommand::USGForceFeedbackCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
: USGFingerCommand(MoveTemp(ForceFeedbackCommandImpl))
{
}
USGForceFeedbackCommand::~USGForceFeedbackCommand() = default;
TSharedRef<FSGForceFeedbackCommandImpl> USGForceFeedbackCommand::ToForceFeedbackCommandImpl() const
{
return FSGFingerCommandImplCast::ToForceFeedbackCommandImpl(ToFingerCommandImpl());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Copy(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Copy(&InstanceContainer, &OutForceFeedbackCommandImplContainer);
return NewForceFeedbackCommand(Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Merge(UObject* Outer,
const USGForceFeedbackCommand* ForceFeedbackCommand) const
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandImplContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Merge(&InstanceContainer, &OutForceFeedbackCommandImplContainer,
&ForceFeedbackCommandImplContainer);
return NewForceFeedbackCommand(Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
@@ -35,8 +35,6 @@
#include "SGCore/SGHandInterpolator.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGInterpolationSet.h"
#include "SGCoreImpl/SGInterpolationSetImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
@@ -50,6 +48,8 @@
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TArray_TArray_float.h"
#include "SGInterop/SGIC_TArray_TArray_FSGInterpolationSetImpl.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGUtils/SGArrayUtils.h"
@@ -99,155 +99,26 @@ USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(UObject* Outer)
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations)
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
SGCoreImpl_FSGHandInterpolatorImpl_ctor_bRightHanded(&OutHandInterpolatorImplContainer,
bRightHanded);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FQuat& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FQuat& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
SGCoreImpl_FSGHandInterpolatorImpl_Default(&OutHandInterpolatorImplContainer, bRightHanded);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::Deserialize(UObject* Outer, const FString& SerializedString)
USGHandInterpolator* USGHandInterpolator::Deserialize(UObject* Outer,
const FString& SerializedString, const bool bRightHanded)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGHandInterpolatorImpl_Deserialize(&OutHandInterpolatorImplContainer, &SerializedStringContainer);
SGCoreImpl_FSGHandInterpolatorImpl_Deserialize(&OutHandInterpolatorImplContainer,
&SerializedStringContainer, bRightHanded);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
TArray<FVector> USGHandInterpolator::InterpolateFingerAngles(const ESGFinger Finger,
const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles)
{
FSGIC_TArray_FVector OutAnglesContainer;
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_FVector TotalGloveAnglesContainer{TotalGloveAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateFingerAngles(&OutAnglesContainer, &FingerContainer,
&InterpolatorContainer, &TotalGloveAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<FVector> USGHandInterpolator::InterpolateThumbAngles(const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles)
{
FSGIC_TArray_FVector OutAnglesContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_FVector TotalGloveAnglesContainer{TotalGloveAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateThumbAngles(&OutAnglesContainer, &InterpolatorContainer,
&TotalGloveAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(const USGHandInterpolator* Interpolator,
const TArray<FVector>& TotalAngles)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_TArray_FVector TotalAnglesContainer{TotalAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateHandAngles(&OutAnglesContainer, &InterpolatorContainer,
&TotalAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
USGHandInterpolator::USGHandInterpolator()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
@@ -257,97 +128,12 @@ USGHandInterpolator::USGHandInterpolator()
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations)
USGHandInterpolator::USGHandInterpolator(const bool bRightHanded)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FQuat& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FRotator& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FQuat& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FRotator& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
SGCoreImpl_FSGHandInterpolatorImpl_ctor_bRightHanded(&OutHandInterpolatorImplContainer,
bRightHanded);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
@@ -373,104 +159,36 @@ const FSGHandInterpolatorImpl& USGHandInterpolator::ToHandInterpolatorImpl() con
return Pimpl->HandInterpolatorImpl;
}
TArray<TArray<USGInterpolationSet*>> USGHandInterpolator::GetJointInterpolations(UObject* Outer) const
float USGHandInterpolator::CalculateAngle(
const ESGFingerMovement Movement, const float Value, const bool bApplyLimits) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_TArray_TArray_FSGInterpolationSetImpl OutInterpolationsContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetJointInterpolations(&InstanceContainer, &OutInterpolationsContainer);
TArray<TArray<USGInterpolationSet*>> JointInterpolations{
FSGArrayUtils::FromImplType<FSGInterpolationSetImpl, USGInterpolationSet,
&USGInterpolationSet::NewInterpolationSet>(
Outer, MoveTemp(OutInterpolationsContainer.Array))
};
return JointInterpolations;
}
FQuat USGHandInterpolator::GetCmcStartRotationQ() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetCmcStartRotation(&InstanceContainer, &OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGHandInterpolator::GetCmcStartRotation() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetCmcStartRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const int32 Movement, const float Value) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_int32Movement_Value(
&InstanceContainer, &FingerContainer, Movement, Value);
return Angle;
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGFingerMovement Movement,
const float Value) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGFingerMovement MovementContainer{Movement};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_ESGFingerMovement_Value(
&InstanceContainer, &FingerContainer, &MovementContainer, Value);
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_ESGFingerMovement_Value_bApplyLimits(
&InstanceContainer, &MovementContainer, Value, bApplyLimits);
return Angle;
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGThumbMovement Movement,
const float Value) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGThumbMovement MovementContainer{Movement};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_ESGThumbMovement_Value(
&InstanceContainer, &FingerContainer, &MovementContainer, Value);
return Angle;
}
void USGHandInterpolator::SetInterpolation(const int32 Finger, const int32 Movement, const float InputAt0,
const float InputAt1, const float AngleAt0, const float AngleAt1)
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_int32Finger_int32Movement_InputAt0_InputAt1_AngleAt0_AngleAt1(
&InstanceContainer, Finger, Movement, InputAt0, InputAt1, AngleAt0, AngleAt1);
}
void USGHandInterpolator::SetInterpolation(const ESGFinger Finger, const ESGFingerMovement Movement,
const float InputAt0, const float InputAt1, const float AngleAt0,
const float AngleAt1)
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGFingerMovement MovementContainer{Movement};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_ESGFinger_ESGFingerMovement_InputAt0_InputAt1_AngleAt0_AngleAt1(
&InstanceContainer, &FingerContainer, &MovementContainer, InputAt0, InputAt1, AngleAt0, AngleAt1);
}
void USGHandInterpolator::SetInterpolation(const ESGThumbMovement Movement, const float InputAt0, const float InputAt1,
const float AngleAt0, const float AngleAt1)
float USGHandInterpolator::CalculateAngle(
const ESGThumbMovement Movement, const float Value, const bool bApplyLimits) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGThumbMovement MovementContainer{Movement};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_Movement_InputAt0_InputAt1_AngleAt0_AngleAt1(
&InstanceContainer, &MovementContainer, InputAt0, InputAt1, AngleAt0, AngleAt1);
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_ESGThumbMovement_Value_bApplyLimits(
&InstanceContainer, &MovementContainer, Value, bApplyLimits);
return Angle;
}
USGInterpolationSet* USGHandInterpolator::GetInterpolation(UObject* Outer,
const int32 Finger, const int32 Movement) const
TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(
const TArray<TArray<float>>& Flexions, const TArray<float>& Abductions, const float CmcTwist) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FSGInterpolationSetImpl OutInterpolationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetInterpolation(&InstanceContainer, &OutInterpolationContainer, Finger,
Movement);
return USGInterpolationSet::NewInterpolationSet(Outer, MoveTemp(OutInterpolationContainer.InterpolationSetImpl));
FSGIC_TArray_TArray_FVector OutAnglesContainer;
FSGIC_TArray_TArray_float FlexionsContainer{Flexions};
FSGIC_TArray_float AbductionsContainer{Abductions};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateHandAngles(
&InstanceContainer, &OutAnglesContainer, &FlexionsContainer, &AbductionsContainer, CmcTwist);
return OutAnglesContainer.Array;
}
bool USGHandInterpolator::Equals(const USGHandInterpolator* HandInterpolator) const
@@ -486,7 +204,7 @@ FString USGHandInterpolator::SGSerialize() const
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHandInterpolatorImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
USGHandInterpolator::FImpl::FImpl(USGHandInterpolator* InOwner)
@@ -0,0 +1,222 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGHandLayer.h"
#include "SGCore/SGCustomWaveform.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGHapticLocation.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
bool FSGHandLayer::DeviceConnected(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_DeviceConnected(bRightHanded);
}
ESGDeviceType FSGHandLayer::GetDeviceType(const bool bRightHanded)
{
FSGIC_ESGDeviceType DeviceTypeContainer;
SGCoreImpl_FSGHandLayerImpl_GetDeviceType(&DeviceTypeContainer, bRightHanded);
return DeviceTypeContainer.Type;
}
bool FSGHandLayer::GetFirstGloveHandedness()
{
return SGCoreImpl_FSGHandLayerImpl_GetFirstGloveHandedness();
}
int32 FSGHandLayer::GlovesConnected()
{
return SGCoreImpl_FSGHandLayerImpl_GlovesConnected();
}
bool FSGHandLayer::GetGloveInstance(UObject* Outer, const bool bRightHanded, USGHapticGlove*& OutGlove)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer;
const bool bResult = SGCoreImpl_FSGHandLayerImpl_GetGloveInstance(bRightHanded, &OutGloveContainer);
OutGlove = USGHapticGlove::NewHapticGlove(Outer, OutGloveContainer.Ptr.ToSharedRef());
return bResult;
}
ESGHapticGloveCalibrationState FSGHandLayer::GetCalibrationState(const bool bRightHanded)
{
FSGIC_ESGHapticGloveCalibrationState HapticGloveCalibrationStateContainer;
SGCoreImpl_FSGHandLayerImpl_GetDeviceType(&HapticGloveCalibrationStateContainer, bRightHanded);
return HapticGloveCalibrationStateContainer.State;
}
FString FSGHandLayer::GetCalibrationInstructions(const bool bRightHanded)
{
FSGIC_FString CalibrationInstructionsContainer;
SGCoreImpl_FSGHandLayerImpl_GetCalibrationInstructions(&CalibrationInstructionsContainer, bRightHanded);
return CalibrationInstructionsContainer.String;
}
void FSGHandLayer::ResetCalibration(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_ResetCalibration(bRightHanded);
}
void FSGHandLayer::EndCalibration(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_EndCalibration(bRightHanded);
}
bool FSGHandLayer::GetHandPose(UObject* Outer, const bool bRightHanded, USGHandPose*& OutHandPose)
{
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHandLayerImpl_GetHandPose(bRightHanded, &OutHandPoseContainer);
OutHandPose = USGHandPose::NewHandPose(Outer, OutHandPose->ToHandPoseImpl());
return bResult;
}
void FSGHandLayer::GetWristLocation(
const bool bRightHanded, const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, FVector& OutWristPosition, FQuat& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGHandLayerImpl_GetWristLocation(
bRightHanded, &ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void FSGHandLayer::StopAllHaptics(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_StopAllHaptics(bRightHanded);
}
bool FSGHandLayer::SendHaptics(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SendHaptics(bRightHanded);
}
bool FSGHandLayer::SupportsCustomWaveform(
const bool bRightHanded, const ESGHapticLocation AtLocation)
{
FSGIC_ESGHapticLocation AtLocationContainer{AtLocation};
return SGCoreImpl_FSGHandLayerImpl_SupportsCustomWaveform(bRightHanded, &AtLocationContainer);
}
bool FSGHandLayer::SendCustomWaveform(
const bool bRightHanded, USGCustomWaveform* OutWaveform, const ESGHapticLocation Location)
{
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGHapticLocation LocationContainer{Location};
return SGCoreImpl_FSGHandLayerImpl_SendCustomWaveform(bRightHanded, &OutWaveformContainer, &LocationContainer);
}
bool FSGHandLayer::QueueCommand_ForceFeedbackLevel(
const bool bRightHanded, const int32 Finger, const float Level01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ForceFeedbackLevel(bRightHanded, Finger, Level01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_ForceFeedbackLevels(
const bool bRightHanded, const TArray<float>& Levels01, const bool bSendImmediate)
{
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ForceFeedbackLevels(
bRightHanded, &Levels01Container, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_VibroLevels(
const bool bRightHanded, const TArray<float>& Levels01, const bool bSendImmediate)
{
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_VibroLevels(bRightHanded, &Levels01Container, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_VibroLevel(
const bool bRightHanded, const int32 Finger, const float Level01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_VibroLevel_bRightHanded_Finger_Level0_bSendImmediate(
bRightHanded, Finger, Level01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_VibroLevel(
const bool bRightHanded, const ESGHapticLocation AtLocation, const float Level01, const bool bSendImmediate)
{
FSGIC_ESGHapticLocation AtLocationContainer{AtLocation};
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_VibroLevel_bRightHanded_AtLocation_Level01_bSendImmediate(
bRightHanded, &AtLocationContainer, Level01, bSendImmediate);
}
bool FSGHandLayer::SupportsWristSqueeze(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SupportsWristSqueeze(bRightHanded);
}
bool FSGHandLayer::QueueCommand_WristSqueeze(
const bool bRightHanded, const float SqueezeLevel01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_WristSqueeze(bRightHanded, SqueezeLevel01, bSendImmediate);
}
bool FSGHandLayer::SupportsFlexionLocks(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SupportsFlexionLocks(bRightHanded);
}
bool FSGHandLayer::QueueCommand_FlexionLock(
const bool bRightHanded, const int32 Finger, const float Flexion01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_FlexionLock(bRightHanded, Finger, Flexion01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_ClearFlexionLock(
const bool bRightHanded, const int32 Finger, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ClearFlexionLock(bRightHanded, Finger, bSendImmediate);
}
@@ -35,8 +35,6 @@
#include "SGCore/SGHandPose.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandPoseImpl.h"
@@ -189,7 +187,7 @@ USGHandPose* USGHandPose::FromHandAngles(UObject* Outer,
FSGIC_TArray_TArray_FVector HandAnglesContainer{HandAngles};
FSGIC_FSGBasicHandModelImpl HandDimensionsContainer{HandDimensions->ToBasicHandModelImpl()};
SGCoreImpl_FSGHandPoseImpl_FromHandAngles_HandAngles_bRightHanded_HandDimensions(
&OutHandPoseImplContainer, &HandAnglesContainer, bRightHanded, &HandAnglesContainer);
&OutHandPoseImplContainer, &HandAnglesContainer, bRightHanded, &HandDimensionsContainer);
return NewHandPose(Outer, MoveTemp(OutHandPoseImplContainer.HandPoseImpl));
}
@@ -394,7 +392,7 @@ TArray<TArray<FVector>> USGHandPose::GetJointPositions() const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_TArray_FVector OutPositionsContainer;
SGCoreImpl_FSGHandPoseImpl_GetJointPositions(&InstanceContainer, &OutPositionsContainer);
return MoveTemp(OutPositionsContainer.Array);
return OutPositionsContainer.Array;
}
TArray<TArray<FQuat>> USGHandPose::GetJointRotationsQ() const
@@ -402,7 +400,7 @@ TArray<TArray<FQuat>> USGHandPose::GetJointRotationsQ() const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGHandPoseImpl_GetJointRotations(&InstanceContainer, &OutRotationsContainer);
return MoveTemp(OutRotationsContainer.Array);
return OutRotationsContainer.Array;
}
TArray<TArray<FRotator>> USGHandPose::GetJointRotations() const
@@ -418,12 +416,11 @@ TArray<TArray<FVector>> USGHandPose::GetHandAngles() const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGHandPoseImpl_GetHandAngles(&InstanceContainer, &OutAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
return OutAnglesContainer.Array;
}
bool USGHandPose::Equals(const USGHandPose* HandPose) const
{
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_FSGHandPoseImpl HandPoseContainer{HandPose->ToHandPoseImpl()};
return SGCoreImpl_FSGHandPoseImpl_Equals(&InstanceContainer, &HandPoseContainer);
@@ -442,7 +439,7 @@ TArray<float> USGHandPose::GetNormalizedFlexion(const bool bClamp01) const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_float OutFlexionContainer;
SGCoreImpl_FSGHandPoseImpl_GetNormalizedFlexion_bClamp01(&InstanceContainer, &OutFlexionContainer, bClamp01);
return MoveTemp(OutFlexionContainer.Array);
return OutFlexionContainer.Array;
}
FString USGHandPose::ToString(const bool bShortFormat) const
@@ -450,7 +447,7 @@ FString USGHandPose::ToString(const bool bShortFormat) const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHandPoseImpl_ToString(&InstanceContainer, &OutStringContainer, bShortFormat);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
FString USGHandPose::SGSerialize() const
@@ -458,7 +455,7 @@ FString USGHandPose::SGSerialize() const
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHandPoseImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
return OutStringContainer.String;
}
USGHandPose::FImpl::FImpl(USGHandPose* InOwner)
@@ -1,284 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 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
*
*
*/
#include "SGCore/SGHandProfile.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGHandProfile::FImpl
{
/************************
* Member variables
************************/
FSGHandProfileImpl HandProfileImpl;
/************************
* Owner object
************************/
USGHandProfile* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHandProfile* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer, const FSGHandProfileImpl& HandProfileImpl)
{
USGHandProfile* Instance = NewObject<USGHandProfile>(Outer);
Instance->SetHandProfileImpl(HandProfileImpl);
return Instance;
}
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer, const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
{SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer
{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_ctor_bRightHanded_SenseGloveHandProfile_NovaGloveHandProfile(
&OutHandProfileImplContainer, bRightHanded, &SenseGloveHandProfileContainer, &NovaGloveHandProfileContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_Default(&OutHandProfileImplContainer, bRightHanded);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::Deserialize(UObject* Outer, const FString& SerializedString)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGHandProfileImpl_Deserialize(&OutHandProfileImplContainer,
&SerializedStringContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
FString USGHandProfile::GetProfileDirectory()
{
FSGIC_FString OutDirectoryContainer;
SGCoreImpl_FSGHandProfileImpl_GetProfileDirectory(&OutDirectoryContainer);
return MoveTemp(OutDirectoryContainer.String);
}
FString USGHandProfile::GetLeftHandFileName()
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetLeftHandFileName(&OutFileName);
return MoveTemp(OutFileName.String);
}
FString USGHandProfile::GetRightHandFileName()
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetRightHandFileName(&OutFileName);
return MoveTemp(OutFileName.String);
}
FString USGHandProfile::GetProfileFileName(const bool bRightHanded)
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetProfileFileName(&OutFileName, bRightHanded);
return MoveTemp(OutFileName.String);
}
bool USGHandProfile::GetLatestProfile(UObject* Outer, const bool bRightHanded, USGHandProfile*& OutLatestProfile)
{
FSGIC_FSGHandProfileImpl OutLatestProfileContainer;
const bool bResult = SGCoreImpl_FSGHandProfileImpl_GetLatestProfile(bRightHanded, &OutLatestProfileContainer);
if (bResult)
{
OutLatestProfile = NewHandProfile(Outer, MoveTemp(OutLatestProfileContainer.HandProfileImpl));
}
return bResult;
}
bool USGHandProfile::StoreProfile(const USGHandProfile* ProfileToStore)
{
FSGIC_FSGHandProfileImpl ProfileToStoreContainer{ProfileToStore->ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_StoreProfile(&ProfileToStoreContainer);
}
bool USGHandProfile::ResetCalibration(const bool bRightHanded, const bool bOnDisk)
{
return SGCoreImpl_FSGHandProfileImpl_ResetCalibration_bRightHanded_bOnDisk(bRightHanded, bOnDisk);
}
void USGHandProfile::ResetCalibration(const bool bOnDisk)
{
return SGCoreImpl_FSGHandProfileImpl_ResetCalibration_bOnDisk(bOnDisk);
}
USGHandProfile::USGHandProfile()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
}
USGHandProfile::USGHandProfile(const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
{SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer
{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_ctor_bRightHanded_SenseGloveHandProfile_NovaGloveHandProfile(
&OutHandProfileImplContainer, bRightHanded, &SenseGloveHandProfileContainer, &NovaGloveHandProfileContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
}
USGHandProfile::USGHandProfile(const FSGHandProfileImpl& HandProfileImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetHandProfileImpl(HandProfileImpl);
}
USGHandProfile::~USGHandProfile() = default;
void USGHandProfile::SetHandProfileImpl(const FSGHandProfileImpl& HandProfileImpl)
{
FSGIC_FSGHandProfileImpl OutHandProfileContainer;
FSGIC_FSGHandProfileImpl RhsContainer{HandProfileImpl};
SGCoreImpl_FSGHandProfileImpl_ctor_copy(&OutHandProfileContainer, &RhsContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileContainer.HandProfileImpl);
}
const FSGHandProfileImpl& USGHandProfile::ToHandProfileImpl() const
{
return Pimpl->HandProfileImpl;
}
bool USGHandProfile::IsRight() const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_IsRight(&InstanceContainer);
}
USGSenseGloveHandProfile* USGHandProfile::GetSenseGloveHandProfile(UObject* Outer) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGSenseGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHandProfileImpl_GetSenseGloveHandProfile(&InstanceContainer, &OutProfileContainer);
return USGSenseGloveHandProfile::NewSenseGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.SenseGloveHandProfileImpl));
}
USGNovaGloveHandProfile* USGHandProfile::GetNovaGloveHandProfile(UObject* Outer) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHandProfileImpl_GetNovaGloveHandProfile(&InstanceContainer, &OutProfileContainer);
return USGNovaGloveHandProfile::NewNovaGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.NovaGloveHandProfileImpl));
}
bool USGHandProfile::Equals(const USGHandProfile* HandProfile) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_Equals(&InstanceContainer, &HandProfileContainer);
}
void USGHandProfile::Reset()
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_Reset(&InstanceContainer);
}
FString USGHandProfile::SGSerialize() const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGHandProfile::FImpl::FImpl(USGHandProfile* InOwner)
: Owner(InOwner)
{
}
USGHandProfile::FImpl::~FImpl() = default;
void USGHandProfile::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}

Some files were not shown because too many files have changed in this diff Show More