Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
882665e386
|
||
|
|
265759e080
|
||
|
|
cac1c475dc
|
||
|
|
8478b7caf8
|
||
|
|
6b2e5dbcf7
|
||
|
|
ae81b15c91
|
||
|
|
5a8feb24ac
|
||
|
|
418133432f
|
||
|
|
0d5c2ee04e
|
||
|
|
edad54bd36
|
||
|
|
bed8269eba
|
||
|
|
598b0942e4
|
||
|
|
a1a36901ea
|
||
|
|
1ee517f392
|
||
|
|
558e2ffcff
|
||
|
|
b5452ff3a8
|
||
|
|
267e518f44
|
||
|
|
a6ae25e581
|
||
|
|
946df25210
|
||
|
|
88a57106ff
|
||
|
|
a98e88d27f
|
||
|
|
25e095ab11
|
||
|
|
360c669dfd
|
||
|
|
6fab1830f1
|
||
|
|
69e13a1de2
|
||
|
|
b7416f1559
|
||
|
|
6c821bf80d
|
||
|
|
318ba52835
|
||
|
|
3a44a177fd
|
||
|
|
7d4c839f9f
|
||
|
|
f17a7ecde8
|
||
|
|
783f1b317c
|
||
|
|
fcd038d2fc
|
||
|
|
c2f67fce2d
|
||
|
|
caf9340641
|
||
|
|
0906a60b66
|
||
|
|
cb51f36d87
|
||
|
|
7a23dddbe0
|
||
|
|
db7433fe26
|
||
|
|
81a663ae91
|
||
|
|
ce9590ae65
|
||
|
|
072cf1ea86
|
||
|
|
e5a378a9fa
|
||
|
|
e25004b9e9
|
||
|
|
b9ca46a906
|
||
|
|
7e9d7d9a6b
|
||
|
|
bc485b9baf
|
||
|
|
6be4ab7a5b
|
||
|
|
66031095dd
|
||
|
|
b4968ebd05
|
||
|
|
79d292e159
|
||
|
|
f09bd379d8
|
||
|
|
5de114f9a4
|
||
|
|
a78e8cade7
|
||
|
|
65e1670974
|
||
|
|
b2ddd29d4c
|
||
|
|
43070d8ce3
|
||
|
|
b9fe67814d
|
||
|
|
67042c7466
|
||
|
|
684331075f
|
||
|
|
5f6641af12
|
||
|
|
77e62eba30
|
||
|
|
48152dfcdd
|
||
|
|
d7f55e1a78
|
||
|
|
aa8e2f097e
|
||
|
|
4452b308f5
|
||
|
|
ffabc4159c
|
||
|
|
7941fca732
|
||
|
|
2c0c3a2dbf
|
||
|
|
9d92e2600b
|
||
|
|
f3afbccb2b
|
||
|
|
b7ea384fd7
|
||
|
|
852f398755
|
||
|
|
933d75bd63
|
||
|
|
9721eaa275
|
||
|
|
afb14d3b89
|
||
|
|
2d77ee8b5d
|
||
|
|
4485d2b786
|
||
|
|
508ef0976e
|
||
|
|
f45f2ea73d
|
||
|
|
434bcf12c5
|
||
|
|
af18e5453d
|
||
|
|
cb894ef7a8
|
||
|
|
75855bcca2
|
||
|
|
380d83717c
|
||
|
|
9a3d44dc81
|
||
|
|
22e782e8e5
|
||
|
|
2ce7439fbf
|
||
|
|
ec1c5c9c8a
|
||
|
|
d32f59a8cb
|
||
|
|
dc0cf37e45
|
||
|
|
dbd252f487
|
||
|
|
37efb4cf51
|
||
|
|
eded9f5ad5
|
||
|
|
82c3993ea9
|
||
|
|
873a850498
|
||
|
|
a1d78fa767
|
||
|
|
7b4b06e3d0
|
||
|
|
daa22b3940
|
||
|
|
cf8fc5fcda
|
||
|
|
7b57334ed0
|
||
|
|
22ca963bd6
|
||
|
|
66d0201d12
|
||
|
|
3b68860eeb
|
||
|
|
649d88e85d
|
||
|
|
2ff9e6f984
|
||
|
|
51e1d5f252
|
||
|
|
66aec3cdea
|
||
|
|
1426e2b2c2
|
||
|
|
cb9a319a6a
|
||
|
|
1539b09925
|
||
|
|
fd9b8d6a01
|
||
|
|
e1353bb0ec
|
||
|
|
7481d2cd8e
|
||
|
|
3d0e7fe8d2
|
||
|
|
da7bc22ed7
|
||
|
|
a54d252971
|
||
|
|
d711d42562
|
||
|
|
3c56af0e1f
|
||
|
|
9cbdf5cea7
|
||
|
|
032422de1c
|
||
|
|
0f89d1c4dd
|
||
|
|
8d289c0f2f
|
||
|
|
62a2dd44f0
|
||
|
|
c3001c588c
|
||
|
|
f3b21fecfa
|
||
|
|
94e1b9ffcb
|
||
|
|
01078b6cd6
|
||
|
|
a62f615036
|
||
|
|
5213282f25
|
||
|
|
58712b48ad
|
||
|
|
1684a40c20
|
||
|
|
cbcb6abaee
|
||
|
|
1ff21f70c7
|
||
|
|
3020fcdd7a
|
||
|
|
d3467ac7f2
|
||
|
|
4a212edbca
|
||
|
|
5ebcb583f6
|
||
|
|
9b99399641
|
||
|
|
691fd43cd1
|
||
|
|
716ce49ca7
|
||
|
|
f4a368a61c
|
||
|
|
22c97d2d77
|
||
|
|
e89643f8d0
|
||
|
|
24eb573007
|
||
|
|
3b29f54622
|
||
|
|
61e4aa2e6a
|
||
|
|
0dccac6432
|
||
|
|
12bfcfe80d
|
||
|
|
407d4ea14c
|
||
|
|
1dff735623
|
||
|
|
1834ea5d5c
|
||
|
|
29d2aad490
|
||
|
|
82f354e340
|
||
|
|
d4b06e062e
|
||
|
|
4a005a85b0
|
||
|
|
919e7f17dd
|
||
|
|
31cb7ee20b
|
||
|
|
ae268ebde7
|
||
|
|
220ddf28a6
|
||
|
|
091b0ade32
|
||
|
|
b0c32ccad4
|
||
|
|
838b5fe557
|
||
|
|
78735026c2
|
||
|
|
e1ced44a69
|
||
|
|
f92e870c56
|
||
|
|
a4941d4d7d
|
||
|
|
4a72839ece
|
||
|
|
1a89f202c5
|
||
|
|
f1b14c7673
|
||
|
|
a35e706283
|
||
|
|
708fce2f0c
|
||
|
|
9116e4a234
|
||
|
|
9ee7e3f0df
|
||
|
|
4a03aedb3c
|
||
|
|
1eadfd249b
|
||
|
|
d2a1583217
|
||
|
|
786c7d8380
|
||
|
|
53a70569bd
|
||
|
|
4f01d61640
|
||
|
|
a0bd230c73
|
||
|
|
81eb3bb90c
|
||
|
|
8253ec277d
|
||
|
|
9598c772fc
|
||
|
|
01eed66701
|
||
|
|
9ae0b1ea2f
|
||
|
|
a6baab575c
|
||
|
|
79c31ecf50
|
||
|
|
d80697ee72
|
||
|
|
50f76c7a0d
|
||
|
|
846dac5a88
|
||
|
|
c314920d89
|
||
|
|
55405672f8
|
||
|
|
f2656f1bea
|
||
|
|
eead79b8f5
|
||
|
|
5ae86cbf66
|
||
|
|
5902aafff0
|
||
|
|
4e591d6290
|
||
|
|
46f885fa5a
|
||
|
|
51190d6ead
|
||
|
|
96fb9c3c8e
|
||
|
|
9bde1878ed
|
||
|
|
7c271d30ce
|
||
|
|
d61183a960
|
||
|
|
caa0bf259a
|
||
|
|
e9a6fc3df0
|
||
|
|
bdfb75920b
|
||
|
|
2e5ba17d89
|
||
|
|
25dca3f8f3
|
||
|
|
b4cdbec91a
|
||
|
|
58ca6a5bca
|
||
|
|
f29c428b16
|
||
|
|
759c94bcbf
|
||
|
|
4393af7317
|
||
|
|
a31b14d48c
|
||
|
|
854ce6a198
|
||
|
|
e0e743b63d
|
||
|
|
e32453dfef
|
||
|
|
d57d3ffa4a
|
||
|
|
8194072025
|
||
|
|
cf7fba949d
|
||
|
|
0dd745bbe6
|
||
|
|
0ca24adee3
|
||
|
|
b947685598
|
||
|
|
11534229f4
|
||
|
|
77d7b4eb23
|
||
|
|
25e8fd2d07
|
||
|
|
dafc7c0ad6
|
||
|
|
2b818dd11b
|
||
|
|
cf115e2782
|
||
|
|
f709be4935
|
||
|
|
a0f3b84aab
|
||
|
|
de83672ef1
|
||
|
|
a465321f9d
|
||
|
|
392fcd4932
|
||
|
|
8a1e9ff300
|
||
|
|
fd257711c2
|
||
|
|
ff59e7f712
|
||
|
|
06b27847cb
|
||
|
|
94301a321c
|
||
|
|
0ea98272a9
|
||
|
|
14a43e0630
|
||
|
|
a7f4a83850
|
||
|
|
9101d2061a
|
||
|
|
3e025f3e47
|
||
|
|
2ba5c0f2fc
|
||
|
|
66e60ff18a
|
||
|
|
25f8ef6393
|
||
|
|
e30ca2c9ed
|
||
|
|
adcfa63415
|
||
|
|
02cb09d504
|
||
|
|
89a9200413
|
||
|
|
e50a65ca92
|
||
|
|
955bb69cf9
|
||
|
|
3335ee2ec3
|
||
|
|
b0113a908e
|
||
|
|
50971e6051
|
||
|
|
78bb5adff6
|
||
|
|
95fb454576
|
||
|
|
c0d4a50f76
|
||
|
|
092f4a1327
|
||
|
|
5bbb51b0fe
|
||
|
|
6006a22c06
|
||
|
|
ffdb3657d6
|
||
|
|
f5b93b45ed
|
+1
-1
@@ -124,4 +124,4 @@ DerivedDataCache/*
|
||||
.ignore
|
||||
|
||||
# Do not ignore anything inside the ThirdParty directory at all
|
||||
!ThirdParty/**/*
|
||||
!Source/ThirdParty/**/*
|
||||
|
||||
+139
-3
@@ -5,13 +5,149 @@ 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).
|
||||
|
||||
## [v1.4.2] - 2023-06-01
|
||||
|
||||
This is a hotfix release addressing a few critical issues.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix build issues with certain compilers when the Unreal Engine version is older than 5.2.
|
||||
- Reintroduced the Virtual Hand and the Wrist Tracker debug gizmos which have temporarily been disabled due to a bug in the settings system.
|
||||
- Some minor changelog fixes.
|
||||
|
||||
## [v1.4.1] - 2023-05-29
|
||||
|
||||
This is a bugfix release with a focus on Android build issues.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix an Android Gradle build issue that happens when the game's package name won't start with com.senseglove.*.
|
||||
- Suppress a grade warning for non-arm64 architectures when the build target is Android.
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove dead Gradle code from the Android module.
|
||||
|
||||
## [v1.4.0] - 2023-05-19
|
||||
|
||||
This release breaks ABI/API compatibility with the previous versions.
|
||||
|
||||
### Added
|
||||
|
||||
- Added support for the stable release of Unreal Engine 5.2 (the preview release has been supported since v1.2.0).
|
||||
- Added Linux AArch64 platform support.
|
||||
- Added a new Grab component that can turn any actor into a grabbable object.
|
||||
- Added a new Touch component that enables haptic feedback such as Buzz and Force-Feedback commands.
|
||||
- Added an optional feature in order to automatically stop all haptics on the EndPlay event, wherever the virtual hand component is used. By default, it's enabled.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix Blueprint signatures for USGVirtualHandComponentKismetLibrary and make all the Blueprint exposed functions static.
|
||||
|
||||
### Changed
|
||||
|
||||
- SenseGlove libraries have been updated to v2.7.1-965f90c with support for Linux AArch64.
|
||||
- The Virtual Hand and the Wrist Tracker debug gizmos (the intended use is only for SenseGlove developers for really low-level stuff; thus won't affect the users of the plugin at all) have been disabled and will be ignored due to an esoteric bug in the settings systems which has been scheduled to be fixed in the future releases.
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed the redundant SenseGloveCoreTypes module which causes all kinds of packaging issues with certain versions of the engine.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- This is the last release to support Unreal Engine 4.27 and please keep in mind that the current release is not obtainable through the Unreal Engine Marketplace. The latest published version on the Marketplace for 4.27 is v1.3.1. 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.
|
||||
|
||||
## [v1.3.1] - 2023-04-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix RunUAT build issues caused by missing headers.
|
||||
- Minor documentation fixes.
|
||||
|
||||
## [v1.3.0] - 2023-04-28
|
||||
|
||||
This release breaks ABI/API compatibility with the previous versions in addition to breaking coordinates systems conversions between Unreal Engine and the SenseGlove libraries.
|
||||
|
||||
### Added
|
||||
|
||||
- A new generic SenseGlove Debug module.
|
||||
- A debug virtual hand.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix the wrist tracker miscalculations for the Quest 2 controllers (other headsets might need fixing as well, in that case, future releases will address that).
|
||||
- Minor code improvement and fixes.
|
||||
- Minor documentation fixes.
|
||||
|
||||
### Changed
|
||||
|
||||
- Breaking API/ABI changes in the Settings and the main SenseGlove module due to some settings refactoring.
|
||||
- Breaking changes in the SenseGlove/Unreal coordinates systems conversions due to underlying changes in the SenseGlove Core Libraries.
|
||||
- SenseGlove libraries have been updated to v2.6.0-aac3d56.
|
||||
|
||||
## [v1.2.1] - 2023-03-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix RunUAT build issues with Android.
|
||||
|
||||
## [v1.2.0] - 2023-03-28
|
||||
|
||||
This release breaks ABI/API compatibility with the previous versions.
|
||||
|
||||
### Added
|
||||
|
||||
- Android / Oculus on-device glove calibration.
|
||||
- Introduced the animated Virtual Hand Model (as a set of virtual hand and wrist tracker components and an actor) with in-editor animation availability.
|
||||
- Introduced SGPawn, SGPlayerController, SGGameModeBase, etc classes.
|
||||
- Added an internal SenseGloveCoreTypes module in order to share common SenseGloveCore types between various modules.
|
||||
- Segregated Android binaries for NDK r21e (UE 4.27 and 5.0) and r25b (UE 5.1, 5.2).
|
||||
- Fully functional and stable Linux development support.
|
||||
- Fully functional and stable Unreal Engine 5.2 preview support has been added.
|
||||
- Added a Plugin's settings manager and two new modules SenseGloveSettings and SenseGloveSettingsKismet.
|
||||
|
||||
### Changed
|
||||
|
||||
- SenseGlove libraries have been updated to the Linux-aware version: v2.5.0-8069342.
|
||||
- API has changed to use degrees instead of radians.
|
||||
- SGCoordinates utility class name has been changed to SGAngles and now the plugin API uses degrees in contrast of SenseGlove libraries by default.
|
||||
- Migrate common nested array types into the SenseGloveTypes module from the SenseGloveCore module.
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed a few thousand lines of archaic pre-public-release dead code.
|
||||
- Dropped Android NDK r21b binaries used by the older engine versions.
|
||||
- Purged the dead code for dropped engine versions by v1.1.1 (4.22, 4.23, 4.24, 4.25, and 4.26) that carried over to the current version.
|
||||
- Removed redundant SGConnectImpl/SGPlatform.
|
||||
- Removed redundant SGTypes/SGConnectTypes.
|
||||
|
||||
### Known Issues
|
||||
|
||||
- Wrist Tracker's offsets are a bit off (e.g. on Quest 2), scheduled to be fixed in the next patch release.
|
||||
|
||||
## [1.1.1] - 2023-02-07
|
||||
|
||||
### Added
|
||||
|
||||
- Initial support for the upcoming Unreal Engine 5.2.
|
||||
- Add support for Android armeabi-v7a with neon, x86-64, and x86 builds in addition to arm64-v8a.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix various Android build issues.
|
||||
- Some minor fixes and improvements.
|
||||
|
||||
### Changed
|
||||
|
||||
- Bump SenseGlove libraries to v2.1.2-95ec6e7.
|
||||
|
||||
## [1.1.0] - 2023-02-03
|
||||
|
||||
### Added
|
||||
|
||||
- Whitelist Android as a target platform.
|
||||
- Introduce Android support.
|
||||
- Add third-pary library SGConnect for Android v1.1.0.
|
||||
- Add third-party library SGConnect for Android v1.1.0.
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -53,7 +189,7 @@ This is a minor release focusing on adherence to the Unreal Engine Marketplace G
|
||||
### Added
|
||||
|
||||
- Added the newly acquired Unreal Engine Market Place Offer ID to the .uplugin file.
|
||||
- List the dot files inside FilterPlugin.ini file as well.
|
||||
- List the dotfiles inside the FilterPlugin.ini file as well.
|
||||
- Add the copyright notice to the source files missing it.
|
||||
- Add the SenseGlove SDK license to the third-party license file.
|
||||
|
||||
@@ -77,4 +213,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.
|
||||
@@ -6,16 +6,17 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
|
||||
|
||||
## Platform Support Matrix
|
||||
|
||||
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux (Native Toolchain)** | **macOS** | **Oculus Mobile (Android NDK r21b)** |
|
||||
|------|:-----------------------:|:-----------------------:|:-----------------------:|:----------------------------:|:---------:|:------------------------------------:|
|
||||
| 4.22 | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
|
||||
| 4.23 | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
|
||||
| 4.24 | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
|
||||
| 4.25 | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
|
||||
| 4.26 | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
|
||||
| 4.27 | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ❌ | ✅ v1.1.x |
|
||||
| 5.0 | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ❌ | ✅ v1.1.x |
|
||||
| 5.1 | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ✅ v1.1.x | ❌ | ✅ v1.1.x |
|
||||
| | **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.2 |
|
||||
| **5.0** | ❌ | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x (r21e) | ✅ v1.4.2 | ✅ v1.4.2 |
|
||||
| **5.1** | ❌ | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x (r25b) | ✅ v1.4.2 | ✅ v1.4.2 |
|
||||
| **5.2** | ❌ | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x | ✅ v1.4.x (r25b) | ✅ v1.4.2 | ✅ v1.4.2 |
|
||||
|
||||
* <code>✅</code> Supported
|
||||
* <code>⚠️</code> Not supported by the latest release and might be lacking features
|
||||
@@ -23,10 +24,12 @@ 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.
|
||||
* All third-party libraries on Windows built against Windows SDK 10.0.
|
||||
* Oculus support is only provided through the recommended Android NDK r21b by Epic Games.
|
||||
* Supporting Unreal Engine 4.22 through 4.24 for Oculus development is a huge challenge due to limited Android NDK support (r14b to r18b); firstly, because of uncomplete C++11 standard library support, and second, as a result of a known bug in Unreal Engine, which falsely detects NDK r18b as unsupported r18c. Thus, only Unreal Engine 4.25+ support is provided for Android/Oculus development. Third, [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, which is the recommended NDK by Epic Games for 4.22 to 4.24 cannot build the serial library.
|
||||
* 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.
|
||||
* 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
|
||||
@@ -52,7 +55,7 @@ Please note that modules postfixed with **Impl** are intended for interal use an
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
Source
|
||||
/
|
||||
│
|
||||
├── Config
|
||||
│
|
||||
@@ -62,6 +65,8 @@ Source
|
||||
│
|
||||
├── SenseGlove (the UE-specific high-level API)
|
||||
│
|
||||
├── SenseGloveAndroid (the Android-specific module)
|
||||
│
|
||||
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
|
||||
│
|
||||
├── SenseGloveConnect (exposes part of the SGConnect low-level API to C++)
|
||||
@@ -76,19 +81,27 @@ Source
|
||||
│
|
||||
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprints)
|
||||
│
|
||||
├── SenseGloveDebug (a utility debug module)
|
||||
│
|
||||
├── SenseGloveEditor (the Editor module)
|
||||
│
|
||||
├── SenseGloveInterop (internally used for interoperability between RTTI disabled/enabled modules)
|
||||
│
|
||||
├── SenseGloveKismet(exposes Blueprints-specific functionality from the SenseGlove module)
|
||||
├── SenseGloveKismet (exposes Blueprints-specific functionality from the SenseGlove module)
|
||||
│
|
||||
├── SenseGloveLog (the internal log module)
|
||||
│
|
||||
├── SenseGloveTypes (exposes various enums from the backend libraries)
|
||||
├── SenseGloveSettings (the plugin's settings manager)
|
||||
│
|
||||
├── SenseGloveSettingsKismet (exposes Blueprints-specific functionality from the SenseGloveSettings module)
|
||||
│
|
||||
├── SenseGloveTypes (exposes various enums from the backend libraries and also types from the SenseGlove module)
|
||||
│
|
||||
├── SenseGloveUtils (the internal utility module)
|
||||
│
|
||||
└── ThirdParty (3rd-party dependencies)
|
||||
│
|
||||
├── android (.jar file Java libraries for Android)
|
||||
│
|
||||
├── include (header files)
|
||||
│ │
|
||||
@@ -103,28 +116,112 @@ Source
|
||||
│ └── serial
|
||||
│
|
||||
└── lib (platform-specific pre-built binary dependencies)
|
||||
│
|
||||
├── 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)
|
||||
│ │ │
|
||||
│ │ ├── 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
|
||||
│
|
||||
├── linux
|
||||
│ │
|
||||
│ ├── v19 (UE 4.27 Linux dependencies)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
|
||||
│ │ │ │
|
||||
│ │ │ ├── debug
|
||||
│ │ │ │
|
||||
│ │ │ └── release
|
||||
│ │ │
|
||||
│ │ └── release
|
||||
│ │ └── x86-64 (dependencies targeting x86-64 Linux architecture)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ │
|
||||
│ │ └── release
|
||||
│ │
|
||||
│ └── v20 (UE 5.0 and 5.1 Linux dependencies)
|
||||
│ ├── v20 (UE 5.0 and 5.1 Linux dependencies)
|
||||
│ │ │
|
||||
│ │ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
|
||||
│ │ │ │
|
||||
│ │ │ ├── debug
|
||||
│ │ │ │
|
||||
│ │ │ └── release
|
||||
│ │ │
|
||||
│ │ └── x86-64 (dependencies targeting x86-64 Linux architecture)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ │
|
||||
│ │ └── release
|
||||
│ │
|
||||
│ └── v21 (UE 5.2 Linux dependencies)
|
||||
│ │
|
||||
│ ├── debug
|
||||
│ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ │
|
||||
│ │ └── release
|
||||
│ │
|
||||
│ └── release
|
||||
│
|
||||
├── oculus
|
||||
│ │
|
||||
│ ├── debug
|
||||
│ │
|
||||
│ └── release
|
||||
│ └── x86-64 (dependencies targeting x86-64 Linux architecture)
|
||||
│ │
|
||||
│ ├── debug
|
||||
│ │
|
||||
│ └── release
|
||||
│
|
||||
└── win64
|
||||
│
|
||||
├── msvc141 (Microsoft Visual Studio 2017 dependencies)
|
||||
│ │
|
||||
│ ├── debug
|
||||
│ │
|
||||
│ └── release
|
||||
│
|
||||
├── msvc142 (Microsoft Visual Studio 2019 dependencies)
|
||||
│ │
|
||||
|
||||
+49
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"Version": 1,
|
||||
"VersionName": "1.1.0",
|
||||
"VersionName": "1.4.2",
|
||||
"FriendlyName": "SenseGlove",
|
||||
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
|
||||
"Category": "Virtual Reality",
|
||||
@@ -27,6 +27,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -37,6 +38,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -47,6 +49,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -57,6 +60,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -67,6 +71,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -77,6 +82,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -87,6 +93,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -97,6 +104,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -107,6 +115,18 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SenseGloveDebug",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "PreDefault",
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -116,6 +136,7 @@
|
||||
"LoadingPhase": "PostEngineInit",
|
||||
"WhitelistPlatforms": [
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -126,6 +147,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -136,6 +158,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -146,6 +169,29 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SenseGloveSettings",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "PreDefault",
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SenseGloveSettingsKismet",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "PreDefault",
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -156,6 +202,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -166,6 +213,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
}
|
||||
|
||||
+10
-6
@@ -33,10 +33,14 @@
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
|
||||
|
||||
#if ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L )
|
||||
#define SG_CPP17 1
|
||||
#else /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L ) */
|
||||
#define SG_CPP17 0
|
||||
#endif /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L ) */
|
||||
USGVirtualHandAnimInstance::USGVirtualHandAnimInstance(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
FSGVirtualHandAnimInstanceProxy* USGVirtualHandAnimInstance::CreateAnimInstanceProxy()
|
||||
{
|
||||
return new FSGVirtualHandAnimInstanceProxy();
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h"
|
||||
|
||||
#include "BoneContainer.h"
|
||||
#include "BoneControllers/AnimNode_ModifyBone.h"
|
||||
#include "BonePose.h"
|
||||
#include "Containers/Array.h"
|
||||
#include "Containers/Map.h"
|
||||
#include "Containers/UnrealString.h"
|
||||
#include "Engine/SkeletalMesh.h"
|
||||
#include "Math/Rotator.h"
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#include "SGLog/SGLog.h"
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
|
||||
FSGVirtualHandAnimInstanceProxy::FSGVirtualHandAnimInstanceProxy()
|
||||
: FAnimInstanceProxy()
|
||||
{
|
||||
}
|
||||
|
||||
FSGVirtualHandAnimInstanceProxy::FSGVirtualHandAnimInstanceProxy(UAnimInstance* Instance)
|
||||
: FAnimInstanceProxy(Instance)
|
||||
{
|
||||
}
|
||||
|
||||
void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnimInstance)
|
||||
{
|
||||
FAnimInstanceProxy::PreEvaluateAnimation(InAnimInstance);
|
||||
|
||||
if (!IsValid(InAnimInstance))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
USGVirtualHandComponent* VirtualHand{Cast<USGVirtualHandComponent>(GetSkelMeshComponent())};
|
||||
if (!IsValid(VirtualHand))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BonesRotations.Empty();
|
||||
|
||||
if (!VirtualHand->IsGloveConnected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BonesRotations = VirtualHand->GetFingersBonesRotations();
|
||||
}
|
||||
|
||||
bool FSGVirtualHandAnimInstanceProxy::Evaluate(FPoseContext& Output)
|
||||
{
|
||||
USGVirtualHandComponent* VirtualHand{Cast<USGVirtualHandComponent>(GetSkelMeshComponent())};
|
||||
if (!IsValid(VirtualHand) && !VirtualHand->IsGloveConnected())
|
||||
{
|
||||
return FAnimInstanceProxy::Evaluate(Output);
|
||||
}
|
||||
|
||||
const USkeletalMesh* HandMesh{VirtualHand->
|
||||
#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 */
|
||||
};
|
||||
if (!IsValid(HandMesh))
|
||||
{
|
||||
return FAnimInstanceProxy::Evaluate(Output);
|
||||
}
|
||||
|
||||
const USkeleton* HandSkeleton{HandMesh->GetSkeleton()};
|
||||
if (!IsValid(HandSkeleton))
|
||||
{
|
||||
return FAnimInstanceProxy::Evaluate(Output);
|
||||
}
|
||||
|
||||
FComponentSpacePoseContext PoseContext{Output.AnimInstanceProxy};
|
||||
PoseContext.Pose.InitPose(Output.Pose);
|
||||
|
||||
for (const TTuple<FName, FRotator>& Bone: BonesRotations)
|
||||
{
|
||||
FName BoneName{Bone.Key};
|
||||
FRotator BoneRotation{Bone.Value};
|
||||
|
||||
const int32 BoneIndex = GetRequiredBones().GetPoseBoneIndexForBoneName(BoneName);
|
||||
if (BoneIndex == INDEX_NONE)
|
||||
{
|
||||
SGLOG_WARNING(FString::Printf(TEXT("Could not find a bone index for '%s' finger bone!"),
|
||||
*BoneName.ToString()));
|
||||
continue;
|
||||
}
|
||||
|
||||
FBoneReference BoneReference;
|
||||
BoneReference.BoneName = MoveTemp(BoneName);
|
||||
BoneReference.BoneIndex = BoneIndex;
|
||||
BoneReference.bUseSkeletonIndex = true;
|
||||
|
||||
FAnimNode_ModifyBone BoneController;
|
||||
BoneController.BoneToModify = MoveTemp(BoneReference);
|
||||
BoneController.Rotation = MoveTemp(BoneRotation);
|
||||
BoneController.RotationMode = EBoneModificationMode::BMM_Replace;
|
||||
BoneController.RotationSpace = EBoneControlSpace::BCS_ParentBoneSpace;
|
||||
BoneController.ScaleMode = EBoneModificationMode::BMM_Ignore;
|
||||
BoneController.TranslationMode = EBoneModificationMode::BMM_Ignore;
|
||||
|
||||
if (BoneController.IsValidToEvaluate(HandSkeleton, Output.Pose.GetBoneContainer()))
|
||||
{
|
||||
TArray<FBoneTransform> BoneTransforms;
|
||||
BoneController.EvaluateSkeletalControl_AnyThread(PoseContext, BoneTransforms);
|
||||
|
||||
const TArray<FBoneTransform>::SizeType BoneTransformsNum = BoneTransforms.Num();
|
||||
if (BoneTransformsNum > 0)
|
||||
{
|
||||
PoseContext.Pose.LocalBlendCSBoneTransforms(BoneTransforms, 1.0f);
|
||||
PoseContext.Pose.ConvertComponentPosesToLocalPoses(PoseContext.Pose, Output.Pose);
|
||||
|
||||
VirtualHand->MarkRenderStateDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Components/SGGrabComponent.h"
|
||||
|
||||
struct USGGrabComponent::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGGrabComponent* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGGrabComponent* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
};
|
||||
|
||||
USGGrabComponent* USGGrabComponent::GetGrabComponent(const AActor* Actor)
|
||||
{
|
||||
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
USGGrabComponent* GrabComponent = Cast<USGGrabComponent>(
|
||||
Actor->GetComponentByClass(USGGrabComponent::StaticClass()));
|
||||
return GrabComponent;
|
||||
}
|
||||
|
||||
bool USGGrabComponent::IsGrabbable(const AActor* Actor)
|
||||
{
|
||||
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const USGGrabComponent* GrabComponent = Cast<USGGrabComponent>(
|
||||
Actor->GetComponentByClass(USGGrabComponent::StaticClass()));
|
||||
if (!IsValid(GrabComponent))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
USGGrabComponent::USGGrabComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
AttachmentLocationRule = EAttachmentRule::SnapToTarget;
|
||||
AttachmentRotationRule = EAttachmentRule::KeepRelative;
|
||||
AttachmentScaleRule = EAttachmentRule::KeepWorld;
|
||||
bAttachmentWeldSimulatedBodies = true;
|
||||
|
||||
AttachmentSocketName = NAME_None;
|
||||
|
||||
DetachmentLocationRule = EDetachmentRule::KeepWorld;
|
||||
DetachmentRotationRule = EDetachmentRule::KeepWorld;
|
||||
DetachmentScaleRule = EDetachmentRule::KeepWorld;
|
||||
bDetachmentCallModify = false;
|
||||
|
||||
bAffectPhysicsState = true;
|
||||
}
|
||||
|
||||
USGGrabComponent::FImpl::FImpl(USGGrabComponent* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGGrabComponent::FImpl::~FImpl() = default;
|
||||
|
||||
void USGGrabComponent::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Components/SGTouchComponent.h"
|
||||
|
||||
struct USGTouchComponent::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGTouchComponent* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGTouchComponent* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
};
|
||||
|
||||
USGTouchComponent* USGTouchComponent::GetTouchComponent(const AActor* Actor)
|
||||
{
|
||||
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
USGTouchComponent* TouchComponent = Cast<USGTouchComponent>(
|
||||
Actor->GetComponentByClass(USGTouchComponent::StaticClass()));
|
||||
return TouchComponent;
|
||||
}
|
||||
|
||||
bool USGTouchComponent::IsTouchable(const AActor* Actor)
|
||||
{
|
||||
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const USGTouchComponent* TouchComponent = Cast<USGTouchComponent>(
|
||||
Actor->GetComponentByClass(USGTouchComponent::StaticClass()));
|
||||
if (!IsValid(TouchComponent))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
USGTouchComponent::USGTouchComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
BuzzLevel = 0;
|
||||
BuzzDuration = 0.25f;
|
||||
|
||||
ForceFeedbackLevel = 100;
|
||||
}
|
||||
|
||||
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGTouchComponent::FImpl::~FImpl() = default;
|
||||
|
||||
void USGTouchComponent::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,762 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "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 "UObject/ConstructorHelpers.h"
|
||||
|
||||
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
|
||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||
#include "SGConnect/SGConnect.h"
|
||||
#include "SGCore/SGDeviceList.h"
|
||||
#include "SGCore/SGHandPose.h"
|
||||
#include "SGCore/SGHapticGlove.h"
|
||||
#include "SGCore/SGHapticGloveHandProfiles.h"
|
||||
#include "SGDebug/SGDebugVirtualHand.h"
|
||||
#include "SGLog/SGLog.h"
|
||||
|
||||
struct USGVirtualHandComponent::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
FORCEINLINE static const FString& GetDefaultLeftHandMeshPath()
|
||||
{
|
||||
static const FString Path{TEXT("SkeletalMesh'/SenseGlove/Meshes/"
|
||||
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_VirtualHand_Left'")};
|
||||
return Path;
|
||||
}
|
||||
|
||||
FORCEINLINE static const FString& GetDefaultLeftHandMeshPathOnly()
|
||||
{
|
||||
static const FString Path{TEXT("/SenseGlove/Meshes/"
|
||||
"SK_SenseGlove_VirtualHand_Left.SK_SenseGlove_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'")};
|
||||
return Path;
|
||||
}
|
||||
|
||||
FORCEINLINE static const FString& GetDefaultRightHandMeshPathOnly()
|
||||
{
|
||||
static const FString Path{TEXT("/SenseGlove/Meshes/"
|
||||
"SK_SenseGlove_VirtualHand_Right.SK_SenseGlove_VirtualHand_Right")};
|
||||
return Path;
|
||||
}
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGVirtualHandComponent* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGVirtualHandComponent* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
bool IsEditor() const;
|
||||
|
||||
FString GetDefaultMeshPath() const;
|
||||
bool IsUsingUserMesh() const;
|
||||
USkeletalMesh* LoadDefaultMesh() const;
|
||||
void SetDefaultMesh() const;
|
||||
|
||||
USkeletalMesh* GetMesh() const;
|
||||
USkeleton* GetSkeleton() const;
|
||||
const FReferenceSkeleton& GetRefSkeleton() const;
|
||||
|
||||
bool InitializeBackend() const;
|
||||
bool UninitializeBackend() const;
|
||||
bool CheckGlove() const;
|
||||
|
||||
void SetVisibility(bool bInVisible) const;
|
||||
|
||||
void DrawDebugVirtualHand() const;
|
||||
};
|
||||
|
||||
const TArray<TArray<FName>>& USGVirtualHandComponent::GetLeftHandFingerBoneNames()
|
||||
{
|
||||
static const TArray<TArray<FName>> BoneNames{
|
||||
{FName(TEXT("thumb_01_l")), FName(TEXT("thumb_02_l")), FName(TEXT("thumb_03_l"))},
|
||||
{FName(TEXT("index_01_l")), FName(TEXT("index_02_l")), FName(TEXT("index_03_l"))},
|
||||
{FName(TEXT("middle_01_l")), FName(TEXT("middle_02_l")), FName(TEXT("middle_03_l"))},
|
||||
{FName(TEXT("ring_01_l")), FName(TEXT("ring_02_l")), FName(TEXT("ring_03_l"))},
|
||||
{FName(TEXT("pinky_01_l")), FName(TEXT("pinky_02_l")), FName(TEXT("pinky_03_l"))},
|
||||
};
|
||||
return BoneNames;
|
||||
}
|
||||
|
||||
const TArray<TArray<FName>>& USGVirtualHandComponent::GetRightHandFingerBoneNames()
|
||||
{
|
||||
static const TArray<TArray<FName>> BoneNames{
|
||||
{FName(TEXT("thumb_01_r")), FName(TEXT("thumb_02_r")), FName(TEXT("thumb_03_r"))},
|
||||
{FName(TEXT("index_01_r")), FName(TEXT("index_02_r")), FName(TEXT("index_03_r"))},
|
||||
{FName(TEXT("middle_01_r")), FName(TEXT("middle_02_r")), FName(TEXT("middle_03_r"))},
|
||||
{FName(TEXT("ring_01_r")), FName(TEXT("ring_02_r")), FName(TEXT("ring_03_r"))},
|
||||
{FName(TEXT("pinky_01_r")), FName(TEXT("pinky_02_r")), FName(TEXT("pinky_03_r"))},
|
||||
};
|
||||
return BoneNames;
|
||||
}
|
||||
|
||||
const FName& USGVirtualHandComponent::GetLeftHandFingerBoneName(const int32 Finger, const int32 Joint)
|
||||
{
|
||||
const TArray<TArray<FName>>& BoneNames{GetLeftHandFingerBoneNames()};
|
||||
|
||||
ensureAlwaysMsgf(Finger < BoneNames.Num(), TEXT("Finger index is out of bound!"));
|
||||
ensureAlwaysMsgf(Joint < BoneNames[Finger].Num(), TEXT("Joint index is out of bound!"));
|
||||
|
||||
const FName& BoneName{BoneNames[Finger][Joint]};
|
||||
return BoneName;
|
||||
}
|
||||
|
||||
const FName& USGVirtualHandComponent::GetRightHandFingerBoneName(const int32 Finger, const int32 Joint)
|
||||
{
|
||||
const TArray<TArray<FName>>& BoneNames{GetRightHandFingerBoneNames()};
|
||||
|
||||
ensureAlwaysMsgf(Finger < BoneNames.Num(), TEXT("Finger index is out of bound!"));
|
||||
ensureAlwaysMsgf(Joint < BoneNames[Finger].Num(), TEXT("Joint index is out of bound!"));
|
||||
|
||||
const FName& BoneName{BoneNames[Finger][Joint]};
|
||||
return BoneName;
|
||||
}
|
||||
|
||||
USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
PrimaryComponentTick.bTickEvenWhenPaused = false;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
PrimaryComponentTick.bStartWithTickEnabled = true;
|
||||
bTickInEditor = true;
|
||||
bNeverNeedsRenderUpdate = false;
|
||||
bAllowConcurrentTick = true;
|
||||
SetUpdateAnimationInEditor(true);
|
||||
|
||||
SetCastShadow(true);
|
||||
SetCastHiddenShadow(false);
|
||||
bCastDynamicShadow = true;
|
||||
SetOnlyOwnerSee(false);
|
||||
SetReceivesDecals(true);
|
||||
SetCanEverAffectNavigation(false);
|
||||
Super::SetCollisionObjectType(ECC_WorldDynamic);
|
||||
Super::SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
|
||||
Super::SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
Super::SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_Pawn, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_Vehicle, ECR_Block);
|
||||
Super::SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
|
||||
|
||||
Super::SetAnimClass(USGVirtualHandAnimInstance::StaticClass());
|
||||
|
||||
bRight = true;
|
||||
|
||||
bAutoStopAllHapticsOnEndPlay = true;
|
||||
|
||||
GrabSocketName = FName{TEXT("GrabPoint")};
|
||||
|
||||
DefaultFingertipsGrabColliderSize = FVector{0.08f, 0.08f, 0.08f};
|
||||
|
||||
ThumbFingertipGrabSocketName = FName{TEXT("GrabThumbFingertip")};
|
||||
IndexFingertipGrabSocketName = FName{TEXT("GrabIndexFingertip")};
|
||||
MiddleFingertipGrabSocketName = FName{TEXT("GrabMiddleFingertip")};
|
||||
|
||||
DefaultFingertipsTouchColliderSize = FVector{0.08f, 0.08f, 0.08f};
|
||||
|
||||
ThumbFingertipTouchSocketName = FName{TEXT("TouchThumbFingertip")};
|
||||
IndexFingertipTouchSocketName = FName{TEXT("TouchIndexFingertip")};
|
||||
MiddleFingertipTouchSocketName = FName{TEXT("TouchMiddleFingertip")};
|
||||
RingFingertipTouchSocketName = FName{TEXT("TouchRingFingertip")};
|
||||
PinkyFingertipTouchSocketName = FName{TEXT("TouchPinkyFingertip")};
|
||||
|
||||
bHiddenInGameIfNoGloveDetected = false;
|
||||
|
||||
DebugVirtualHandSettings = FSGDebugVirtualHandSettings{
|
||||
ESGDebugVirtualHandDrawingMode::None,
|
||||
FVector(0.5f, 0.5f, 0.5f),
|
||||
FColor(255, 0, 0, 255),
|
||||
0.1f, 1.0f, 1.0f,
|
||||
FColor(255, 0, 0, 255),
|
||||
FColor(0, 255, 0, 255),
|
||||
FColor(0, 0, 255, 255),
|
||||
false, 1.1f, 0
|
||||
};
|
||||
|
||||
Super::SetSkeletalMesh(nullptr, true);
|
||||
|
||||
bBackendInitialized = false;
|
||||
Glove = nullptr;
|
||||
WristTracker = nullptr;
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::SetRight(const bool bInRight)
|
||||
{
|
||||
bRight = bInRight;
|
||||
|
||||
if (!Pimpl->IsUsingUserMesh())
|
||||
{
|
||||
Pimpl->SetDefaultMesh();
|
||||
}
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::SetAnimClass(UClass* NewClass)
|
||||
{
|
||||
ensureAlwaysMsgf(Cast<USGVirtualHandAnimInstance>(NewClass),
|
||||
TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!"));
|
||||
|
||||
Super::SetAnimClass(NewClass);
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::PostInitProperties()
|
||||
{
|
||||
Super::PostInitProperties();
|
||||
|
||||
if (!Pimpl->IsUsingUserMesh())
|
||||
{
|
||||
Pimpl->SetDefaultMesh();
|
||||
}
|
||||
}
|
||||
|
||||
#if WITH_EDITOR
|
||||
void USGVirtualHandComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
|
||||
{
|
||||
Super::PostEditChangeProperty(PropertyChangedEvent);
|
||||
|
||||
const FName PropertyName{
|
||||
PropertyChangedEvent.Property
|
||||
? PropertyChangedEvent.Property->GetFName()
|
||||
: NAME_None
|
||||
};
|
||||
if (PropertyName == GET_MEMBER_NAME_CHECKED(USGVirtualHandComponent, bRight))
|
||||
{
|
||||
if (!Pimpl->IsUsingUserMesh())
|
||||
{
|
||||
Pimpl->SetDefaultMesh();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
void USGVirtualHandComponent::InitializeComponent()
|
||||
{
|
||||
Super::InitializeComponent();
|
||||
|
||||
if (!Pimpl->IsUsingUserMesh())
|
||||
{
|
||||
Pimpl->SetDefaultMesh();
|
||||
}
|
||||
|
||||
if (Pimpl->InitializeBackend())
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::UninitializeComponent()
|
||||
{
|
||||
Super::UninitializeComponent();
|
||||
|
||||
(void) Pimpl->UninitializeBackend();
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
if (Pimpl->InitializeBackend())
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
Super::EndPlay(EndPlayReason);
|
||||
|
||||
if (IsValid(Glove) && AutoStopsAllHapticsOnEndPlay())
|
||||
{
|
||||
Glove->StopHaptics();
|
||||
}
|
||||
|
||||
(void) Pimpl->UninitializeBackend();
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::TickComponent(
|
||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
#if WITH_EDITOR
|
||||
if (Pimpl->IsEditor())
|
||||
{
|
||||
EditorTick(DeltaTime, TickType, ThisTickFunction);
|
||||
return;
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
(void) Pimpl->CheckGlove();
|
||||
|
||||
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
|
||||
{
|
||||
Pimpl->DrawDebugVirtualHand();
|
||||
}
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::SetSkeletalMesh(USkeletalMesh* NewMesh, const bool bReinitPose)
|
||||
{
|
||||
if (IsValid(NewMesh))
|
||||
{
|
||||
Super::SetSkeletalMesh(NewMesh, bReinitPose);
|
||||
}
|
||||
else
|
||||
{
|
||||
Super::SetSkeletalMesh(Pimpl->LoadDefaultMesh(), bReinitPose);
|
||||
}
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::EditorTick(
|
||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
|
||||
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
|
||||
{
|
||||
Pimpl->DrawDebugVirtualHand();
|
||||
}
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::IsGloveConnected() const
|
||||
{
|
||||
return Pimpl->CheckGlove();
|
||||
}
|
||||
|
||||
USGHandPose* USGVirtualHandComponent::GetHandPose()
|
||||
{
|
||||
USGHandPose* HandPose{nullptr};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
const FName& USGVirtualHandComponent::GetFingerBoneName(const int32 Finger, const int32 Joint) const
|
||||
{
|
||||
const FName& Name{
|
||||
IsRight()
|
||||
? GetRightHandFingerBoneName(Finger, Joint)
|
||||
: GetLeftHandFingerBoneName(Finger, Joint)
|
||||
};
|
||||
return Name;
|
||||
}
|
||||
|
||||
const FTransform& USGVirtualHandComponent::GetFingerBoneRefTransform(const int32 Finger, const int32 Joint) const
|
||||
{
|
||||
const FName& BoneName{GetFingerBoneName(Finger, Joint)};
|
||||
const FReferenceSkeleton& ReferenceSkeleton{Pimpl->GetRefSkeleton()};
|
||||
const int32 BoneIndex = ReferenceSkeleton.FindBoneIndex(BoneName);
|
||||
|
||||
if (BoneIndex == INDEX_NONE)
|
||||
{
|
||||
SGLOG_WARNING(FString::Printf(TEXT("Could not find a bone index for '%s' finger bone!"),
|
||||
*BoneName.ToString()));
|
||||
return FTransform::Identity;
|
||||
}
|
||||
|
||||
const FTransform& BoneTransform{ReferenceSkeleton.GetRefBonePose()[BoneIndex]};
|
||||
return BoneTransform;
|
||||
}
|
||||
|
||||
FRotator USGVirtualHandComponent::GetFingerBoneRefRotation(const int32 Finger, const int32 Joint) const
|
||||
{
|
||||
const FTransform BoneTransform{GetFingerBoneRefTransform(Finger, Joint)};
|
||||
FRotator BoneRotation{BoneTransform.GetRotation().Rotator()};
|
||||
return MoveTemp(BoneRotation);
|
||||
}
|
||||
|
||||
TMap<FName, FRotator> USGVirtualHandComponent::GetFingersBonesRotations()
|
||||
{
|
||||
TMap<FName, FRotator> Rotations;
|
||||
|
||||
if (!IsGloveConnected())
|
||||
{
|
||||
return MoveTemp(Rotations);
|
||||
}
|
||||
|
||||
const USGHandPose* HandPose = GetHandPose();
|
||||
if (!IsValid(HandPose))
|
||||
{
|
||||
return MoveTemp(Rotations);
|
||||
}
|
||||
|
||||
const TArray<TArray<FVector>> HandAngles{HandPose->GetHandAngles()};
|
||||
|
||||
for (int32 FingerIndex = 0; FingerIndex < HandAngles.Num(); ++FingerIndex)
|
||||
{
|
||||
const TArray<FVector>& FingerJointAngles{HandAngles[FingerIndex]};
|
||||
|
||||
for (int32 JointIndex = 0; JointIndex < FingerJointAngles.Num(); ++JointIndex)
|
||||
{
|
||||
const FVector& JointAngle{FingerJointAngles[JointIndex]};
|
||||
const FQuat JointRotation{FQuat::MakeFromEuler(JointAngle)};
|
||||
|
||||
const FTransform& BoneRefTransform{GetFingerBoneRefTransform(FingerIndex, JointIndex)};
|
||||
|
||||
FQuat NewBoneRotation{BoneRefTransform.GetRotation() * JointRotation};
|
||||
|
||||
FName BoneName{GetFingerBoneName(FingerIndex, JointIndex)};
|
||||
|
||||
Rotations.Emplace(MoveTemp(BoneName), MoveTemp(NewBoneRotation));
|
||||
}
|
||||
}
|
||||
|
||||
return MoveTemp(Rotations);
|
||||
}
|
||||
|
||||
USGVirtualHandComponent::FImpl::FImpl(USGVirtualHandComponent* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGVirtualHandComponent::FImpl::~FImpl() = default;
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::IsEditor() const
|
||||
{
|
||||
const UWorld* World{Owner->GetWorld()};
|
||||
if (World && (World->WorldType == EWorldType::Editor || World->WorldType == EWorldType::EditorPreview))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
|
||||
{
|
||||
FString SkeletalMeshPath;
|
||||
|
||||
if (Owner->IsRight())
|
||||
{
|
||||
SkeletalMeshPath = GetDefaultRightHandMeshPath();
|
||||
}
|
||||
else
|
||||
{
|
||||
SkeletalMeshPath = GetDefaultLeftHandMeshPath();
|
||||
}
|
||||
|
||||
return MoveTemp(SkeletalMeshPath);
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
|
||||
{
|
||||
const USkeletalMesh* CurrentMesh{GetMesh()};
|
||||
if (!IsValid(CurrentMesh))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const FString CurrentMeshPath(CurrentMesh->GetPathName());
|
||||
const FString LeftHandDefaultMeshPath(GetDefaultLeftHandMeshPath());
|
||||
const FString LeftHandDefaultMeshPathOnly(GetDefaultLeftHandMeshPathOnly());
|
||||
const FString RightHandDefaultMeshPath(GetDefaultRightHandMeshPath());
|
||||
const FString RightHandDefaultMeshPathOnly(GetDefaultRightHandMeshPathOnly());
|
||||
if (CurrentMeshPath == LeftHandDefaultMeshPath
|
||||
|| CurrentMeshPath == LeftHandDefaultMeshPathOnly
|
||||
|| CurrentMeshPath == RightHandDefaultMeshPath
|
||||
|| CurrentMeshPath == RightHandDefaultMeshPathOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
|
||||
{
|
||||
const FString DefaultMeshPath{GetDefaultMeshPath()};
|
||||
USkeletalMesh* DefaultMesh{
|
||||
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
|
||||
};
|
||||
|
||||
if (!IsValid(DefaultMesh))
|
||||
{
|
||||
SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
|
||||
}
|
||||
|
||||
return DefaultMesh;
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
|
||||
{
|
||||
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 */
|
||||
;
|
||||
}
|
||||
|
||||
USkeleton* USGVirtualHandComponent::FImpl::GetSkeleton() const
|
||||
{
|
||||
USkeletalMesh* Mesh{GetMesh()};
|
||||
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
|
||||
return Mesh->GetSkeleton();
|
||||
}
|
||||
|
||||
const FReferenceSkeleton& USGVirtualHandComponent::FImpl::GetRefSkeleton() const
|
||||
{
|
||||
const USkeletalMesh* Mesh{GetMesh()};
|
||||
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
|
||||
return Mesh->GetRefSkeleton();
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::InitializeBackend() const
|
||||
{
|
||||
if (!Owner->bBackendInitialized)
|
||||
{
|
||||
#if PLATFORM_ANDROID
|
||||
const int32_t Result = FSGConnect::Init();
|
||||
switch (Result)
|
||||
{
|
||||
case -3:
|
||||
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
|
||||
return false;
|
||||
case -2:
|
||||
SGLOG_ERROR("Device Scanning is already running within a different program.");
|
||||
return false;
|
||||
case -1:
|
||||
SGLOG_ERROR("Device Scanning already being initialized (function called twice in short succession).");
|
||||
return false;
|
||||
case 0:
|
||||
// Do not pollute the logs!
|
||||
//SGLOG_ERROR("Device Scanning is already running within this program.");
|
||||
// We must return here in case there are two virtual hand components are present in the scene.
|
||||
return true;
|
||||
case 1:
|
||||
SGLOG("Successfully started up DeviceScanning from the current program.");
|
||||
break;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled Init return status code!"));
|
||||
return false;
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
// Ensure that the device list is empty before doing anything.
|
||||
FSGDeviceList::Dispose();
|
||||
FSGDeviceList::Reinitialize();
|
||||
|
||||
// Load the latest hand profiles.
|
||||
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
|
||||
|
||||
Owner->bBackendInitialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::UninitializeBackend() const
|
||||
{
|
||||
// NOTE
|
||||
// In Editor builds we should be avoiding dispose, since stopping the game in PIE mode, causes the virtual-hand
|
||||
// to disappear in the editor as the plugin won't be able to retrieve the glove status anymore.
|
||||
#if ! WITH_EDITOR
|
||||
if (Owner->bBackendInitialized)
|
||||
{
|
||||
FSGDeviceList::Dispose();
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
const int32_t Result = FSGConnect::Dispose();
|
||||
switch (Result)
|
||||
{
|
||||
case -3:
|
||||
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
|
||||
return false;
|
||||
case -2:
|
||||
SGLOG_ERROR("Not allowed to dispose of Device Scanning because this is not the program which started it.");
|
||||
return false;
|
||||
case -1:
|
||||
SGLOG_ERROR("Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).");
|
||||
return false;
|
||||
case 0:
|
||||
SGLOG_ERROR("There is no deviceScanner running from any program, so disposing is skipped.");
|
||||
return false;
|
||||
case 1:
|
||||
SGLOG("Successfully disposed of DeviceScanner resources.");
|
||||
break;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled Dispose return status code!"));
|
||||
return false;
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
Owner->bBackendInitialized = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif /* ! WITH_EDITOR */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::CheckGlove() const
|
||||
{
|
||||
if (!Owner->bBackendInitialized)
|
||||
{
|
||||
const bool bSucceeded = InitializeBackend();
|
||||
if (!bSucceeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const bool bGloveWasPresent = IsValid(Owner->Glove);
|
||||
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
|
||||
|
||||
if (!bFoundGlove && bGloveWasPresent)
|
||||
{
|
||||
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
|
||||
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
|
||||
}
|
||||
|
||||
const bool bIsEditor = IsEditor();
|
||||
if (!bIsEditor)
|
||||
{
|
||||
const bool bIsVisible = Owner->IsVisible();
|
||||
if (Owner->bHiddenInGameIfNoGloveDetected)
|
||||
{
|
||||
if (bFoundGlove)
|
||||
{
|
||||
if (!bIsVisible)
|
||||
{
|
||||
SetVisibility(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bIsVisible)
|
||||
{
|
||||
SetVisibility(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bIsVisible)
|
||||
{
|
||||
SetVisibility(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bFoundGlove;
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) const
|
||||
{
|
||||
Owner->SetVisibility(bInVisible, true);
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
|
||||
{
|
||||
const UWorld* World{Owner->GetWorld()};
|
||||
|
||||
if (!IsValid(Owner->WristTracker))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const FVector& WristLocation{Owner->WristTracker->GetWristLocation()};
|
||||
const FRotator& WristRotation{Owner->WristTracker->GetWristRotation()};
|
||||
|
||||
const USGHandPose* HandPose{Owner->GetHandPose()};
|
||||
if (!IsValid(HandPose))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const TArray<TArray<FVector>>& JointPositions{HandPose->GetJointPositions()};
|
||||
const TArray<TArray<FRotator>>& JointRotations{HandPose->GetJointRotations()};
|
||||
|
||||
FSGDebugVirtualHand::Draw(World, WristLocation, WristRotation, JointPositions, JointRotations,
|
||||
Owner->DebugVirtualHandSettings);
|
||||
}
|
||||
|
||||
void USGVirtualHandComponent::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,548 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||
|
||||
#include "Animation/Skeleton.h"
|
||||
#include "Components/SkeletalMeshComponent.h"
|
||||
#include "Engine/SkeletalMesh.h"
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
|
||||
#include "SGConnect/SGConnect.h"
|
||||
#include "SGCore/SGDeviceList.h"
|
||||
#include "SGCore/SGHapticGlove.h"
|
||||
#include "SGCore/SGHapticGloveHandProfiles.h"
|
||||
#include "SGDebug/SGDebugGizmo.h"
|
||||
#include "SGLog/SGLog.h"
|
||||
#include "SGSettings/SGSettings.h"
|
||||
|
||||
struct USGWristTrackerComponent::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGWristTrackerComponent* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGWristTrackerComponent* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
bool IsEditor() const;
|
||||
|
||||
bool InitializeBackend() const;
|
||||
bool UninitializeBackend() const;
|
||||
bool CheckGlove() const;
|
||||
|
||||
void UpdateWristTrackingData() const;
|
||||
void DrawDebugGizmo();
|
||||
};
|
||||
|
||||
USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
PrimaryComponentTick.bTickEvenWhenPaused = false;
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
PrimaryComponentTick.bStartWithTickEnabled = true;
|
||||
bTickInEditor = true;
|
||||
bNeverNeedsRenderUpdate = true;
|
||||
bAllowConcurrentTick = true;
|
||||
|
||||
SetCastShadow(false);
|
||||
SetCastHiddenShadow(false);
|
||||
bCastDynamicShadow = false;
|
||||
SetOnlyOwnerSee(false);
|
||||
SetReceivesDecals(false);
|
||||
SetCanEverAffectNavigation(false);
|
||||
|
||||
SetRight(true);
|
||||
|
||||
bOverridePluginWristTrackingSettings = false;
|
||||
bDrawWristTrackerDebugGizmo = false;
|
||||
TrackingHardware = ESGPositionalTrackingHardware::None;
|
||||
TrackingHardwareLocationOffset = FVector::ZeroVector;
|
||||
TrackingHardwareLocationOffset = FVector::ZeroVector;
|
||||
|
||||
bOverridePluginWristTrackingDebugSettings = false;
|
||||
bDrawWristTrackerDebugGizmo = false;
|
||||
WristTrackerDebugGizmoSettings = FSGDebugGizmoSettings(
|
||||
4.0f, 1.0f,
|
||||
FColor(255, 0, 0, 255),
|
||||
FColor(0, 255, 0, 255),
|
||||
FColor(0, 0, 255, 255),
|
||||
false, 1.1f, 0
|
||||
);
|
||||
bDrawWristTrackerDebugGizmo = false;
|
||||
|
||||
bBackendInitialized = false;
|
||||
Glove = nullptr;
|
||||
WristLocation = FVector::ZeroVector;
|
||||
WristRotation = FRotator::ZeroRotator;
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetRight(const bool bRight)
|
||||
{
|
||||
SetTrackingSource(bRight ? EControllerHand::Right : EControllerHand::Left);
|
||||
}
|
||||
|
||||
ESGPositionalTrackingHardware USGWristTrackerComponent::GetTrackingHardware() const
|
||||
{
|
||||
if (OverridesPluginWristTrackingSettings())
|
||||
{
|
||||
return TrackingHardware;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetTrackingHardware();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetTrackingHardware(const ESGPositionalTrackingHardware InTrackingHardware)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingSettings(),
|
||||
TEXT( "Setting TrackingHardware is only permitted when bOverridePluginWristTrackingSettings is enabled!"));
|
||||
|
||||
TrackingHardware = InTrackingHardware;
|
||||
}
|
||||
|
||||
const FVector& USGWristTrackerComponent::GetTrackingHardwareLocationOffset() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Getting TrackingHardwareLocationOffset is only permitted when TrackingHardware is set to Custom!"));
|
||||
|
||||
if (OverridesPluginWristTrackingSettings())
|
||||
{
|
||||
return TrackingHardwareLocationOffset;
|
||||
}
|
||||
|
||||
return IsRight()
|
||||
? USGSettings::GetInstance()->GetTrackingHardwareLocationOffsetRightHand()
|
||||
: USGSettings::GetInstance()->GetTrackingHardwareLocationOffsetLeftHand();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetTrackingHardwareLocationOffset(const FVector& InTrackingHardwareLocationOffset)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingSettings(),
|
||||
TEXT(
|
||||
"Setting TrackingHardwareLocationOffset is only permitted when bOverridePluginWristTrackingSettings is enabled!"
|
||||
));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Setting TrackingHardwareLocationOffset is only permitted when TrackingHardware is set to Custom!"));
|
||||
|
||||
TrackingHardwareLocationOffset = InTrackingHardwareLocationOffset;
|
||||
}
|
||||
|
||||
const FRotator& USGWristTrackerComponent::GetTrackingHardwareRotationOffset() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Getting TrackingHardwareRotationOffset is only permitted when TrackingHardware is set to Custom!"));
|
||||
|
||||
if (OverridesPluginWristTrackingSettings())
|
||||
{
|
||||
return TrackingHardwareRotationOffset;
|
||||
}
|
||||
|
||||
return IsRight()
|
||||
? USGSettings::GetInstance()->GetTrackingHardwareRotationOffsetRightHand()
|
||||
: USGSettings::GetInstance()->GetTrackingHardwareRotationOffsetLeftHand();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetTrackingHardwareRotationOffset(const FRotator& InTrackingHardwareRotationOffset)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingSettings(),
|
||||
TEXT(
|
||||
"Setting TrackingHardwareRotationOffset is only permitted when bOverridePluginWristTrackingSettings is enabled!"
|
||||
));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetTrackingHardware() == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT("Setting TrackingHardwareRotationOffsetRightHand is only permitted when TrackingHardware is set to Custom!"
|
||||
));
|
||||
|
||||
TrackingHardwareRotationOffset = InTrackingHardwareRotationOffset;
|
||||
}
|
||||
|
||||
bool USGWristTrackerComponent::GetDrawWristTrackerDebugGizmo() const
|
||||
{
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return !!bDrawWristTrackerDebugGizmo;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDrawWristTrackerDebugGizmo();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDrawWristTrackerDebugGizmo(const bool bInDrawWristTrackerDebugGizmo)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT( "Setting bDrawWristTrackerDebugGizmo is only permitted when bOverridePluginWristTrackingDebugSettings is"
|
||||
" enabled!"));
|
||||
|
||||
bDrawWristTrackerDebugGizmo = bInDrawWristTrackerDebugGizmo;
|
||||
}
|
||||
|
||||
const FSGDebugGizmoSettings& USGWristTrackerComponent::GetWristTrackerDebugGizmoSettings() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawWristTrackerDebugGizmo(),
|
||||
TEXT("Getting WristTrackerDebugGizmoLength is only permitted when bDrawWristTrackerDebugGizmo is enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return WristTrackerDebugGizmoSettings;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetWristTrackerDebugGizmoSettings();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetWristTrackerDebugGizmoSettings(
|
||||
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting WristTrackerDebugGizmoLength is only permitted when bOverridePluginWristTrackingDebugSettings is"
|
||||
" enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawWristTrackerDebugGizmo(),
|
||||
TEXT("Setting WristTrackerDebugGizmoLength is only permitted when bDrawWristTrackerDebugGizmo is enabled!"));
|
||||
|
||||
WristTrackerDebugGizmoSettings = InWristTrackerDebugGizmoSettings;
|
||||
}
|
||||
|
||||
#if WITH_EDITOR
|
||||
void USGWristTrackerComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
|
||||
{
|
||||
Super::PostEditChangeProperty(PropertyChangedEvent);
|
||||
|
||||
const FName PropertyName{
|
||||
PropertyChangedEvent.Property
|
||||
? PropertyChangedEvent.Property->GetFName()
|
||||
: NAME_None
|
||||
};
|
||||
|
||||
(void) PropertyName;
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
void USGWristTrackerComponent::InitializeComponent()
|
||||
{
|
||||
Super::InitializeComponent();
|
||||
|
||||
if (Pimpl->InitializeBackend())
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::UninitializeComponent()
|
||||
{
|
||||
Super::UninitializeComponent();
|
||||
|
||||
(void) Pimpl->UninitializeBackend();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
if (Pimpl->InitializeBackend())
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
Super::EndPlay(EndPlayReason);
|
||||
|
||||
(void) Pimpl->UninitializeBackend();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::TickComponent(
|
||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
#if WITH_EDITOR
|
||||
if (Pimpl->IsEditor())
|
||||
{
|
||||
EditorTick(DeltaTime, TickType, ThisTickFunction);
|
||||
return;
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
if (GetDrawWristTrackerDebugGizmo())
|
||||
{
|
||||
Pimpl->DrawDebugGizmo();
|
||||
}
|
||||
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
|
||||
|
||||
void USGWristTrackerComponent::EditorTick(
|
||||
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
|
||||
USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGWristTrackerComponent::FImpl::~FImpl() = default;
|
||||
|
||||
bool USGWristTrackerComponent::FImpl::IsEditor() const
|
||||
{
|
||||
const UWorld* World{Owner->GetWorld()};
|
||||
if (World && (World->WorldType == EWorldType::Editor || World->WorldType == EWorldType::EditorPreview))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGWristTrackerComponent::FImpl::InitializeBackend() const
|
||||
{
|
||||
if (!Owner->bBackendInitialized)
|
||||
{
|
||||
#if PLATFORM_ANDROID
|
||||
const int32_t Result = FSGConnect::Init();
|
||||
switch (Result)
|
||||
{
|
||||
case -3:
|
||||
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
|
||||
return false;
|
||||
case -2:
|
||||
SGLOG_ERROR("Device Scanning is already running within a different program.");
|
||||
return false;
|
||||
case -1:
|
||||
SGLOG_ERROR("Device Scanning already being initialized (function called twice in short succession).");
|
||||
return false;
|
||||
case 0:
|
||||
// Do not pollute the logs!
|
||||
//SGLOG_ERROR("Device Scanning is already running within this program.");
|
||||
// We must return here in case two virtual hand components are present in the scene.
|
||||
return true;
|
||||
case 1:
|
||||
SGLOG("Successfully started up DeviceScanning from the current program.");
|
||||
break;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled Init return status code!"));
|
||||
return false;
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
// Ensure that the device list is empty before doing anything.
|
||||
FSGDeviceList::Dispose();
|
||||
FSGDeviceList::Reinitialize();
|
||||
|
||||
// Load the latest hand profiles.
|
||||
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
|
||||
|
||||
Owner->bBackendInitialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGWristTrackerComponent::FImpl::UninitializeBackend() const
|
||||
{
|
||||
// NOTE
|
||||
// In Editor builds we should be avoiding dispose, since stopping the game in PIE mode, causes the virtual-hand
|
||||
// to disappear in the editor as the plugin won't be able to retrieve the glove status anymore.
|
||||
#if ! WITH_EDITOR
|
||||
if (Owner->bBackendInitialized)
|
||||
{
|
||||
FSGDeviceList::Dispose();
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
const int32_t Result = FSGConnect::Dispose();
|
||||
switch (Result)
|
||||
{
|
||||
case -3:
|
||||
SGLOG_ERROR("An Unexpected error occurred. Please try again.");
|
||||
return false;
|
||||
case -2:
|
||||
SGLOG_ERROR("Not allowed to dispose of Device Scanning because this is not the program which started it.");
|
||||
return false;
|
||||
case -1:
|
||||
SGLOG_ERROR("Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).");
|
||||
return false;
|
||||
case 0:
|
||||
SGLOG_ERROR("There is no deviceScanner running from any program, so disposing is skipped.");
|
||||
return false;
|
||||
case 1:
|
||||
SGLOG("Successfully disposed of DeviceScanner resources.");
|
||||
break;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled Dispose return status code!"));
|
||||
return false;
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
Owner->bBackendInitialized = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif /* ! WITH_EDITOR */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGWristTrackerComponent::FImpl::CheckGlove() const
|
||||
{
|
||||
if (!Owner->bBackendInitialized)
|
||||
{
|
||||
const bool bSucceeded = InitializeBackend();
|
||||
if (!bSucceeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const bool bGloveWasPresent = IsValid(Owner->Glove);
|
||||
const bool bFoundGlove = USGHapticGlove::GetGlove(Owner, Owner->IsRight(), Owner->Glove);
|
||||
|
||||
if (!bFoundGlove && bGloveWasPresent)
|
||||
{
|
||||
SGLOG_ERROR(FString::Printf(TEXT("Could not find a %s glove!"),
|
||||
(Owner->IsRight() ? TEXT("right-handed") : TEXT("left-handed"))));
|
||||
}
|
||||
|
||||
if (bFoundGlove)
|
||||
{
|
||||
UpdateWristTrackingData();
|
||||
}
|
||||
|
||||
return bFoundGlove;
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
|
||||
{
|
||||
ensureAlwaysMsgf(Owner->Glove, TEXT("Invalid Glove!"));
|
||||
|
||||
FVector TrackerLocation{Owner->GetComponentLocation()};
|
||||
FRotator TrackerRotation{Owner->GetComponentRotation()};
|
||||
|
||||
ESGPositionalTrackingHardware TrackerHardware = Owner->GetTrackingHardware();
|
||||
if (TrackerHardware == ESGPositionalTrackingHardware::None)
|
||||
{
|
||||
TrackerHardware = ESGPositionalTrackingHardware::Custom;
|
||||
}
|
||||
else if (TrackerHardware == ESGPositionalTrackingHardware::Custom)
|
||||
{
|
||||
TrackerLocation += Owner->GetTrackingHardwareLocationOffset();
|
||||
TrackerRotation += Owner->GetTrackingHardwareRotationOffset();
|
||||
}
|
||||
|
||||
FVector NewWristLocation;
|
||||
FRotator NewWristRotation;
|
||||
Owner->Glove->GetWristLocation(TrackerLocation, TrackerRotation, TrackerHardware,
|
||||
NewWristLocation, NewWristRotation);
|
||||
|
||||
const bool bLocationUpdated = !Owner->WristLocation.Equals(NewWristLocation, SMALL_NUMBER);
|
||||
const bool bRotationUpdated = !Owner->WristRotation.Equals(NewWristRotation, SMALL_NUMBER);
|
||||
|
||||
if (bLocationUpdated)
|
||||
{
|
||||
Owner->WristLocation = MoveTemp(NewWristLocation);
|
||||
}
|
||||
|
||||
if (bRotationUpdated)
|
||||
{
|
||||
Owner->WristRotation = MoveTemp(NewWristRotation);
|
||||
}
|
||||
|
||||
if (bLocationUpdated && Owner->WristLocationChangedEvent.IsBound())
|
||||
{
|
||||
Owner->WristLocationChangedEvent.Broadcast(Owner->WristLocation);
|
||||
}
|
||||
|
||||
if (bRotationUpdated && Owner->WristRotationChangedEvent.IsBound())
|
||||
{
|
||||
Owner->WristRotationChangedEvent.Broadcast(Owner->WristRotation);
|
||||
}
|
||||
|
||||
if ((bLocationUpdated && bRotationUpdated) && Owner->WristLocationAndRotationChangedEvent.IsBound())
|
||||
{
|
||||
Owner->WristLocationAndRotationChangedEvent.Broadcast(Owner->WristLocation, Owner->WristRotation);
|
||||
}
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImpl::DrawDebugGizmo()
|
||||
{
|
||||
const UWorld* World{Owner->GetWorld()};
|
||||
const FVector& Location{Owner->GetComponentLocation()};
|
||||
const FRotator& Rotation{Owner->GetComponentRotation()};
|
||||
const FSGDebugGizmoSettings& DebugGizmoSettings{Owner->GetWristTrackerDebugGizmoSettings()};
|
||||
|
||||
FSGDebugGizmo::Draw(World, Location, Rotation, DebugGizmoSettings);
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/GameFramework//SGGameModeBase.h"
|
||||
|
||||
#include "SenseGlove/GameFramework/SGPawn.h"
|
||||
#include "SenseGlove/GameFramework/SGPlayerController.h"
|
||||
|
||||
ASGGameModeBase::ASGGameModeBase(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
DefaultPawnClass = ASGPawn::StaticClass();
|
||||
PlayerControllerClass = ASGPlayerController::StaticClass();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,372 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/GameFramework/SGPlayerController.h"
|
||||
|
||||
#if ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 )
|
||||
#include "Engine/TimerHandle.h"
|
||||
#else /* ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 ) */
|
||||
#include "Engine/EngineTypes.h"
|
||||
#endif /* ENGINE_MAJOR_VERSION > 5 || ( ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 2 ) */
|
||||
|
||||
#include "TimerManager.h"
|
||||
|
||||
#include "SenseGlove/Components/SGGrabComponent.h"
|
||||
#include "SenseGlove/Components/SGTouchComponent.h"
|
||||
#include "SenseGlove/GameFramework/SGPawn.h"
|
||||
#include "SenseGlove/Haptics/SGGrabState.h"
|
||||
#include "SenseGlove/Haptics/SGTouchState.h"
|
||||
#include "SGCore/SGBuzzCommand.h"
|
||||
#include "SGCore/SGForceFeedbackCommand.h"
|
||||
#include "SGCore/SGHapticGlove.h"
|
||||
|
||||
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 int32 GetForceFeedbackLevel(const AActor* Actor);
|
||||
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
FTimerHandle TouchBuzzStopTimer;
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
ASGPlayerController* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(ASGPlayerController* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* 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)
|
||||
{
|
||||
if (IsValid(Actor))
|
||||
{
|
||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
|
||||
if (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 0.0f;
|
||||
}
|
||||
|
||||
int32 ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
|
||||
{
|
||||
if (IsValid(Actor))
|
||||
{
|
||||
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
|
||||
if (TouchComponent)
|
||||
{
|
||||
return TouchComponent->GetForceFeedbackLevel();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
void ASGPlayerController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
ASGPawn* SGPawn = Cast<ASGPawn>(GetPawn());
|
||||
if (!ensureAlwaysMsgf(IsValid(SGPawn), TEXT("%s"), TEXT("ERROR: invalid SenseGlove pawn!")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SGPawn->OnGrabStateUpdated().AddWeakLambda(
|
||||
this, [=](const FSGGrabState& GrabState) -> void
|
||||
{
|
||||
if (!IsValid(SGPawn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsValid(GrabState.Hand))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SGPawn->IsGrabbing(GrabState.Hand))
|
||||
{
|
||||
if (!IsValid(GrabState.ActorThumbCanGrab) ||
|
||||
(GrabState.ActorIndexCanGrab != GrabState.ActorThumbCanGrab
|
||||
&& GrabState.ActorMiddleCanGrab != GrabState.ActorThumbCanGrab))
|
||||
{
|
||||
SGPawn->Release(GrabState.Hand);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SGPawn->CanGrab(GrabState.Hand, GrabState.ActorThumbCanGrab))
|
||||
{
|
||||
SGPawn->Grab(GrabState.Hand, GrabState.ActorThumbCanGrab);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
SGPawn->OnTouchStateUpdated().AddWeakLambda(
|
||||
this, [=](const FSGTouchState& TouchState) -> void
|
||||
{
|
||||
Pimpl->UpdateHapticsFeedback(TouchState);
|
||||
});
|
||||
}
|
||||
|
||||
ASGPlayerController::FImpl::FImpl(ASGPlayerController* InOwner)
|
||||
: Owner(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)
|
||||
{
|
||||
if (!IsValid(TouchState.Hand))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
USGHapticGlove* Glove = TouchState.Hand->GetConnectedGlove();
|
||||
if (!IsValid(Glove))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const USGBuzzCommand* BuzzCommand{
|
||||
GetBuzzCommand(
|
||||
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
|
||||
TouchState.ActorRingTouching,TouchState.ActorPinkyTouching)
|
||||
};
|
||||
if (IsValid(BuzzCommand))
|
||||
{
|
||||
Glove->SendHaptics(BuzzCommand);
|
||||
|
||||
const float Duration = FImpl::GetBuzzDuration(
|
||||
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
|
||||
TouchState. ActorRingTouching, TouchState.ActorPinkyTouching);
|
||||
|
||||
Owner->GetWorldTimerManager().ClearTimer(TouchBuzzStopTimer);
|
||||
|
||||
FTimerDelegate TouchBuzzStopHandler;
|
||||
TouchBuzzStopHandler.BindLambda([=]()-> void
|
||||
{
|
||||
Glove->SendHaptics(USGBuzzCommand::Off(Owner));
|
||||
});
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
void ASGPlayerController::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,703 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/GameFramework/SGVirtualHandActor.h"
|
||||
|
||||
#include "Components/SphereComponent.h"
|
||||
|
||||
#include "SenseGlove/Components/SGGrabComponent.h"
|
||||
#include "SenseGlove/Components/SGTouchComponent.h"
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||
|
||||
struct ASGVirtualHandActor::FImpl
|
||||
{
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
ASGVirtualHandActor* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(ASGVirtualHandActor* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void BindFingerGrabOverlapEvents();
|
||||
void UnbindFingerGrabOverlapEvents();
|
||||
|
||||
void BindFingerTouchOverlapEvents();
|
||||
void UnbindFingerTouchOverlapEvents();
|
||||
|
||||
bool IsFingerGrabbing(AActor* Actor) const;
|
||||
bool IsFingerTouching(AActor* Actor) const;
|
||||
};
|
||||
|
||||
ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
|
||||
SceneRoot = CreateDefaultSubobject<USceneComponent>(TEXT("SceneRoot"));
|
||||
SetRootComponent(SceneRoot);
|
||||
|
||||
VirtualHand = CreateDefaultSubobject<USGVirtualHandComponent>(TEXT("VirtualHand"));
|
||||
VirtualHand->SetupAttachment(RootComponent);
|
||||
VirtualHand->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
|
||||
false, nullptr, ETeleportType::None);
|
||||
|
||||
ThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("ThumbFingertipGrabCollider"));
|
||||
ThumbFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetThumbFingertipGrabSocketName());
|
||||
ThumbFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
|
||||
ThumbFingertipGrabCollider->SetCastShadow(false);
|
||||
ThumbFingertipGrabCollider->bCastDynamicShadow = false;
|
||||
ThumbFingertipGrabCollider->SetReceivesDecals(true);
|
||||
ThumbFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
||||
ThumbFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
ThumbFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
ThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
IndexFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("IndexFingertipGrabCollider"));
|
||||
IndexFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
|
||||
IndexFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetIndexFingertipGrabSocketName());
|
||||
IndexFingertipGrabCollider->SetCastShadow(false);
|
||||
IndexFingertipGrabCollider->bCastDynamicShadow = false;
|
||||
IndexFingertipGrabCollider->SetReceivesDecals(true);
|
||||
IndexFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
||||
IndexFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
IndexFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
IndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
MiddleFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("MiddleFingertipGrabCollider"));
|
||||
MiddleFingertipGrabCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsGrabColliderSize());
|
||||
MiddleFingertipGrabCollider->SetupAttachment(VirtualHand, VirtualHand->GetMiddleFingertipGrabSocketName());
|
||||
MiddleFingertipGrabCollider->SetCastShadow(false);
|
||||
MiddleFingertipGrabCollider->bCastDynamicShadow = false;
|
||||
MiddleFingertipGrabCollider->SetReceivesDecals(true);
|
||||
MiddleFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
||||
MiddleFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
MiddleFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
MiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
ThumbFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("ThumbFingertipTouchCollider"));
|
||||
ThumbFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetThumbFingertipTouchSocketName());
|
||||
ThumbFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
|
||||
ThumbFingertipTouchCollider->SetCastShadow(false);
|
||||
ThumbFingertipTouchCollider->bCastDynamicShadow = false;
|
||||
ThumbFingertipTouchCollider->SetReceivesDecals(true);
|
||||
ThumbFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
||||
ThumbFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
ThumbFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
ThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
IndexFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("IndexFingertipTouchCollider"));
|
||||
IndexFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
|
||||
IndexFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetIndexFingertipTouchSocketName());
|
||||
IndexFingertipTouchCollider->SetCastShadow(false);
|
||||
IndexFingertipTouchCollider->bCastDynamicShadow = false;
|
||||
IndexFingertipTouchCollider->SetReceivesDecals(true);
|
||||
IndexFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
||||
IndexFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
IndexFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
IndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
MiddleFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("MiddleFingertipTouchCollider"));
|
||||
MiddleFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
|
||||
MiddleFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetMiddleFingertipTouchSocketName());
|
||||
MiddleFingertipTouchCollider->SetCastShadow(false);
|
||||
MiddleFingertipTouchCollider->bCastDynamicShadow = false;
|
||||
MiddleFingertipTouchCollider->SetReceivesDecals(true);
|
||||
MiddleFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
||||
MiddleFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
MiddleFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
MiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
RingFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("RingFingertipTouchCollider"));
|
||||
RingFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
|
||||
RingFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetRingFingertipTouchSocketName());
|
||||
RingFingertipTouchCollider->SetCastShadow(false);
|
||||
RingFingertipTouchCollider->bCastDynamicShadow = false;
|
||||
RingFingertipTouchCollider->SetReceivesDecals(true);
|
||||
RingFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
||||
RingFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
RingFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
RingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
PinkyFingertipTouchCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
||||
this, TEXT("PinkyFingertipTouchCollider"));
|
||||
PinkyFingertipTouchCollider->SetRelativeScale3D(VirtualHand->GetDefaultFingertipsTouchColliderSize());
|
||||
PinkyFingertipTouchCollider->SetupAttachment(VirtualHand, VirtualHand->GetPinkyFingertipTouchSocketName());
|
||||
PinkyFingertipTouchCollider->SetCastShadow(false);
|
||||
PinkyFingertipTouchCollider->bCastDynamicShadow = false;
|
||||
PinkyFingertipTouchCollider->SetReceivesDecals(true);
|
||||
PinkyFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
||||
PinkyFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
||||
PinkyFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
||||
PinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
||||
|
||||
WristTracker = CreateDefaultSubobject<USGWristTrackerComponent>(TEXT("WristTracker"));
|
||||
WristTracker->SetupAttachment(RootComponent);
|
||||
|
||||
WristTracker->SetRight(VirtualHand->IsRight());
|
||||
|
||||
GrabState = FSGGrabState(VirtualHand, nullptr, nullptr, nullptr, nullptr);
|
||||
TouchState = FSGTouchState(VirtualHand, nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
(WristTracker->IsLeft() && VirtualHand->IsLeft())
|
||||
|| (WristTracker->IsRight() && VirtualHand->IsRight()),
|
||||
TEXT("The virtual hand component and the wrist tracker component do not track the same hand!"));
|
||||
|
||||
WristTracker->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
|
||||
{
|
||||
VirtualHand->SetWorldLocation(Location);
|
||||
});
|
||||
|
||||
WristTracker->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
|
||||
{
|
||||
VirtualHand->SetWorldRotation(Rotation);
|
||||
});
|
||||
|
||||
Pimpl->BindFingerGrabOverlapEvents();
|
||||
Pimpl->BindFingerTouchOverlapEvents();
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
Super::EndPlay(EndPlayReason);
|
||||
|
||||
Pimpl->UnbindFingerGrabOverlapEvents();
|
||||
Pimpl->UnbindFingerTouchOverlapEvents();
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::PreInitializeComponents()
|
||||
{
|
||||
Super::PreInitializeComponents();
|
||||
|
||||
WristTracker->SetRight(VirtualHand->IsRight());
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
||||
{
|
||||
GrabState.ActorThumbCanGrab = OtherActor;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (GrabState.ActorThumbCanGrab == OtherActor)
|
||||
{
|
||||
GrabState.ActorThumbCanGrab = nullptr;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
||||
{
|
||||
GrabState.ActorIndexCanGrab = OtherActor;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (GrabState.ActorIndexCanGrab == OtherActor)
|
||||
{
|
||||
GrabState.ActorIndexCanGrab = nullptr;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
||||
{
|
||||
GrabState.ActorMiddleCanGrab = OtherActor;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (GrabState.ActorMiddleCanGrab == OtherActor)
|
||||
{
|
||||
GrabState.ActorMiddleCanGrab = nullptr;
|
||||
GrabStateUpdatedEvent.Broadcast(GrabState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
||||
{
|
||||
TouchState.ActorThumbTouching = OtherActor;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (TouchState.ActorThumbTouching == OtherActor)
|
||||
{
|
||||
TouchState.ActorThumbTouching = nullptr;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
||||
{
|
||||
TouchState.ActorIndexTouching = OtherActor;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (TouchState.ActorIndexTouching == OtherActor)
|
||||
{
|
||||
TouchState.ActorIndexTouching = nullptr;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
(void) bFromSweep;
|
||||
(void) SweepResult;
|
||||
|
||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
||||
{
|
||||
TouchState.ActorMiddleTouching = OtherActor;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (TouchState.ActorMiddleTouching == OtherActor)
|
||||
{
|
||||
TouchState.ActorMiddleTouching = nullptr;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
||||
{
|
||||
TouchState.ActorRingTouching = OtherActor;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (TouchState.ActorRingTouching == OtherActor)
|
||||
{
|
||||
TouchState.ActorRingTouching = nullptr;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex,
|
||||
const bool bFromSweep,
|
||||
const FHitResult& SweepResult)
|
||||
{
|
||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
||||
{
|
||||
TouchState.ActorPinkyTouching = OtherActor;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
const int32 OtherBodyIndex)
|
||||
{
|
||||
(void) OverlappedComponent;
|
||||
(void) OtherComp;
|
||||
(void) OtherBodyIndex;
|
||||
|
||||
if (TouchState.ActorPinkyTouching == OtherActor)
|
||||
{
|
||||
TouchState.ActorPinkyTouching = nullptr;
|
||||
TouchStateUpdatedEvent.Broadcast(TouchState);
|
||||
}
|
||||
}
|
||||
|
||||
bool ASGVirtualHandActor::IsLeft() const
|
||||
{
|
||||
return WristTracker->IsLeft() && VirtualHand->IsLeft();
|
||||
}
|
||||
|
||||
bool ASGVirtualHandActor::IsRight() const
|
||||
{
|
||||
return WristTracker->IsRight() && VirtualHand->IsRight();
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::SetRight(const bool bRight)
|
||||
{
|
||||
WristTracker->SetRight(bRight);
|
||||
VirtualHand->SetRight(bRight);
|
||||
}
|
||||
|
||||
bool ASGVirtualHandActor::IsGloveConnected() const
|
||||
{
|
||||
return VirtualHand->IsGloveConnected();
|
||||
}
|
||||
|
||||
ASGVirtualHandActor::FImpl::FImpl(ASGVirtualHandActor* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::FImpl::BindFingerGrabOverlapEvents()
|
||||
{
|
||||
Owner->ThumbFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins);
|
||||
Owner->ThumbFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds);
|
||||
|
||||
Owner->IndexFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins);
|
||||
Owner->IndexFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds);
|
||||
|
||||
Owner->MiddleFingertipGrabCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins);
|
||||
Owner->MiddleFingertipGrabCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds);
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::FImpl::UnbindFingerGrabOverlapEvents()
|
||||
{
|
||||
Owner->ThumbFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapBegins);
|
||||
Owner->ThumbFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipGrabColliderOverlapEnds);
|
||||
|
||||
Owner->IndexFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapBegins);
|
||||
Owner->IndexFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipGrabColliderOverlapEnds);
|
||||
|
||||
Owner->MiddleFingertipGrabCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapBegins);
|
||||
Owner->MiddleFingertipGrabCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipGrabColliderOverlapEnds);
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::FImpl::BindFingerTouchOverlapEvents()
|
||||
{
|
||||
Owner->ThumbFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins);
|
||||
Owner->ThumbFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->IndexFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins);
|
||||
Owner->IndexFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->MiddleFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins);
|
||||
Owner->MiddleFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->RingFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins);
|
||||
Owner->RingFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->PinkyFingertipTouchCollider->OnComponentBeginOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins);
|
||||
Owner->PinkyFingertipTouchCollider->OnComponentEndOverlap.AddDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds);
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::FImpl::UnbindFingerTouchOverlapEvents()
|
||||
{
|
||||
Owner->ThumbFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapBegins);
|
||||
Owner->ThumbFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnThumbFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->IndexFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapBegins);
|
||||
Owner->IndexFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnIndexFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->MiddleFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapBegins);
|
||||
Owner->MiddleFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnMiddleFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->RingFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapBegins);
|
||||
Owner->RingFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnRingFingertipTouchColliderOverlapEnds);
|
||||
|
||||
Owner->PinkyFingertipTouchCollider->OnComponentBeginOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapBegins);
|
||||
Owner->PinkyFingertipTouchCollider->OnComponentEndOverlap.RemoveDynamic(
|
||||
Owner, &ASGVirtualHandActor::OnPinkyFingertipTouchColliderOverlapEnds);
|
||||
}
|
||||
|
||||
ASGVirtualHandActor::FImpl::~FImpl() = default;
|
||||
|
||||
void ASGVirtualHandActor::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Haptics/SGGrabState.h"
|
||||
|
||||
#include "GameFramework/Actor.h"
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
|
||||
FSGGrabState::FSGGrabState()
|
||||
: Hand(nullptr),
|
||||
ActorThumbCanGrab(nullptr),
|
||||
ActorIndexCanGrab(nullptr),
|
||||
ActorMiddleCanGrab(nullptr),
|
||||
GrabbedActor(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
FSGGrabState::FSGGrabState(USGVirtualHandComponent* InHand,
|
||||
AActor* InActorThumbCanGrab,
|
||||
AActor* InActorIndexCanGrab,
|
||||
AActor* InActorMiddleCanGrab,
|
||||
AActor* InGrabbedActor)
|
||||
: Hand(InHand),
|
||||
ActorThumbCanGrab(InActorThumbCanGrab),
|
||||
ActorIndexCanGrab(InActorIndexCanGrab),
|
||||
ActorMiddleCanGrab(InActorMiddleCanGrab),
|
||||
GrabbedActor(InGrabbedActor)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "SenseGlove/Haptics/SGTouchState.h"
|
||||
|
||||
#include "GameFramework/Actor.h"
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
|
||||
FSGTouchState::FSGTouchState()
|
||||
: Hand(nullptr),
|
||||
ActorThumbTouching(nullptr),
|
||||
ActorIndexTouching(nullptr),
|
||||
ActorMiddleTouching(nullptr),
|
||||
ActorRingTouching(nullptr),
|
||||
ActorPinkyTouching(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
FSGTouchState::FSGTouchState(USGVirtualHandComponent* InHand,
|
||||
AActor* InActorThumbTouching,
|
||||
AActor* InActorIndexTouching,
|
||||
AActor* InActorMiddleTouching,
|
||||
AActor* InActorRingTouching,
|
||||
AActor* InActorPinkyTouching)
|
||||
: Hand(InHand),
|
||||
ActorThumbTouching(InActorThumbTouching),
|
||||
ActorIndexTouching(InActorIndexTouching),
|
||||
ActorMiddleTouching(InActorMiddleTouching),
|
||||
ActorRingTouching(InActorRingTouching),
|
||||
ActorPinkyTouching(InActorPinkyTouching)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Animation/AnimInstance.h"
|
||||
|
||||
#include "SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h"
|
||||
|
||||
#include "SGVirtualHandAnimInstance.generated.h"
|
||||
|
||||
UCLASS(Transient, Blueprintable, BlueprintType, meta=(BlueprintThreadSafe), Within=SkeletalMeshComponent)
|
||||
class SENSEGLOVE_API USGVirtualHandAnimInstance : public UAnimInstance
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
protected:
|
||||
virtual FSGVirtualHandAnimInstanceProxy* CreateAnimInstanceProxy() override;
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Animation/AnimInstanceProxy.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/NameTypes.h"
|
||||
|
||||
#include "SGVirtualHandAnimInstanceProxy.generated.h"
|
||||
|
||||
USTRUCT()
|
||||
struct SENSEGLOVE_API FSGVirtualHandAnimInstanceProxy : public FAnimInstanceProxy
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
TMap<FName, FRotator> BonesRotations;
|
||||
|
||||
public:
|
||||
FSGVirtualHandAnimInstanceProxy();
|
||||
FSGVirtualHandAnimInstanceProxy(UAnimInstance* Instance);
|
||||
|
||||
protected:
|
||||
virtual void PreEvaluateAnimation(UAnimInstance* InAnimInstance) override;
|
||||
|
||||
virtual bool Evaluate(FPoseContext& Output) override;
|
||||
};
|
||||
@@ -0,0 +1,199 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Components/SceneComponent.h"
|
||||
#include "Engine/EngineTypes.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/NameTypes.h"
|
||||
|
||||
#include "SGGrabComponent.generated.h"
|
||||
|
||||
class AActor;
|
||||
|
||||
UCLASS(Blueprintable, BlueprintType, meta=(BlueprintSpawnableComponent))
|
||||
class SENSEGLOVE_API USGGrabComponent : public USceneComponent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
static USGGrabComponent* GetGrabComponent(const AActor* Actor);
|
||||
|
||||
static bool IsGrabbable(const AActor* Actor);
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentLocationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentRotationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EAttachmentRule AttachmentScaleRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bAttachmentWeldSimulatedBodies : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
FName AttachmentSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EDetachmentRule DetachmentLocationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EDetachmentRule DetachmentRotationRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
EDetachmentRule DetachmentScaleRule;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bDetachmentCallModify : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bAffectPhysicsState : 1;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
FORCEINLINE EAttachmentRule GetAttachmentLocationRule() const
|
||||
{
|
||||
return AttachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentLocationRule(const EAttachmentRule InAttachmentLocationRule)
|
||||
{
|
||||
AttachmentLocationRule = InAttachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EAttachmentRule GetAttachmentRotationRule() const
|
||||
{
|
||||
return AttachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentRotationRule(const EAttachmentRule InAttachmentRotationRule)
|
||||
{
|
||||
AttachmentRotationRule = InAttachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EAttachmentRule GetAttachmentScaleRule() const
|
||||
{
|
||||
return AttachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentScaleRule(const EAttachmentRule InAttachmentScaleRule)
|
||||
{
|
||||
AttachmentScaleRule = InAttachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE bool GetAttachmentWeldSimulatedBodies() const
|
||||
{
|
||||
return !!bAttachmentWeldSimulatedBodies;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentWeldSimulatedBodies(const bool bInAttachmentWeldSimulatedBodies)
|
||||
{
|
||||
bAttachmentWeldSimulatedBodies = bInAttachmentWeldSimulatedBodies;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetAttachmentSocketName() const
|
||||
{
|
||||
return AttachmentSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAttachmentSocketName(const FName& InAttachmentSocketName)
|
||||
{
|
||||
AttachmentSocketName = InAttachmentSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE EDetachmentRule GetDetachmentLocationRule() const
|
||||
{
|
||||
return DetachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetDetachmentLocationRule(const EDetachmentRule InDetachmentLocationRule)
|
||||
{
|
||||
DetachmentLocationRule = InDetachmentLocationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EDetachmentRule GetDetachmentRotationRule() const
|
||||
{
|
||||
return DetachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetDetachmentRotationRule(const EDetachmentRule InDetachmentRotationRule)
|
||||
{
|
||||
DetachmentRotationRule = InDetachmentRotationRule;
|
||||
}
|
||||
|
||||
FORCEINLINE EDetachmentRule GetDetachmentScaleRule() const
|
||||
{
|
||||
return DetachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetDetachmentScaleRule(const EDetachmentRule InDetachmentScaleRule)
|
||||
{
|
||||
DetachmentScaleRule = InDetachmentScaleRule;
|
||||
}
|
||||
|
||||
FORCEINLINE bool GetDetachmentInCallModify() const
|
||||
{
|
||||
return !!bDetachmentCallModify;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetDetachmentInCallModify(const bool bInDetachmentCallModify)
|
||||
{
|
||||
bDetachmentCallModify = bInDetachmentCallModify;
|
||||
}
|
||||
|
||||
FORCEINLINE bool GetAffectPhysicsState() const
|
||||
{
|
||||
return !!bAffectPhysicsState;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAffectPhysicsState(const bool bInAffectPhysicsState)
|
||||
{
|
||||
bAffectPhysicsState = bInAffectPhysicsState;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Components/SceneComponent.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGTouchComponent.generated.h"
|
||||
|
||||
class AActor;
|
||||
|
||||
UCLASS(Blueprintable, BlueprintType, meta=(BlueprintSpawnableComponent))
|
||||
class SENSEGLOVE_API USGTouchComponent : public USceneComponent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
static USGTouchComponent* GetTouchComponent(const AActor* Actor);
|
||||
|
||||
static bool IsTouchable(const AActor* Actor);
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
||||
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100"))
|
||||
int32 BuzzLevel;
|
||||
|
||||
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;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
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
|
||||
{
|
||||
return ForceFeedbackLevel;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetForceFeedbackLevel(const int32 Level)
|
||||
{
|
||||
ForceFeedbackLevel = Level;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,317 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Containers/Array.h"
|
||||
#include "Components/SkeletalMeshComponent.h"
|
||||
#include "Containers/Map.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "Math/Rotator.h"
|
||||
#include "Math/Transform.h"
|
||||
#include "ReferenceSkeleton.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/NameTypes.h"
|
||||
|
||||
#include "SGSettings/SGDebugVirtualHandSettings.h"
|
||||
|
||||
#include "SGVirtualHandComponent.generated.h"
|
||||
|
||||
class USphereComponent;
|
||||
class USkeletalMesh;
|
||||
|
||||
class USGHandPose;
|
||||
class USGHapticGlove;
|
||||
class USGWristTrackerComponent;
|
||||
|
||||
UCLASS(Config=Engine, Blueprintable, ClassGroup=(Rendering, Common), hidecategories=(Object, "Mesh|SkeletalAsset"),
|
||||
editinlinenew, meta=(BlueprintSpawnableComponent))
|
||||
class SENSEGLOVE_API USGVirtualHandComponent : public USkeletalMeshComponent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
static const TArray<TArray<FName>>& GetLeftHandFingerBoneNames();
|
||||
static const TArray<TArray<FName>>& GetRightHandFingerBoneNames();
|
||||
|
||||
static const FName& GetLeftHandFingerBoneName(int32 Finger, int32 Joint);
|
||||
static const FName& GetRightHandFingerBoneName(int32 Finger, int32 Joint);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bRight : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Haptics", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bAutoStopAllHapticsOnEndPlay : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
|
||||
FName GrabSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
|
||||
FVector DefaultFingertipsGrabColliderSize;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
|
||||
FName ThumbFingertipGrabSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
|
||||
FName IndexFingertipGrabSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
|
||||
FName MiddleFingertipGrabSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FVector DefaultFingertipsTouchColliderSize;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FName ThumbFingertipTouchSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FName IndexFingertipTouchSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FName MiddleFingertipTouchSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FName RingFingertipTouchSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
|
||||
FName PinkyFingertipTouchSocketName;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bHiddenInGameIfNoGloveDetected : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove",
|
||||
meta=(AllowPrivateAccess="false", EditCondition="bDrawDebugVirtualHand", EditConditionHides))
|
||||
FSGDebugVirtualHandSettings DebugVirtualHandSettings;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
uint8 bBackendInitialized : 1;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
USGHapticGlove* Glove;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
USGWristTrackerComponent* WristTracker;
|
||||
|
||||
public:
|
||||
FORCEINLINE bool IsLeft() const
|
||||
{
|
||||
return !IsRight();
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return !!bRight;
|
||||
}
|
||||
|
||||
void SetRight(const bool bInRight);
|
||||
|
||||
FORCEINLINE bool AutoStopsAllHapticsOnEndPlay() const
|
||||
{
|
||||
return !!bAutoStopAllHapticsOnEndPlay;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetAutoStopAllHapticsOnEndPlay(const bool bInAutoStopAllHapticsOnEndPlay)
|
||||
{
|
||||
bAutoStopAllHapticsOnEndPlay = bInAutoStopAllHapticsOnEndPlay;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetGrabSocketName() const
|
||||
{
|
||||
return GrabSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FVector& GetDefaultFingertipsGrabColliderSize() const
|
||||
{
|
||||
return DefaultFingertipsGrabColliderSize;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetThumbFingertipGrabSocketName() const
|
||||
{
|
||||
return ThumbFingertipGrabSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetThumbFingertipGrabSocketName(const FName& SocketName)
|
||||
{
|
||||
ThumbFingertipGrabSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetIndexFingertipGrabSocketName() const
|
||||
{
|
||||
return IndexFingertipGrabSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetIndexFingertipGrabSocketName(const FName& SocketName)
|
||||
{
|
||||
IndexFingertipGrabSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetMiddleFingertipGrabSocketName() const
|
||||
{
|
||||
return MiddleFingertipGrabSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetMiddleFingertipGrabSocketName(const FName& SocketName)
|
||||
{
|
||||
MiddleFingertipGrabSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FVector& GetDefaultFingertipsTouchColliderSize() const
|
||||
{
|
||||
return DefaultFingertipsTouchColliderSize;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetThumbFingertipTouchSocketName() const
|
||||
{
|
||||
return ThumbFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetThumbFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
ThumbFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetIndexFingertipTouchSocketName() const
|
||||
{
|
||||
return IndexFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetIndexFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
IndexFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetMiddleFingertipTouchSocketName() const
|
||||
{
|
||||
return MiddleFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetMiddleFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
MiddleFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetRingFingertipTouchSocketName() const
|
||||
{
|
||||
return RingFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetRingFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
RingFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE const FName& GetPinkyFingertipTouchSocketName() const
|
||||
{
|
||||
return PinkyFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetPinkyFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
PinkyFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsHiddenInGameIfNoGloveDetected() const
|
||||
{
|
||||
return !!bHiddenInGameIfNoGloveDetected;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetHiddenIfNoGloveDetected(const bool bInHiddenIfNoGloveDetected)
|
||||
{
|
||||
bHiddenInGameIfNoGloveDetected = bInHiddenIfNoGloveDetected;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetWristTracker(USGWristTrackerComponent* InWristTracker)
|
||||
{
|
||||
WristTracker = InWristTracker;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void SetAnimClass(class UClass* NewClass) override;
|
||||
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
#if WITH_EDITOR
|
||||
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
virtual void InitializeComponent() override;
|
||||
|
||||
virtual void UninitializeComponent() override;
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||||
|
||||
virtual void TickComponent(float DeltaTime,
|
||||
enum ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
virtual void SetSkeletalMesh(USkeletalMesh* NewMesh, bool bReinitPose = true) override;
|
||||
|
||||
protected:
|
||||
virtual void EditorTick(float DeltaTime,
|
||||
enum ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction);
|
||||
|
||||
public:
|
||||
bool IsGloveConnected() const;
|
||||
|
||||
FORCEINLINE USGHapticGlove* GetConnectedGlove() const
|
||||
{
|
||||
return Glove;
|
||||
}
|
||||
|
||||
USGHandPose* GetHandPose();
|
||||
|
||||
public:
|
||||
const FName& GetFingerBoneName(int32 Finger, int32 Joint) const;
|
||||
const FTransform& GetFingerBoneRefTransform(int32 Finger, int32 Joint) const;
|
||||
|
||||
FRotator GetFingerBoneRefRotation(int32 Finger, int32 Joint) const;
|
||||
TMap<FName, FRotator> GetFingersBonesRotations();
|
||||
};
|
||||
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "GameFramework/Actor.h"
|
||||
#include "Math/Rotator.h"
|
||||
#include "Math/Vector.h"
|
||||
#include "MotionControllerComponent.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGSettings/SGDebugGizmoSettings.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
|
||||
#include "SGWristTrackerComponent.generated.h"
|
||||
|
||||
class USGHandPose;
|
||||
class USGHapticGlove;
|
||||
|
||||
UCLASS(Blueprintable, ClassGroup = MotionController, meta = (BlueprintSpawnableComponent))
|
||||
class SENSEGLOVE_API USGWristTrackerComponent : public UMotionControllerComponent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_OneParam(USGWristTrackerComponent, FWristLocationChangedEvent, const FVector&)
|
||||
|
||||
FWristLocationChangedEvent& OnWristLocationChanged()
|
||||
{
|
||||
return WristLocationChangedEvent;
|
||||
};
|
||||
|
||||
DECLARE_EVENT_OneParam(USGWristTrackerComponent, FWristRotationChangedEvent, const FRotator&)
|
||||
|
||||
FWristRotationChangedEvent& OnWristRotationChanged()
|
||||
{
|
||||
return WristRotationChangedEvent;
|
||||
};
|
||||
|
||||
DECLARE_EVENT_TwoParams(USGWristTrackerComponent, FWristLocationAndRotationChangedEvent,
|
||||
const FVector&, const FRotator&)
|
||||
|
||||
FWristLocationAndRotationChangedEvent& OnWristLocationAndRotationChanged()
|
||||
{
|
||||
return WristLocationAndRotationChangedEvent;
|
||||
};
|
||||
|
||||
private:
|
||||
FWristLocationChangedEvent WristLocationChangedEvent;
|
||||
FWristRotationChangedEvent WristRotationChangedEvent;
|
||||
FWristLocationAndRotationChangedEvent WristLocationAndRotationChangedEvent;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings")
|
||||
uint8 bOverridePluginWristTrackingSettings : 1;
|
||||
|
||||
/**
|
||||
* If set to Custom, any desired location and rotation can be specified.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingSettings", EditConditionHides))
|
||||
ESGPositionalTrackingHardware TrackingHardware;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition=
|
||||
"bOverridePluginWristTrackingSettings && TrackingHardware == ESGPositionalTrackingHardware::Custom",
|
||||
EditConditionHides))
|
||||
FVector TrackingHardwareLocationOffset;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition=
|
||||
"bOverridePluginWristTrackingSettings && TrackingHardware == ESGPositionalTrackingHardware::Custom",
|
||||
EditConditionHides))
|
||||
FRotator TrackingHardwareRotationOffset;
|
||||
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings")
|
||||
uint8 bOverridePluginWristTrackingDebugSettings : 1;
|
||||
|
||||
/**
|
||||
* If enabled, draws debug Wrist trackers where possible.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings", EditConditionHides))
|
||||
uint8 bDrawWristTrackerDebugGizmo : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawWristTrackerDebugGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawWristTrackerDebugGizmo",
|
||||
EditConditionHides))
|
||||
FSGDebugGizmoSettings WristTrackerDebugGizmoSettings;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
uint8 bBackendInitialized : 1;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
USGHapticGlove* Glove;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FVector WristLocation;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FRotator WristRotation;
|
||||
|
||||
public:
|
||||
FORCEINLINE bool OverridesPluginWristTrackingSettings() const
|
||||
{
|
||||
return !!bOverridePluginWristTrackingSettings;
|
||||
}
|
||||
|
||||
FORCEINLINE void OverridePluginWristTrackingSettings(const bool bInOverridePluginWristTrackingSettings)
|
||||
{
|
||||
bOverridePluginWristTrackingSettings = bInOverridePluginWristTrackingSettings;
|
||||
}
|
||||
|
||||
ESGPositionalTrackingHardware GetTrackingHardware() const;
|
||||
void SetTrackingHardware(ESGPositionalTrackingHardware InTrackingHardware);
|
||||
|
||||
const FVector& GetTrackingHardwareLocationOffset() const;
|
||||
void SetTrackingHardwareLocationOffset(const FVector& InTrackingHardwareLocationOffset);
|
||||
|
||||
const FRotator& GetTrackingHardwareRotationOffset() const;
|
||||
void SetTrackingHardwareRotationOffset(const FRotator& InTrackingHardwareRotationOffset);
|
||||
|
||||
FORCEINLINE bool OverridesPluginWristTrackingDebugSettings() const
|
||||
{
|
||||
return !!bOverridePluginWristTrackingDebugSettings;
|
||||
}
|
||||
|
||||
FORCEINLINE void OverridePluginWristTrackingDebugSettings(const bool bInOverridePluginWristTrackingDebugSettings)
|
||||
{
|
||||
bOverridePluginWristTrackingDebugSettings = bInOverridePluginWristTrackingDebugSettings;
|
||||
}
|
||||
|
||||
bool GetDrawWristTrackerDebugGizmo() const;
|
||||
void SetDrawWristTrackerDebugGizmo(bool bInDrawWristTrackerDebugGizmo);
|
||||
|
||||
const FSGDebugGizmoSettings& GetWristTrackerDebugGizmoSettings() const;
|
||||
void SetWristTrackerDebugGizmoSettings(const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
|
||||
|
||||
FORCEINLINE bool IsLeft() const
|
||||
{
|
||||
return GetTrackingSource() == EControllerHand::Left;
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return GetTrackingSource() == EControllerHand::Right;
|
||||
}
|
||||
|
||||
void SetRight(const bool bRight);
|
||||
|
||||
FORCEINLINE const FVector& GetWristLocation() const
|
||||
{
|
||||
return WristLocation;
|
||||
}
|
||||
|
||||
FORCEINLINE const FRotator& GetWristRotation() const
|
||||
{
|
||||
return WristRotation;
|
||||
}
|
||||
|
||||
public:
|
||||
#if WITH_EDITOR
|
||||
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
virtual void InitializeComponent() override;
|
||||
|
||||
virtual void UninitializeComponent() override;
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||||
|
||||
virtual void TickComponent(float DeltaTime,
|
||||
enum ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
protected:
|
||||
virtual void EditorTick(float DeltaTime,
|
||||
enum ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction);
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "GameFramework/GameModeBase.h"
|
||||
|
||||
#include "SGGameModeBase.generated.h"
|
||||
|
||||
UCLASS(Config=Game, NotPlaceable, BlueprintType, Blueprintable, Transient)
|
||||
class SENSEGLOVE_API ASGGameModeBase : public AGameModeBase
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
};
|
||||
@@ -0,0 +1,612 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "GameFramework/Pawn.h"
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SenseGlove/Haptics/SGGrabState.h"
|
||||
#include "SenseGlove/Haptics/SGTouchState.h"
|
||||
|
||||
#include "SGPawn.generated.h"
|
||||
|
||||
class UCameraComponent;
|
||||
class UPrimitiveComponent;
|
||||
class USphereComponent;
|
||||
|
||||
class USGVirtualHandComponent;
|
||||
class USGWristTrackerComponent;
|
||||
|
||||
UCLASS(Config=Game, BlueprintType, Blueprintable)
|
||||
class SENSEGLOVE_API ASGPawn : public APawn
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FGrabStateUpdatedEvent, const FSGGrabState& GrabState);
|
||||
|
||||
FGrabStateUpdatedEvent& OnGrabStateUpdated()
|
||||
{
|
||||
return GrabStateUpdatedEvent;
|
||||
};
|
||||
|
||||
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FTouchStateUpdatedEvent, const FSGTouchState& TouchState)
|
||||
|
||||
FTouchStateUpdatedEvent& OnTouchStateUpdated()
|
||||
{
|
||||
return TouchStateUpdatedEvent;
|
||||
};
|
||||
|
||||
private:
|
||||
FGrabStateUpdatedEvent GrabStateUpdatedEvent;
|
||||
FTouchStateUpdatedEvent TouchStateUpdatedEvent;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USceneComponent* SceneRoot;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
UCameraComponent* Camera;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGWristTrackerComponent* WristTrackerLeft;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGVirtualHandComponent* HandLeft;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftThumbFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftIndexFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftMiddleFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftThumbFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftIndexFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftMiddleFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftRingFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* LeftPinkyFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGWristTrackerComponent* WristTrackerRight;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGVirtualHandComponent* HandRight;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightThumbFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightIndexFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightMiddleFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightThumbFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightIndexFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightMiddleFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightRingFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RightPinkyFingertipTouchCollider;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
FSGGrabState LeftHandGrabState;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FSGTouchState LeftHandTouchState;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FSGGrabState RightHandGrabState;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FSGTouchState RightHandTouchState;
|
||||
|
||||
public:
|
||||
FORCEINLINE UCameraComponent* GetCamera() const
|
||||
{
|
||||
return Camera;
|
||||
}
|
||||
|
||||
FORCEINLINE USGWristTrackerComponent* GetWristTrackerLeft() const
|
||||
{
|
||||
return WristTrackerLeft;
|
||||
}
|
||||
|
||||
FORCEINLINE USGVirtualHandComponent* GetHandLeft() const
|
||||
{
|
||||
return HandLeft;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftThumbFingertipGrabCollider() const
|
||||
{
|
||||
return LeftThumbFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftIndexFingertipGrabCollider() const
|
||||
{
|
||||
return LeftIndexFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftMiddleFingertipGrabCollider() const
|
||||
{
|
||||
return LeftMiddleFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftThumbFingertipTouchCollider() const
|
||||
{
|
||||
return LeftThumbFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftIndexFingertipTouchCollider() const
|
||||
{
|
||||
return LeftIndexFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftMiddleFingertipTouchCollider() const
|
||||
{
|
||||
return LeftMiddleFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftRingFingertipTouchCollider() const
|
||||
{
|
||||
return LeftRingFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetLeftPinkyFingertipTouchCollider() const
|
||||
{
|
||||
return LeftPinkyFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USGWristTrackerComponent* GetWristTrackerRight() const
|
||||
{
|
||||
return WristTrackerRight;
|
||||
}
|
||||
|
||||
FORCEINLINE USGVirtualHandComponent* GetHandRight() const
|
||||
{
|
||||
return HandRight;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightThumbFingertipGrabCollider() const
|
||||
{
|
||||
return RightThumbFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightIndexFingertipGrabCollider() const
|
||||
{
|
||||
return RightIndexFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightMiddleFingertipGrabCollider() const
|
||||
{
|
||||
return RightMiddleFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightThumbFingertipTouchCollider() const
|
||||
{
|
||||
return RightThumbFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightIndexFingertipTouchCollider() const
|
||||
{
|
||||
return RightIndexFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightMiddleFingertipTouchCollider() const
|
||||
{
|
||||
return RightMiddleFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightRingFingertipTouchCollider() const
|
||||
{
|
||||
return RightRingFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRightPinkyFingertipTouchCollider() const
|
||||
{
|
||||
return RightPinkyFingertipTouchCollider;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void BeginPlay() override;
|
||||
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||||
virtual void PreInitializeComponents() override;
|
||||
|
||||
protected:
|
||||
UFUNCTION()
|
||||
virtual void OnLeftThumbFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftThumbFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftIndexFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftIndexFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftMiddleFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftMiddleFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftThumbFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftThumbFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftIndexFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftIndexFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftMiddleFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftMiddleFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftRingFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftRingFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftPinkyFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnLeftPinkyFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightThumbFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightThumbFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightIndexFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightIndexFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightMiddleFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightMiddleFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightThumbFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightThumbFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightIndexFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightIndexFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightMiddleFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightMiddleFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightRingFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightRingFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightPinkyFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRightPinkyFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
public:
|
||||
FORCEINLINE bool CanLeftHandGrab(const AActor* Actor) const
|
||||
{
|
||||
return !IsLeftHandGrabbing() && ((IsValid(Actor) && Actor == LeftHandGrabState.ActorThumbCanGrab)
|
||||
&& (Actor == LeftHandGrabState.ActorIndexCanGrab || Actor == LeftHandGrabState.ActorMiddleCanGrab));
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsLeftHandGrabbing(const AActor* Actor) const
|
||||
{
|
||||
return IsValid(Actor) && LeftHandGrabState.GrabbedActor == Actor;
|
||||
}
|
||||
|
||||
bool IsLeftHandGrabbing(AActor*& OutActor) const;
|
||||
|
||||
FORCEINLINE bool IsLeftHandGrabbing() const
|
||||
{
|
||||
return IsValid(LeftHandGrabState.GrabbedActor);
|
||||
}
|
||||
|
||||
FORCEINLINE bool CanRightHandGrab(const AActor* Actor) const
|
||||
{
|
||||
return !IsRightHandGrabbing() && ((IsValid(Actor) && Actor == RightHandGrabState.ActorThumbCanGrab)
|
||||
&& (Actor == RightHandGrabState.ActorIndexCanGrab || Actor == RightHandGrabState.ActorMiddleCanGrab));
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRightHandGrabbing(const AActor* Actor) const
|
||||
{
|
||||
return IsValid(Actor) && RightHandGrabState.GrabbedActor == Actor;
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRightHandGrabbing() const
|
||||
{
|
||||
return IsValid(RightHandGrabState.GrabbedActor);
|
||||
}
|
||||
|
||||
bool IsRightHandGrabbing(AActor*& OutActor) const;
|
||||
|
||||
FORCEINLINE bool CanGrab(const USGVirtualHandComponent* Hand, const AActor* Actor) const
|
||||
{
|
||||
return Hand == HandLeft ? CanLeftHandGrab(Actor) : CanRightHandGrab(Actor);
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand, const AActor* Actor) const
|
||||
{
|
||||
return Hand == HandLeft ? IsLeftHandGrabbing(Actor) : IsRightHandGrabbing(Actor);
|
||||
}
|
||||
|
||||
bool IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor) const;
|
||||
|
||||
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand) const
|
||||
{
|
||||
return Hand == HandLeft ? IsLeftHandGrabbing() : IsRightHandGrabbing();
|
||||
}
|
||||
|
||||
public:
|
||||
FORCEINLINE void GrabLeft(AActor* Actor)
|
||||
{
|
||||
Grab(HandLeft, Actor);
|
||||
}
|
||||
|
||||
FORCEINLINE void GrabRight(AActor* Actor)
|
||||
{
|
||||
Grab(HandRight, Actor);
|
||||
}
|
||||
|
||||
void Grab(USGVirtualHandComponent* Hand, AActor* Actor);
|
||||
|
||||
void ReleaseLeft();
|
||||
|
||||
void ReleaseRight();
|
||||
|
||||
FORCEINLINE void Release(const USGVirtualHandComponent* Hand)
|
||||
{
|
||||
return Hand == HandLeft ? ReleaseLeft() : ReleaseRight();
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "GameFramework/PlayerController.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGPlayerController.generated.h"
|
||||
|
||||
UCLASS(Config=Game, BlueprintType, Blueprintable)
|
||||
class SENSEGLOVE_API ASGPlayerController : public APlayerController
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
};
|
||||
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "Containers/Array.h"
|
||||
#include "Containers/Map.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/NameTypes.h"
|
||||
|
||||
#include "SenseGlove/Haptics/SGGrabState.h"
|
||||
#include "SenseGlove/Haptics/SGTouchState.h"
|
||||
|
||||
#include "SGVirtualHandActor.generated.h"
|
||||
|
||||
class USceneComponent;
|
||||
class USkeletalMesh;
|
||||
class USkeleton;
|
||||
class USphereComponent;
|
||||
|
||||
class USGHandPose;
|
||||
class USGVirtualHandComponent;
|
||||
class USGWristTrackerComponent;
|
||||
|
||||
UCLASS(Config=Game, BlueprintType)
|
||||
class SENSEGLOVE_API ASGVirtualHandActor : public AActor
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FGrabStateUpdatedEvent, const FSGGrabState& GrabState);
|
||||
|
||||
FGrabStateUpdatedEvent& OnGrabStateUpdated()
|
||||
{
|
||||
return GrabStateUpdatedEvent;
|
||||
};
|
||||
|
||||
DECLARE_EVENT_OneParam(ASGVirtualHandActor, FTouchStateUpdatedEvent, const FSGTouchState& TouchState)
|
||||
|
||||
FTouchStateUpdatedEvent& OnTouchStateUpdated()
|
||||
{
|
||||
return TouchStateUpdatedEvent;
|
||||
};
|
||||
|
||||
private:
|
||||
FGrabStateUpdatedEvent GrabStateUpdatedEvent;
|
||||
FTouchStateUpdatedEvent TouchStateUpdatedEvent;
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USceneComponent* SceneRoot;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGWristTrackerComponent* WristTracker;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USGVirtualHandComponent* VirtualHand;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* ThumbFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* IndexFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* MiddleFingertipGrabCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* ThumbFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* IndexFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* MiddleFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* RingFingertipTouchCollider;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
USphereComponent* PinkyFingertipTouchCollider;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
FSGGrabState GrabState;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
FSGTouchState TouchState;
|
||||
|
||||
public:
|
||||
FORCEINLINE USGWristTrackerComponent* GetWristTracker() const
|
||||
{
|
||||
return WristTracker;
|
||||
}
|
||||
|
||||
FORCEINLINE USGVirtualHandComponent* GetVirtualHand() const
|
||||
{
|
||||
return VirtualHand;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetThumbFingertipGrabCollider() const
|
||||
{
|
||||
return ThumbFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetIndexFingertipGrabCollider() const
|
||||
{
|
||||
return IndexFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetMiddleFingertipGrabCollider() const
|
||||
{
|
||||
return MiddleFingertipGrabCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetThumbFingertipTouchCollider() const
|
||||
{
|
||||
return ThumbFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetIndexFingertipTouchCollider() const
|
||||
{
|
||||
return IndexFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetMiddleFingertipTouchCollider() const
|
||||
{
|
||||
return MiddleFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetRingFingertipTouchCollider() const
|
||||
{
|
||||
return RingFingertipTouchCollider;
|
||||
}
|
||||
|
||||
FORCEINLINE USphereComponent* GetPinkyFingertipTouchCollider() const
|
||||
{
|
||||
return PinkyFingertipTouchCollider;
|
||||
}
|
||||
|
||||
protected:
|
||||
FORCEINLINE void SetMesh(USGVirtualHandComponent* InVirtualHand)
|
||||
{
|
||||
VirtualHand = InVirtualHand;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void BeginPlay() override;
|
||||
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||||
virtual void PreInitializeComponents() override;
|
||||
|
||||
protected:
|
||||
UFUNCTION()
|
||||
virtual void OnThumbFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnThumbFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnIndexFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnIndexFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnMiddleFingertipGrabColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnMiddleFingertipGrabColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnThumbFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnThumbFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnIndexFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnIndexFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnMiddleFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnMiddleFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRingFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnRingFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnPinkyFingertipTouchColliderOverlapBegins(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex,
|
||||
bool bFromSweep,
|
||||
const FHitResult& SweepResult);
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnPinkyFingertipTouchColliderOverlapEnds(
|
||||
UPrimitiveComponent* OverlappedComponent,
|
||||
AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp,
|
||||
int32 OtherBodyIndex);
|
||||
|
||||
public:
|
||||
bool IsLeft() const;
|
||||
bool IsRight() const;
|
||||
void SetRight(bool bRight);
|
||||
|
||||
bool IsGloveConnected() const;
|
||||
|
||||
FORCEINLINE bool CanGrab(const AActor* Actor) const
|
||||
{
|
||||
return ((IsValid(Actor) && Actor == GrabState.ActorThumbCanGrab)
|
||||
&& (Actor == GrabState.ActorIndexCanGrab || Actor == GrabState.ActorMiddleCanGrab));
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGGrabState.generated.h"
|
||||
|
||||
class AActor;
|
||||
class UPrimitiveComponent;
|
||||
|
||||
class USGVirtualHandComponent;
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVE_API FSGGrabState
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
USGVirtualHandComponent* Hand;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorThumbCanGrab;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorIndexCanGrab;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorMiddleCanGrab;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* GrabbedActor;
|
||||
|
||||
public:
|
||||
FSGGrabState();
|
||||
|
||||
explicit FSGGrabState(USGVirtualHandComponent* InHand,
|
||||
AActor* InActorThumbCanGrab,
|
||||
AActor* InActorIndexCanGrab,
|
||||
AActor* InActorMiddleCanGrab,
|
||||
AActor* InGrabbedActor);
|
||||
};
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2023 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 "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGTouchState.generated.h"
|
||||
|
||||
class AActor;
|
||||
|
||||
class USGVirtualHandComponent;
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVE_API FSGTouchState
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
USGVirtualHandComponent* Hand;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorThumbTouching;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorIndexTouching;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorMiddleTouching;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorRingTouching;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SenseGlove")
|
||||
AActor* ActorPinkyTouching;
|
||||
|
||||
public:
|
||||
FSGTouchState();
|
||||
|
||||
explicit FSGTouchState(USGVirtualHandComponent* InHand,
|
||||
AActor* InActorThumbTouching,
|
||||
AActor* InActorIndexTouching,
|
||||
AActor* InActorMiddleTouching,
|
||||
AActor* InActorRingTouching,
|
||||
AActor* InActorPinkyTouching);
|
||||
};
|
||||
@@ -52,11 +52,15 @@ public class SenseGlove : ModuleRules
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"AnimGraphRuntime",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"HeadMountedDisplay",
|
||||
"SenseGloveConnect",
|
||||
"SenseGloveCore",
|
||||
"SenseGloveDebug",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveSettings",
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -40,8 +40,11 @@
|
||||
#include "Android/AndroidJava.h"
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
#include "Misc/Paths.h"
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
#include "SGConnectImpl/SGExportedFunctions.h"
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
#include "SGInterop/SGIC_jclass.h"
|
||||
#include "SGInterop/SGIC_jmethodID.h"
|
||||
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
|
||||
@@ -110,10 +113,13 @@ int32 FSGConnectJNI::Initialize()
|
||||
}
|
||||
FSGIC_jmethodID InGetLibraryVersionMethodIDContainer{GetLibraryVersionMethodID};
|
||||
|
||||
FSGIC_FString ProjectSavedDirContainer{FPaths::ProjectSavedDir()};
|
||||
|
||||
Result = SGConnectImpl_Android_Initialize(&InEnvContainer, &InClassContainer,
|
||||
&InInitMethodIDContainer,
|
||||
&InDisposeMethodIDContainer,
|
||||
&InGetLibraryVersionMethodIDContainer);
|
||||
&InGetLibraryVersionMethodIDContainer,
|
||||
&ProjectSavedDirContainer);
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
return Result;
|
||||
|
||||
@@ -40,8 +40,11 @@
|
||||
#include "Android/AndroidJava.h"
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
#include "Misc/Paths.h"
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
#include "SGCoreImpl/SGExportedFunctions.h"
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
#include "SGInterop/SGIC_jclass.h"
|
||||
#include "SGInterop/SGIC_jmethodID.h"
|
||||
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
|
||||
@@ -123,12 +126,15 @@ int32 FSGCoreJNI::Initialize()
|
||||
}
|
||||
FSGIC_jmethodID InWriteHapticsMethodIDContainer{WriteHapticsMethodID};
|
||||
|
||||
FSGIC_FString ProjectSavedDirContainer{FPaths::ProjectSavedDir()};
|
||||
|
||||
Result = SGCoreImpl_Android_Initialize(&InEnvContainer, &InClassContainer,
|
||||
&InActiveDevicesMethodIDContainer,
|
||||
&InGetDeviceStringMethodIDContainer,
|
||||
&InGetSensorStringMethodIDContainer,
|
||||
&InWriteHapticsMethodIDContainer);
|
||||
&InWriteHapticsMethodIDContainer,
|
||||
&ProjectSavedDirContainer);
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
@@ -64,15 +64,8 @@ public class SenseGloveAndroid : ModuleRules
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Launch",
|
||||
"Settings",
|
||||
}
|
||||
);
|
||||
|
||||
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(ModuleDirectory, "SenseGloveAndroid_UPL.xml"));
|
||||
AdditionalPropertiesForReceipt.Add("AndroidPlugin",
|
||||
Path.Combine(ModuleDirectory, "SenseGloveAndroid_UPL.xml"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
<setBool result="bSupportedArch" value="false"/>
|
||||
|
||||
<isArch arch="armeabi-v7a">
|
||||
<setBool result="bSupportedArch" value="false"/>
|
||||
<setBool result="bSupportedArch" value="true"/>
|
||||
</isArch>
|
||||
|
||||
<isArch arch="arm64-v8a">
|
||||
@@ -47,11 +47,11 @@
|
||||
</isArch>
|
||||
|
||||
<isArch arch="x86">
|
||||
<setBool result="bSupportedArch" value="false"/>
|
||||
<setBool result="bSupportedArch" value="true"/>
|
||||
</isArch>
|
||||
|
||||
<isArch arch="x86_64">
|
||||
<setBool result="bSupportedArch" value="false"/>
|
||||
<setBool result="bSupportedArch" value="true"/>
|
||||
</isArch>
|
||||
|
||||
<if condition="bSupportedArch">
|
||||
@@ -61,37 +61,12 @@
|
||||
</if>
|
||||
</init>
|
||||
|
||||
<!--
|
||||
<prebuildCopies>
|
||||
<copyDir src="$S(PluginDir)/Private/Java" dst="$S(BuildDir)/src/com/senseglove/sgconnect" />
|
||||
</prebuildCopies>
|
||||
-->
|
||||
|
||||
<resourceCopies>
|
||||
<isArch arch="arm64-v8a">
|
||||
<if condition="Distribution">
|
||||
<true>
|
||||
<!--
|
||||
<copyFile src="$S(PluginDir)/ThirdParty/lib/oculus/release/somelib.so"
|
||||
dst="$S(BuildDir)/libs/$S(Architecture)/somelib.so" />
|
||||
-->
|
||||
</true>
|
||||
<false>
|
||||
<!--
|
||||
<copyFile src="$S(PluginDir)/ThirdParty/lib/oculus/debug/somelib.so"
|
||||
dst="$S(BuildDir)/libs/$S(Architecture)/somelib.so" />
|
||||
-->
|
||||
</false>
|
||||
</if>
|
||||
</isArch>
|
||||
|
||||
<copyFile src="$S(PluginDir)/../ThirdParty/android/sgconnect.jar" dst="$S(BuildDir)/gradle/app/libs/sgconnect.jar" />
|
||||
</resourceCopies>
|
||||
|
||||
<gradleProperties>
|
||||
<insert>
|
||||
<!--android.useAndroidX=true
|
||||
android.enableJetifier=true-->
|
||||
kapt.incremental.apt=true
|
||||
</insert>
|
||||
</gradleProperties>
|
||||
@@ -105,20 +80,9 @@
|
||||
-keep interface com.senseglove.** { *; }
|
||||
-keep public class com.senseglove.sgconnect.** { public protected *; }
|
||||
|
||||
<!-- Disable obfuscation for AndroidX classes -->
|
||||
<!---dontwarn androidx.**
|
||||
-keep class androidx.** { *; }
|
||||
-keep interface androidx.** { *; }-->
|
||||
|
||||
</insert>
|
||||
</proguardAdditions>
|
||||
|
||||
<soLoadLibrary>
|
||||
<!--
|
||||
<loadLibrary name="somelib" failmsg="SenseGlove [WARN]: somelib.so library failed to load!" />
|
||||
-->
|
||||
</soLoadLibrary>
|
||||
|
||||
<androidManifestUpdates>
|
||||
|
||||
<!-- For target SDK 31 update the SplashActivity activity -->
|
||||
@@ -132,12 +96,6 @@
|
||||
</if>
|
||||
</loopElements>
|
||||
|
||||
<addElements tag="application">
|
||||
<!--
|
||||
<addAttribute tag="application" name="android:requestSomeThingHere" value="true"/>
|
||||
-->
|
||||
</addElements>
|
||||
|
||||
<addPermission android:name="android.permission.BLUETOOTH"/>
|
||||
<addPermission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
||||
<addPermission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
|
||||
@@ -145,15 +103,6 @@
|
||||
|
||||
</androidManifestUpdates>
|
||||
|
||||
<!--
|
||||
<AARImports>
|
||||
<insertValue value="repository $S(PluginDir)/../../ThirdParty/android"/>
|
||||
<insertNewline/>
|
||||
<insertValue value="com.senseglove.sgconnect,sgconnect-android,release" />
|
||||
<insertNewline/>
|
||||
</AARImports>
|
||||
-->
|
||||
|
||||
<buildGradleAdditions>
|
||||
<insert>
|
||||
ext {
|
||||
@@ -189,21 +138,4 @@
|
||||
</insert>
|
||||
</baseBuildGradleAdditions>
|
||||
|
||||
<buildscriptGradleAdditions>
|
||||
</buildscriptGradleAdditions>
|
||||
|
||||
<gradleCopies>
|
||||
</gradleCopies>
|
||||
|
||||
<buildXmlPropertyAdditions>
|
||||
</buildXmlPropertyAdditions>
|
||||
|
||||
<minimumSDKAPI>
|
||||
</minimumSDKAPI>
|
||||
|
||||
<gameActivityImportAdditions>
|
||||
<insert>
|
||||
import com.senseglove.*;
|
||||
</insert>
|
||||
</gameActivityImportAdditions>
|
||||
</root>
|
||||
@@ -60,14 +60,16 @@ int32 SGConnectImpl_Android_Initialize(
|
||||
void* InClass,
|
||||
void* InInitMethodID,
|
||||
void* InDisposeMethodID,
|
||||
void* InGetLibraryVersionMethodID)
|
||||
void* InGetLibraryVersionMethodID,
|
||||
void* StoragePath)
|
||||
{
|
||||
return SGConnect::Android::Initialize(
|
||||
StaticCast<FSGIC_JNIEnv_Ptr*>(InEnv)->Ptr,
|
||||
StaticCast<FSGIC_jclass*>(InClass)->Class,
|
||||
StaticCast<FSGIC_jmethodID*>(InInitMethodID)->MethodID,
|
||||
StaticCast<FSGIC_jmethodID*>(InDisposeMethodID)->MethodID,
|
||||
StaticCast<FSGIC_jmethodID*>(InGetLibraryVersionMethodID)->MethodID);
|
||||
StaticCast<FSGIC_jmethodID*>(InGetLibraryVersionMethodID)->MethodID,
|
||||
std::string{TCHAR_TO_UTF8(*StaticCast<FSGIC_FString*>(StoragePath)->String)});
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
* -3 : An Unexpected error occured. Please try again.
|
||||
* -2 : Device Scanning is already running within a different program.
|
||||
* -1 : Device Scanning already being initialized (function called twice in short succession).
|
||||
* 0 : Device Scanning is already running in within this program.
|
||||
* 0 : Device Scanning is already running within this program.
|
||||
* 1 : Successfully started up DeviceScanning from the current program.
|
||||
*/
|
||||
static int32 Init();
|
||||
|
||||
@@ -74,7 +74,8 @@ SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnectImpl_Android_Initialize(
|
||||
void* InClass,
|
||||
void* InInitMethodID,
|
||||
void* InDisposeMethodID,
|
||||
void* InGetLibraryVersionMethodID);
|
||||
void* InGetLibraryVersionMethodID,
|
||||
void* StoragePath);
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -83,17 +83,63 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||
|
||||
#if UE_5_1_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
|
||||
#else
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 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")
|
||||
if (Arch == "-arm64")
|
||||
{
|
||||
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
|
||||
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
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "oculus"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Linux)
|
||||
@@ -101,23 +147,38 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_0_OR_LATER
|
||||
#if UE_5_2_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#elif UE_4_26_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v17"));
|
||||
#elif UE_4_25_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v16"));
|
||||
#elif UE_4_24_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_23_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_22_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v13"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
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
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
@@ -128,19 +189,17 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
#endif
|
||||
#if UE_4_22_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
#if ! UE_5_0_OR_LATER && UE_4_17_OR_LATER
|
||||
#if ! UE_5_0_OR_LATER && UE_4_27_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2017:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc141"));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -178,17 +237,63 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
|
||||
|
||||
#if UE_5_1_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
|
||||
#else
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 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")
|
||||
if (Arch == "-arm64")
|
||||
{
|
||||
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
|
||||
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
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "oculus"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Linux)
|
||||
@@ -196,23 +301,38 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_0_OR_LATER
|
||||
#if UE_5_2_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#elif UE_4_26_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v17"));
|
||||
#elif UE_4_25_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v16"));
|
||||
#elif UE_4_24_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_23_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_22_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v13"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
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
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21"));
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
@@ -223,19 +343,17 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
#endif
|
||||
#if UE_4_22_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
#if ! UE_5_0_OR_LATER && UE_4_17_OR_LATER
|
||||
#if ! UE_5_0_OR_LATER && UE_4_27_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2017:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc141"));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,14 +68,14 @@ float FSGAnatomy::GetThumbJointLimit(const bool bRightHanded, const int32 Joint,
|
||||
return SGCoreImpl_FSGAnatomyImpl_GetThumbJointLimit(bRightHanded, Joint, Movement, bMax);
|
||||
}
|
||||
|
||||
float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInRadians)
|
||||
float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInDegrees)
|
||||
{
|
||||
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInRadians);
|
||||
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInDegrees);
|
||||
}
|
||||
|
||||
float FSGAnatomy::NormalizeThumbFlexion(const float FlexionInRadians)
|
||||
float FSGAnatomy::NormalizeThumbFlexion(const float FlexionInDegrees)
|
||||
{
|
||||
return SGCoreImpl_FSGAnatomyImpl_NormalizeThumbFlexion(FlexionInRadians);
|
||||
return SGCoreImpl_FSGAnatomyImpl_NormalizeThumbFlexion(FlexionInDegrees);
|
||||
}
|
||||
|
||||
TArray<TArray<FVector>> FSGAnatomy::GetDefaultHandAngles(const bool bRightHanded)
|
||||
|
||||
@@ -76,13 +76,6 @@ struct USGBasicHandModel::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const FSGBasicHandModelImpl& BasicHandModelImpl)
|
||||
@@ -233,28 +226,17 @@ TArray<FVector> USGBasicHandModel::GetBaseJointAngles()
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
SGCoreImpl_FSGBasicHandModelImpl_ctor(&OutBasicHandModelImplContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
|
||||
const TArray<FVector>& StartPositions)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
|
||||
@@ -263,17 +245,11 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArra
|
||||
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer, &StartPositionsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
|
||||
const TArray<FVector>& StartPositions)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{
|
||||
@@ -284,17 +260,11 @@ USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArr
|
||||
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer, &StartPositionsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
|
||||
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
|
||||
@@ -305,17 +275,11 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArra
|
||||
&StartPositionsContainer, &StartRotationsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
|
||||
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
|
||||
@@ -326,17 +290,11 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArra
|
||||
&StartPositionsContainer, &StartRotationsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
|
||||
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{
|
||||
@@ -349,17 +307,11 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFl
|
||||
&StartPositionsContainer, &StartRotationsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
|
||||
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
|
||||
FSGIC_TArray_TArray_float LengthsContainer{
|
||||
@@ -372,19 +324,12 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFl
|
||||
&StartPositionsContainer, &StartRotationsContainer);
|
||||
|
||||
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::USGBasicHandModel(const FSGBasicHandModelImpl& BasicHandModelImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetBasicHandModelImpl(BasicHandModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBasicHandModel::~USGBasicHandModel() = default;
|
||||
@@ -399,13 +344,11 @@ void USGBasicHandModel::SetBasicHandModelImpl(const FSGBasicHandModelImpl& Basic
|
||||
|
||||
const FSGBasicHandModelImpl& USGBasicHandModel::ToBasicHandModelImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->BasicHandModelImpl;
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl& USGBasicHandModel::ToBasicHandModelImpl()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->BasicHandModelImpl;
|
||||
}
|
||||
|
||||
@@ -425,8 +368,6 @@ TArray<TArray<float>> USGBasicHandModel::GetFingerLengths() const
|
||||
|
||||
TArray<float> USGBasicHandModel::GetFingerLengths(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_TArray_float OutLengthsContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -437,26 +378,18 @@ TArray<float> USGBasicHandModel::GetFingerLengths(const ESGFinger Finger) const
|
||||
|
||||
void USGBasicHandModel::SetFingerLengths(const ESGFinger Finger, const TArray<float>& Lengths)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
FSGIC_TArray_float LengthsContainer{Lengths};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetFingerLengths_ESGFinger(&InstanceContainer, &FingerContainer,
|
||||
&LengthsContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGBasicHandModel::SetFingerLengths(const uint8 Finger, const TArray<float>& Lengths)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_TArray_float LengthsContainer{Lengths};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetFingerLengths_uint8Finger(&InstanceContainer, Finger, &LengthsContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
TArray<TArray<float>> USGBasicHandModel::GetFingerRatios() const
|
||||
@@ -469,8 +402,6 @@ TArray<TArray<float>> USGBasicHandModel::GetFingerRatios() const
|
||||
|
||||
TArray<float> USGBasicHandModel::GetFingerRatios(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
FSGIC_TArray_float OutRatiosContainer;
|
||||
@@ -489,26 +420,18 @@ TArray<FVector> USGBasicHandModel::GetStartJointPositions() const
|
||||
|
||||
void USGBasicHandModel::SetStartJointPosition(const ESGFinger Finger, const FVector& Position)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
FSGIC_FVector PositionContainer{Position};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetStartJointPosition_ESGFinger(&InstanceContainer, &FingerContainer,
|
||||
&PositionContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGBasicHandModel::SetStartJointPosition(const uint8 Finger, const FVector& Position)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FVector PositionContainer{Position};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetStartJointPosition_uin8Finger(&InstanceContainer, Finger, &PositionContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
TArray<FQuat> USGBasicHandModel::GetStartJointRotationsQ() const
|
||||
@@ -529,74 +452,53 @@ TArray<FRotator> USGBasicHandModel::GetStartJointRotations() const
|
||||
|
||||
FVector USGBasicHandModel::GetJointPosition(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FVector OutPositionContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_GetJointPosition(&InstanceContainer, &OutPositionContainer, &FingerContainer);
|
||||
|
||||
return MoveTemp(OutPositionContainer.Vector);
|
||||
}
|
||||
|
||||
void USGBasicHandModel::SetJointPosition(const FVector& NewPosition, const ESGFinger Finger)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FVector NewPositionContainer{NewPosition};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetJointPosition(&InstanceContainer, &NewPositionContainer, &FingerContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
FQuat USGBasicHandModel::GetJointRotationQ(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FQuat OutRotationContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_GetJointRotation(&InstanceContainer, &OutRotationContainer, &FingerContainer);
|
||||
|
||||
return MoveTemp(OutRotationContainer.Quat);
|
||||
}
|
||||
|
||||
FRotator USGBasicHandModel::GetJointRotation(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FQuat OutRotationContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_GetJointRotation(&InstanceContainer, &OutRotationContainer, &FingerContainer);
|
||||
|
||||
return OutRotationContainer.Quat.Rotator();
|
||||
}
|
||||
|
||||
void USGBasicHandModel::SetJointRotation(const FQuat& NewRotation, const ESGFinger Finger)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FQuat NewRotationContainer{NewRotation};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetJointRotation(&InstanceContainer, &NewRotationContainer, &FingerContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGBasicHandModel::SetJointRotation(const FRotator& NewRotation, const ESGFinger Finger)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FQuat NewRotationContainer{NewRotation.Quaternion()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
SGCoreImpl_FSGBasicHandModelImpl_SetJointRotation(&InstanceContainer, &NewRotationContainer, &FingerContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
TArray<float> USGBasicHandModel::GetTotalLengths() const
|
||||
@@ -609,8 +511,6 @@ TArray<float> USGBasicHandModel::GetTotalLengths() const
|
||||
|
||||
float USGBasicHandModel::GetTotalLength(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
return SGCoreImpl_FSGBasicHandModelImpl_GetTotalLength(&InstanceContainer, &FingerContainer);
|
||||
@@ -618,8 +518,6 @@ float USGBasicHandModel::GetTotalLength(const ESGFinger Finger) const
|
||||
|
||||
TArray<FVector> USGBasicHandModel::Get3DLengths(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_TArray_FVector OutLengthsContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -630,8 +528,6 @@ TArray<FVector> USGBasicHandModel::Get3DLengths(const ESGFinger Finger) const
|
||||
|
||||
bool USGBasicHandModel::Equals(const USGBasicHandModel* BasicHandModel) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl BasicHandModelContainer{BasicHandModel->ToBasicHandModelImpl()};
|
||||
return SGCoreImpl_FSGBasicHandModelImpl_Equals(&InstanceContainer, &BasicHandModelContainer);
|
||||
@@ -639,8 +535,6 @@ bool USGBasicHandModel::Equals(const USGBasicHandModel* BasicHandModel) const
|
||||
|
||||
FString USGBasicHandModel::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGBasicHandModelImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -649,8 +543,6 @@ FString USGBasicHandModel::ToString() const
|
||||
|
||||
FString USGBasicHandModel::ToString(const bool bLengthsOnly) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGBasicHandModelImpl_ToString_bLengthsOnly(&InstanceContainer, &OutStringContainer, bLengthsOnly);
|
||||
@@ -659,8 +551,6 @@ FString USGBasicHandModel::ToString(const bool bLengthsOnly) const
|
||||
|
||||
FString USGBasicHandModel::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGBasicHandModelImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -677,12 +567,4 @@ USGBasicHandModel::FImpl::~FImpl() = default;
|
||||
void USGBasicHandModel::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGBasicHandModel::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGBasicHandModel::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -46,42 +46,6 @@
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h"
|
||||
|
||||
struct USGBetaDevice::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGDevice* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGBetaDevice* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGBetaDevice* USGBetaDevice::NewBetaDevice(UObject* Outer, const FSGBetaDeviceImpl& BetaDeviceImpl)
|
||||
{
|
||||
USGBetaDevice* Instance = NewObject<USGBetaDevice>(Outer);
|
||||
@@ -128,29 +92,18 @@ USGBetaDevice* USGBetaDevice::Parse(UObject* Outer, const FString& String)
|
||||
}
|
||||
|
||||
USGBetaDevice::USGBetaDevice()
|
||||
: USGDevice(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBetaDevice::USGBetaDevice(const FString& ConstantsString, const FString& DeviceId,
|
||||
const FString& HardwareVersion,
|
||||
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
|
||||
: USGDevice(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
|
||||
FSGIC_FString ConstantsStringContainer{ConstantsString};
|
||||
@@ -161,55 +114,27 @@ USGBetaDevice::USGBetaDevice(const FString& ConstantsString, const FString& Devi
|
||||
&HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBetaDevice::USGBetaDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
|
||||
: USGDevice(BetaDeviceImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(BetaDeviceImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBetaDevice::USGBetaDevice(TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl)
|
||||
: USGDevice(MoveTemp(BetaDeviceImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(MoveTemp(BetaDeviceImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBetaDevice::~USGBetaDevice() = default;
|
||||
|
||||
TSharedRef<FSGBetaDeviceImpl> USGBetaDevice::ToBetaDeviceImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGDeviceImplCast::ToBetaDeviceImpl(ToSGDeviceImpl());
|
||||
}
|
||||
|
||||
void USGBetaDevice::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGBetaDevice::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
ESGDeviceType USGBetaDevice::GetDeviceType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_ESGDeviceType OutTypeContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -218,8 +143,6 @@ ESGDeviceType USGBetaDevice::GetDeviceType() const
|
||||
|
||||
FString USGBetaDevice::GetDeviceId() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString OutIdContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
|
||||
@@ -228,8 +151,6 @@ FString USGBetaDevice::GetDeviceId() const
|
||||
|
||||
FString USGBetaDevice::GetHardwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString VersionContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetHardwareVersion(&InstanceContainer, &VersionContainer);
|
||||
@@ -238,24 +159,18 @@ FString USGBetaDevice::GetHardwareVersion() const
|
||||
|
||||
int32 USGBetaDevice::GetFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
return SGCoreImpl_FSGBetaDeviceImpl_GetFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGBetaDevice::GetSubFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
return SGCoreImpl_FSGBetaDeviceImpl_GetSubFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
FString USGBetaDevice::GetConstantsString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetConstantsString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -264,8 +179,6 @@ FString USGBetaDevice::GetConstantsString() const
|
||||
|
||||
FString USGBetaDevice::GetSensorData() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString OutDataContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetSensorData(&InstanceContainer, &OutDataContainer);
|
||||
@@ -274,8 +187,6 @@ FString USGBetaDevice::GetSensorData() const
|
||||
|
||||
FString USGBetaDevice::GetLastCommand() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString OutCommandContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_GetLastCommand(&InstanceContainer, &OutCommandContainer);
|
||||
@@ -284,8 +195,6 @@ FString USGBetaDevice::GetLastCommand() const
|
||||
|
||||
bool USGBetaDevice::SendHaptics(const FString& Command) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString CommandContainer{Command};
|
||||
return SGCoreImpl_FSGBetaDeviceImpl_SendHaptics(&InstanceContainer, &CommandContainer);
|
||||
@@ -293,30 +202,8 @@ bool USGBetaDevice::SendHaptics(const FString& Command) const
|
||||
|
||||
FString USGBetaDevice::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl InstanceContainer{ToBetaDeviceImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
return MoveTemp(OutStringContainer.String);
|
||||
}
|
||||
|
||||
USGBetaDevice::FImpl::FImpl(USGBetaDevice* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGBetaDevice::FImpl::~FImpl() = default;
|
||||
|
||||
void USGBetaDevice::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGBetaDevice::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGBetaDevice::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -44,42 +44,6 @@
|
||||
#include "SGInterop/SGIC_TArray_int32.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
|
||||
|
||||
struct USGBuzzCommand::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGBuzzCommand* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGBuzzCommand* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const FSGBuzzCommandImpl& BuzzCommandImpl)
|
||||
{
|
||||
USGBuzzCommand* Instance = NewObject<USGBuzzCommand>(Outer);
|
||||
@@ -140,27 +104,16 @@ USGBuzzCommand* USGBuzzCommand::Off(UObject* Outer)
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand()
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
|
||||
: USGFingerCommand(BuzzLevels),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(BuzzLevels)
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
|
||||
@@ -168,33 +121,21 @@ USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
|
||||
&OutSharedPtrContainer, &BuzzLevelsContainer);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand(
|
||||
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
|
||||
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -202,55 +143,27 @@ USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
|
||||
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
|
||||
: USGFingerCommand(BuzzCommandImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(BuzzCommandImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::USGBuzzCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
|
||||
: USGFingerCommand(MoveTemp(BuzzCommandImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(MoveTemp(BuzzCommandImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand::~USGBuzzCommand() = default;
|
||||
|
||||
TSharedRef<FSGBuzzCommandImpl> USGBuzzCommand::ToBuzzCommandImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGFingerCommandImplCast::ToBuzzCommandImpl(ToFingerCommandImpl());
|
||||
}
|
||||
|
||||
void USGBuzzCommand::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGBuzzCommand::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand* USGBuzzCommand::Copy(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl InstanceContainer{ToBuzzCommandImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
|
||||
SGCoreImpl_FSGBuzzCommandImpl_Copy(&InstanceContainer, &OutBuzzCommandImplContainer);
|
||||
@@ -259,31 +172,9 @@ USGBuzzCommand* USGBuzzCommand::Copy(UObject* Outer) const
|
||||
|
||||
USGBuzzCommand* USGBuzzCommand::Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
USGBuzzCommand::FImpl::FImpl(USGBuzzCommand* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGBuzzCommand::FImpl::~FImpl() = default;
|
||||
|
||||
void USGBuzzCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGBuzzCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGBuzzCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -69,14 +69,6 @@ struct USGCalibrationDataPoint::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
|
||||
@@ -107,27 +99,16 @@ USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
|
||||
}
|
||||
|
||||
USGCalibrationDataPoint::USGCalibrationDataPoint()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
|
||||
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
|
||||
|
||||
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
|
||||
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
|
||||
@@ -135,19 +116,12 @@ USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const
|
||||
&OutCalibrationDataPointImplContainer, CurrentStage, &CalibrationValuesContainer);
|
||||
|
||||
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGCalibrationDataPoint::USGCalibrationDataPoint(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetCalibrationDataPointImpl(CalibrationDataPointImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGCalibrationDataPoint::~USGCalibrationDataPoint() = default;
|
||||
@@ -162,7 +136,6 @@ void USGCalibrationDataPoint::SetCalibrationDataPointImpl(const FSGCalibrationDa
|
||||
|
||||
const FSGCalibrationDataPointImpl& USGCalibrationDataPoint::ToCalibrationDataPointImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->CalibrationDataPointImpl;
|
||||
}
|
||||
|
||||
@@ -199,12 +172,4 @@ USGCalibrationDataPoint::FImpl::~FImpl() = default;
|
||||
void USGCalibrationDataPoint::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGCalibrationDataPoint::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGCalibrationDataPoint::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -85,14 +85,6 @@ struct USGDevice::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
void USGDevice::ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion)
|
||||
@@ -110,43 +102,26 @@ FString USGDevice::ToString(const ESGDeviceType DeviceType)
|
||||
}
|
||||
|
||||
USGDevice::USGDevice()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(const FSGDeviceImpl& SGDeviceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGDeviceImpl RhsContainer{SGDeviceImpl};
|
||||
SGCoreImpl_FSGDeviceImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGBetaDeviceImpl RhsContainer{BetaDeviceImpl};
|
||||
@@ -156,111 +131,63 @@ USGDevice::USGDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(const FSGHapticGloveImpl& HapticGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGHapticGloveImpl RhsContainer{HapticGloveImpl};
|
||||
SGCoreImpl_FSGHapticGloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGNovaGloveImpl RhsContainer{NovaGloveImpl};
|
||||
SGCoreImpl_FSGNovaGloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(const FSGSenseGloveImpl& SenseGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGSenseGloveImpl RhsContainer{SenseGloveImpl};
|
||||
SGCoreImpl_FSGSenseGloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->SGDeviceImpl = MoveTemp(SGDeviceImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->SGDeviceImpl = MoveTemp(BetaDeviceImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->SGDeviceImpl = MoveTemp(NovaGloveImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::USGDevice(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->SGDeviceImpl = MoveTemp(SenseGloveImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDevice::~USGDevice() = default;
|
||||
@@ -332,24 +259,11 @@ void USGDevice::SetSGDeviceImpl(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
|
||||
|
||||
TSharedRef<FSGDeviceImpl> USGDevice::ToSGDeviceImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return Pimpl->SGDeviceImpl.ToSharedRef();
|
||||
}
|
||||
|
||||
void USGDevice::SyncImplObject() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGDevice::SyncUProperties()
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
ESGDeviceType USGDevice::GetDeviceType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
FSGIC_ESGDeviceType OutTypeContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -358,16 +272,12 @@ ESGDeviceType USGDevice::GetDeviceType() const
|
||||
|
||||
int32 USGDevice::GetSubFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_GetSubFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
FString USGDevice::GetFirmwareString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_GetFirmwareString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -376,8 +286,6 @@ FString USGDevice::GetFirmwareString() const
|
||||
|
||||
FString USGDevice::GetAddress() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
FSGIC_FString AddressContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_GetAddress(&InstanceContainer, &AddressContainer);
|
||||
@@ -386,16 +294,12 @@ FString USGDevice::GetAddress() const
|
||||
|
||||
bool USGDevice::IsConnected() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_IsConnected(&InstanceContainer);
|
||||
}
|
||||
|
||||
ESGConnectionType USGDevice::GetConnectionType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
FSGIC_ESGConnectionType OutTypeContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_GetConnectionType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -404,82 +308,57 @@ ESGConnectionType USGDevice::GetConnectionType() const
|
||||
|
||||
int32 USGDevice::PacketsPerSecondReceived() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_PacketsPerSecondReceived(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGDevice::PacketsPerSecondSent() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_PacketsPerSecondSent(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGDevice::GetDeviceIndex() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_GetDeviceIndex(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGDevice::SetDeviceIndex(const int32 NewIndex)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
SGCoreImpl_FSGDeviceImpl_SetDeviceIndex(&InstanceContainer, NewIndex);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGDevice::IsWireless() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_IsWireless(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGDevice::HasBattery() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
return SGCoreImpl_FSGDeviceImpl_HasBattery(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGDevice::IsCharging()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
const bool bResult = SGCoreImpl_FSGDeviceImpl_IsCharging(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool USGDevice::GetBatteryLevel(float& OutLevel)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
const bool bResult = SGCoreImpl_FSGDeviceImpl_GetBatteryLevel(&InstanceContainer, &OutLevel);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
FString USGDevice::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGDeviceImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -496,12 +375,4 @@ USGDevice::FImpl::~FImpl() = default;
|
||||
void USGDevice::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGDevice::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGDevice::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -69,13 +69,6 @@ struct USGDeviceModel::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGDeviceModel* USGDeviceModel::NewDeviceModel(UObject* Outer, const FSGDeviceModelImpl& DeviceModelImpl)
|
||||
@@ -120,28 +113,17 @@ void USGDeviceModel::ParseFirmware(const FString& RawFirmware, int32& OutMainVer
|
||||
}
|
||||
|
||||
USGDeviceModel::USGDeviceModel()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGDeviceModelImpl OutDeviceModelImplContainer;
|
||||
SGCoreImpl_FSGDeviceModelImpl_ctor(&OutDeviceModelImplContainer);
|
||||
|
||||
Pimpl->DeviceModelImpl = MoveTemp(OutDeviceModelImplContainer.DeviceModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDeviceModel::USGDeviceModel(const FString& Id, const FString& HardwareVersion,
|
||||
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGDeviceModelImpl OutDeviceModelImplContainer;
|
||||
FSGIC_FString IdContainer{Id};
|
||||
@@ -150,19 +132,12 @@ USGDeviceModel::USGDeviceModel(const FString& Id, const FString& HardwareVersion
|
||||
&OutDeviceModelImplContainer, &IdContainer, &HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion);
|
||||
|
||||
Pimpl->DeviceModelImpl = MoveTemp(OutDeviceModelImplContainer.DeviceModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDeviceModel::USGDeviceModel(const FSGDeviceModelImpl& DeviceModelImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetDeviceModelImpl(DeviceModelImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGDeviceModel::~USGDeviceModel() = default;
|
||||
@@ -177,13 +152,11 @@ void USGDeviceModel::SetDeviceModelImpl(const FSGDeviceModelImpl& DeviceModelImp
|
||||
|
||||
const FSGDeviceModelImpl& USGDeviceModel::ToDeviceModelImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->DeviceModelImpl;
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl& USGDeviceModel::ToDeviceModelImpl()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->DeviceModelImpl;
|
||||
}
|
||||
|
||||
@@ -225,12 +198,4 @@ USGDeviceModel::FImpl::~FImpl() = default;
|
||||
void USGDeviceModel::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGDeviceModel::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGDeviceModel::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -76,54 +76,29 @@ struct USGFingerCommand::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGFingerCommand::USGFingerCommand()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGFingerCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(const TArray<int32>& InLevels)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: 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);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
|
||||
@@ -131,16 +106,10 @@ USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
|
||||
@@ -148,16 +117,10 @@ USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
|
||||
@@ -165,16 +128,10 @@ USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedb
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
|
||||
@@ -182,55 +139,30 @@ USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzComma
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::USGFingerCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGFingerCommand::~USGFingerCommand() = default;
|
||||
@@ -289,20 +221,9 @@ void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGTimedBuzzCommandImpl>
|
||||
|
||||
TSharedRef<FSGFingerCommandImpl> USGFingerCommand::ToFingerCommandImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return Pimpl->FingerCommandImpl.ToSharedRef();
|
||||
}
|
||||
|
||||
void USGFingerCommand::SyncImplObject() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGFingerCommand::SyncUProperties()
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
TArray<int32> USGFingerCommand::GetLevels() const
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
|
||||
@@ -313,28 +234,19 @@ TArray<int32> USGFingerCommand::GetLevels() const
|
||||
|
||||
int32 USGFingerCommand::GetLevel(const int32 Finger) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
|
||||
const int32 Level = SGCoreImpl_FSGFingerCommandImpl_GetLevel(&InstanceContainer, Finger);
|
||||
|
||||
return Level;
|
||||
}
|
||||
|
||||
void USGFingerCommand::SetLevel(const int32 Finger, const int32 Value)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
|
||||
SGCoreImpl_FSGFingerCommandImpl_SetLevel(&InstanceContainer, Finger, Value);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGFingerCommand::Equals(const USGFingerCommand* FingerCommand) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
|
||||
FSGIC_FSGFingerCommandImpl FingerCommandImplContainer{FingerCommand->ToFingerCommandImpl().Get()};
|
||||
const bool bEquals = SGCoreImpl_FSGFingerCommandImpl_Equals(&InstanceContainer, &FingerCommandImplContainer);
|
||||
@@ -343,8 +255,6 @@ bool USGFingerCommand::Equals(const USGFingerCommand* FingerCommand) const
|
||||
|
||||
FString USGFingerCommand::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGFingerCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -361,12 +271,4 @@ USGFingerCommand::FImpl::~FImpl() = default;
|
||||
void USGFingerCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGFingerCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGFingerCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -42,42 +42,6 @@
|
||||
#include "SGInterop/SGIC_TArray_int32.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
|
||||
|
||||
struct USGForceFeedbackCommand::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGForceFeedbackCommand* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGForceFeedbackCommand* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer,
|
||||
const FSGForceFeedbackCommandImpl&
|
||||
ForceFeedbackCommandImpl)
|
||||
@@ -144,27 +108,16 @@ USGForceFeedbackCommand* USGForceFeedbackCommand::Off(UObject* Outer)
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand()
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedbackLevels)
|
||||
: USGFingerCommand(ForceFeedbackLevels),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(ForceFeedbackLevels)
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
|
||||
@@ -172,33 +125,21 @@ USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedb
|
||||
&OutSharedPtrContainer, &ForceFeedbackLevelsContainer);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand(
|
||||
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
|
||||
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const int32 BuzzLevel)
|
||||
: USGFingerCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -206,55 +147,27 @@ USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const i
|
||||
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
|
||||
: USGFingerCommand(ForceFeedbackCommandImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(ForceFeedbackCommandImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::USGForceFeedbackCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
|
||||
: USGFingerCommand(MoveTemp(ForceFeedbackCommandImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGFingerCommand(MoveTemp(ForceFeedbackCommandImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::~USGForceFeedbackCommand() = default;
|
||||
|
||||
TSharedRef<FSGForceFeedbackCommandImpl> USGForceFeedbackCommand::ToForceFeedbackCommandImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGFingerCommandImplCast::ToForceFeedbackCommandImpl(ToFingerCommandImpl());
|
||||
}
|
||||
|
||||
void USGForceFeedbackCommand::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGForceFeedbackCommand::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand* USGForceFeedbackCommand::Copy(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
|
||||
SGCoreImpl_FSGForceFeedbackCommandImpl_Copy(&InstanceContainer, &OutForceFeedbackCommandImplContainer);
|
||||
@@ -264,8 +177,6 @@ USGForceFeedbackCommand* USGForceFeedbackCommand::Copy(UObject* Outer) const
|
||||
USGForceFeedbackCommand* USGForceFeedbackCommand::Merge(UObject* Outer,
|
||||
const USGForceFeedbackCommand* ForceFeedbackCommand) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandImplContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
@@ -273,24 +184,4 @@ USGForceFeedbackCommand* USGForceFeedbackCommand::Merge(UObject* Outer,
|
||||
SGCoreImpl_FSGForceFeedbackCommandImpl_Merge(&InstanceContainer, &OutForceFeedbackCommandImplContainer,
|
||||
&ForceFeedbackCommandImplContainer);
|
||||
return NewForceFeedbackCommand(Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::FImpl::FImpl(USGForceFeedbackCommand* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand::FImpl::~FImpl() = default;
|
||||
|
||||
void USGForceFeedbackCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGForceFeedbackCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGForceFeedbackCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -81,13 +81,6 @@ struct USGHandInterpolator::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
|
||||
@@ -256,27 +249,16 @@ TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(const USGHand
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
SGCoreImpl_FSGHandInterpolatorImpl_ctor(&OutHandInterpolatorImplContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -286,16 +268,10 @@ USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet
|
||||
&JointInterpolationsContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -308,17 +284,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>&
|
||||
&JointInterpolationsContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
|
||||
const FQuat& CmcStartRotation)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -329,17 +299,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet
|
||||
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
|
||||
const FRotator& CmcStartRotation)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -350,17 +314,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet
|
||||
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
|
||||
const FQuat& CmcStartRotation)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -374,17 +332,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>&
|
||||
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
|
||||
const FRotator& CmcStartRotation)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
|
||||
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
|
||||
@@ -398,19 +350,12 @@ USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>&
|
||||
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
|
||||
|
||||
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::USGHandInterpolator(const FSGHandInterpolatorImpl& HandInterpolatorImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetHandInterpolatorImpl(HandInterpolatorImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandInterpolator::~USGHandInterpolator() = default;
|
||||
@@ -425,7 +370,6 @@ void USGHandInterpolator::SetHandInterpolatorImpl(const FSGHandInterpolatorImpl&
|
||||
|
||||
const FSGHandInterpolatorImpl& USGHandInterpolator::ToHandInterpolatorImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->HandInterpolatorImpl;
|
||||
}
|
||||
|
||||
@@ -462,8 +406,6 @@ FRotator USGHandInterpolator::GetCmcStartRotation() const
|
||||
|
||||
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const int32 Movement, const float Value) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_int32Movement_Value(
|
||||
@@ -474,8 +416,6 @@ float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const int32 Mo
|
||||
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGFingerMovement Movement,
|
||||
const float Value) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
FSGIC_ESGFingerMovement MovementContainer{Movement};
|
||||
@@ -487,8 +427,6 @@ float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGFinge
|
||||
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGThumbMovement Movement,
|
||||
const float Value) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
FSGIC_ESGThumbMovement MovementContainer{Movement};
|
||||
@@ -500,48 +438,34 @@ float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGThumb
|
||||
void USGHandInterpolator::SetInterpolation(const int32 Finger, const int32 Movement, const float InputAt0,
|
||||
const float InputAt1, const float AngleAt0, const float AngleAt1)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_int32Finger_int32Movement_InputAt0_InputAt1_AngleAt0_AngleAt1(
|
||||
&InstanceContainer, Finger, Movement, InputAt0, InputAt1, AngleAt0, AngleAt1);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHandInterpolator::SetInterpolation(const ESGFinger Finger, const ESGFingerMovement Movement,
|
||||
const float InputAt0, const float InputAt1, const float AngleAt0,
|
||||
const float AngleAt1)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
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);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHandInterpolator::SetInterpolation(const ESGThumbMovement Movement, const float InputAt0, const float InputAt1,
|
||||
const float AngleAt0, const float AngleAt1)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_ESGThumbMovement MovementContainer{Movement};
|
||||
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_Movement_InputAt0_InputAt1_AngleAt0_AngleAt1(
|
||||
&InstanceContainer, &MovementContainer, InputAt0, InputAt1, AngleAt0, AngleAt1);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGInterpolationSet* USGHandInterpolator::GetInterpolation(UObject* Outer,
|
||||
const int32 Finger, const int32 Movement) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_FSGInterpolationSetImpl OutInterpolationContainer;
|
||||
SGCoreImpl_FSGHandInterpolatorImpl_GetInterpolation(&InstanceContainer, &OutInterpolationContainer, Finger,
|
||||
@@ -551,8 +475,6 @@ USGInterpolationSet* USGHandInterpolator::GetInterpolation(UObject* Outer,
|
||||
|
||||
bool USGHandInterpolator::Equals(const USGHandInterpolator* HandInterpolator) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_FSGHandInterpolatorImpl HandInterpolatorContainer{HandInterpolator->ToHandInterpolatorImpl()};
|
||||
const bool bEquals = SGCoreImpl_FSGHandInterpolatorImpl_Equals(&InstanceContainer, &HandInterpolatorContainer);
|
||||
@@ -561,8 +483,6 @@ bool USGHandInterpolator::Equals(const USGHandInterpolator* HandInterpolator) co
|
||||
|
||||
FString USGHandInterpolator::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGHandInterpolatorImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -579,12 +499,4 @@ USGHandInterpolator::FImpl::~FImpl() = default;
|
||||
void USGHandInterpolator::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHandInterpolator::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHandInterpolator::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "SGCore/SGHandPose.h"
|
||||
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#include "SGCore/SGRotatorArray.h"
|
||||
|
||||
#include "SGCore/SGBasicHandModel.h"
|
||||
#include "SGCoreImpl/SGExportedFunctions.h"
|
||||
@@ -48,6 +47,8 @@
|
||||
#include "SGInterop/SGIC_TArray_float.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_FQuat.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
|
||||
#include "SGTypes/SGRotatorArray.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
struct USGHandPose::FImpl
|
||||
{
|
||||
@@ -76,13 +77,6 @@ struct USGHandPose::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHandPose* USGHandPose::NewHandPose(UObject* Outer, const FSGHandPoseImpl& HandPoseImpl)
|
||||
@@ -284,29 +278,18 @@ USGHandPose* USGHandPose::Fist(UObject* Outer, const bool bRightHanded)
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
|
||||
SGCoreImpl_FSGHandPoseImpl_ctor(&OutHandPoseImplContainer);
|
||||
|
||||
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FQuat>>& JointRotations,
|
||||
const TArray<TArray<FVector>>& HandAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
|
||||
@@ -317,18 +300,12 @@ USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &HandAnglesContainer);
|
||||
|
||||
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
|
||||
const TArray<TArray<FVector>>& HandAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
|
||||
@@ -339,18 +316,12 @@ USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &HandAnglesContainer);
|
||||
|
||||
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose(const bool bRightHanded, const
|
||||
TArray<FSGVectorArray>& JointPositions, const TArray<FSGQuatArray>& JointRotations,
|
||||
const TArray<FSGVectorArray>& HandAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{
|
||||
@@ -367,18 +338,12 @@ USGHandPose::USGHandPose(const bool bRightHanded, const
|
||||
&JointRotationsContainer, &HandAnglesContainer);
|
||||
|
||||
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
const TArray<FSGVectorArray>& JointPositions, const TArray<FSGRotatorArray>& JointRotations,
|
||||
const TArray<FSGVectorArray>& HandAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{
|
||||
@@ -395,19 +360,12 @@ USGHandPose::USGHandPose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &HandAnglesContainer);
|
||||
|
||||
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::USGHandPose(const FSGHandPoseImpl& HandPoseImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetHandPoseImpl(HandPoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandPose::~USGHandPose() = default;
|
||||
@@ -422,7 +380,6 @@ void USGHandPose::SetHandPoseImpl(const FSGHandPoseImpl& HandPoseImpl)
|
||||
|
||||
const FSGHandPoseImpl& USGHandPose::ToHandPoseImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->HandPoseImpl;
|
||||
}
|
||||
|
||||
@@ -466,7 +423,6 @@ TArray<TArray<FVector>> USGHandPose::GetHandAngles() const
|
||||
|
||||
bool USGHandPose::Equals(const USGHandPose* HandPose) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
|
||||
FSGIC_FSGHandPoseImpl HandPoseContainer{HandPose->ToHandPoseImpl()};
|
||||
@@ -475,8 +431,6 @@ bool USGHandPose::Equals(const USGHandPose* HandPose) const
|
||||
|
||||
float USGHandPose::GetNormalizedFlexion(const ESGFinger Finger, const bool bClamp01) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
return SGCoreImpl_FSGHandPoseImpl_GetNormalizedFlexion_Finger_bClamp01(
|
||||
@@ -485,8 +439,6 @@ float USGHandPose::GetNormalizedFlexion(const ESGFinger Finger, const bool bClam
|
||||
|
||||
TArray<float> USGHandPose::GetNormalizedFlexion(const bool bClamp01) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
|
||||
FSGIC_TArray_float OutFlexionContainer;
|
||||
SGCoreImpl_FSGHandPoseImpl_GetNormalizedFlexion_bClamp01(&InstanceContainer, &OutFlexionContainer, bClamp01);
|
||||
@@ -495,8 +447,6 @@ TArray<float> USGHandPose::GetNormalizedFlexion(const bool bClamp01) const
|
||||
|
||||
FString USGHandPose::ToString(const bool bShortFormat) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGHandPoseImpl_ToString(&InstanceContainer, &OutStringContainer, bShortFormat);
|
||||
@@ -505,8 +455,6 @@ FString USGHandPose::ToString(const bool bShortFormat) const
|
||||
|
||||
FString USGHandPose::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGHandPoseImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -523,12 +471,4 @@ USGHandPose::FImpl::~FImpl() = default;
|
||||
void USGHandPose::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHandPose::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHandPose::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -73,13 +73,6 @@ struct USGHandProfile::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer, const FSGHandProfileImpl& HandProfileImpl)
|
||||
@@ -186,29 +179,18 @@ void USGHandProfile::ResetCalibration(const bool bOnDisk)
|
||||
}
|
||||
|
||||
USGHandProfile::USGHandProfile()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
|
||||
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
|
||||
|
||||
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandProfile::USGHandProfile(const bool bRightHanded,
|
||||
const USGSenseGloveHandProfile* SenseGloveHandProfile,
|
||||
const USGNovaGloveHandProfile* NovaGloveHandProfile)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
|
||||
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
|
||||
@@ -219,19 +201,12 @@ USGHandProfile::USGHandProfile(const bool bRightHanded,
|
||||
&OutHandProfileImplContainer, bRightHanded, &SenseGloveHandProfileContainer, &NovaGloveHandProfileContainer);
|
||||
|
||||
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandProfile::USGHandProfile(const FSGHandProfileImpl& HandProfileImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetHandProfileImpl(HandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHandProfile::~USGHandProfile() = default;
|
||||
@@ -246,7 +221,6 @@ void USGHandProfile::SetHandProfileImpl(const FSGHandProfileImpl& HandProfileImp
|
||||
|
||||
const FSGHandProfileImpl& USGHandProfile::ToHandProfileImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->HandProfileImpl;
|
||||
}
|
||||
|
||||
@@ -278,8 +252,6 @@ USGNovaGloveHandProfile* USGHandProfile::GetNovaGloveHandProfile(UObject* Outer)
|
||||
|
||||
bool USGHandProfile::Equals(const USGHandProfile* HandProfile) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
|
||||
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
return SGCoreImpl_FSGHandProfileImpl_Equals(&InstanceContainer, &HandProfileContainer);
|
||||
@@ -287,18 +259,12 @@ bool USGHandProfile::Equals(const USGHandProfile* HandProfile) const
|
||||
|
||||
void USGHandProfile::Reset()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
|
||||
SGCoreImpl_FSGHandProfileImpl_Reset(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
FString USGHandProfile::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -315,12 +281,4 @@ USGHandProfile::FImpl::~FImpl() = default;
|
||||
void USGHandProfile::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHandProfile::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHandProfile::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -58,42 +58,6 @@
|
||||
#include "SGInterop/SGIC_TArray_TSharedRef_FSGHapticGloveImpl.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
|
||||
|
||||
struct USGHapticGlove::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGDevice* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGHapticGlove* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHapticGlove* USGHapticGlove::NewHapticGlove(UObject* Outer, const FSGHapticGloveImpl& HapticGloveImpl)
|
||||
{
|
||||
USGHapticGlove* Instance = NewObject<USGHapticGlove>(Outer);
|
||||
@@ -155,132 +119,63 @@ bool USGHapticGlove::GetGlove(UObject* Outer, const bool bRightHanded, USGHaptic
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove()
|
||||
: USGDevice(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGBetaDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(const FSGDeviceImpl& SGDeviceImpl)
|
||||
: USGDevice(SGDeviceImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(SGDeviceImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(const FSGHapticGloveImpl& HapticGloveImpl)
|
||||
: USGDevice(HapticGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(HapticGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(const FSGNovaGloveImpl& NovaGloveImpl)
|
||||
: USGDevice(NovaGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(NovaGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(const FSGSenseGloveImpl& SenseGloveImpl)
|
||||
: USGDevice(SenseGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(SenseGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
|
||||
: USGDevice(MoveTemp(SGDeviceImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(MoveTemp(SGDeviceImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
|
||||
: USGDevice(MoveTemp(HapticGloveImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(MoveTemp(HapticGloveImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
|
||||
: USGDevice(MoveTemp(NovaGloveImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(MoveTemp(NovaGloveImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::USGHapticGlove(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
|
||||
: USGDevice(MoveTemp(SenseGloveImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGDevice(MoveTemp(SenseGloveImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove::~USGHapticGlove() = default;
|
||||
|
||||
TSharedRef<FSGHapticGloveImpl> USGHapticGlove::ToHapticGloveImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGDeviceImplCast::ToHapticGloveImpl(ToSGDeviceImpl());
|
||||
}
|
||||
|
||||
void USGHapticGlove::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
ESGDeviceType USGHapticGlove::GetDeviceType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_ESGDeviceType OutTypeContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -289,8 +184,6 @@ ESGDeviceType USGHapticGlove::GetDeviceType() const
|
||||
|
||||
FString USGHapticGlove::GetDeviceId() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FString OutIdContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
|
||||
@@ -299,8 +192,6 @@ FString USGHapticGlove::GetDeviceId() const
|
||||
|
||||
FString USGHapticGlove::GetHardwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FString OutVersionContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_GetHardwareVersion(&InstanceContainer, &OutVersionContainer);
|
||||
@@ -309,38 +200,28 @@ FString USGHapticGlove::GetHardwareVersion() const
|
||||
|
||||
int32 USGHapticGlove::GetFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveImpl_GetFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGHapticGlove::GetSubFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveImpl_GetSubFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGlove::IsRight() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveImpl_IsRight(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGlove::GetImuRotation(FQuat& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = MoveTemp(OutImuContainer.Quat);
|
||||
@@ -351,14 +232,10 @@ bool USGHapticGlove::GetImuRotation(FQuat& OutImu)
|
||||
|
||||
bool USGHapticGlove::GetImuRotation(FRotator& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = OutImuContainer.Quat.Rotator();
|
||||
@@ -371,8 +248,6 @@ bool USGHapticGlove::GetHandPose(
|
||||
UObject* Outer,
|
||||
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
@@ -380,8 +255,6 @@ bool USGHapticGlove::GetHandPose(
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &HandGeometryContainer, &HandProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -392,16 +265,12 @@ bool USGHapticGlove::GetHandPose(
|
||||
|
||||
bool USGHapticGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &HandProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -412,16 +281,12 @@ bool USGHapticGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfi
|
||||
|
||||
bool USGHapticGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_HandGeometry_OutHandPose(
|
||||
&InstanceContainer, &HandGeometryContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -432,15 +297,11 @@ bool USGHapticGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGe
|
||||
|
||||
bool USGHapticGlove::GetHandPose(UObject* Outer, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_OutHandPose(
|
||||
&InstanceContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -449,81 +310,72 @@ bool USGHapticGlove::GetHandPose(UObject* Outer, USGHandPose*& OutHandPose)
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
bool USGHapticGlove::GetHandPose(UObject* Outer, const float DeltaTime, USGHandPose*& OutHandPose)
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_DeltaTime_OutHandPose(
|
||||
&InstanceContainer, DeltaTime, &OutHandPoseContainer);
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
void USGHapticGlove::StopHaptics()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_StopHaptics(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::StopVibrations()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_StopVibrations(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SendHaptics(const USGBuzzCommand* BuzzCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_BuzzCommand(&InstanceContainer, &BuzzCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SendHaptics(const USGThumperCommand* ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ThumperCommand(&InstanceContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
|
||||
const USGBuzzCommand* BuzzCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
|
||||
const USGBuzzCommand* BuzzCommand,
|
||||
const USGThumperCommand* ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
@@ -531,20 +383,14 @@ void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCom
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGHapticGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_TArray_FVector OutValuesContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetCalibrationValues(&InstanceContainer, &OutValuesContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutValues = MoveTemp(OutValuesContainer.Array);
|
||||
@@ -555,68 +401,46 @@ bool USGHapticGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
|
||||
void USGHapticGlove::ResetCalibrationRange()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_ResetCalibrationRange(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::UpdateCalibrationRange()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibrationRange(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::UpdateCalibrationRange(const TArray<FVector>& CalibrationValues)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
|
||||
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibrationRange_CalibrationValues(
|
||||
&InstanceContainer, &CalibrationValuesContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGlove::GetCalibrationRange(TArray<FVector>& OutMinValues, TArray<FVector>& OutMaxValues)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_TArray_FVector OutMinValuesContainer;
|
||||
FSGIC_TArray_FVector OutMaxValuesContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_GetCalibrationRange(&InstanceContainer, &OutMinValues, &OutMaxValues);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
OutMinValues = MoveTemp(OutMinValuesContainer.Array);
|
||||
OutMaxValues = MoveTemp(OutMaxValuesContainer.Array);
|
||||
}
|
||||
|
||||
void USGHapticGlove::UpdateCalibration(UObject* Outer, USGHandProfile*& OutProfile)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibration(&InstanceContainer, &OutProfileContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
|
||||
}
|
||||
|
||||
void USGHapticGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGHapticGloveImpl_ApplyCalibration(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -628,8 +452,6 @@ void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FQ
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -650,8 +472,6 @@ void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FR
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -672,8 +492,6 @@ void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FQ
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -695,8 +513,6 @@ void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FR
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -712,24 +528,4 @@ void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FR
|
||||
|
||||
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
|
||||
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
|
||||
}
|
||||
|
||||
USGHapticGlove::FImpl::FImpl(USGHapticGlove* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGHapticGlove::FImpl::~FImpl() = default;
|
||||
|
||||
void USGHapticGlove::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHapticGlove::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHapticGlove::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -74,13 +74,6 @@ struct USGHapticGloveCalibrationCheck::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHapticGloveCalibrationCheck* USGHapticGloveCalibrationCheck::NewHapticGloveCalibrationCheck(
|
||||
@@ -176,28 +169,17 @@ bool USGHapticGloveCalibrationCheck::MatchesLast(const TArray<FVector>& CurrentR
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor(&OutHapticGloveCalibrationCheckImplContainer);
|
||||
|
||||
Pimpl->HapticGloveCalibrationCheckImpl = MoveTemp(
|
||||
OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(const USGSensorRange* LastCalibrationRange)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
|
||||
FSGIC_FSGSensorRangeImpl LastCalibrationRangeContainer{LastCalibrationRange->ToSensorRangeImpl()};
|
||||
@@ -206,20 +188,13 @@ USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(const USGSensorRa
|
||||
|
||||
Pimpl->HapticGloveCalibrationCheckImpl = MoveTemp(
|
||||
OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(
|
||||
const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetHapticGloveCalibrationCheckImpl(HapticGloveCalibrationCheckImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationCheck::~USGHapticGloveCalibrationCheck() = default;
|
||||
@@ -236,22 +211,11 @@ void USGHapticGloveCalibrationCheck::SetHapticGloveCalibrationCheckImpl(
|
||||
|
||||
const FSGHapticGloveCalibrationCheckImpl& USGHapticGloveCalibrationCheck::ToHapticGloveCalibrationCheckImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->HapticGloveCalibrationCheckImpl;
|
||||
}
|
||||
|
||||
USGSensorRange* USGHapticGloveCalibrationCheck::GetLastSensorRange(UObject* Outer) const
|
||||
{
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
|
||||
FSGIC_FSGSensorRangeImpl OutLastSensorRangeContainer;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetLastSensorRange(&InstanceContainer, &OutLastSensorRangeContainer);
|
||||
return USGSensorRange::NewSensorRange(Outer, MoveTemp(OutLastSensorRangeContainer.SensorRangeImpl));
|
||||
}
|
||||
|
||||
ESGCalibrationStage USGHapticGloveCalibrationCheck::GetCalibrationStage() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
|
||||
FSGIC_ESGCalibrationStage OutStageContainer;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetCalibrationStage(&InstanceContainer, &OutStageContainer);
|
||||
@@ -261,7 +225,6 @@ ESGCalibrationStage USGHapticGloveCalibrationCheck::GetCalibrationStage() const
|
||||
|
||||
bool USGHapticGloveCalibrationCheck::ReachedConclusion() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ReachedConclusion(&InstanceContainer);
|
||||
@@ -269,26 +232,18 @@ bool USGHapticGloveCalibrationCheck::ReachedConclusion() const
|
||||
|
||||
void USGHapticGloveCalibrationCheck::Reset()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_Reset(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationCheck::CheckRange(
|
||||
const TArray<FVector>& CurrentValues, const float DeltaSeconds, const ESGDeviceType DeviceType)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
|
||||
FSGIC_TArray_FVector CurrentValuesContainer{CurrentValues};
|
||||
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_CheckRange(&InstanceContainer, &CurrentValuesContainer,
|
||||
DeltaSeconds, &DeviceTypeContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationCheck::FImpl::FImpl(USGHapticGloveCalibrationCheck* InOwner)
|
||||
@@ -301,12 +256,4 @@ USGHapticGloveCalibrationCheck::FImpl::~FImpl() = default;
|
||||
void USGHapticGloveCalibrationCheck::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationCheck::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationCheck::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -84,14 +84,6 @@ struct USGHapticGloveCalibrationSequence::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHapticGloveCalibrationSequence* USGHapticGloveCalibrationSequence::NewHapticGloveCalibrationSequence(UObject* Outer,
|
||||
@@ -154,27 +146,16 @@ bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
|
||||
@@ -182,17 +163,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(const USGHa
|
||||
&OutSharedPtrContainer, &LinkedGloveContainer);
|
||||
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
const FSGHapticGloveCalibrationSequenceImpl& HapticGloveCalibrationSequenceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGHapticGloveCalibrationSequenceImpl RhsContainer{HapticGloveCalibrationSequenceImpl};
|
||||
@@ -200,17 +175,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGHapticGloveQuickCalibrationImpl RhsContainer{HapticGloveQuickCalibrationImpl};
|
||||
@@ -218,33 +187,20 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
&OutSharedPtrContainer, &RhsContainer);
|
||||
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveCalibrationSequenceImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
|
||||
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveQuickCalibrationImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCalibrationSequence::~USGHapticGloveCalibrationSequence() = default;
|
||||
@@ -282,24 +238,11 @@ void USGHapticGloveCalibrationSequence::SetHapticGloveCalibrationSequenceImpl(
|
||||
TSharedRef<FSGHapticGloveCalibrationSequenceImpl>
|
||||
USGHapticGloveCalibrationSequence::ToHapticGloveCalibrationSequenceImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return Pimpl->HapticGloveCalibrationSequenceImpl.ToSharedRef();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::SyncImplObject() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::SyncUProperties()
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGlove* USGHapticGloveCalibrationSequence::GetLinkedGlove(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetLinkedGlove(&InstanceContainer, &OutGloveContainer);
|
||||
@@ -308,19 +251,13 @@ USGHapticGlove* USGHapticGloveCalibrationSequence::GetLinkedGlove(UObject* Outer
|
||||
|
||||
void USGHapticGloveCalibrationSequence::SetLinkedGlove(const USGHapticGlove* LinkedGlove)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_SetLinkedGlove(&InstanceContainer, &LinkedGloveContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
TArray<USGCalibrationDataPoint*> USGHapticGloveCalibrationSequence::GetCalibrationPoints(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_TArray_FSGCalibrationDataPointImpl OutPoints;
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCalibrationPoints(&InstanceContainer, &OutPoints);
|
||||
@@ -336,97 +273,67 @@ TArray<USGCalibrationDataPoint*> USGHapticGloveCalibrationSequence::GetCalibrati
|
||||
|
||||
float USGHapticGloveCalibrationSequence::GetElapsedTime() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetElapsedTime(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGloveCalibrationSequence::IsManuallyCompleted() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_IsManuallyCompleted(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGHapticGloveCalibrationSequence::GetCurrentStage() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCurrentStage(&InstanceContainer);
|
||||
}
|
||||
|
||||
SIZE_T USGHapticGloveCalibrationSequence::GetCalibrationPointsCount() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCalibrationPointsCount(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGloveCalibrationSequence::AutoCompleted() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_AutoCompleted(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGloveCalibrationSequence::Completed() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Completed(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::Reset()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Reset(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::AddDataPoint(const TArray<FVector>& CalibrationPoints)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_TArray_FVector CalibrationPointsContainer{CalibrationPoints};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_AddDataPoint(&InstanceContainer, &CalibrationPointsContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::Update(const float DeltaSeconds)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Update(&InstanceContainer, DeltaSeconds);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::ConfirmCurrentStep()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ConfirmCurrentStep(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGHapticGloveCalibrationSequence::CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_FSGSensorRangeImpl OutSensorRangeContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_CompileRange(
|
||||
@@ -444,8 +351,6 @@ bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
|
||||
const ESGDeviceType ForDevice, const bool bRightHanded,
|
||||
USGHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_ESGDeviceType ForDeviceContainer{ForDevice};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
@@ -463,8 +368,6 @@ bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
|
||||
|
||||
bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetHandPose_OutCurrentHandPose(
|
||||
@@ -481,8 +384,6 @@ bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer, USGHandPose*
|
||||
bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer,
|
||||
const bool bRightHanded, USGHandPose*& OutCurrentHandPose) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetHandPose_bRightHanded_OutCurrentHandPose(
|
||||
@@ -498,8 +399,6 @@ bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer,
|
||||
|
||||
FString USGHapticGloveCalibrationSequence::GetCurrentInstruction(const FString& NextStepKey) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
|
||||
FSGIC_FString OutInstructionContainer;
|
||||
FSGIC_FString NextStepKeyContainer{NextStepKey};
|
||||
@@ -519,12 +418,4 @@ USGHapticGloveCalibrationSequence::FImpl::~FImpl() = default;
|
||||
void USGHapticGloveCalibrationSequence::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHapticGloveCalibrationSequence::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -80,13 +80,6 @@ struct USGHapticGloveCommandBuffer::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHapticGloveCommandBuffer* USGHapticGloveCommandBuffer::NewHapticGloveCommandBuffer(
|
||||
@@ -122,32 +115,20 @@ int32 USGHapticGloveCommandBuffer::GetMaxThumpCommands()
|
||||
}
|
||||
|
||||
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl OutHapticGloveCommandBufferImplContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ctor(&OutHapticGloveCommandBufferImplContainer);
|
||||
|
||||
Pimpl->HapticGloveCommandBufferImpl = MoveTemp(
|
||||
OutHapticGloveCommandBufferImplContainer.HapticGloveCommandBufferImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer(
|
||||
const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetHapticGloveCommandBufferImpl(HapticGloveCommandBufferImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCommandBuffer::~USGHapticGloveCommandBuffer() = default;
|
||||
@@ -163,14 +144,11 @@ void USGHapticGloveCommandBuffer::SetHapticGloveCommandBufferImpl(
|
||||
|
||||
const FSGHapticGloveCommandBufferImpl& USGHapticGloveCommandBuffer::ToHapticGloveCommandBufferImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->HapticGloveCommandBufferImpl;
|
||||
}
|
||||
|
||||
TArray<USGForceFeedbackCommand*> USGHapticGloveCommandBuffer::GetForceFeedbackCommandsQueue(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_TArray_FSGForceFeedbackCommandImpl OutForceFeedbackCommandsQueueContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetForceFeedbackCommandsQueue(&InstanceContainer,
|
||||
@@ -188,8 +166,6 @@ TArray<USGForceFeedbackCommand*> USGHapticGloveCommandBuffer::GetForceFeedbackCo
|
||||
|
||||
TArray<USGTimedBuzzCommand*> USGHapticGloveCommandBuffer::GetBuzzCommandsQueue(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_TArray_FSGTimedBuzzCommandImpl OutBuzzCommandsQueueContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetBuzzCommandsQueue(&InstanceContainer, &OutBuzzCommandsQueueContainer);
|
||||
@@ -205,8 +181,6 @@ TArray<USGTimedBuzzCommand*> USGHapticGloveCommandBuffer::GetBuzzCommandsQueue(U
|
||||
|
||||
TArray<USGTimedThumpCommand*> USGHapticGloveCommandBuffer::GetThumperCommandsQueue(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_TArray_FSGTimedThumpCommandImpl OutThumperCommandsQueueContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetThumperCommandsQueue(&InstanceContainer,
|
||||
@@ -223,84 +197,54 @@ TArray<USGTimedThumpCommand*> USGHapticGloveCommandBuffer::GetThumperCommandsQue
|
||||
|
||||
void USGHapticGloveCommandBuffer::ClearForceFeedbackCommandsQueue()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ClearForceFeedbackCommandsQueue(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::ClearVibrations()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ClearVibrations(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::Clear()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_Clear(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_ForceFeedbackCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::AddCommand(const USGTimedBuzzCommand* BuzzCommand)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGTimedBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToTimedBuzzCommandImpl().Get()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_BuzzCommand(&InstanceContainer, &BuzzCommandContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::AddCommand(const USGTimedThumpCommand* ThumpCommand)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGTimedThumpCommandImpl ThumpCommandContainer{ThumpCommand->ToTimedThumpCommandImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_ThumpCommand(&InstanceContainer, &ThumpCommandContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::UpdateTimedCommands(const float DeltaSeconds)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_UpdateTimedCommands(&InstanceContainer, DeltaSeconds);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevels(
|
||||
UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
|
||||
FSGIC_FSGForceFeedbackCommandImpl LastForceFeedbackCommandContainer{
|
||||
@@ -314,8 +258,6 @@ USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevel
|
||||
|
||||
USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevels(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalForceFeedbackLevels(
|
||||
@@ -327,8 +269,6 @@ USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevel
|
||||
|
||||
USGBuzzCommand* USGHapticGloveCommandBuffer::GetTotalBuzzLevels(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalBuzzLevels(&InstanceContainer, &OutBuzzCommandImplContainer);
|
||||
@@ -338,8 +278,6 @@ USGBuzzCommand* USGHapticGloveCommandBuffer::GetTotalBuzzLevels(UObject* Outer)
|
||||
|
||||
USGThumperCommand* USGHapticGloveCommandBuffer::GetTotalThumperLevels(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
|
||||
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalThumperLevels(&InstanceContainer,
|
||||
@@ -355,8 +293,6 @@ void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
|
||||
USGThumperCommand*& OutThumperCommand,
|
||||
const bool bClearForceFeedbackQueue)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl LastBrakeLevelContainer{LastBrakeLevel->ToForceFeedbackCommandImpl().Get()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
|
||||
@@ -371,8 +307,6 @@ void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
|
||||
OutBuzzCommand = USGBuzzCommand::NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
|
||||
OutThumperCommand = USGThumperCommand::NewThumperCommand(
|
||||
Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
|
||||
@@ -382,8 +316,6 @@ void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
|
||||
USGBuzzCommand*& OutBuzzCommand,
|
||||
USGThumperCommand*& OutThumperCommand)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl LastBrakeLevelContainer{LastBrakeLevel->ToForceFeedbackCommandImpl().Get()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
|
||||
@@ -398,8 +330,6 @@ void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
|
||||
OutBuzzCommand = USGBuzzCommand::NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
|
||||
OutThumperCommand = USGThumperCommand::NewThumperCommand(
|
||||
Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveCommandBuffer::FImpl::FImpl(USGHapticGloveCommandBuffer* InOwner)
|
||||
@@ -412,12 +342,4 @@ USGHapticGloveCommandBuffer::FImpl::~FImpl() = default;
|
||||
void USGHapticGloveCommandBuffer::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHapticGloveCommandBuffer::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -38,6 +38,9 @@
|
||||
#include "SGHapticGloveCalibrationSequenceImplCast.h"
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
|
||||
#include "SGCore/SGHandPose.h"
|
||||
#include "SGCore/SGHandProfile.h"
|
||||
#include "SGCore/SGSensorRange.h"
|
||||
#include "SGCoreImpl/SGExportedFunctions.h"
|
||||
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
|
||||
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
|
||||
@@ -48,42 +51,6 @@
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
struct USGHapticGloveQuickCalibration::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGHapticGloveQuickCalibration* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGHapticGloveQuickCalibration* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGHapticGloveQuickCalibration* USGHapticGloveQuickCalibration::NewHapticGloveQuickCalibration(UObject* Outer,
|
||||
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibration)
|
||||
{
|
||||
@@ -125,28 +92,17 @@ float USGHapticGloveQuickCalibration::GetDefaultAutoEndTimeout()
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration()
|
||||
: USGHapticGloveCalibrationSequence(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGloveCalibrationSequence()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetHapticGloveCalibrationSequenceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
|
||||
const USGHapticGlove* GloveToCalibrate, const float AutoEndTimeout)
|
||||
: USGHapticGloveCalibrationSequence(GloveToCalibrate),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGloveCalibrationSequence(GloveToCalibrate)
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
|
||||
FSGIC_TSharedPtr_FSGHapticGloveImpl GloveToCalibrateContainer{GloveToCalibrate->ToHapticGloveImpl()};
|
||||
@@ -154,54 +110,28 @@ USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
|
||||
&OutSharedPtrContainer, &GloveToCalibrateContainer, AutoEndTimeout);
|
||||
|
||||
SetHapticGloveCalibrationSequenceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
|
||||
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
|
||||
: USGHapticGloveCalibrationSequence(HapticGloveQuickCalibrationImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGloveCalibrationSequence(HapticGloveQuickCalibrationImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
|
||||
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
|
||||
: USGHapticGloveCalibrationSequence(MoveTemp(HapticGloveQuickCalibrationImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGloveCalibrationSequence(MoveTemp(HapticGloveQuickCalibrationImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::~USGHapticGloveQuickCalibration() = default;
|
||||
|
||||
TSharedRef<FSGHapticGloveQuickCalibrationImpl> USGHapticGloveQuickCalibration::ToHapticGloveQuickCalibrationImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGHapticGloveCalibrationSequenceImplCast::ToHapticGloveQuickCalibrationImpl(
|
||||
ToHapticGloveCalibrationSequenceImpl());
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
float USGHapticGloveQuickCalibration::GetAutoEndTimeout() const
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
@@ -210,16 +140,12 @@ float USGHapticGloveQuickCalibration::GetAutoEndTimeout() const
|
||||
|
||||
int32 USGHapticGloveQuickCalibration::GetSmoothingSamples() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetSmoothingSamples(&InstanceContainer);
|
||||
}
|
||||
|
||||
USGSensorRange* USGHapticGloveQuickCalibration::GetSensorRange(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_FSGSensorRangeImpl OutRangeContainer;
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetSensorRange(&InstanceContainer, &OutRangeContainer);
|
||||
@@ -229,8 +155,6 @@ USGSensorRange* USGHapticGloveQuickCalibration::GetSensorRange(UObject* Outer) c
|
||||
|
||||
USGHandProfile* USGHapticGloveQuickCalibration::GetTemporaryProfile(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetTemporaryProfile(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -240,65 +164,43 @@ USGHandProfile* USGHapticGloveQuickCalibration::GetTemporaryProfile(UObject* Out
|
||||
|
||||
bool USGHapticGloveQuickCalibration::CanAnimate() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_CanAnimate(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGHapticGloveQuickCalibration::AutoCompleted() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_AutoCompleted(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::Reset()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_Reset(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::Update(const float DeltaSeconds)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_Update(&InstanceContainer, DeltaSeconds);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::AddDataPoint(const TArray<FVector>& CalibrationPoints)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_TArray_FVector CalibrationPointsContainer{CalibrationPoints};
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_AddDataPoint(&InstanceContainer, &CalibrationPointsContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::ConfirmCurrentStep()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ConfirmCurrentStep(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGHapticGloveQuickCalibration::CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_FSGSensorRangeImpl OutSensorRangeContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_CompileRange(
|
||||
@@ -312,8 +214,6 @@ bool USGHapticGloveQuickCalibration::CompileRange(UObject* Outer, USGSensorRange
|
||||
bool USGHapticGloveQuickCalibration::GetHandPose(UObject* Outer,
|
||||
const bool bRightHanded, USGHandPose*& OutCurrentHandPose) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetHandPose(
|
||||
@@ -326,8 +226,6 @@ bool USGHapticGloveQuickCalibration::GetHandPose(UObject* Outer,
|
||||
|
||||
FString USGHapticGloveQuickCalibration::GetCurrentInstruction(const FString& NextStepKey) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
|
||||
FSGIC_FString OutInstructionContainer;
|
||||
FSGIC_FString NextStepKeyContainer{NextStepKey};
|
||||
@@ -335,24 +233,4 @@ FString USGHapticGloveQuickCalibration::GetCurrentInstruction(const FString& Nex
|
||||
&InstanceContainer, &OutInstructionContainer, &NextStepKeyContainer);
|
||||
|
||||
return MoveTemp(OutInstructionContainer.String);
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::FImpl::FImpl(USGHapticGloveQuickCalibration* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGHapticGloveQuickCalibration::FImpl::~FImpl() = default;
|
||||
|
||||
void USGHapticGloveQuickCalibration::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGHapticGloveQuickCalibration::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -69,13 +69,6 @@ struct USGInterpolationSet::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGInterpolationSet* USGInterpolationSet::NewInterpolationSet(UObject* Outer,
|
||||
@@ -125,63 +118,39 @@ USGInterpolationSet* USGInterpolationSet::Deserialize(UObject* Outer, const FStr
|
||||
}
|
||||
|
||||
USGInterpolationSet::USGInterpolationSet()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_ctor(&OutInterpolationSetImplContainer);
|
||||
|
||||
Pimpl->InterpolationSetImpl = MoveTemp(OutInterpolationSetImplContainer.InterpolationSetImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, const float To1, const float To2)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_ctor_From1_From2_To1_To2(&OutInterpolationSetImplContainer,
|
||||
From1, From2, To1, To2);
|
||||
|
||||
Pimpl->InterpolationSetImpl = MoveTemp(OutInterpolationSetImplContainer.InterpolationSetImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, const float To1, const float To2,
|
||||
const float Min, const float Max)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_ctor_From1_From2_To1_To2_Min_Max(&OutInterpolationSetImplContainer,
|
||||
From1, From2, To1, To2, Min, Max);
|
||||
|
||||
Pimpl->InterpolationSetImpl = MoveTemp(OutInterpolationSetImplContainer.InterpolationSetImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGInterpolationSet::USGInterpolationSet(const FSGInterpolationSetImpl& InterpolationSetImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetInterpolationSetImpl(InterpolationSetImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGInterpolationSet::~USGInterpolationSet() = default;
|
||||
@@ -196,7 +165,6 @@ void USGInterpolationSet::SetInterpolationSetImpl(const FSGInterpolationSetImpl&
|
||||
|
||||
const FSGInterpolationSetImpl& USGInterpolationSet::ToInterpolationSetImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->InterpolationSetImpl;
|
||||
}
|
||||
|
||||
@@ -274,16 +242,12 @@ void USGInterpolationSet::SetMax(const float Max)
|
||||
|
||||
float USGInterpolationSet::Get(const float Value, const bool bLimit, const bool bNormalizeAngle) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGInterpolationSetImpl InstanceContainer{ToInterpolationSetImpl()};
|
||||
return SGCoreImpl_FSGInterpolationSetImpl_Get(&InstanceContainer, Value, bLimit, bNormalizeAngle);
|
||||
}
|
||||
|
||||
bool USGInterpolationSet::Equals(const USGInterpolationSet* InterpolationSet) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGInterpolationSetImpl InstanceContainer{ToInterpolationSetImpl()};
|
||||
FSGIC_FSGInterpolationSetImpl InterpolationSetContainer{InterpolationSet->ToInterpolationSetImpl()};
|
||||
return SGCoreImpl_FSGInterpolationSetImpl_Equals(&InstanceContainer, &InterpolationSetContainer);
|
||||
@@ -291,8 +255,6 @@ bool USGInterpolationSet::Equals(const USGInterpolationSet* InterpolationSet) co
|
||||
|
||||
FString USGInterpolationSet::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGInterpolationSetImpl InstanceContainer{ToInterpolationSetImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -301,8 +263,6 @@ FString USGInterpolationSet::ToString() const
|
||||
|
||||
FString USGInterpolationSet::ToString(const bool bLimits) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGInterpolationSetImpl InstanceContainer{ToInterpolationSetImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_ToString_bLimits(&InstanceContainer, &OutStringContainer, bLimits);
|
||||
@@ -311,8 +271,6 @@ FString USGInterpolationSet::ToString(const bool bLimits) const
|
||||
|
||||
FString USGInterpolationSet::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGInterpolationSetImpl InstanceContainer{ToInterpolationSetImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGInterpolationSetImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -329,12 +287,4 @@ USGInterpolationSet::FImpl::~FImpl() = default;
|
||||
void USGInterpolationSet::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGInterpolationSet::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGInterpolationSet::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "SGInterop/SGIC_FVector.h"
|
||||
#include "SGInterop/SGIC_TArray_FQuat.h"
|
||||
#include "SGInterop/SGIC_TArray_FVector.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
bool FSGJointKinematics::ForwardKinematics(
|
||||
const FVector& StartPosition, const FQuat& StartRotation, const TArray<FVector>& JointLengths,
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "SGCore/SGForceFeedbackCommand.h"
|
||||
#include "SGCore/SGHandPose.h"
|
||||
#include "SGCore/SGHandProfile.h"
|
||||
#include "SGCore/SGNovaGloveHandProfile.h"
|
||||
#include "SGCore/SGNovaGloveInfo.h"
|
||||
#include "SGCore/SGNovaGloveSensorData.h"
|
||||
#include "SGCore/SGThumperCommand.h"
|
||||
@@ -69,42 +70,6 @@
|
||||
#include "SGInterop/SGIC_TArray_FVector.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
|
||||
|
||||
struct USGNovaGlove::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGDevice* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGNovaGlove* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGNovaGlove* USGNovaGlove::NewNovaGlove(UObject* Outer, const FSGNovaGloveImpl& NovaGloveImpl)
|
||||
{
|
||||
USGNovaGlove* Instance = NewObject<USGNovaGlove>(Outer);
|
||||
@@ -335,126 +300,63 @@ FString USGNovaGlove::ToBytes(const USGBuzzCommand* BuzzCommand)
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove()
|
||||
: USGHapticGlove(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const USGNovaGloveInfo& DeviceInfo)
|
||||
: USGHapticGlove(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGNovaGloveInfoImpl DeviceInfoContainer{DeviceInfo.ToNovaGloveInfoImpl()};
|
||||
SGCoreImpl_FSGSenseGloveImpl_ctor_Model_MakeShared(&OutSharedPtrContainer, &DeviceInfoContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const FSGDeviceImpl& SGDeviceImpl)
|
||||
: USGHapticGlove(SGDeviceImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(SGDeviceImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const FSGHapticGloveImpl& HapticGloveImpl)
|
||||
: USGHapticGlove(HapticGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(HapticGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const FSGNovaGloveImpl& NovaGloveImpl)
|
||||
: USGHapticGlove(NovaGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(NovaGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGDeviceImpl> SGDeviceImpl)
|
||||
: USGHapticGlove(SGDeviceImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(SGDeviceImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
|
||||
: USGHapticGlove(HapticGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(HapticGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
|
||||
: USGHapticGlove(NovaGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(NovaGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGlove::~USGNovaGlove() = default;
|
||||
|
||||
TSharedRef<FSGNovaGloveImpl> USGNovaGlove::ToNovaGloveImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGDeviceImplCast::ToNovaGloveImpl(ToSGDeviceImpl());
|
||||
}
|
||||
|
||||
void USGNovaGlove::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGNovaGlove::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
ESGDeviceType USGNovaGlove::GetDeviceType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_ESGDeviceType OutTypeContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -463,8 +365,6 @@ ESGDeviceType USGNovaGlove::GetDeviceType() const
|
||||
|
||||
FString USGNovaGlove::GetDeviceId() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FString OutIdContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
|
||||
@@ -473,8 +373,6 @@ FString USGNovaGlove::GetDeviceId() const
|
||||
|
||||
FString USGNovaGlove::GetHardwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FString OutVersionContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_GetHardwareVersion(&InstanceContainer, &OutVersionContainer);
|
||||
@@ -483,56 +381,38 @@ FString USGNovaGlove::GetHardwareVersion() const
|
||||
|
||||
int32 USGNovaGlove::GetFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveImpl_GetFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGNovaGlove::GetSubFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveImpl_GetSubFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGNovaGlove::HasBattery() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveImpl_HasBattery(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGNovaGlove::IsCharging()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_IsCharging(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool USGNovaGlove::GetBatteryLevel(float& OutBatteryLevel)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetBatteryLevel(&InstanceContainer, &OutBatteryLevel);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool USGNovaGlove::GetSensorData(UObject* Outer, USGNovaGloveSensorData*& OutSensorData)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGNovaGloveSensorDataImpl OutSensorDataContainer;
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
|
||||
@@ -548,14 +428,10 @@ bool USGNovaGlove::GetSensorData(UObject* Outer, USGNovaGloveSensorData*& OutSen
|
||||
|
||||
bool USGNovaGlove::GetImuRotation(FQuat& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = MoveTemp(OutImuContainer.Quat);
|
||||
@@ -566,14 +442,10 @@ bool USGNovaGlove::GetImuRotation(FQuat& OutImu)
|
||||
|
||||
bool USGNovaGlove::GetImuRotation(FRotator& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = OutImuContainer.Quat.Rotator();
|
||||
@@ -586,8 +458,6 @@ bool USGNovaGlove::GetHandPose(
|
||||
UObject* Outer, const USGBasicHandModel* HandModel, const USGNovaGloveHandProfile* Profile,
|
||||
USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGNovaGloveHandProfileImpl ProfileContainer{Profile->ToNovaGloveHandProfileImpl()};
|
||||
@@ -595,8 +465,6 @@ bool USGNovaGlove::GetHandPose(
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandModel_Profile_OutHandPose(
|
||||
&InstanceContainer, &HandModelContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -608,8 +476,6 @@ bool USGNovaGlove::GetHandPose(
|
||||
bool USGNovaGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile,
|
||||
USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
@@ -617,8 +483,6 @@ bool USGNovaGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeom
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &HandGeometryContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -629,16 +493,12 @@ bool USGNovaGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeom
|
||||
|
||||
bool USGNovaGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -651,8 +511,6 @@ void USGNovaGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackComma
|
||||
const USGBuzzCommand* BuzzCommand,
|
||||
const USGThumperCommand* ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
@@ -660,55 +518,37 @@ void USGNovaGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackComma
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGNovaGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
|
||||
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGNovaGlove::SendHaptics(const USGBuzzCommand* BuzzCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
|
||||
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &BuzzCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGNovaGlove::SendHaptics(const USGThumperCommand* ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGNovaGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_TArray_FVector OutValuesContainer;
|
||||
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetCalibrationValues_OutValues(
|
||||
&InstanceContainer, &OutValuesContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutValues = MoveTemp(OutValuesContainer.Array);
|
||||
@@ -719,8 +559,6 @@ bool USGNovaGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
|
||||
void USGNovaGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_ApplyCalibration_HandProfile(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -729,8 +567,6 @@ void USGNovaGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile)
|
||||
|
||||
void USGNovaGlove::ApplyCalibration(UObject* Outer, USGNovaGloveHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FSGNovaGloveHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_ApplyCalibration_NovaGloveHandProfile(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -742,8 +578,6 @@ void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FQua
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -765,8 +599,6 @@ void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FRot
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -788,8 +620,6 @@ void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FQua
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -810,8 +640,6 @@ void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FRot
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -830,30 +658,8 @@ void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FRot
|
||||
|
||||
FString USGNovaGlove::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
return MoveTemp(OutStringContainer.String);;
|
||||
}
|
||||
|
||||
USGNovaGlove::FImpl::FImpl(USGNovaGlove* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGNovaGlove::FImpl::~FImpl() = default;
|
||||
|
||||
void USGNovaGlove::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGNovaGlove::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGNovaGlove::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -71,14 +71,6 @@ struct USGNovaGloveHandProfile::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGNovaGloveHandProfile* USGNovaGloveHandProfile::NewNovaGloveHandProfile(
|
||||
@@ -121,33 +113,22 @@ USGNovaGloveHandProfile* USGNovaGloveHandProfile::Deserialize(UObject* Outer, co
|
||||
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
|
||||
FSGIC_FString SerializedStringContainer{SerializedString};
|
||||
SGCoreImpl_FSGNovaGloveHandProfileImpl_Deserialize(&OutNovaGloveHandProfileImplContainer,
|
||||
&SerializedStringContainer);
|
||||
&SerializedStringContainer);
|
||||
|
||||
return NewNovaGloveHandProfile(Outer, MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl));
|
||||
}
|
||||
|
||||
USGNovaGloveHandProfile::USGNovaGloveHandProfile()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
|
||||
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor(&OutNovaGloveHandProfileImplContainer);
|
||||
|
||||
Pimpl->NovaGloveHandProfileImpl = MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const bool bRightHanded, const USGHandInterpolator* Interpolator)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
|
||||
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
|
||||
@@ -155,19 +136,12 @@ USGNovaGloveHandProfile::USGNovaGloveHandProfile(const bool bRightHanded, const
|
||||
&OutNovaGloveHandProfileImplContainer, bRightHanded, &InterpolatorContainer);
|
||||
|
||||
Pimpl->NovaGloveHandProfileImpl = MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetNovaGloveHandProfileImpl(NovaGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveHandProfile::~USGNovaGloveHandProfile() = default;
|
||||
@@ -182,7 +156,6 @@ void USGNovaGloveHandProfile::SetNovaGloveHandProfileImpl(const FSGNovaGloveHand
|
||||
|
||||
const FSGNovaGloveHandProfileImpl& USGNovaGloveHandProfile::ToNovaGloveHandProfileImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->NovaGloveHandProfileImpl;
|
||||
}
|
||||
|
||||
@@ -203,8 +176,6 @@ USGHandInterpolator* USGNovaGloveHandProfile::GetInterpolationSet(UObject* Outer
|
||||
|
||||
bool USGNovaGloveHandProfile::Equals(const USGNovaGloveHandProfile* NovaGloveHandProfile) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
|
||||
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveHandProfileImpl_Equals(&InstanceContainer, &NovaGloveHandProfileContainer);
|
||||
@@ -212,18 +183,12 @@ bool USGNovaGloveHandProfile::Equals(const USGNovaGloveHandProfile* NovaGloveHan
|
||||
|
||||
void USGNovaGloveHandProfile::Reset()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
|
||||
SGCoreImpl_FSGNovaGloveHandProfileImpl_Reset(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
FString USGNovaGloveHandProfile::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -240,12 +205,4 @@ USGNovaGloveHandProfile::FImpl::~FImpl() = default;
|
||||
void USGNovaGloveHandProfile::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGNovaGloveHandProfile::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGNovaGloveHandProfile::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -69,13 +69,6 @@ struct USGNovaGloveInfo::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGNovaGloveInfo* USGNovaGloveInfo::NewNovaGloveInfo(UObject* Outer, const FSGNovaGloveInfoImpl& NovaGloveInfoImpl)
|
||||
@@ -134,30 +127,19 @@ USGNovaGloveInfo* USGNovaGloveInfo::Deserialize(UObject* Outer, const FString& S
|
||||
}
|
||||
|
||||
USGNovaGloveInfo::USGNovaGloveInfo()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveInfoImpl OutNovaGloveInfoImplContainer;
|
||||
SGCoreImpl_FSGNovaGloveInfoImpl_ctor(&OutNovaGloveInfoImplContainer);
|
||||
|
||||
Pimpl->NovaGloveInfoImpl = MoveTemp(OutNovaGloveInfoImplContainer.NovaGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveInfo::USGNovaGloveInfo(
|
||||
const FString& DeviceId,
|
||||
const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion,
|
||||
const bool bRightHanded, const FQuat& ImuCorrection, const int32 NumberOfSensors)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveInfoImpl OutNovaGloveInfoImplContainer;
|
||||
FSGIC_FString DeviceIdContainer{DeviceId};
|
||||
@@ -169,19 +151,12 @@ USGNovaGloveInfo::USGNovaGloveInfo(
|
||||
bRightHanded, &ImuCorrectionContainer, NumberOfSensors);
|
||||
|
||||
Pimpl->NovaGloveInfoImpl = MoveTemp(OutNovaGloveInfoImplContainer.NovaGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveInfo::USGNovaGloveInfo(const FSGNovaGloveInfoImpl& NovaGloveInfoImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetNovaGloveInfoImpl(NovaGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveInfo::~USGNovaGloveInfo() = default;
|
||||
@@ -196,13 +171,11 @@ void USGNovaGloveInfo::SetNovaGloveInfoImpl(const FSGNovaGloveInfoImpl& NovaGlov
|
||||
|
||||
const FSGNovaGloveInfoImpl& USGNovaGloveInfo::ToNovaGloveInfoImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->NovaGloveInfoImpl;
|
||||
}
|
||||
|
||||
FSGNovaGloveInfoImpl& USGNovaGloveInfo::ToNovaGloveInfoImpl()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->NovaGloveInfoImpl;
|
||||
}
|
||||
|
||||
@@ -264,8 +237,6 @@ int32 USGNovaGloveInfo::GetNumberOfSensors() const
|
||||
|
||||
bool USGNovaGloveInfo::Equals(const USGNovaGloveInfo* NovaGloveInfo) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
|
||||
FSGIC_FSGNovaGloveInfoImpl NovaGloveInfoImplContainer{NovaGloveInfo->ToNovaGloveInfoImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveInfoImpl_Equals(&InstanceContainer, &NovaGloveInfoImplContainer);
|
||||
@@ -273,8 +244,6 @@ bool USGNovaGloveInfo::Equals(const USGNovaGloveInfo* NovaGloveInfo) const
|
||||
|
||||
FString USGNovaGloveInfo::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveInfoImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -283,8 +252,6 @@ FString USGNovaGloveInfo::ToString() const
|
||||
|
||||
FString USGNovaGloveInfo::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveInfoImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -301,12 +268,4 @@ USGNovaGloveInfo::FImpl::~FImpl() = default;
|
||||
void USGNovaGloveInfo::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGNovaGloveInfo::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGNovaGloveInfo::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -73,13 +73,6 @@ struct USGNovaGloveSensorData::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGNovaGloveSensorData* USGNovaGloveSensorData::NewNovaGloveSensorData(
|
||||
@@ -156,29 +149,18 @@ USGNovaGloveSensorData* USGNovaGloveSensorData::Deserialize(UObject* Outer, cons
|
||||
}
|
||||
|
||||
USGNovaGloveSensorData::USGNovaGloveSensorData()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
|
||||
SGCoreImpl_FSGNovaGloveSensorDataImpl_ctor(&OutNovaGloveSensorDataImplContainer);
|
||||
|
||||
Pimpl->NovaGloveSensorDataImpl = MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, const int32 ParsedValues,
|
||||
const FQuat& ImuRotation, const bool bImuParsed,
|
||||
const float BatteryLevel, const bool bCharging)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
|
||||
FSGIC_TArray_FVector ValuesContainer{Values};
|
||||
@@ -188,18 +170,12 @@ USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, co
|
||||
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
|
||||
|
||||
Pimpl->NovaGloveSensorDataImpl = MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, const int32 ParsedValues,
|
||||
const FRotator& ImuRotation, const bool bImuParsed,
|
||||
const float BatteryLevel, const bool bCharging)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
|
||||
FSGIC_TArray_FVector ValuesContainer{Values};
|
||||
@@ -209,19 +185,12 @@ USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, co
|
||||
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
|
||||
|
||||
Pimpl->NovaGloveSensorDataImpl = MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveSensorData::USGNovaGloveSensorData(const FSGNovaGloveSensorDataImpl& NovaGloveSensorDataImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetNovaGloveSensorDataImpl(NovaGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGNovaGloveSensorData::~USGNovaGloveSensorData() = default;
|
||||
@@ -236,7 +205,6 @@ void USGNovaGloveSensorData::SetNovaGloveSensorDataImpl(const FSGNovaGloveSensor
|
||||
|
||||
const FSGNovaGloveSensorDataImpl& USGNovaGloveSensorData::ToNovaGloveSensorDataImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->NovaGloveSensorDataImpl;
|
||||
}
|
||||
|
||||
@@ -290,8 +258,6 @@ bool USGNovaGloveSensorData::IsCharging() const
|
||||
|
||||
bool USGNovaGloveSensorData::Equals(const USGNovaGloveSensorData* NovaGloveSensorData) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
|
||||
FSGIC_FSGNovaGloveSensorDataImpl NovaGloveSensorDataContainer{NovaGloveSensorData->ToNovaGloveSensorDataImpl()};
|
||||
return SGCoreImpl_FSGNovaGloveSensorDataImpl_Equals(&InstanceContainer, &NovaGloveSensorDataContainer);
|
||||
@@ -299,8 +265,6 @@ bool USGNovaGloveSensorData::Equals(const USGNovaGloveSensorData* NovaGloveSenso
|
||||
|
||||
FString USGNovaGloveSensorData::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveSensorDataImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -309,8 +273,6 @@ FString USGNovaGloveSensorData::ToString() const
|
||||
|
||||
FString USGNovaGloveSensorData::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGNovaGloveSensorDataImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -327,12 +289,4 @@ USGNovaGloveSensorData::FImpl::~FImpl() = default;
|
||||
void USGNovaGloveSensorData::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGNovaGloveSensorData::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGNovaGloveSensorData::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -67,42 +67,6 @@
|
||||
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
|
||||
|
||||
struct USGSenseGlove::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGDevice* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGSenseGlove* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSenseGlove* USGSenseGlove::NewSenseGlove(UObject* Outer, const FSGSenseGloveImpl& SenseGloveImpl)
|
||||
{
|
||||
USGSenseGlove* Instance = NewObject<USGSenseGlove>(Outer);
|
||||
@@ -354,126 +318,58 @@ void USGSenseGlove::CalculateWristLocation(const FVector& ReferencePosition, con
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove()
|
||||
: USGHapticGlove(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(const USGSenseGloveInfo& Model)
|
||||
: USGHapticGlove(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGSenseGloveInfoImpl ModelContainer{Model.ToSenseGloveInfoImpl()};
|
||||
SGCoreImpl_FSGSenseGloveImpl_ctor_Model_MakeShared(&OutSharedPtrContainer, &ModelContainer);
|
||||
|
||||
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(const FSGDeviceImpl& SGDeviceImpl)
|
||||
: USGHapticGlove(SGDeviceImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(SGDeviceImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(const FSGHapticGloveImpl& HapticGloveImpl)
|
||||
: USGHapticGlove(HapticGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(HapticGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(const FSGSenseGloveImpl& SenseGloveImpl)
|
||||
: USGHapticGlove(SenseGloveImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(SenseGloveImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
|
||||
: USGHapticGlove(MoveTemp(SGDeviceImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(MoveTemp(SGDeviceImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
|
||||
: USGHapticGlove(MoveTemp(HapticGloveImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(MoveTemp(HapticGloveImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::USGSenseGlove(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
|
||||
: USGHapticGlove(MoveTemp(SenseGloveImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGHapticGlove(MoveTemp(SenseGloveImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlove::~USGSenseGlove() = default;
|
||||
|
||||
TSharedRef<FSGSenseGloveImpl> USGSenseGlove::ToSenseGloveImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGDeviceImplCast::ToSenseGloveImpl(ToSGDeviceImpl());
|
||||
}
|
||||
|
||||
void USGSenseGlove::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGSenseGlove::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo* USGSenseGlove::GetGloveModel(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGSenseGloveInfoImpl OutModelContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_GetGloveModel(&InstanceContainer, &OutModelContainer);
|
||||
@@ -483,16 +379,12 @@ USGSenseGloveInfo* USGSenseGlove::GetGloveModel(UObject* Outer) const
|
||||
|
||||
bool USGSenseGlove::IsRight() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
return SGCoreImpl_FSGSenseGloveImpl_IsRight(&InstanceContainer);
|
||||
}
|
||||
|
||||
ESGDeviceType USGSenseGlove::GetDeviceType() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_ESGDeviceType OutTypeContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
|
||||
@@ -501,8 +393,6 @@ ESGDeviceType USGSenseGlove::GetDeviceType() const
|
||||
|
||||
FString USGSenseGlove::GetDeviceId() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FString OutIdContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
|
||||
@@ -511,8 +401,6 @@ FString USGSenseGlove::GetDeviceId() const
|
||||
|
||||
FString USGSenseGlove::GetHardwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FString OutVersionContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_GetHardwareVersion(&InstanceContainer, &OutVersionContainer);
|
||||
@@ -521,24 +409,18 @@ FString USGSenseGlove::GetHardwareVersion() const
|
||||
|
||||
int32 USGSenseGlove::GetFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
return SGCoreImpl_FSGSenseGloveImpl_GetFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
int32 USGSenseGlove::GetSubFirmwareVersion() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
return SGCoreImpl_FSGSenseGloveImpl_GetSubFirmwareVersion(&InstanceContainer);
|
||||
}
|
||||
|
||||
bool USGSenseGlove::GetSensorData(UObject* Outer, USGSenseGloveSensorData*& OutSensorData) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGSenseGloveSensorDataImpl OutSensorDataContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
|
||||
@@ -554,14 +436,10 @@ bool USGSenseGlove::GetSensorData(UObject* Outer, USGSenseGloveSensorData*& OutS
|
||||
|
||||
bool USGSenseGlove::GetImuRotation(FQuat& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = MoveTemp(OutImuContainer.Quat);
|
||||
@@ -572,14 +450,10 @@ bool USGSenseGlove::GetImuRotation(FQuat& OutImu)
|
||||
|
||||
bool USGSenseGlove::GetImuRotation(FRotator& OutImu)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FQuat OutImuContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutImu = OutImuContainer.Quat.Rotator();
|
||||
@@ -590,15 +464,11 @@ bool USGSenseGlove::GetImuRotation(FRotator& OutImu)
|
||||
|
||||
bool USGSenseGlove::GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_OutGlovePose(
|
||||
&InstanceContainer, &OutGlovePoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
|
||||
@@ -610,16 +480,12 @@ bool USGSenseGlove::GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePos
|
||||
bool USGSenseGlove::GetGlovePose(
|
||||
UObject* Outer, const USGSenseGloveSensorData* SensorData, USGSenseGlovePose*& OutGlovePose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGSenseGloveSensorDataImpl SensorDataContainer{SensorData->ToSenseGloveSensorDataImpl()};
|
||||
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_SensorData_OutGlovePose(
|
||||
&InstanceContainer, &SensorDataContainer, &OutGlovePoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
|
||||
@@ -632,8 +498,6 @@ bool USGSenseGlove::GetHandPose(
|
||||
UObject* Outer, const USGBasicHandModel* HandModel, const USGSenseGloveHandProfile* Profile,
|
||||
USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGSenseGloveHandProfileImpl ProfileContainer{Profile->ToSenseGloveHandProfileImpl()};
|
||||
@@ -641,8 +505,6 @@ bool USGSenseGlove::GetHandPose(
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandModel_Profile_OutHandPose(
|
||||
&InstanceContainer, &HandModelContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -654,8 +516,6 @@ bool USGSenseGlove::GetHandPose(
|
||||
bool USGSenseGlove::GetHandPose(
|
||||
UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
|
||||
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
@@ -663,8 +523,6 @@ bool USGSenseGlove::GetHandPose(
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &HandGeometryContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -675,16 +533,12 @@ bool USGSenseGlove::GetHandPose(
|
||||
|
||||
bool USGSenseGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()};
|
||||
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandProfile_OutHandPose(
|
||||
&InstanceContainer, &ProfileContainer, &OutHandPoseContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
|
||||
@@ -696,8 +550,6 @@ bool USGSenseGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfil
|
||||
bool USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, const USGBuzzCommand* BuzzCommand,
|
||||
ESGSenseGloveThumperCommand ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
|
||||
@@ -710,55 +562,39 @@ bool USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackComm
|
||||
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ESenseGloveThumperCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool USGSenseGlove::SendHaptics(ESGSenseGloveThumperCommand ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_ESGSenseGloveThumperCommand ThumperCommandContainer{ThumperCommand};
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ThumperCommand(
|
||||
&InstanceContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
|
||||
};
|
||||
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGSenseGlove::SendHaptics(const USGBuzzCommand* BuzzCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
|
||||
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &BuzzCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
|
||||
const USGBuzzCommand* BuzzCommand,
|
||||
const USGThumperCommand* ThumperCommand)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
|
||||
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
|
||||
@@ -767,21 +603,15 @@ void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackComm
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
|
||||
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
bool USGSenseGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_TArray_FVector OutValuesContainer;
|
||||
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetCalibrationValues_OutValues(
|
||||
&InstanceContainer, &OutValuesContainer);
|
||||
|
||||
SyncUProperties();
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
OutValues = MoveTemp(OutValuesContainer.Array);
|
||||
@@ -792,18 +622,12 @@ bool USGSenseGlove::GetCalibrationValues(TArray<FVector>& OutValues)
|
||||
|
||||
void USGSenseGlove::ResetCalibrationRange()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
SGCoreImpl_FSGSenseGloveImpl_ResetCalibrationRange(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGSenseGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_ApplyCalibration_HandProfile(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -812,8 +636,6 @@ void USGSenseGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile
|
||||
|
||||
void USGSenseGlove::ApplyCalibration(UObject* Outer, USGSenseGloveHandProfile*& OutProfile) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FSGSenseGloveHandProfileImpl OutProfileContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_ApplyCalibration_SenseGloveHandProfile(&InstanceContainer, &OutProfileContainer);
|
||||
@@ -825,8 +647,6 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQu
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -848,8 +668,6 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FRo
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -871,8 +689,6 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQu
|
||||
const ESGPositionalTrackingHardware TrackingHardware, const ESGFinger MountedOn,
|
||||
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -895,8 +711,6 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FRo
|
||||
const ESGPositionalTrackingHardware TrackingHardware, const ESGFinger MountedOn,
|
||||
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -919,8 +733,6 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQu
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -941,8 +753,6 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRo
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -965,8 +775,6 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQu
|
||||
const FQuat& GloveWristRotationOffset,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
|
||||
@@ -992,8 +800,6 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRo
|
||||
const FRotator& GloveWristRotationOffset,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
@@ -1015,30 +821,8 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRo
|
||||
|
||||
FString USGSenseGlove::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
return MoveTemp(OutStringContainer.String);;
|
||||
}
|
||||
|
||||
USGSenseGlove::FImpl::FImpl(USGSenseGlove* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGSenseGlove::FImpl::~FImpl() = default;
|
||||
|
||||
void USGSenseGlove::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSenseGlove::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSenseGlove::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -75,13 +75,6 @@ struct USGSenseGloveHandProfile::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSenseGloveHandProfile* USGSenseGloveHandProfile::NewSenseGloveHandProfile(
|
||||
@@ -142,29 +135,18 @@ FVector USGSenseGloveHandProfile::GetDefaultThimbleOffset()
|
||||
}
|
||||
|
||||
USGSenseGloveHandProfile::USGSenseGloveHandProfile()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
|
||||
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor(&OutSenseGloveHandProfileImplContainer);
|
||||
|
||||
Pimpl->SenseGloveHandProfileImpl = MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveHandProfile::USGSenseGloveHandProfile(const bool bRightHanded, const USGHandInterpolator* Interpolator,
|
||||
const ESGThumbSolver ThumbSolver, const ESGFingerSolver FingerSolver,
|
||||
const TArray<FVector>& FingerThimbleOffset)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
|
||||
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
|
||||
@@ -176,19 +158,12 @@ USGSenseGloveHandProfile::USGSenseGloveHandProfile(const bool bRightHanded, cons
|
||||
&ThumbSolverContainer, &FingerSolverContainer, &FingerThimbleOffsetContainer);
|
||||
|
||||
Pimpl->SenseGloveHandProfileImpl = MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveHandProfile::USGSenseGloveHandProfile(const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetSenseGloveHandProfileImpl(SenseGloveHandProfileImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveHandProfile::~USGSenseGloveHandProfile() = default;
|
||||
@@ -204,7 +179,6 @@ void USGSenseGloveHandProfile::SetSenseGloveHandProfileImpl(
|
||||
|
||||
const FSGSenseGloveHandProfileImpl& USGSenseGloveHandProfile::ToSenseGloveHandProfileImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SenseGloveHandProfileImpl;
|
||||
}
|
||||
|
||||
@@ -249,8 +223,6 @@ TArray<FVector> USGSenseGloveHandProfile::GetFingerThimbleOffset() const
|
||||
|
||||
bool USGSenseGloveHandProfile::Equals(const USGSenseGloveHandProfile* SenseGloveHandProfile) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
|
||||
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer{
|
||||
SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
|
||||
@@ -259,18 +231,12 @@ bool USGSenseGloveHandProfile::Equals(const USGSenseGloveHandProfile* SenseGlove
|
||||
|
||||
void USGSenseGloveHandProfile::Reset()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
|
||||
SGCoreImpl_FSGSenseGloveHandProfileImpl_Reset(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
FString USGSenseGloveHandProfile::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -287,12 +253,4 @@ USGSenseGloveHandProfile::FImpl::~FImpl() = default;
|
||||
void USGSenseGloveHandProfile::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSenseGloveHandProfile::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSenseGloveHandProfile::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "SGInterop/SGIC_TArray_FVector.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_float.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
struct USGSenseGloveInfo::FImpl
|
||||
{
|
||||
@@ -76,13 +77,6 @@ struct USGSenseGloveInfo::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FSGSenseGloveInfoImpl& SenseGloveInfoImpl)
|
||||
@@ -238,18 +232,12 @@ USGSenseGloveInfo* USGSenseGloveInfo::Deserialize(UObject* Outer, const FString&
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
|
||||
SGCoreImpl_FSGSenseGloveInfoImpl_ctor(&OutSenseGloveInfoImplContainer);
|
||||
|
||||
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
@@ -258,12 +246,7 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
const bool bRightHanded, const int32 NumberOfSensors, const FQuat& ImuCorrection,
|
||||
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
|
||||
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
|
||||
FSGIC_FString DeviceIdContainer{DeviceId};
|
||||
@@ -281,7 +264,6 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
&GloveLengthsContainer, &FunctionsContainer);
|
||||
|
||||
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
@@ -290,12 +272,7 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
const bool bRightHanded, const int32 NumberOfSensors, const FRotator& ImuCorrection,
|
||||
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
|
||||
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
|
||||
FSGIC_FString DeviceIdContainer{DeviceId};
|
||||
@@ -313,7 +290,6 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
&GloveLengthsContainer, &FunctionsContainer);
|
||||
|
||||
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
@@ -341,7 +317,6 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
&GloveLengthsContainer, &FunctionsContainer);
|
||||
|
||||
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
@@ -369,19 +344,12 @@ USGSenseGloveInfo::USGSenseGloveInfo(
|
||||
&GloveLengthsContainer, &FunctionsContainer);
|
||||
|
||||
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::USGSenseGloveInfo(const FSGSenseGloveInfoImpl& SenseGloveInfoImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetSenseGloveInfoImpl(SenseGloveInfoImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveInfo::~USGSenseGloveInfo() = default;
|
||||
@@ -396,13 +364,11 @@ void USGSenseGloveInfo::SetSenseGloveInfoImpl(const FSGSenseGloveInfoImpl& Sense
|
||||
|
||||
const FSGSenseGloveInfoImpl& USGSenseGloveInfo::ToSenseGloveInfoImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SenseGloveInfoImpl;
|
||||
}
|
||||
|
||||
FSGSenseGloveInfoImpl& USGSenseGloveInfo::ToSenseGloveInfoImpl()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SenseGloveInfoImpl;
|
||||
}
|
||||
|
||||
@@ -504,8 +470,6 @@ TArray<bool> USGSenseGloveInfo::GetFunctions() const
|
||||
|
||||
FVector USGSenseGloveInfo::GetStartPosition(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FVector OutPositionContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -515,8 +479,6 @@ FVector USGSenseGloveInfo::GetStartPosition(const ESGFinger Finger) const
|
||||
|
||||
FQuat USGSenseGloveInfo::GetStartRotationQ(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FQuat OutRotationContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -526,8 +488,6 @@ FQuat USGSenseGloveInfo::GetStartRotationQ(const ESGFinger Finger) const
|
||||
|
||||
FRotator USGSenseGloveInfo::GetStartRotation(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FQuat OutRotationContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -537,8 +497,6 @@ FRotator USGSenseGloveInfo::GetStartRotation(const ESGFinger Finger) const
|
||||
|
||||
TArray<FVector> USGSenseGloveInfo::GetGloveLengths(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_TArray_FVector OutLengths;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -548,8 +506,6 @@ TArray<FVector> USGSenseGloveInfo::GetGloveLengths(const ESGFinger Finger) const
|
||||
|
||||
TArray<TArray<FVector>> USGSenseGloveInfo::ToGloveAngles(const TArray<TArray<float>>& SensorAngles) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_TArray_TArray_FVector OutAnglesContainer;
|
||||
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
|
||||
@@ -559,8 +515,6 @@ TArray<TArray<FVector>> USGSenseGloveInfo::ToGloveAngles(const TArray<TArray<flo
|
||||
|
||||
bool USGSenseGloveInfo::Equals(const USGSenseGloveInfo* SenseGloveInfo) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FSGSenseGloveInfoImpl SenseGloveInfoImplContainer{SenseGloveInfo->ToSenseGloveInfoImpl()};
|
||||
return SGCoreImpl_FSGSenseGloveInfoImpl_Equals(&InstanceContainer, &SenseGloveInfoImplContainer);
|
||||
@@ -568,8 +522,6 @@ bool USGSenseGloveInfo::Equals(const USGSenseGloveInfo* SenseGloveInfo) const
|
||||
|
||||
FString USGSenseGloveInfo::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveInfoImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -578,8 +530,6 @@ FString USGSenseGloveInfo::ToString() const
|
||||
|
||||
FString USGSenseGloveInfo::ToString(const bool bShortNotation) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveInfoImpl_ToString_bShortNotation(&InstanceContainer, &OutStringContainer, bShortNotation);
|
||||
@@ -588,8 +538,6 @@ FString USGSenseGloveInfo::ToString(const bool bShortNotation) const
|
||||
|
||||
FString USGSenseGloveInfo::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveInfoImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -606,12 +554,4 @@ USGSenseGloveInfo::FImpl::~FImpl() = default;
|
||||
void USGSenseGloveInfo::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSenseGloveInfo::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSenseGloveInfo::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "SGInterop/SGIC_TArray_FVector.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_FQuat.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
struct USGSenseGlovePose::FImpl
|
||||
{
|
||||
@@ -77,13 +78,6 @@ struct USGSenseGlovePose::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const FSGSenseGlovePoseImpl& SenseGlovePoseImpl)
|
||||
@@ -196,30 +190,19 @@ USGSenseGlovePose* USGSenseGlovePose::Deserialize(UObject* Outer, const FString&
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_ctor(&OutSenseGlovePoseImplContainer);
|
||||
|
||||
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
const TArray<TArray<FVector>>& JointPositions,
|
||||
const TArray<TArray<FQuat>>& JointRotations,
|
||||
const TArray<TArray<FVector>>& GloveAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
|
||||
@@ -230,19 +213,13 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &GloveAnglesContainer);
|
||||
|
||||
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
const TArray<TArray<FVector>>& JointPositions,
|
||||
const TArray<TArray<FRotator>>& JointRotations,
|
||||
const TArray<TArray<FVector>>& GloveAngles)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
|
||||
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
|
||||
@@ -253,7 +230,6 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &GloveAnglesContainer);
|
||||
|
||||
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
@@ -276,7 +252,6 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &GloveAnglesContainer);
|
||||
|
||||
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
@@ -299,19 +274,12 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
|
||||
&JointRotationsContainer, &GloveAnglesContainer);
|
||||
|
||||
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::USGSenseGlovePose(const FSGSenseGlovePoseImpl& SenseGlovePoseImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetSenseGlovePoseImpl(SenseGlovePoseImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGlovePose::~USGSenseGlovePose() = default;
|
||||
@@ -326,7 +294,6 @@ void USGSenseGlovePose::SetSenseGlovePoseImpl(const FSGSenseGlovePoseImpl& Sense
|
||||
|
||||
const FSGSenseGlovePoseImpl& USGSenseGlovePose::ToSenseGlovePoseImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SenseGlovePoseImpl;
|
||||
}
|
||||
|
||||
@@ -370,8 +337,6 @@ TArray<TArray<FVector>> USGSenseGlovePose::GetGloveAngles() const
|
||||
|
||||
TArray<FVector> USGSenseGlovePose::GetThimblePositions() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FVector OutPositionsContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_GetThimblePositions(&InstanceContainer, &OutPositionsContainer);
|
||||
@@ -380,8 +345,6 @@ TArray<FVector> USGSenseGlovePose::GetThimblePositions() const
|
||||
|
||||
TArray<FQuat> USGSenseGlovePose::GetThimbleRotationsQ() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FQuat OutRotationsContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_GetThimbleRotations(&InstanceContainer, &OutRotationsContainer);
|
||||
@@ -390,8 +353,6 @@ TArray<FQuat> USGSenseGlovePose::GetThimbleRotationsQ() const
|
||||
|
||||
TArray<FRotator> USGSenseGlovePose::GetThimbleRotations() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FQuat OutRotationsContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_GetThimbleRotations(&InstanceContainer, &OutRotationsContainer);
|
||||
@@ -400,8 +361,6 @@ TArray<FRotator> USGSenseGlovePose::GetThimbleRotations() const
|
||||
|
||||
TArray<FVector> USGSenseGlovePose::GetTotalGloveAngles() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FVector OutAnglesContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_GetTotalGloveAngles(&InstanceContainer, &OutAnglesContainer);
|
||||
@@ -410,8 +369,6 @@ TArray<FVector> USGSenseGlovePose::GetTotalGloveAngles() const
|
||||
|
||||
TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const USGSenseGloveHandProfile* SenseGloveHandProfile) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FVector OutFingerTipsContainer;
|
||||
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileImplContainer{
|
||||
@@ -423,8 +380,6 @@ TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const USGSenseGloveHandPr
|
||||
|
||||
TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const TArray<FVector>& FingerOffsets) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_TArray_FVector OutFingerTipsContainer;
|
||||
FSGIC_TArray_FVector FingerOffsetsContainer{FingerOffsets};
|
||||
@@ -435,8 +390,6 @@ TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const TArray<FVector>& Fi
|
||||
|
||||
bool USGSenseGlovePose::Equals(const USGSenseGlovePose* SenseGlovePose) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_FSGSenseGlovePoseImpl SenseGlovePoseContainer{SenseGlovePose->ToSenseGlovePoseImpl()};
|
||||
return SGCoreImpl_FSGSenseGlovePoseImpl_Equals(&InstanceContainer, &SenseGlovePoseContainer);
|
||||
@@ -444,8 +397,6 @@ bool USGSenseGlovePose::Equals(const USGSenseGlovePose* SenseGlovePose) const
|
||||
|
||||
FString USGSenseGlovePose::ToString(const bool bShortFormat) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_ToString(&InstanceContainer, &OutStringContainer, bShortFormat);
|
||||
@@ -454,8 +405,6 @@ FString USGSenseGlovePose::ToString(const bool bShortFormat) const
|
||||
|
||||
FString USGSenseGlovePose::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGlovePoseImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -472,12 +421,4 @@ USGSenseGlovePose::FImpl::~FImpl() = default;
|
||||
void USGSenseGlovePose::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSenseGlovePose::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSenseGlovePose::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
#include "SGInterop/SGIC_TArray_float.h"
|
||||
#include "SGInterop/SGIC_TArray_TArray_float.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
struct USGSenseGloveSensorData::FImpl
|
||||
{
|
||||
@@ -74,13 +75,6 @@ struct USGSenseGloveSensorData::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
|
||||
@@ -186,28 +180,17 @@ USGSenseGloveSensorData* USGSenseGloveSensorData::Deserialize(UObject* Outer, co
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
|
||||
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor(&OutSenseGloveSensorDataImplContainer);
|
||||
|
||||
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles, const FQuat& ImuRotation,
|
||||
const int32 ParsedValues, const bool bImuParsed)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
|
||||
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
|
||||
@@ -216,17 +199,11 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& Se
|
||||
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
|
||||
|
||||
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles, const FRotator& ImuRotation,
|
||||
const int32 ParsedValues, const bool bImuParsed)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
|
||||
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
|
||||
@@ -235,7 +212,6 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& Se
|
||||
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
|
||||
|
||||
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles, const FQuat& ImuRotation,
|
||||
@@ -250,7 +226,6 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& Se
|
||||
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
|
||||
|
||||
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles, const FRotator& ImuRotation,
|
||||
@@ -265,19 +240,12 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& Se
|
||||
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
|
||||
|
||||
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::USGSenseGloveSensorData(const FSGSenseGloveSensorDataImpl& SenseGloveSensorDataImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetSenseGloveSensorDataImpl(SenseGloveSensorDataImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSenseGloveSensorData::~USGSenseGloveSensorData() = default;
|
||||
@@ -292,7 +260,6 @@ void USGSenseGloveSensorData::SetSenseGloveSensorDataImpl(const FSGSenseGloveSen
|
||||
|
||||
const FSGSenseGloveSensorDataImpl& USGSenseGloveSensorData::ToSenseGloveSensorDataImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SenseGloveSensorDataImpl;
|
||||
}
|
||||
|
||||
@@ -334,8 +301,6 @@ bool USGSenseGloveSensorData::IsImuParsed() const
|
||||
|
||||
TArray<float> USGSenseGloveSensorData::GetSensorAngles(const ESGFinger Finger) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
|
||||
FSGIC_TArray_float OutAnglesContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -354,8 +319,6 @@ TArray<float> USGSenseGloveSensorData::GetAngleSequence() const
|
||||
|
||||
bool USGSenseGloveSensorData::Equals(const USGSenseGloveSensorData* SenseGloveSensorData) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
|
||||
FSGIC_FSGSenseGloveSensorDataImpl SenseGloveSensorDataContainer{SenseGloveSensorData->ToSenseGloveSensorDataImpl()};
|
||||
return SGCoreImpl_FSGSenseGloveSensorDataImpl_Equals(&InstanceContainer, &SenseGloveSensorDataContainer);
|
||||
@@ -363,8 +326,6 @@ bool USGSenseGloveSensorData::Equals(const USGSenseGloveSensorData* SenseGloveSe
|
||||
|
||||
FString USGSenseGloveSensorData::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveSensorDataImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -373,8 +334,6 @@ FString USGSenseGloveSensorData::ToString() const
|
||||
|
||||
FString USGSenseGloveSensorData::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSenseGloveSensorDataImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -391,12 +350,4 @@ USGSenseGloveSensorData::FImpl::~FImpl() = default;
|
||||
void USGSenseGloveSensorData::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSenseGloveSensorData::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSenseGloveSensorData::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -70,13 +70,6 @@ struct USGSensorRange::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGSensorRange* USGSensorRange::NewSensorRange(UObject* Outer, const FSGSensorRangeImpl& SensorRangeImpl)
|
||||
@@ -140,27 +133,16 @@ void USGSensorRange::CheckMin(const FVector& CurrentValues, FVector& OutMinValue
|
||||
}
|
||||
|
||||
USGSensorRange::USGSensorRange()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
|
||||
SGCoreImpl_FSGSensorRangeImpl_ctor(&OutSensorRangeImplContainer);
|
||||
|
||||
Pimpl->SensorRangeImpl = MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSensorRange::USGSensorRange(const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
|
||||
FSGIC_TArray_FVector MinValuesContainer{MinValues};
|
||||
@@ -169,19 +151,12 @@ USGSensorRange::USGSensorRange(const TArray<FVector>& MinValues, const TArray<FV
|
||||
&OutSensorRangeImplContainer, &MinValuesContainer, &MaxValuesContainer);
|
||||
|
||||
Pimpl->SensorRangeImpl = MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSensorRange::USGSensorRange(const FSGSensorRangeImpl& SensorRangeImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetSensorRangeImpl(SensorRangeImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGSensorRange::~USGSensorRange() = default;
|
||||
@@ -196,7 +171,6 @@ void USGSensorRange::SetSensorRangeImpl(const FSGSensorRangeImpl& SensorRangeImp
|
||||
|
||||
const FSGSensorRangeImpl& USGSensorRange::ToSensorRangeImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->SensorRangeImpl;
|
||||
}
|
||||
|
||||
@@ -240,29 +214,19 @@ TArray<FVector> USGSensorRange::GetRange() const
|
||||
|
||||
void USGSensorRange::UpdateRange()
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
|
||||
SGCoreImpl_FSGSensorRangeImpl_UpdateRange(&InstanceContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
void USGSensorRange::CheckForExtremes(const TArray<FVector>& OtherValues)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
|
||||
FSGIC_TArray_FVector OtherValuesContainer{OtherValues};
|
||||
SGCoreImpl_FSGSensorRangeImpl_CheckForExtremes(&InstanceContainer, &OtherValuesContainer);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
FString USGSensorRange::RangeString(const bool bYOnly) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSensorRangeImpl_RangeString(&InstanceContainer, &OutStringContainer, bYOnly);
|
||||
@@ -271,8 +235,6 @@ FString USGSensorRange::RangeString(const bool bYOnly) const
|
||||
|
||||
FString USGSensorRange::ToString(const bool bYOnly) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSensorRangeImpl_ToString(&InstanceContainer, &OutStringContainer, bYOnly);
|
||||
@@ -281,8 +243,6 @@ FString USGSensorRange::ToString(const bool bYOnly) const
|
||||
|
||||
FString USGSensorRange::SGSerialize() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGSensorRangeImpl_Serialize(&InstanceContainer, &OutStringContainer);
|
||||
@@ -299,12 +259,4 @@ USGSensorRange::FImpl::~FImpl() = default;
|
||||
void USGSensorRange::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGSensorRange::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGSensorRange::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -65,13 +65,6 @@ struct USGThumperCommand::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGThumperCommand* USGThumperCommand::NewThumperCommand(UObject* Outer, const FSGThumperCommandImpl& ThumperCommandImpl)
|
||||
@@ -106,45 +99,27 @@ USGThumperCommand* USGThumperCommand::Off(UObject* Outer)
|
||||
}
|
||||
|
||||
USGThumperCommand::USGThumperCommand()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
|
||||
SGCoreImpl_FSGThumperCommandImpl_ctor(&OutThumperCommandImplContainer);
|
||||
|
||||
Pimpl->ThumperCommandImpl = MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGThumperCommand::USGThumperCommand(const int32 Magnitude)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
|
||||
SGCoreImpl_FSGThumperCommandImpl_ctor_Magnitude(&OutThumperCommandImplContainer, Magnitude);
|
||||
|
||||
Pimpl->ThumperCommandImpl = MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGThumperCommand::USGThumperCommand(const FSGThumperCommandImpl& ThumperCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetThumperCommandImpl(ThumperCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGThumperCommand::~USGThumperCommand() = default;
|
||||
@@ -164,26 +139,18 @@ const FSGThumperCommandImpl& USGThumperCommand::ToThumperCommandImpl() const
|
||||
|
||||
int32 USGThumperCommand::GetMagnitude() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ToThumperCommandImpl()};
|
||||
return SGCoreImpl_FSGThumperCommandImpl_GetMagnitude(&ThumperCommandImplContainer);
|
||||
}
|
||||
|
||||
void USGThumperCommand::SetMagnitude(const int32 Magnitude)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ToThumperCommandImpl()};
|
||||
SGCoreImpl_FSGThumperCommandImpl_SetMagnitude(&ThumperCommandImplContainer, Magnitude);
|
||||
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGThumperCommand* USGThumperCommand::Copy(UObject* Outer) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
|
||||
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
|
||||
SGCoreImpl_FSGThumperCommandImpl_Copy(&InstanceContainer, &OutThumperCommandImplContainer);
|
||||
@@ -192,8 +159,6 @@ USGThumperCommand* USGThumperCommand::Copy(UObject* Outer) const
|
||||
|
||||
USGThumperCommand* USGThumperCommand::Merge(UObject* Outer, const USGThumperCommand* ThumperCommand) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
|
||||
@@ -204,8 +169,6 @@ USGThumperCommand* USGThumperCommand::Merge(UObject* Outer, const USGThumperComm
|
||||
|
||||
bool USGThumperCommand::Equals(const USGThumperCommand* ThumperCommand) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
|
||||
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ThumperCommand->ToThumperCommandImpl()};
|
||||
return SGCoreImpl_FSGThumperCommandImpl_Equals(&InstanceContainer, &ThumperCommandImplContainer);
|
||||
@@ -221,12 +184,4 @@ USGThumperCommand::FImpl::~FImpl() = default;
|
||||
void USGThumperCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGThumperCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
|
||||
void USGThumperCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
@@ -47,42 +47,6 @@
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
|
||||
|
||||
struct USGTimedBuzzCommand::FImpl
|
||||
{
|
||||
/************************
|
||||
* Member variables
|
||||
************************/
|
||||
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
|
||||
USGTimedBuzzCommand* Owner;
|
||||
|
||||
/************************
|
||||
* Constructor / Destructor
|
||||
************************/
|
||||
|
||||
explicit FImpl(USGTimedBuzzCommand* InOwner);
|
||||
~FImpl();
|
||||
|
||||
/************************
|
||||
* Default copy constructor & copy assignment operator
|
||||
************************/
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
|
||||
UObject* Outer, const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
|
||||
{
|
||||
@@ -132,28 +96,17 @@ USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::USGTimedBuzzCommand()
|
||||
: USGBuzzCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGBuzzCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutTimedBuzzCommandImplContainer;
|
||||
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_MakeShared(&OutTimedBuzzCommandImplContainer);
|
||||
|
||||
SetFingerCommandImpl(OutTimedBuzzCommandImplContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::USGTimedBuzzCommand(const ESGFinger Finger, const int32 Magnitude,
|
||||
const float DurationSeconds, const float StartTimeSeconds)
|
||||
: USGBuzzCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGBuzzCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_ESGFinger FingerContainer{Finger};
|
||||
@@ -161,17 +114,11 @@ USGTimedBuzzCommand::USGTimedBuzzCommand(const ESGFinger Finger, const int32 Mag
|
||||
&OutSharedPtrContainer, &FingerContainer, Magnitude, DurationSeconds, StartTimeSeconds);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand,
|
||||
const float DurationSeconds, const float StartTimeSeconds)
|
||||
: USGBuzzCommand(),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGBuzzCommand()
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
|
||||
FSGIC_FSGBuzzCommandImpl BaseCommandContainer{BaseCommand->ToBuzzCommandImpl().Get()};
|
||||
@@ -179,55 +126,27 @@ USGTimedBuzzCommand::USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand,
|
||||
&OutSharedPtrContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
|
||||
|
||||
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::USGTimedBuzzCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
|
||||
: USGBuzzCommand(TimedBuzzCommandImpl),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGBuzzCommand(TimedBuzzCommandImpl)
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::USGTimedBuzzCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
|
||||
: USGBuzzCommand(MoveTemp(TimedBuzzCommandImpl)),
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: USGBuzzCommand(MoveTemp(TimedBuzzCommandImpl))
|
||||
{
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::~USGTimedBuzzCommand() = default;
|
||||
|
||||
TSharedRef<FSGTimedBuzzCommandImpl> USGTimedBuzzCommand::ToTimedBuzzCommandImpl() const
|
||||
{
|
||||
SyncImplObject();
|
||||
return FSGFingerCommandImplCast::ToTimedBuzzCommandImpl(ToFingerCommandImpl());
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::SyncImplObject() const
|
||||
{
|
||||
Super::SyncImplObject();
|
||||
Pimpl->SyncImplObject();
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::SyncUProperties()
|
||||
{
|
||||
Super::SyncUProperties();
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGBuzzCommand* USGTimedBuzzCommand::Copy(UObject* Outer) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
|
||||
SGCoreImpl_FSGTimedBuzzCommandImpl_Copy(&InstanceContainer, &OutBuzzCommandImplContainer);
|
||||
@@ -237,8 +156,6 @@ USGBuzzCommand* USGTimedBuzzCommand::Copy(UObject* Outer) const
|
||||
|
||||
USGBuzzCommand* USGTimedBuzzCommand::Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
FSGIC_FSGBuzzCommandImpl BuzzCommandImplContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
|
||||
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
|
||||
@@ -256,12 +173,6 @@ USGBuzzCommand* USGTimedBuzzCommand::GetBaseCommand(UObject* Outer) const
|
||||
return NewBuzzCommand(Outer, MoveTemp(OutCommandContainer.BuzzCommandImpl));
|
||||
}
|
||||
|
||||
int32 USGTimedBuzzCommand::GetMagnitude() const
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedBuzzCommandImpl_GetMagnitude(&InstanceContainer);
|
||||
}
|
||||
|
||||
float USGTimedBuzzCommand::GetDuration() const
|
||||
{
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
@@ -276,66 +187,32 @@ float USGTimedBuzzCommand::GetElapsedTime() const
|
||||
|
||||
bool USGTimedBuzzCommand::HasTimeElapsed() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedBuzzCommandImpl_HasTimeElapsed(&InstanceContainer);
|
||||
}
|
||||
|
||||
float USGTimedBuzzCommand::NormalizedTime(const bool bClamp01) const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedBuzzCommandImpl_NormalizedTime(&InstanceContainer, bClamp01);
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::ResetTiming()
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
SGCoreImpl_FSGTimedBuzzCommandImpl_ResetTiming(&InstanceContainer);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::UpdateTiming(const float DeltaSeconds)
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
SGCoreImpl_FSGTimedBuzzCommandImpl_UpdateTiming(&InstanceContainer, DeltaSeconds);
|
||||
|
||||
SyncUProperties();
|
||||
}
|
||||
|
||||
FString USGTimedBuzzCommand::ToString() const
|
||||
{
|
||||
SyncImplObject();
|
||||
|
||||
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGTimedBuzzCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
return MoveTemp(OutStringContainer.String);
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::FImpl::FImpl(USGTimedBuzzCommand* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
}
|
||||
|
||||
USGTimedBuzzCommand::FImpl::~FImpl() = default;
|
||||
|
||||
void USGTimedBuzzCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void USGTimedBuzzCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
@@ -70,13 +70,6 @@ struct USGTimedThumpCommand::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void SyncUProperties();
|
||||
void SyncImplObject();
|
||||
};
|
||||
|
||||
USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
|
||||
@@ -117,45 +110,28 @@ USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
|
||||
}
|
||||
|
||||
USGTimedThumpCommand::USGTimedThumpCommand()
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_ctor(&OutTimedThumpCommandImplContainer);
|
||||
|
||||
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedThumpCommand::USGTimedThumpCommand(const int32 Magnitude,
|
||||
const float DurationSeconds, const float StartTimeSeconds)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_Magnitude_DurationSeconds_StartTimeSeconds(
|
||||
&OutTimedThumpCommandImplContainer, Magnitude, DurationSeconds, StartTimeSeconds);
|
||||
|
||||
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedThumpCommand::USGTimedThumpCommand(const USGThumperCommand* BaseCommand,
|
||||
const float DurationSeconds, const float StartTimeSeconds)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
|
||||
FSGIC_FSGThumperCommandImpl BaseCommandContainer{BaseCommand->ToThumperCommandImpl()};
|
||||
@@ -163,19 +139,12 @@ USGTimedThumpCommand::USGTimedThumpCommand(const USGThumperCommand* BaseCommand,
|
||||
&OutTimedThumpCommandImplContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
|
||||
|
||||
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedThumpCommand::USGTimedThumpCommand(const FSGTimedThumpCommandImpl& TimedThumpCommandImpl)
|
||||
:
|
||||
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
SetTimedThumpCommandImpl(TimedThumpCommandImpl);
|
||||
Pimpl->SyncUProperties();
|
||||
}
|
||||
|
||||
USGTimedThumpCommand::~USGTimedThumpCommand() = default;
|
||||
@@ -190,7 +159,6 @@ void USGTimedThumpCommand::SetTimedThumpCommandImpl(const FSGTimedThumpCommandIm
|
||||
|
||||
const FSGTimedThumpCommandImpl& USGTimedThumpCommand::ToTimedThumpCommandImpl() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
return Pimpl->TimedThumpCommandImpl;
|
||||
}
|
||||
|
||||
@@ -200,48 +168,26 @@ int32 USGTimedThumpCommand::GetMagnitude() const
|
||||
return SGCoreImpl_FSGTimedThumpCommandImpl_GetMagnitude(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGTimedThumpCommand::SetMagnitude(int32 Magnitude)
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_SetMagnitude(&InstanceContainer, Magnitude);
|
||||
}
|
||||
|
||||
float USGTimedThumpCommand::GetDuration() const
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedThumpCommandImpl_GetDuration(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGTimedThumpCommand::SetDuration(const float Duration)
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_SetDuration(&InstanceContainer, Duration);
|
||||
}
|
||||
|
||||
float USGTimedThumpCommand::GetElapsedTime() const
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedThumpCommandImpl_GetElapsedTime(&InstanceContainer);
|
||||
}
|
||||
|
||||
void USGTimedThumpCommand::SetElapsedTime(const float ElapsedTime)
|
||||
{
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_SetElapsedTime(&InstanceContainer, ElapsedTime);
|
||||
}
|
||||
|
||||
bool USGTimedThumpCommand::HasTimeElapsed() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedThumpCommandImpl_HasTimeElapsed(&InstanceContainer);
|
||||
}
|
||||
|
||||
USGTimedThumpCommand* USGTimedThumpCommand::Copy(UObject* Outer, const bool bCopyElapsed) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_Copy(&InstanceContainer, &OutTimedThumpCommandImplContainer, bCopyElapsed);
|
||||
@@ -251,16 +197,12 @@ USGTimedThumpCommand* USGTimedThumpCommand::Copy(UObject* Outer, const bool bCop
|
||||
|
||||
void USGTimedThumpCommand::Update(const float DeltaSeconds)
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_Update(&InstanceContainer, DeltaSeconds);
|
||||
}
|
||||
|
||||
bool USGTimedThumpCommand::Equals(const USGTimedThumpCommand* TimedThumpCommand) const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
FSGIC_FSGTimedThumpCommandImpl TimedThumpCommandImplContainer{TimedThumpCommand->ToTimedThumpCommandImpl()};
|
||||
return SGCoreImpl_FSGTimedThumpCommandImpl_Equals(&InstanceContainer, &TimedThumpCommandImplContainer);
|
||||
@@ -268,8 +210,6 @@ bool USGTimedThumpCommand::Equals(const USGTimedThumpCommand* TimedThumpCommand)
|
||||
|
||||
FString USGTimedThumpCommand::ToString() const
|
||||
{
|
||||
Pimpl->SyncImplObject();
|
||||
|
||||
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
|
||||
FSGIC_FString OutStringContainer;
|
||||
SGCoreImpl_FSGTimedThumpCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
|
||||
@@ -286,12 +226,4 @@ USGTimedThumpCommand::FImpl::~FImpl() = default;
|
||||
void USGTimedThumpCommand::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
|
||||
void USGTimedThumpCommand::FImpl::SyncImplObject()
|
||||
{
|
||||
}
|
||||
|
||||
void USGTimedThumpCommand::FImpl::SyncUProperties()
|
||||
{
|
||||
}
|
||||
@@ -82,14 +82,14 @@ public:
|
||||
static float GetThumbJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax);
|
||||
|
||||
/**
|
||||
* Convert a total finger flexion in radians into a 0..1 representation.
|
||||
* Convert a total finger flexion in degrees into a 0..1 representation.
|
||||
*/
|
||||
static float NormalizeFingerFlexion(float FlexionInRadians);
|
||||
static float NormalizeFingerFlexion(float FlexionInDegrees);
|
||||
|
||||
/**
|
||||
* Convert a total thumb flexion in radians into a 0..1 representation.
|
||||
* Convert a total thumb flexion in degrees into a 0..1 representation.
|
||||
*/
|
||||
static float NormalizeThumbFlexion(float FlexionInRadians);
|
||||
static float NormalizeThumbFlexion(float FlexionInDegrees);
|
||||
|
||||
/**
|
||||
* Get Hand Angles that would make a Default (Idle) Pose.
|
||||
@@ -110,4 +110,4 @@ public:
|
||||
* Get Hand Angles that would make a fist.
|
||||
*/
|
||||
static TArray<TArray<FVector>> GetFistHandAngles(bool bRightHanded);
|
||||
};
|
||||
};
|
||||
@@ -46,8 +46,8 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGFloatArray.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGTypes/SGFloatArray.h"
|
||||
|
||||
#include "SGBasicHandModel.generated.h"
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGCore/SGDevice.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
|
||||
@@ -81,17 +79,6 @@ public:
|
||||
*/
|
||||
static USGBetaDevice* Parse(UObject* Outer, const FString& String);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
/**
|
||||
* The basic class constructor.
|
||||
@@ -128,17 +115,6 @@ protected:
|
||||
*/
|
||||
TSharedRef<FSGBetaDeviceImpl> ToBetaDeviceImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration.
|
||||
@@ -192,4 +168,4 @@ public:
|
||||
* Create a string representation of this device for reporting purposes.
|
||||
*/
|
||||
virtual FString ToString() const override;
|
||||
};
|
||||
};
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "HAL/Platform.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGFingerCommand.h"
|
||||
@@ -88,17 +87,6 @@ public:
|
||||
*/
|
||||
static USGBuzzCommand* Off(UObject* Outer);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
/**
|
||||
* The basic constructor.
|
||||
@@ -144,17 +132,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGBuzzCommandImpl> ToBuzzCommandImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Copy this Buzz Command into a new object.
|
||||
@@ -165,4 +142,4 @@ public:
|
||||
* Merge this command with another, taking the maximum value between the two.
|
||||
*/
|
||||
USGBuzzCommand* Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const;
|
||||
};
|
||||
};
|
||||
@@ -134,4 +134,4 @@ public:
|
||||
* Log Calibration values for storing on disk.
|
||||
*/
|
||||
FString ToLogData(const FString& Delimiter = "\t") const;
|
||||
};
|
||||
};
|
||||
@@ -202,17 +202,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGDeviceImpl> ToSGDeviceImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties();
|
||||
|
||||
public:
|
||||
/**
|
||||
* Check which DeviceType this class belongs to.
|
||||
@@ -303,4 +292,4 @@ public:
|
||||
* Get a string representation of this SGDevice, used for debugging.
|
||||
*/
|
||||
virtual FString ToString() const;
|
||||
};
|
||||
};
|
||||
@@ -174,17 +174,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGFingerCommandImpl> ToFingerCommandImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties();
|
||||
|
||||
public:
|
||||
/**
|
||||
*
|
||||
@@ -211,4 +200,4 @@ public:
|
||||
* Create a string representation of this finger command.
|
||||
*/
|
||||
FString ToString() const;
|
||||
};
|
||||
};
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "HAL/Platform.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGFingerCommand.h"
|
||||
@@ -92,17 +91,6 @@ public:
|
||||
*/
|
||||
static USGForceFeedbackCommand* Off(UObject* Outer);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Empty constructor for internal initialization.
|
||||
@@ -148,17 +136,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGForceFeedbackCommandImpl> ToForceFeedbackCommandImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Copy this ForceFeedback Command into a new object.
|
||||
@@ -169,4 +146,4 @@ public:
|
||||
* Merge this finger command with another, taking the maximum value between the two.
|
||||
*/
|
||||
USGForceFeedbackCommand* Merge(UObject* Outer, const USGForceFeedbackCommand* ForceFeedbackCommand) const;
|
||||
};
|
||||
};
|
||||
@@ -236,16 +236,22 @@ public:
|
||||
public:
|
||||
/**
|
||||
* Calculate any finger's movement rotation, using an input value.
|
||||
*
|
||||
* WARNING: This method is for internal use only. Avoid using it!
|
||||
*/
|
||||
float CalculateAngle(ESGFinger Finger, int32 Movement, float Value) const;
|
||||
|
||||
/**
|
||||
* Calculate a finger movement's rotation, using an input value.
|
||||
*
|
||||
* WARNING: This method is for internal use only. Avoid using it!
|
||||
*/
|
||||
float CalculateAngle(ESGFinger Finger, ESGFingerMovement Movement, float Value) const;
|
||||
|
||||
/**
|
||||
* Calculate a thumb movement's rotation, using an input value.
|
||||
*
|
||||
* WARNING: This method is for internal use only. Avoid using it!
|
||||
*/
|
||||
float CalculateAngle(ESGFinger Finger, ESGThumbMovement Movement, float Value) const;
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGQuatArray.h"
|
||||
#include "SGCore/SGRotatorArray.h"
|
||||
#include "SGCore/SGVectorArray.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGTypes/SGQuatArray.h"
|
||||
#include "SGTypes/SGRotatorArray.h"
|
||||
#include "SGTypes/SGVectorArray.h"
|
||||
|
||||
#include "SGHandPose.generated.h"
|
||||
|
||||
|
||||
@@ -94,17 +94,6 @@ public:
|
||||
*/
|
||||
static bool GetGlove(UObject* Outer, bool bRightHanded, USGHapticGlove*& OutGlove);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The basic constructor.
|
||||
@@ -165,17 +154,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGHapticGloveImpl> ToHapticGloveImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get the DeviceType enumerator of this device; used to check if its a SenseGlove/Nova/etc.
|
||||
@@ -239,6 +217,10 @@ public:
|
||||
*/
|
||||
virtual bool GetHandPose(UObject* Outer, USGHandPose*& OutHandPose);
|
||||
|
||||
#if PLATFORM_ANDROID
|
||||
virtual bool GetHandPose(UObject* Outer, float DeltaTime, USGHandPose*& OutHandPose);
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
public:
|
||||
/**
|
||||
* Stops all Haptic effects if any are currently playing. Useful at the end of simulations or when resetting.
|
||||
@@ -347,4 +329,4 @@ public:
|
||||
virtual void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutGlovePosition, FRotator& OutGloveRotation) const;
|
||||
};
|
||||
};
|
||||
@@ -172,12 +172,6 @@ public:
|
||||
*/
|
||||
const FSGHapticGloveCalibrationCheckImpl& ToHapticGloveCalibrationCheckImpl() const;
|
||||
|
||||
public:
|
||||
/**
|
||||
*
|
||||
*/
|
||||
USGSensorRange* GetLastSensorRange(UObject* Outer) const;
|
||||
|
||||
public:
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -180,17 +180,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> ToHapticGloveCalibrationSequenceImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties();
|
||||
|
||||
public:
|
||||
/**
|
||||
* Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called.
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "Containers/Array.h"
|
||||
#include "Containers/UnrealString.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGCore/SGHapticGloveCalibrationSequence.h"
|
||||
|
||||
@@ -76,21 +75,10 @@ public:
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default time in seconds, to end this sequence. 15 seconds is very quick for some people.
|
||||
* Default time in seconds, to end this sequence. 15 seconds is very quick for some people.
|
||||
*/
|
||||
static float GetDefaultAutoEndTimeout();
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
/**
|
||||
*
|
||||
@@ -128,17 +116,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGHapticGloveQuickCalibrationImpl> ToHapticGloveQuickCalibrationImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Time, in seconds, after which this sequence stops gathering data. Based on the deltaSeconds variable passed in the Update() function.
|
||||
|
||||
@@ -39,14 +39,12 @@
|
||||
|
||||
#include "SGInterpolationSetArray.generated.h"
|
||||
|
||||
class FSGInterpolationSetImpl;
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVECORE_API FSGInterpolationSetArray
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Core | Nested Arrays", BlueprintReadWrite)
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Types | Nested Arrays", BlueprintReadWrite)
|
||||
TArray<USGInterpolationSet*> InterpolationSetArray;
|
||||
};
|
||||
@@ -177,17 +177,6 @@ public:
|
||||
*/
|
||||
static FString ToBytes(const USGBuzzCommand* BuzzCommand);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
protected:
|
||||
USGNovaGlove();
|
||||
|
||||
@@ -237,17 +226,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGNovaGloveImpl> ToNovaGloveImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Return the DeviceType of this Nova.
|
||||
|
||||
@@ -190,17 +190,6 @@ public:
|
||||
const FRotator& GloveWristRotationOffset,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
protected:
|
||||
/**
|
||||
*
|
||||
@@ -256,17 +245,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGSenseGloveImpl> ToSenseGloveImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Retrieve this glove's hardware model, which contains its hardware data.
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGVectorArray.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGTypes/SGVectorArray.h"
|
||||
|
||||
#include "SGSenseGloveInfo.generated.h"
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGQuatArray.h"
|
||||
#include "SGCore/SGRotatorArray.h"
|
||||
#include "SGCore/SGVectorArray.h"
|
||||
#include "SGTypes/SGQuatArray.h"
|
||||
#include "SGTypes/SGRotatorArray.h"
|
||||
#include "SGTypes/SGVectorArray.h"
|
||||
|
||||
#include "SGSenseGlovePose.generated.h"
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCore/SGFloatArray.h"
|
||||
#include "SGCore/SGSenseGloveInfo.h"
|
||||
#include "SGTypes/SGFloatArray.h"
|
||||
|
||||
#include "SGSenseGloveSensorData.generated.h"
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
|
||||
public:
|
||||
/**
|
||||
* Glove angles in radians, sorted by finger, from proximal to distal.
|
||||
* Glove angles in degrees, sorted by finger, from proximal to distal.
|
||||
*/
|
||||
TArray<TArray<float>> GetSensorAngles() const;
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "HAL/Platform.h"
|
||||
#include "Templates/SharedPointer.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGTimedBuzzCommand.generated.h"
|
||||
@@ -82,17 +81,6 @@ public:
|
||||
UObject* Outer,
|
||||
const USGBuzzCommand* BaseCommand, float DurationSeconds, float StartTimeSeconds = 0.0f);
|
||||
|
||||
private:
|
||||
struct FImpl;
|
||||
|
||||
struct FImplDeleter
|
||||
{
|
||||
void operator()(const FImpl* P) const;
|
||||
};
|
||||
|
||||
TUniquePtr<FImpl, FImplDeleter> Pimpl;
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Empty constructor for inheritance.
|
||||
@@ -133,17 +121,6 @@ public:
|
||||
*/
|
||||
TSharedRef<FSGTimedBuzzCommandImpl> ToTimedBuzzCommandImpl() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's underlying object at any time.
|
||||
*/
|
||||
virtual void SyncImplObject() const override;
|
||||
|
||||
/**
|
||||
* Allows the child classes to synchronize the parent's uproperties at any time.
|
||||
*/
|
||||
virtual void SyncUProperties() override;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Copy this Buzz Command's values into a new object.
|
||||
@@ -161,11 +138,6 @@ public:
|
||||
*/
|
||||
USGBuzzCommand* GetBaseCommand(UObject* Outer) const;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
int32 GetMagnitude() const;
|
||||
|
||||
/**
|
||||
* The total time [milliseconds] each buzz motor should be vibrating for.
|
||||
*/
|
||||
@@ -202,4 +174,4 @@ public:
|
||||
*
|
||||
*/
|
||||
FString ToString() const;
|
||||
};
|
||||
};
|
||||
@@ -132,31 +132,16 @@ public:
|
||||
*/
|
||||
int32 GetMagnitude() const;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void SetMagnitude(int32 Magnitude);
|
||||
|
||||
/**
|
||||
* Duration in seconds.
|
||||
*/
|
||||
float GetDuration() const;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void SetDuration(float Duration);
|
||||
|
||||
/**
|
||||
* The elapsed time so far.
|
||||
*/
|
||||
float GetElapsedTime() const;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void SetElapsedTime(float ElapsedTime);
|
||||
|
||||
public:
|
||||
/**
|
||||
* Returns true if the timed command has elapsed.
|
||||
|
||||
@@ -47,7 +47,6 @@ public class SenseGloveCore : ModuleRules
|
||||
{
|
||||
"Core",
|
||||
"Engine",
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -59,8 +58,16 @@ public class SenseGloveCore : ModuleRules
|
||||
"SenseGloveCoreImpl",
|
||||
"SenseGloveInterop",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveTypes",
|
||||
"SenseGloveUtils",
|
||||
}
|
||||
);
|
||||
|
||||
PublicIncludePathModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,8 +38,8 @@
|
||||
#include "SGBuildHacks/SGInclude_Core_Anatomy.h"
|
||||
#include "SGBuildHacks/SGInclude_Core_Vect3D.h"
|
||||
#include "SGCoreImpl/SGVect3DImpl.h"
|
||||
#include "SGUtils/SGAngles.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
#include "SGUtils/SGCoordinates.h"
|
||||
|
||||
float FSGAnatomyImpl::GetTotalFingerFlexion()
|
||||
{
|
||||
@@ -64,25 +64,31 @@ float FSGAnatomyImpl::GetTotalThumbExtension()
|
||||
float FSGAnatomyImpl::GetFingerJointLimit(
|
||||
const bool bRightHanded, const int32 Joint, const int32 Movement, const bool bMax)
|
||||
{
|
||||
return FSGCoordinates::TransformToUnreal(
|
||||
return FSGAngles::TransformToUnreal(
|
||||
Movement, FAnatomyType::GetFingerJointLimit(bRightHanded, Joint, Movement, bMax));
|
||||
}
|
||||
|
||||
float FSGAnatomyImpl::GetThumbJointLimit(
|
||||
const bool bRightHanded, const int32 Joint, const int32 Movement, const bool bMax)
|
||||
{
|
||||
return FSGCoordinates::TransformToUnreal(
|
||||
return FSGAngles::TransformToUnreal(
|
||||
Movement, FAnatomyType::GetThumbJointLimit(bRightHanded, Joint, Movement, bMax));
|
||||
}
|
||||
|
||||
float FSGAnatomyImpl::NormalizeFingerFlexion(const float FlexionInRadians)
|
||||
float FSGAnatomyImpl::NormalizeFingerFlexion(const float FlexionInDegrees)
|
||||
{
|
||||
return FAnatomyType::NormalizeFingerFlexion(FlexionInRadians);
|
||||
return FSGAngles::TransformToUnreal(
|
||||
FAnatomyType::NormalizeFingerFlexion(
|
||||
FSGAngles::TransformToSenseGlove(
|
||||
FlexionInDegrees)));
|
||||
}
|
||||
|
||||
float FSGAnatomyImpl::NormalizeThumbFlexion(const float FlexionInRadians)
|
||||
float FSGAnatomyImpl::NormalizeThumbFlexion(const float FlexionInDegrees)
|
||||
{
|
||||
return FAnatomyType::NormalizeThumbFlexion(FlexionInRadians);
|
||||
return FSGAngles::TransformToUnreal(
|
||||
FAnatomyType::NormalizeThumbFlexion(
|
||||
FSGAngles::TransformToSenseGlove(
|
||||
FlexionInDegrees)));
|
||||
}
|
||||
|
||||
TArray<TArray<FVector>> FSGAnatomyImpl::GetDefaultHandAngles(const bool bRightHanded)
|
||||
|
||||
@@ -118,23 +118,13 @@ const TArray<FVector>& FSGBasicHandModelImpl::GetBaseJointAngles()
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl()
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
|
||||
const TArray<FVector>& StartPositions)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
std::vector<std::vector<float>> LengthsVector{
|
||||
FSGArrayUtils::ToMillimeters(Lengths)
|
||||
@@ -150,12 +140,7 @@ FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArr
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
|
||||
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
std::vector<std::vector<float>> LengthsVector{
|
||||
FSGArrayUtils::ToMillimeters(Lengths)
|
||||
@@ -175,32 +160,18 @@ FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArr
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const FBasicHandModelType& BasicHandModel)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->BasicHandModel = BasicHandModel;
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const FSGBasicHandModelImpl& Rhs)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(FSGBasicHandModelImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBasicHandModelImpl::FSGBasicHandModelImpl(FSGBasicHandModelImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGBasicHandModelImpl::~FSGBasicHandModelImpl() = default;
|
||||
|
||||
@@ -211,11 +182,7 @@ FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(const FSGBasicHandModelI
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(FSGBasicHandModelImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(FSGBasicHandModelImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
const FSGBasicHandModelImpl::FBasicHandModelType& FSGBasicHandModelImpl::ToBasicHandModel() const
|
||||
{
|
||||
@@ -227,11 +194,6 @@ bool FSGBasicHandModelImpl::IsRight() const
|
||||
return Pimpl->BasicHandModel.IsRight();
|
||||
}
|
||||
|
||||
void FSGBasicHandModelImpl::SetIsRight(const bool bRightHanded)
|
||||
{
|
||||
Pimpl->BasicHandModel.SetIsRight(bRightHanded);
|
||||
}
|
||||
|
||||
TArray<TArray<float>> FSGBasicHandModelImpl::GetFingerLengths() const
|
||||
{
|
||||
TArray<TArray<float>> FingerLengths{
|
||||
@@ -240,14 +202,6 @@ TArray<TArray<float>> FSGBasicHandModelImpl::GetFingerLengths() const
|
||||
return MoveTemp(FingerLengths);
|
||||
}
|
||||
|
||||
void FSGBasicHandModelImpl::SetFingerLengths(const TArray<TArray<float>>& FingerLengths)
|
||||
{
|
||||
std::vector<std::vector<float>> FingerLengthsVector{
|
||||
FSGArrayUtils::ToMillimeters(FingerLengths)
|
||||
};
|
||||
Pimpl->BasicHandModel.SetFingerLengths(MoveTemp(FingerLengthsVector));
|
||||
}
|
||||
|
||||
TArray<float> FSGBasicHandModelImpl::GetFingerLengths(const ESGFinger Finger) const
|
||||
{
|
||||
TArray<float> FingerLengths{
|
||||
@@ -297,14 +251,6 @@ TArray<FVector> FSGBasicHandModelImpl::GetStartJointPositions() const
|
||||
return MoveTemp(StartJointPositions);
|
||||
}
|
||||
|
||||
void FSGBasicHandModelImpl::SetStartJointPositions(const TArray<FVector>& StartJointPositions)
|
||||
{
|
||||
std::vector<FSGVect3DImpl::FVect3DType> StartJointPositionsVector{
|
||||
FSGArrayUtils::ToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(StartJointPositions)
|
||||
};
|
||||
Pimpl->BasicHandModel.SetStartJointPositions(MoveTemp(StartJointPositionsVector));
|
||||
}
|
||||
|
||||
void FSGBasicHandModelImpl::SetStartJointPosition(const ESGFinger Finger, const FVector& Position)
|
||||
{
|
||||
Pimpl->BasicHandModel.SetStartJointPosition(
|
||||
@@ -329,15 +275,6 @@ TArray<FQuat> FSGBasicHandModelImpl::GetStartJointRotations() const
|
||||
return MoveTemp(StartJointRotations);
|
||||
}
|
||||
|
||||
void FSGBasicHandModelImpl::SetStartJointRotations(const TArray<FQuat>& StartJointRotations)
|
||||
{
|
||||
std::vector<FSGQuatImpl::FQuatType> StartJointRotationsVector{
|
||||
FSGArrayUtils::ToStdVector<
|
||||
FQuat, FSGQuatImpl::FQuatType, FSGQuatImpl, &FSGQuatImpl::ToQuat>(StartJointRotations)
|
||||
};
|
||||
Pimpl->BasicHandModel.SetStartJointRotations(MoveTemp(StartJointRotationsVector));
|
||||
}
|
||||
|
||||
FVector FSGBasicHandModelImpl::GetJointPosition(const ESGFinger Finger) const
|
||||
{
|
||||
return FSGUnits::MillimetersToCentimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(
|
||||
@@ -418,4 +355,4 @@ FSGBasicHandModelImpl::FImpl::~FImpl() = default;
|
||||
void FSGBasicHandModelImpl::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
}
|
||||
@@ -77,11 +77,7 @@ TSharedRef<FSGBetaDeviceImpl> FSGBetaDeviceImpl::Parse(const FString& String)
|
||||
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl()
|
||||
: FSGDeviceImpl(),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
{
|
||||
}
|
||||
|
||||
@@ -93,50 +89,30 @@ FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FString& ConstantsString, const FStri
|
||||
TCHAR_TO_UTF8(*HardwareVersion),
|
||||
FirmwareVersion,
|
||||
SubFirmwareVersion)),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
{
|
||||
}
|
||||
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FBetaDeviceType BetaDevice)
|
||||
: FSGDeviceImpl(std::make_shared<FBetaDeviceType>(BetaDevice)),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
{
|
||||
}
|
||||
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FBetaDevicePtrType BetaDevice)
|
||||
: FSGDeviceImpl(BetaDevice),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
{
|
||||
}
|
||||
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FSGBetaDeviceImpl& Rhs)
|
||||
: FSGDeviceImpl(Rhs),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl(FSGBetaDeviceImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBetaDeviceImpl::FSGBetaDeviceImpl(FSGBetaDeviceImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGBetaDeviceImpl::~FSGBetaDeviceImpl() = default;
|
||||
|
||||
@@ -148,11 +124,7 @@ FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(const FSGBetaDeviceImpl& Rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(FSGBetaDeviceImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(FSGBetaDeviceImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGBetaDeviceImpl::FBetaDeviceType FSGBetaDeviceImpl::ToBetaDevice() const
|
||||
{
|
||||
|
||||
@@ -75,81 +75,49 @@ const FSGBuzzCommandImpl& FSGBuzzCommandImpl::Off()
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl()
|
||||
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>()),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const TArray<int32>& BuzzLevels)
|
||||
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(FSGArrayUtils::ToStdVector<int32>(BuzzLevels))),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring,
|
||||
const int32 Pinky)
|
||||
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(Thumb, Index, Middle, Ring, Pinky)),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const ESGFinger Finger, const int32 BuzzLevel)
|
||||
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(FSGCoreEnumCast::ToEFinger(Finger), BuzzLevel)),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const FBuzzCommandType& BuzzCommand)
|
||||
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(BuzzCommand)),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const TSharedRef<FBuzzCommandType> BuzzCommand)
|
||||
: FSGFingerCommandImpl(BuzzCommand),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const FSGBuzzCommandImpl& Rhs)
|
||||
: FSGFingerCommandImpl(Rhs),
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(FSGBuzzCommandImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBuzzCommandImpl::FSGBuzzCommandImpl(FSGBuzzCommandImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGBuzzCommandImpl::~FSGBuzzCommandImpl() = default;
|
||||
|
||||
@@ -161,11 +129,7 @@ FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(const FSGBuzzCommandImpl& Rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(FSGBuzzCommandImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(FSGBuzzCommandImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
const FSGBuzzCommandImpl::FBuzzCommandType& FSGBuzzCommandImpl::ToBuzzCommand() const
|
||||
{
|
||||
|
||||
@@ -76,23 +76,13 @@ struct FSGCalibrationDataPointImpl::FImpl
|
||||
};
|
||||
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl()
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const int32 CurrentStage,
|
||||
const TArray<FVector>& CalibrationValues)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
std::vector<FSGVect3DImpl::FVect3DType> Values(
|
||||
FSGArrayUtils::ToStdVector<FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(
|
||||
@@ -101,32 +91,18 @@ FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const int32 CurrentStag
|
||||
}
|
||||
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const FCalibrationDataPointType& CalibrationDataPoint)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->CalibrationDataPoint = CalibrationDataPoint;
|
||||
}
|
||||
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const FSGCalibrationDataPointImpl& Rhs)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(FSGCalibrationDataPointImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(FSGCalibrationDataPointImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGCalibrationDataPointImpl::~FSGCalibrationDataPointImpl() = default;
|
||||
|
||||
@@ -137,10 +113,7 @@ FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(const FSGCal
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(FSGCalibrationDataPointImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(FSGCalibrationDataPointImpl&& Rhs) SG_NOEXCEPT
|
||||
= default;
|
||||
|
||||
const FSGCalibrationDataPointImpl::FCalibrationDataPointType&
|
||||
@@ -159,25 +132,11 @@ TArray<FVector> FSGCalibrationDataPointImpl::GetCalibrationValues() const
|
||||
return CalibrationValues;
|
||||
}
|
||||
|
||||
void FSGCalibrationDataPointImpl::SetCalibrationValues(const TArray<FVector>& CalibrationValues)
|
||||
{
|
||||
std::vector<FSGVect3DImpl::FVect3DType> CalibrationValuesVector{
|
||||
FSGArrayUtils::ToStdVector<FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(
|
||||
CalibrationValues)
|
||||
};
|
||||
Pimpl->CalibrationDataPoint.SetCalibrationValues(MoveTemp(CalibrationValuesVector));
|
||||
}
|
||||
|
||||
int32 FSGCalibrationDataPointImpl::GetStage() const
|
||||
{
|
||||
return Pimpl->CalibrationDataPoint.GetStage();
|
||||
}
|
||||
|
||||
void FSGCalibrationDataPointImpl::SetStage(const int32 Stage)
|
||||
{
|
||||
Pimpl->CalibrationDataPoint.SetStage(Stage);
|
||||
}
|
||||
|
||||
FString FSGCalibrationDataPointImpl::ToLogData(const FString& Delimiter) const
|
||||
{
|
||||
std::string DelimiterString(TCHAR_TO_UTF8(*Delimiter));
|
||||
@@ -195,4 +154,4 @@ FSGCalibrationDataPointImpl::FImpl::~FImpl() = default;
|
||||
void FSGCalibrationDataPointImpl::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
}
|
||||
}
|
||||
@@ -89,43 +89,24 @@ FString FSGDeviceImpl::ToString(ESGDeviceType DeviceType)
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FSGDeviceImpl()
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FSGDeviceImpl(const FSGDevicePtrType SGDevice)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
ensureAlwaysMsgf(SGDevice.get(), TEXT("Invalid SGDevice!"));
|
||||
Pimpl->SGDevice = SGDevice;
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FSGDeviceImpl(const FSGDeviceImpl& Rhs)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGDeviceImpl::FSGDeviceImpl(FSGDeviceImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGDeviceImpl::FSGDeviceImpl(FSGDeviceImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGDeviceImpl::~FSGDeviceImpl() = default;
|
||||
|
||||
@@ -136,11 +117,7 @@ FSGDeviceImpl& FSGDeviceImpl::operator=(const FSGDeviceImpl& Rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGDeviceImpl& FSGDeviceImpl::operator=(FSGDeviceImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGDeviceImpl& FSGDeviceImpl::operator=(FSGDeviceImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGDeviceImpl::FSGDevicePtrType FSGDeviceImpl::ToSGDevicePtr() const
|
||||
{
|
||||
|
||||
@@ -96,23 +96,13 @@ void FSGDeviceModelImpl::ParseFirmware(const FString& RawFirmware, int32& OutMai
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl()
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl(
|
||||
const FString& Id, const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
std::string IdString(TCHAR_TO_UTF8(*Id));
|
||||
std::string HardwareVersionString(TCHAR_TO_UTF8(*HardwareVersion));
|
||||
@@ -121,32 +111,18 @@ FSGDeviceModelImpl::FSGDeviceModelImpl(
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl(const FDeviceModelType& DeviceModel)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
Pimpl->DeviceModel = DeviceModel;
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl(const FSGDeviceModelImpl& Rhs)
|
||||
:
|
||||
#if SG_CPP17
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
#else
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
|
||||
#endif /* SG_CPP17 */
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
|
||||
{
|
||||
Pimpl->Owner = this;
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl(FSGDeviceModelImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGDeviceModelImpl::FSGDeviceModelImpl(FSGDeviceModelImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
FSGDeviceModelImpl::~FSGDeviceModelImpl() = default;
|
||||
|
||||
@@ -157,11 +133,7 @@ FSGDeviceModelImpl& FSGDeviceModelImpl::operator=(const FSGDeviceModelImpl& Rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl& FSGDeviceModelImpl::operator=(FSGDeviceModelImpl&& Rhs)
|
||||
#if SG_CPP17
|
||||
noexcept
|
||||
#endif /* SG_CPP17 */
|
||||
= default;
|
||||
FSGDeviceModelImpl& FSGDeviceModelImpl::operator=(FSGDeviceModelImpl&& Rhs) SG_NOEXCEPT = default;
|
||||
|
||||
const FSGDeviceModelImpl::FDeviceModelType& FSGDeviceModelImpl::ToDeviceModel() const
|
||||
{
|
||||
@@ -174,42 +146,22 @@ FString FSGDeviceModelImpl::GetDeviceId() const
|
||||
return MoveTemp(DeviceId);
|
||||
}
|
||||
|
||||
void FSGDeviceModelImpl::SetDeviceId(const FString& Id) const
|
||||
{
|
||||
Pimpl->DeviceModel.SetDeviceId(TCHAR_TO_UTF8(*Id));
|
||||
}
|
||||
|
||||
FString FSGDeviceModelImpl::GetHardwareVersion() const
|
||||
{
|
||||
FString HardwareVersion(UTF8_TO_TCHAR(Pimpl->DeviceModel.GetHardwareVersion().c_str()));
|
||||
return MoveTemp(HardwareVersion);
|
||||
}
|
||||
|
||||
void FSGDeviceModelImpl::SetHardwareVersion(const FString& Version) const
|
||||
{
|
||||
Pimpl->DeviceModel.SetHardwareVersion(TCHAR_TO_UTF8(*Version));
|
||||
}
|
||||
|
||||
int32 FSGDeviceModelImpl::GetFirmwareVersion() const
|
||||
{
|
||||
return Pimpl->DeviceModel.GetFirmwareVersion();
|
||||
}
|
||||
|
||||
void FSGDeviceModelImpl::SetFirmwareVersion(const int32 Version) const
|
||||
{
|
||||
Pimpl->DeviceModel.SetFirmwareVersion(Version);
|
||||
}
|
||||
|
||||
int32 FSGDeviceModelImpl::GetSubFirmwareVersion() const
|
||||
{
|
||||
return Pimpl->DeviceModel.GetSubFirmwareVersion();
|
||||
}
|
||||
|
||||
void FSGDeviceModelImpl::SetSubFirmwareVersion(const int32 Version) const
|
||||
{
|
||||
Pimpl->DeviceModel.SetSubFirmwareVersion(Version);
|
||||
}
|
||||
|
||||
FSGDeviceModelImpl::FImpl::FImpl(FSGDeviceModelImpl* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user