Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75eaea13a4
|
||
|
|
b2f89c4694
|
||
|
|
b4e547f755
|
||
|
|
8125ad2fc6
|
||
|
|
f7f997019d
|
||
|
|
914f0c34ac
|
||
|
|
8e9b45ddc0
|
||
|
|
bf4e1f53f6
|
||
|
|
5c40592070
|
||
|
|
3fb66fa469
|
||
|
|
c0c6d6b262
|
||
|
|
03e698de32
|
||
|
|
4c0d886518
|
||
|
|
c63c182ab0
|
||
|
|
51af76bf55
|
||
|
|
a95e067e85
|
||
|
|
e05347f2a4
|
||
|
|
d85428a30f
|
||
|
|
0f5e0e1c7f
|
||
|
|
a7efdb75c7
|
||
|
|
f849252dc8
|
||
|
|
be76335a46
|
||
|
|
d6f1e21804
|
||
|
|
08657ceda2
|
||
|
|
1f57ae7a8f
|
||
|
|
fcf9bdb0a5
|
||
|
|
5cec1ac563
|
||
|
|
b6bd971bc8
|
||
|
|
3088a60d5a
|
||
|
|
e22625ae34
|
||
|
|
30720e5bd5
|
||
|
|
a2b8e186b5
|
||
|
|
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
|
+130
-6
@@ -5,13 +5,137 @@ 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.2.1] - 2023-03-30
|
||||
## [1.5.1] - 2023-07-13
|
||||
|
||||
This is a hotfix release addressing a few critical issues introduced by recent changes.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix a wrist tracker bug where left and right hands' wrist trackers are mistakenly tracking the opposite hand's motion source.
|
||||
- Fix a bug where the right hand is not able to do grab or release.
|
||||
|
||||
## [1.5.0] - 2023-06-16
|
||||
|
||||
This release breaks ABI/API compatibility with the previous versions in some areas as documented below.
|
||||
|
||||
### Added
|
||||
|
||||
- Added HTC VIVE Focus 3 positional tracking hardware enum.
|
||||
- Added support for the Meta Quest Pro, HTC VIVE, and HTC VIVE Focus 3 positional tracking hardware.
|
||||
- Added two options to the wrist tracker settings (to the global plugin settings and the overrides in the wrist tracker component) in order to be able to specify a custom motion source for the left and right hands, so that it allows SteamVR-based trackers such as HTC VIVE or HTC VIVE Focus 3 to operate with the SGPawn.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix a bug where SteamVR trackers such as HTC VIVE and HTC VIVE Focus 3's wrist orientation and location were not being tracked.
|
||||
|
||||
### Changed
|
||||
|
||||
- Fully refactored the top-level configurations in the settings system into USTRUCTs.
|
||||
- SenseGlove libraries have been updated to v.2.10.0-12133ac.
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped support for the Epic Native Toolchain v19, MSVC v141 (Visual Studio 2017), and thus Unreal Engine 4.27 as it has been marked as deprecated since v1.4.x.
|
||||
- Removed any kind of support for Oculus Touch (Oculus Rift S and Oculus Quest 1) positional tracking hardware, thus the enum as well.
|
||||
- Removed any kind of support for Pico Neo 2 positional tracking hardware, thus the enum as well.
|
||||
- Removed any kind of support for Pico Neo 3 positional tracking hardware, thus the enum as well.
|
||||
|
||||
## [1.4.3] - 2023-06-01
|
||||
|
||||
This is a hotfix release addressing a critical Android crash.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix a critical Android crash that happens where the default development hand meshes are not found, which means almost always since we don't ship any default virtual hand mesh at the moment.
|
||||
- Minor changelog release formatting fix in order to stay consistent.
|
||||
|
||||
## [1.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.
|
||||
|
||||
## [1.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.
|
||||
|
||||
## [1.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.
|
||||
|
||||
## [1.3.1] - 2023-04-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix RunUAT build issues caused by missing headers.
|
||||
- Minor documentation fixes.
|
||||
|
||||
## [1.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.
|
||||
|
||||
## [1.2.1] - 2023-03-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix RunUAT build issues with Android.
|
||||
|
||||
## [v1.2.0] - 2023-03-28
|
||||
## [1.2.0] - 2023-03-28
|
||||
|
||||
This release breaks ABI/API compatibility with the previous versions.
|
||||
|
||||
@@ -35,7 +159,7 @@ This release breaks ABI/API compatibility with the previous versions.
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed a few thousands lines of archaic pre-public-release dead code.
|
||||
- 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.
|
||||
@@ -67,7 +191,7 @@ This release breaks ABI/API compatibility with the previous versions.
|
||||
|
||||
- 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
|
||||
|
||||
@@ -109,7 +233,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.
|
||||
|
||||
@@ -133,4 +257,4 @@ This is a minor release focusing on adherence to the Unreal Engine Marketplace G
|
||||
|
||||
### Added
|
||||
|
||||
- Initial public release of the SenseGlove haptic API for Unreal Engine with support for Microsoft Windows and GNU/Linux.
|
||||
- Initial public release of the SenseGlove haptic API for Unreal Engine with support for Microsoft Windows and GNU/Linux.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,17 +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)** |
|
||||
|:--------:|:-----------------------:|:-----------------------:|:-----------------------:|:----------------------------:|:---------:|:-------------------------------:|
|
||||
| **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.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r21e) |
|
||||
| **5.0** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r21e) |
|
||||
| **5.1** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r25b) |
|
||||
| **5.2** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r25b) |
|
||||
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Android (NDK)** | **UE Marketplace Version** | **Azure DevOps Version** |
|
||||
|----------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:-----------------:|:--------------------------:|:------------------------:|
|
||||
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
|
||||
| **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
|
||||
| **5.0** | ❌ | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x (r21e) | ✅ v1.5.1 | ✅ v1.5.0 |
|
||||
| **5.1** | ❌ | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x (r25b) | ✅ v1.5.1 | ✅ v1.5.0 |
|
||||
| **5.2** | ❌ | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x | ✅ v1.5.x (r25b) | ✅ v1.5.1 | ✅ v1.5.0 |
|
||||
|
||||
* <code>✅</code> Supported
|
||||
* <code>⚠️</code> Not supported by the latest release and might be lacking features
|
||||
@@ -24,6 +24,7 @@ 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 versions by Epic Games.
|
||||
@@ -54,7 +55,7 @@ Please note that modules postfixed with **Impl** are intended for interal use an
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
Source
|
||||
/
|
||||
│
|
||||
├── Config
|
||||
│
|
||||
@@ -80,7 +81,7 @@ Source
|
||||
│
|
||||
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprints)
|
||||
│
|
||||
├── SenseGloveCoreTypes (exposes special public types from the SenseGloveCore module in order to be shared by with other modules)
|
||||
├── SenseGloveDebug (a utility debug module)
|
||||
│
|
||||
├── SenseGloveEditor (the Editor module)
|
||||
│
|
||||
@@ -120,8 +121,7 @@ Source
|
||||
│ │
|
||||
│ ├── r21e (Android NDK r21e dependencies for UE 4.27 and 5.0)
|
||||
│ │ │
|
||||
│ │ │
|
||||
│ │ ├── arm64 (64-bit Arm variant of Android)
|
||||
│ │ ├── arm64 (64-bit ARM variant of Android)
|
||||
│ │ │ │
|
||||
│ │ │ ├── debug
|
||||
│ │ │ │
|
||||
@@ -147,8 +147,7 @@ Source
|
||||
│ │
|
||||
│ └── r25b (Android NDK r21b dependencies for UE 5.1)
|
||||
│ │
|
||||
│ │
|
||||
│ ├── arm64 (64-bit Arm variant of Android)
|
||||
│ ├── arm64 (64-bit ARM variant of Android)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ │
|
||||
@@ -176,21 +175,45 @@ Source
|
||||
│ │
|
||||
│ ├── 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)
|
||||
│ │ │
|
||||
│ │ ├── debug
|
||||
│ │ ├── aarch64 (dependencies targeting AArch64 Linux architecture)
|
||||
│ │ │ │
|
||||
│ │ │ ├── debug
|
||||
│ │ │ │
|
||||
│ │ │ └── release
|
||||
│ │ │
|
||||
│ │ └── 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
|
||||
│ └── x86-64 (dependencies targeting x86-64 Linux architecture)
|
||||
│ │
|
||||
│ ├── debug
|
||||
│ │
|
||||
│ └── release
|
||||
│
|
||||
└── win64
|
||||
│
|
||||
|
||||
+20
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"Version": 1,
|
||||
"VersionName": "1.2.1",
|
||||
"VersionName": "1.5.1",
|
||||
"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,16 +115,18 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SenseGloveCoreTypes",
|
||||
"Name": "SenseGloveDebug",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "PreDefault",
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -126,6 +136,7 @@
|
||||
"LoadingPhase": "PostEngineInit",
|
||||
"WhitelistPlatforms": [
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -136,6 +147,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -146,6 +158,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -156,6 +169,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -166,6 +180,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -176,6 +191,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -186,6 +202,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
},
|
||||
@@ -196,6 +213,7 @@
|
||||
"WhitelistPlatforms": [
|
||||
"Android",
|
||||
"Linux",
|
||||
"LinuxArm64",
|
||||
"Win64"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
#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"
|
||||
@@ -43,11 +44,13 @@
|
||||
#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
|
||||
@@ -111,6 +114,7 @@ struct USGVirtualHandComponent::FImpl
|
||||
bool IsEditor() const;
|
||||
|
||||
FString GetDefaultMeshPath() const;
|
||||
bool IsUsingDefaultMesh() const;
|
||||
bool IsUsingUserMesh() const;
|
||||
USkeletalMesh* LoadDefaultMesh() const;
|
||||
void SetDefaultMesh() const;
|
||||
@@ -124,6 +128,8 @@ struct USGVirtualHandComponent::FImpl
|
||||
bool CheckGlove() const;
|
||||
|
||||
void SetVisibility(bool bInVisible) const;
|
||||
|
||||
void DrawDebugVirtualHand() const;
|
||||
};
|
||||
|
||||
const TArray<TArray<FName>>& USGVirtualHandComponent::GetLeftHandFingerBoneNames()
|
||||
@@ -206,10 +212,41 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
|
||||
bRight = true;
|
||||
bHiddenInGameIfNoGloveDetected = false;
|
||||
|
||||
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")};
|
||||
|
||||
DebugVirtualHandSettings = FSGDebugVirtualHandSettings{
|
||||
false,
|
||||
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)
|
||||
@@ -296,6 +333,11 @@ void USGVirtualHandComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
Super::EndPlay(EndPlayReason);
|
||||
|
||||
if (IsValid(Glove) && AutoStopsAllHapticsOnEndPlay())
|
||||
{
|
||||
Glove->StopHaptics();
|
||||
}
|
||||
|
||||
(void) Pimpl->UninitializeBackend();
|
||||
}
|
||||
|
||||
@@ -313,6 +355,11 @@ void USGVirtualHandComponent::TickComponent(
|
||||
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)
|
||||
@@ -331,6 +378,11 @@ 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
|
||||
@@ -463,6 +515,30 @@ FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
|
||||
return MoveTemp(SkeletalMeshPath);
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::IsUsingDefaultMesh() 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 true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
|
||||
{
|
||||
const USkeletalMesh* CurrentMesh{GetMesh()};
|
||||
@@ -504,7 +580,14 @@ USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
|
||||
|
||||
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
|
||||
{
|
||||
Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
||||
// FIXME
|
||||
// Since we dont ship a default virtual hand mesh at the moment, calling SetDefaultMesh causes the following failed
|
||||
// assertion due the fact that the engine won't be able to find the asset at the default location:
|
||||
// Assertion failed: IsInGameThread()
|
||||
// Unable to load /SenseGlove/Meshes/SK_SenseGlove_VirtualHand_*. Objects and Packages can only be loaded from the
|
||||
// One workaround would be disabling the async loading or as an alternative simply disabling this portion of the
|
||||
// code should be a good-enough fix until we address this issue in it's own time.
|
||||
//Owner->SetSkeletalMesh(LoadDefaultMesh(), true);
|
||||
}
|
||||
|
||||
USkeletalMesh* USGVirtualHandComponent::FImpl::GetMesh() const
|
||||
@@ -680,6 +763,31 @@ 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;
|
||||
|
||||
@@ -37,15 +37,14 @@
|
||||
|
||||
#include "Animation/Skeleton.h"
|
||||
#include "Components/SkeletalMeshComponent.h"
|
||||
#include "DrawDebugHelpers.h"
|
||||
#include "Engine/SkeletalMesh.h"
|
||||
#include "Kismet/GameplayStatics.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"
|
||||
|
||||
@@ -85,6 +84,7 @@ struct USGWristTrackerComponent::FImpl
|
||||
bool UninitializeBackend() const;
|
||||
bool CheckGlove() const;
|
||||
|
||||
void UpdateMotionSource() const;
|
||||
void UpdateWristTrackingData() const;
|
||||
void DrawDebugGizmo();
|
||||
};
|
||||
@@ -107,24 +107,26 @@ USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& Obj
|
||||
SetReceivesDecals(false);
|
||||
SetCanEverAffectNavigation(false);
|
||||
|
||||
SetRight(true);
|
||||
|
||||
bOverridePluginWristTrackingSettings = false;
|
||||
bDrawDebugWristTrackerGizmo = false;
|
||||
TrackingHardware = ESGPositionalTrackingHardware::None;
|
||||
TrackingHardwareLocationOffset = FVector::ZeroVector;
|
||||
TrackingHardwareLocationOffset = FVector::ZeroVector;
|
||||
WristTrackingSettings = FSGWristTrackingSettings(
|
||||
ESGPositionalTrackingHardware::None,
|
||||
FVector::ZeroVector,
|
||||
FVector::ZeroVector,
|
||||
FRotator::ZeroRotator,
|
||||
FRotator::ZeroRotator,
|
||||
EControllerHand::Left,
|
||||
EControllerHand::Right,
|
||||
false,
|
||||
FSGDebugGizmoSettings(
|
||||
4.0f, 1.0f,
|
||||
FColor(255, 0, 0, 255),
|
||||
FColor(0, 255, 0, 255),
|
||||
FColor(0, 0, 255, 255),
|
||||
false, 1.1f, 0
|
||||
)
|
||||
);
|
||||
|
||||
bOverridePluginWristTrackingDebugSettings = false;
|
||||
bDrawDebugWristTrackerGizmo = false;
|
||||
DebugWristTrackerGizmoLength = 1.0f;
|
||||
DebugWristTrackerGizmoXAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
DebugWristTrackerGizmoYAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
DebugWristTrackerGizmoZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
bDebugWristTrackerGizmoPersistentLines = false;
|
||||
DebugWristTrackerGizmoLifeTimeModifier = 1.1f;
|
||||
DebugWristTrackerGizmoDepthPriority = 0;
|
||||
DebugWristTrackerGizmoThickness = 1.0f;
|
||||
bRight = true;
|
||||
|
||||
bBackendInitialized = false;
|
||||
Glove = nullptr;
|
||||
@@ -132,352 +134,35 @@ USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& Obj
|
||||
WristRotation = FRotator::ZeroRotator;
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetRight(const bool bRight)
|
||||
void USGWristTrackerComponent::SetRight(const bool bInRight)
|
||||
{
|
||||
SetTrackingSource(bRight ? EControllerHand::Right : EControllerHand::Left);
|
||||
bRight = bInRight;
|
||||
Pimpl->UpdateMotionSource();
|
||||
}
|
||||
|
||||
ESGPositionalTrackingHardware USGWristTrackerComponent::GetTrackingHardware() const
|
||||
const FSGWristTrackingSettings& USGWristTrackerComponent::GetWristTrackingSettings() const
|
||||
{
|
||||
if (OverridesPluginWristTrackingSettings())
|
||||
{
|
||||
return TrackingHardware;
|
||||
return WristTrackingSettings;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetTrackingHardware();
|
||||
const USGSettings* Settings{USGSettings::GetInstance()};
|
||||
if (!ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!")))
|
||||
{
|
||||
return WristTrackingSettings;
|
||||
}
|
||||
|
||||
return Settings->GetWristTrackingSettings();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetTrackingHardware(const ESGPositionalTrackingHardware InTrackingHardware)
|
||||
void USGWristTrackerComponent::SetWristTrackingSettings(const FSGWristTrackingSettings& InWristTrackingSettings)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingSettings(),
|
||||
TEXT( "Setting TrackingHardware is only permitted when bOverridePluginWristTrackingSettings is enabled!"));
|
||||
TEXT( "Setting WristTrackingSettings 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::GetDrawDebugWristTrackerGizmo() const
|
||||
{
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return !!bDrawDebugWristTrackerGizmo;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDrawDebugWristTrackerGizmo();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDrawDebugWristTrackerGizmo(const bool bInDrawDebugWristTrackerGizmo)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT( "Setting bDrawDebugWristTrackerGizmo is only permitted when bOverridePluginWristTrackingDebugSettings is"
|
||||
" enabled!"));
|
||||
|
||||
bDrawDebugWristTrackerGizmo = bInDrawDebugWristTrackerGizmo;
|
||||
}
|
||||
|
||||
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLength() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoLength;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLength();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLength(const float InDebugWristTrackerGizmoLength)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bOverridePluginWristTrackingDebugSettings is"
|
||||
" enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoLength = InDebugWristTrackerGizmoLength;
|
||||
}
|
||||
|
||||
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoXAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoXAxisColor;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoXAxisColor();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoXAxisColor(
|
||||
const FColor& InDebugWristTrackerGizmoXAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
|
||||
" is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoXAxisColor = InDebugWristTrackerGizmoXAxisColor;
|
||||
}
|
||||
|
||||
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoYAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoYAxisColor;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoYAxisColor();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoYAxisColor(
|
||||
const FColor& InDebugWristTrackerGizmoYAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
|
||||
" is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoYAxisColor = InDebugWristTrackerGizmoYAxisColor;
|
||||
}
|
||||
|
||||
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoZAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoZAxisColor;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoZAxisColor();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoZAxisColor(
|
||||
const FColor& InDebugWristTrackerGizmoZAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
|
||||
" is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoZAxisColor = InDebugWristTrackerGizmoZAxisColor;
|
||||
}
|
||||
|
||||
bool USGWristTrackerComponent::GetDebugWristTrackerGizmoPersistentLines() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return !!bDebugWristTrackerGizmoPersistentLines;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoPersistentLines();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoPersistentLines(
|
||||
const bool bInDebugWristTrackerGizmoPersistentLines)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoPersistentLines is only permitted when"
|
||||
" bOverridePluginWristTrackingDebugSettings is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
bDebugWristTrackerGizmoPersistentLines = bInDebugWristTrackerGizmoPersistentLines;
|
||||
}
|
||||
|
||||
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLifeTimeModifier() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoLifeTimeModifier;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLifeTimeModifier();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLifeTimeModifier(
|
||||
const float InDebugWristTrackerGizmoLifeTimeModifier)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLifetimeModifier is only permitted when"
|
||||
" bOverridePluginWristTrackingDebugSettings is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoLifeTimeModifier = InDebugWristTrackerGizmoLifeTimeModifier;
|
||||
}
|
||||
|
||||
uint8 USGWristTrackerComponent::GetDebugWristTrackerGizmoDepthPriority() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoDepthPriority;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoDepthPriority();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoDepthPriority(const uint8 InDebugWristTrackerGizmoDepthPriority)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when"
|
||||
" bOverridePluginWristTrackingDebugSettings is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoDepthPriority = InDebugWristTrackerGizmoDepthPriority;
|
||||
}
|
||||
|
||||
float USGWristTrackerComponent::GetDebugWristTrackerGizmoThickness() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
|
||||
if (OverridesPluginWristTrackingDebugSettings())
|
||||
{
|
||||
return DebugWristTrackerGizmoThickness;
|
||||
}
|
||||
|
||||
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoThickness();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
OverridesPluginWristTrackingDebugSettings(),
|
||||
TEXT("Setting DebugWristTrackerGizmoDepthThickness is only permitted when"
|
||||
" bOverridePluginWristTrackingDebugSettings is enabled!"));
|
||||
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
|
||||
DebugWristTrackerGizmoThickness = InDebugWristTrackerGizmoThickness;
|
||||
WristTrackingSettings = InWristTrackingSettings;
|
||||
}
|
||||
|
||||
#if WITH_EDITOR
|
||||
@@ -503,6 +188,8 @@ void USGWristTrackerComponent::InitializeComponent()
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
|
||||
Pimpl->UpdateMotionSource();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::UninitializeComponent()
|
||||
@@ -520,6 +207,8 @@ void USGWristTrackerComponent::BeginPlay()
|
||||
{
|
||||
(void) Pimpl->CheckGlove();
|
||||
}
|
||||
|
||||
Pimpl->UpdateMotionSource();
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
@@ -542,7 +231,7 @@ void USGWristTrackerComponent::TickComponent(
|
||||
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
if (GetDrawDebugWristTrackerGizmo())
|
||||
if (!!WristTrackingSettings.bDrawWristTrackerDebugGizmo)
|
||||
{
|
||||
Pimpl->DrawDebugGizmo();
|
||||
}
|
||||
@@ -595,7 +284,7 @@ bool USGWristTrackerComponent::FImpl::InitializeBackend() const
|
||||
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.
|
||||
// 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.");
|
||||
@@ -693,22 +382,40 @@ bool USGWristTrackerComponent::FImpl::CheckGlove() const
|
||||
return bFoundGlove;
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImpl::UpdateMotionSource() const
|
||||
{
|
||||
if (GEngine)
|
||||
{
|
||||
Owner->SetTrackingSource(Owner->IsRight()
|
||||
? Owner->GetWristTrackingSettings().RightHandMotionSource
|
||||
: Owner->GetWristTrackingSettings().LeftHandMotionSource);
|
||||
}
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
|
||||
{
|
||||
ensureAlwaysMsgf(Owner->Glove, TEXT("Invalid Glove!"));
|
||||
|
||||
FVector TrackerLocation{Owner->GetRelativeLocation()};
|
||||
FRotator TrackerRotation{Owner->GetRelativeRotation()};
|
||||
FVector TrackerLocation{Owner->GetComponentLocation()};
|
||||
FRotator TrackerRotation{Owner->GetComponentRotation()};
|
||||
|
||||
ESGPositionalTrackingHardware TrackerHardware = Owner->GetTrackingHardware();
|
||||
ESGPositionalTrackingHardware TrackerHardware = Owner->GetWristTrackingSettings().TrackingHardware;
|
||||
if (TrackerHardware == ESGPositionalTrackingHardware::None)
|
||||
{
|
||||
TrackerHardware = ESGPositionalTrackingHardware::Custom;
|
||||
}
|
||||
else if (TrackerHardware == ESGPositionalTrackingHardware::Custom)
|
||||
{
|
||||
TrackerLocation += Owner->GetTrackingHardwareLocationOffset();
|
||||
TrackerRotation += Owner->GetTrackingHardwareRotationOffset();
|
||||
if (Owner->IsRight())
|
||||
{
|
||||
TrackerLocation += Owner->GetWristTrackingSettings().TrackingHardwareLocationOffsetRightHand;
|
||||
TrackerRotation += Owner->GetWristTrackingSettings().TrackingHardwareRotationOffsetRightHand;
|
||||
}
|
||||
else
|
||||
{
|
||||
TrackerLocation += Owner->GetWristTrackingSettings().TrackingHardwareLocationOffsetLeftHand;
|
||||
TrackerRotation += Owner->GetWristTrackingSettings().TrackingHardwareRotationOffsetLeftHand;
|
||||
}
|
||||
}
|
||||
|
||||
FVector NewWristLocation;
|
||||
@@ -748,26 +455,11 @@ void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
|
||||
void USGWristTrackerComponent::FImpl::DrawDebugGizmo()
|
||||
{
|
||||
const UWorld* World{Owner->GetWorld()};
|
||||
const FVector& Location{Owner->GetRelativeLocation()};
|
||||
const FRotator& Rotation{Owner->GetRelativeRotation()};
|
||||
const float Length = Owner->GetDebugWristTrackerGizmoLength();
|
||||
const bool bPersistentLines = Owner->GetDebugWristTrackerGizmoPersistentLines();
|
||||
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World)
|
||||
* Owner->GetDebugWristTrackerGizmoLifeTimeModifier();
|
||||
const float DepthPriority = Owner->GetDebugWristTrackerGizmoDepthPriority();
|
||||
const float Thickness = Owner->GetDebugWristTrackerGizmoThickness();
|
||||
const FColor& XAxisColor{Owner->GetDebugWristTrackerGizmoXAxisColor()};
|
||||
const FColor& YAxisColor{Owner->GetDebugWristTrackerGizmoYAxisColor()};
|
||||
const FColor& ZAxisColor{Owner->GetDebugWristTrackerGizmoZAxisColor()};
|
||||
const FVector& Location{Owner->GetComponentLocation()};
|
||||
const FRotator& Rotation{Owner->GetComponentRotation()};
|
||||
const FSGDebugGizmoSettings& DebugGizmoSettings{Owner->GetWristTrackingSettings().WristTrackerDebugGizmoSettings};
|
||||
|
||||
const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Length, 0.0f, 0.0f)));
|
||||
DrawDebugLine(World, Location, XAxisLineEnd, XAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
|
||||
|
||||
const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Length, 0.0f}));
|
||||
DrawDebugLine(World, Location, YAxisLineEnd, YAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
|
||||
|
||||
const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Length})};
|
||||
DrawDebugLine(World, Location, ZAxisLineEnd, ZAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
|
||||
FSGDebugGizmo::Draw(World, Location, Rotation, DebugGizmoSettings);
|
||||
}
|
||||
|
||||
void USGWristTrackerComponent::FImplDeleter::operator()(const FImpl* P) const
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,12 +35,338 @@
|
||||
|
||||
#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)
|
||||
: Super(ObjectInitializer),
|
||||
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
}
|
||||
|
||||
void ASGPlayerController::SetupInputComponent()
|
||||
void ASGPlayerController::BeginPlay()
|
||||
{
|
||||
Super::SetupInputComponent();
|
||||
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;
|
||||
}
|
||||
@@ -35,6 +35,10 @@
|
||||
|
||||
#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"
|
||||
|
||||
@@ -63,6 +67,15 @@ struct ASGVirtualHandActor::FImpl
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void BindFingerGrabOverlapEvents();
|
||||
void UnbindFingerGrabOverlapEvents();
|
||||
|
||||
void BindFingerTouchOverlapEvents();
|
||||
void UnbindFingerTouchOverlapEvents();
|
||||
|
||||
bool IsFingerGrabbing(AActor* Actor) const;
|
||||
bool IsFingerTouching(AActor* Actor) const;
|
||||
};
|
||||
|
||||
ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitializer)
|
||||
@@ -79,10 +92,165 @@ ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitial
|
||||
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()
|
||||
@@ -96,13 +264,24 @@ void ASGVirtualHandActor::BeginPlay()
|
||||
|
||||
WristTracker->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
|
||||
{
|
||||
VirtualHand->SetRelativeLocation(Location);
|
||||
VirtualHand->SetWorldLocation(Location);
|
||||
});
|
||||
|
||||
WristTracker->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
|
||||
{
|
||||
VirtualHand->SetRelativeRotation(Rotation);
|
||||
VirtualHand->SetWorldRotation(Rotation);
|
||||
});
|
||||
|
||||
Pimpl->BindFingerGrabOverlapEvents();
|
||||
Pimpl->BindFingerTouchOverlapEvents();
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
{
|
||||
Super::EndPlay(EndPlayReason);
|
||||
|
||||
Pimpl->UnbindFingerGrabOverlapEvents();
|
||||
Pimpl->UnbindFingerTouchOverlapEvents();
|
||||
}
|
||||
|
||||
void ASGVirtualHandActor::PreInitializeComponents()
|
||||
@@ -112,6 +291,292 @@ void ASGVirtualHandActor::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();
|
||||
@@ -138,6 +603,98 @@ ASGVirtualHandActor::FImpl::FImpl(ASGVirtualHandActor* 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
|
||||
|
||||
@@ -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,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;
|
||||
}
|
||||
};
|
||||
@@ -45,12 +45,16 @@
|
||||
#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))
|
||||
@@ -83,6 +87,45 @@ private:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bHiddenInGameIfNoGloveDetected : 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"))
|
||||
FSGDebugVirtualHandSettings DebugVirtualHandSettings;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
uint8 bBackendInitialized : 1;
|
||||
@@ -90,6 +133,9 @@ private:
|
||||
UPROPERTY(Transient)
|
||||
USGHapticGlove* Glove;
|
||||
|
||||
UPROPERTY(Transient)
|
||||
USGWristTrackerComponent* WristTracker;
|
||||
|
||||
public:
|
||||
FORCEINLINE bool IsLeft() const
|
||||
{
|
||||
@@ -103,6 +149,111 @@ public:
|
||||
|
||||
void SetRight(const bool bInRight);
|
||||
|
||||
FORCEINLINE const FName& GetMiddleFingertipTouchSocketName() const
|
||||
{
|
||||
return MiddleFingertipTouchSocketName;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetMiddleFingertipTouchSocketName(const FName& SocketName)
|
||||
{
|
||||
MiddleFingertipTouchSocketName = SocketName;
|
||||
}
|
||||
|
||||
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& 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;
|
||||
@@ -113,10 +264,15 @@ public:
|
||||
bHiddenInGameIfNoGloveDetected = bInHiddenIfNoGloveDetected;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetWristTracker(USGWristTrackerComponent* InWristTracker)
|
||||
{
|
||||
WristTracker = InWristTracker;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void SetAnimClass(class UClass* NewClass) override;
|
||||
|
||||
virtual void PostInitProperties() override;
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
#if WITH_EDITOR
|
||||
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
||||
@@ -143,6 +299,12 @@ protected:
|
||||
|
||||
public:
|
||||
bool IsGloveConnected() const;
|
||||
|
||||
FORCEINLINE USGHapticGlove* GetConnectedGlove() const
|
||||
{
|
||||
return Glove;
|
||||
}
|
||||
|
||||
USGHandPose* GetHandPose();
|
||||
|
||||
public:
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "MotionControllerComponent.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGSettings/SGWristTrackingSettings.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
|
||||
#include "SGWristTrackerComponent.generated.h"
|
||||
@@ -93,107 +94,21 @@ private:
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings")
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bRight : 1;
|
||||
|
||||
/**
|
||||
* Determines whether to override the plugin's wrist tracking settings or not.
|
||||
*/
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove", meta=(AllowPrivateAccess="false"))
|
||||
uint8 bOverridePluginWristTrackingSettings : 1;
|
||||
|
||||
/**
|
||||
* If set to Custom, any desired location and rotation can be specified.
|
||||
* Overrides the plugin's wrist tracking settings.
|
||||
*/
|
||||
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 bDrawDebugWristTrackerGizmo : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
float DebugWristTrackerGizmoLength;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoXAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoYAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoZAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
uint8 bDebugWristTrackerGizmoPersistentLines : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
float DebugWristTrackerGizmoLifeTimeModifier;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
uint8 DebugWristTrackerGizmoDepthPriority;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
|
||||
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
|
||||
EditConditionHides))
|
||||
float DebugWristTrackerGizmoThickness;
|
||||
UPROPERTY(EditAnywhere, Category = "SenseGlove",
|
||||
meta=(AllowPrivateAccess="false", EditCondition="bOverridePluginWristTrackingSettings", EditConditionHides))
|
||||
FSGWristTrackingSettings WristTrackingSettings;
|
||||
|
||||
private:
|
||||
UPROPERTY(Transient)
|
||||
@@ -209,6 +124,18 @@ private:
|
||||
FRotator WristRotation;
|
||||
|
||||
public:
|
||||
FORCEINLINE bool IsLeft() const
|
||||
{
|
||||
return !IsRight();
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return !!bRight;
|
||||
}
|
||||
|
||||
void SetRight(const bool bInRight);
|
||||
|
||||
FORCEINLINE bool OverridesPluginWristTrackingSettings() const
|
||||
{
|
||||
return !!bOverridePluginWristTrackingSettings;
|
||||
@@ -219,63 +146,8 @@ public:
|
||||
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 GetDrawDebugWristTrackerGizmo() const;
|
||||
void SetDrawDebugWristTrackerGizmo(bool bInDrawDebugWristTrackerGizmo);
|
||||
|
||||
float GetDebugWristTrackerGizmoLength() const;
|
||||
void SetDebugWristTrackerGizmoLength(float InDebugWristTrackerGizmoLength);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoXAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoYAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoZAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor);
|
||||
|
||||
bool GetDebugWristTrackerGizmoPersistentLines() const;
|
||||
void SetDebugWristTrackerGizmoPersistentLines(bool bInDebugWristTrackerGizmoPersistentLines);
|
||||
|
||||
float GetDebugWristTrackerGizmoLifeTimeModifier() const;
|
||||
void SetDebugWristTrackerGizmoLifeTimeModifier(float InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
|
||||
uint8 GetDebugWristTrackerGizmoDepthPriority() const;
|
||||
void SetDebugWristTrackerGizmoDepthPriority(uint8 InDebugWristTrackerGizmoDepthPriority);
|
||||
|
||||
float GetDebugWristTrackerGizmoThickness() const;
|
||||
void SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness);
|
||||
|
||||
FORCEINLINE bool IsLeft() const
|
||||
{
|
||||
return GetTrackingSource() == EControllerHand::Left;
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsRight() const
|
||||
{
|
||||
return GetTrackingSource() == EControllerHand::Right;
|
||||
}
|
||||
|
||||
void SetRight(const bool bRight);
|
||||
const FSGWristTrackingSettings& GetWristTrackingSettings() const;
|
||||
void SetWristTrackingSettings(const FSGWristTrackingSettings& InWristTrackingSettings);
|
||||
|
||||
FORCEINLINE const FVector& GetWristLocation() const
|
||||
{
|
||||
@@ -308,4 +180,4 @@ protected:
|
||||
virtual void EditorTick(float DeltaTime,
|
||||
enum ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction);
|
||||
};
|
||||
};
|
||||
@@ -36,11 +36,17 @@
|
||||
#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;
|
||||
@@ -50,6 +56,25 @@ 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;
|
||||
|
||||
@@ -71,15 +96,76 @@ private:
|
||||
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* HandLeft;
|
||||
|
||||
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
|
||||
{
|
||||
@@ -91,22 +177,436 @@ public:
|
||||
return WristTrackerLeft;
|
||||
}
|
||||
|
||||
FORCEINLINE USGWristTrackerComponent* GetWristTrackerRight() const
|
||||
{
|
||||
return WristTrackerRight;
|
||||
}
|
||||
|
||||
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 == HandRight ? CanRightHandGrab(Actor) : CanLeftHandGrab(Actor);
|
||||
}
|
||||
|
||||
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand, const AActor* Actor) const
|
||||
{
|
||||
return Hand == HandRight ? IsRightHandGrabbing(Actor) : IsLeftHandGrabbing(Actor);
|
||||
}
|
||||
|
||||
bool IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor) const;
|
||||
|
||||
FORCEINLINE bool IsGrabbing(const USGVirtualHandComponent* Hand) const
|
||||
{
|
||||
return Hand == HandRight ? IsRightHandGrabbing() : IsLeftHandGrabbing();
|
||||
}
|
||||
|
||||
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 == HandRight ? ReleaseRight() : ReleaseLeft();
|
||||
}
|
||||
};
|
||||
@@ -36,6 +36,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "Templates/UniquePtr.h"
|
||||
|
||||
#include "SGPlayerController.generated.h"
|
||||
|
||||
@@ -44,6 +45,17 @@ 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 SetupInputComponent() override;
|
||||
virtual void BeginPlay() override;
|
||||
};
|
||||
@@ -41,11 +41,15 @@
|
||||
#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 USceneComponent;
|
||||
class USphereComponent;
|
||||
|
||||
class USGHandPose;
|
||||
class USGVirtualHandComponent;
|
||||
@@ -56,6 +60,25 @@ 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;
|
||||
|
||||
@@ -77,6 +100,37 @@ private:
|
||||
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
|
||||
{
|
||||
@@ -88,6 +142,46 @@ public:
|
||||
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)
|
||||
{
|
||||
@@ -96,12 +190,148 @@ protected:
|
||||
|
||||
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);
|
||||
};
|
||||
@@ -56,8 +56,10 @@ public class SenseGlove : ModuleRules
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"HeadMountedDisplay",
|
||||
"InputCore",
|
||||
"SenseGloveConnect",
|
||||
"SenseGloveCore",
|
||||
"SenseGloveDebug",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveSettings",
|
||||
"SenseGloveTypes",
|
||||
|
||||
@@ -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>
|
||||
@@ -87,10 +87,10 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
|
||||
#if UE_5_1_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
|
||||
#else
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 5.0 is not supported!");
|
||||
#endif
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
@@ -151,29 +151,43 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
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, "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"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
|
||||
switch (Target.WindowsPlatform.Compiler)
|
||||
{
|
||||
#if UE_4_27_OR_LATER
|
||||
#if UE_5_0_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
#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 engine version or compiler!");
|
||||
@@ -218,10 +232,10 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
|
||||
#if UE_5_1_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
#elif UE_4_5_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
|
||||
#else
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 5.0 is not supported!");
|
||||
#endif
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
@@ -282,29 +296,43 @@ public class SenseGloveConnectImpl : ModuleRules
|
||||
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, "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"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
|
||||
switch (Target.WindowsPlatform.Compiler)
|
||||
{
|
||||
#if UE_4_27_OR_LATER
|
||||
#if UE_5_0_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
#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 engine version or compiler!");
|
||||
|
||||
+1
-1
@@ -33,4 +33,4 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "SGCoreTypes/SGInterpolationSetArray.h"
|
||||
#include "SGCore/SGInterpolationSetArray.h"
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "UObject/Object.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGCoreTypes/SGInterpolationSetArray.h"
|
||||
#include "SGCore/SGInterpolationSetArray.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
|
||||
#include "SGHandInterpolator.generated.h"
|
||||
|
||||
+2
-4
@@ -39,14 +39,12 @@
|
||||
|
||||
#include "SGInterpolationSetArray.generated.h"
|
||||
|
||||
class FSGInterpolationSetImpl;
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVECORETYPES_API FSGInterpolationSetArray
|
||||
struct SENSEGLOVECORE_API FSGInterpolationSetArray
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Core | Types | Nested Arrays", BlueprintReadWrite)
|
||||
UPROPERTY(EditAnywhere, Category="SenseGlove | Types | Nested Arrays", BlueprintReadWrite)
|
||||
TArray<USGInterpolationSet*> InterpolationSetArray;
|
||||
};
|
||||
@@ -47,7 +47,6 @@ public class SenseGloveCore : ModuleRules
|
||||
{
|
||||
"Core",
|
||||
"Engine",
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
|
||||
@@ -59,15 +58,16 @@ public class SenseGloveCore : ModuleRules
|
||||
"SenseGloveCoreImpl",
|
||||
"SenseGloveInterop",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveTypes",
|
||||
"SenseGloveUtils",
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePathModuleNames.AddRange(
|
||||
PublicIncludePathModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"SenseGloveCoreTypes",
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,14 +313,12 @@ FSGCoreEnumCast::FEPositionalTrackingHardware FSGCoreEnumCast::ToEPositionalTrac
|
||||
return FEPositionalTrackingHardware::Custom;
|
||||
case ESGPositionalTrackingHardware::ViveTracker:
|
||||
return FEPositionalTrackingHardware::ViveTracker;
|
||||
case ESGPositionalTrackingHardware::OculusTouch:
|
||||
return FEPositionalTrackingHardware::OculusTouch;
|
||||
case ESGPositionalTrackingHardware::Quest2Controller:
|
||||
return FEPositionalTrackingHardware::Quest2Controller;
|
||||
case ESGPositionalTrackingHardware::PicoNeo2:
|
||||
return FEPositionalTrackingHardware::PicoNeo2;
|
||||
case ESGPositionalTrackingHardware::PicoNeo3:
|
||||
return FEPositionalTrackingHardware::PicoNeo3;
|
||||
case ESGPositionalTrackingHardware::ViveFocus3WristTracker:
|
||||
return FEPositionalTrackingHardware::ViveFocus3WristTracker;
|
||||
case ESGPositionalTrackingHardware::QuestProController:
|
||||
return FEPositionalTrackingHardware::QuestProController;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled enum cast item!"));
|
||||
break;
|
||||
@@ -338,14 +336,12 @@ ESGPositionalTrackingHardware FSGCoreEnumCast::ToESGPositionalTrackingHardware(c
|
||||
return ESGPositionalTrackingHardware::Custom;
|
||||
case FEPositionalTrackingHardware::ViveTracker:
|
||||
return ESGPositionalTrackingHardware::ViveTracker;
|
||||
case FEPositionalTrackingHardware::OculusTouch:
|
||||
return ESGPositionalTrackingHardware::OculusTouch;
|
||||
case FEPositionalTrackingHardware::Quest2Controller:
|
||||
return ESGPositionalTrackingHardware::Quest2Controller;
|
||||
case FEPositionalTrackingHardware::PicoNeo2:
|
||||
return ESGPositionalTrackingHardware::PicoNeo2;
|
||||
case FEPositionalTrackingHardware::PicoNeo3:
|
||||
return ESGPositionalTrackingHardware::PicoNeo3;
|
||||
case FEPositionalTrackingHardware::ViveFocus3WristTracker:
|
||||
return ESGPositionalTrackingHardware::ViveFocus3WristTracker;
|
||||
case FEPositionalTrackingHardware::QuestProController:
|
||||
return ESGPositionalTrackingHardware::QuestProController;
|
||||
default:
|
||||
ensureAlwaysMsgf(false, TEXT("Unhandled enum cast item!"));
|
||||
break;
|
||||
|
||||
@@ -154,7 +154,7 @@ FSGQuatImpl::FSGQuatImpl(const FQuat& Quat)
|
||||
/// Forward X
|
||||
/// Right Y
|
||||
/// Up Z
|
||||
Pimpl->Quat = FQuatType(-Quat.X, Quat.Y, -Quat.Z, Quat.W);
|
||||
Pimpl->Quat = FQuatType(-Quat.Y, -Quat.X, -Quat.Z, Quat.W);
|
||||
}
|
||||
|
||||
FSGQuatImpl::FSGQuatImpl(const FSGQuatImpl& Rhs)
|
||||
@@ -192,7 +192,7 @@ FQuat FSGQuatImpl::ToFQuat() const
|
||||
/// Forward X
|
||||
/// Left Y
|
||||
/// Up Z
|
||||
return FQuat(-Pimpl->Quat.GetX(), Pimpl->Quat.GetY(), -Pimpl->Quat.GetZ(), Pimpl->Quat.GetW());
|
||||
return FQuat(-Pimpl->Quat.GetY(), -Pimpl->Quat.GetX(), -Pimpl->Quat.GetZ(), Pimpl->Quat.GetW());
|
||||
}
|
||||
|
||||
FSGQuatImpl FSGQuatImpl::operator*(const FSGQuatImpl& QuatImpl) const
|
||||
|
||||
@@ -113,7 +113,7 @@ FSGVect3DImpl::FSGVect3DImpl(const FVector& Vector)
|
||||
/// Right Y
|
||||
/// Up Z
|
||||
|
||||
FVect3DType Vect3D(Vector.X, -Vector.Y, Vector.Z);
|
||||
FVect3DType Vect3D(Vector.Y, Vector.X, Vector.Z);
|
||||
Pimpl->Vect3D = MoveTemp(Vect3D);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ FVector FSGVect3DImpl::ToFVector() const
|
||||
/// Right Y
|
||||
/// Up Z
|
||||
|
||||
FVector Vector(Pimpl->Vect3D.GetX(), -Pimpl->Vect3D.GetY(), Pimpl->Vect3D.GetZ());
|
||||
FVector Vector(Pimpl->Vect3D.GetY(), Pimpl->Vect3D.GetX(), Pimpl->Vect3D.GetZ());
|
||||
return MoveTemp(Vector);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -86,10 +86,10 @@ public class SenseGloveCoreImpl : ModuleRules
|
||||
|
||||
#if UE_5_1_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
#elif UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r21e"));
|
||||
#else
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
|
||||
Debug.Assert(false, "Developing for Android on UE versions older than 5.0 is not supported!");
|
||||
#endif
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
@@ -150,29 +150,43 @@ public class SenseGloveCoreImpl : ModuleRules
|
||||
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, "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"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported engine version or compiler!");
|
||||
#endif
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
|
||||
switch (Target.WindowsPlatform.Compiler)
|
||||
{
|
||||
#if UE_4_27_OR_LATER
|
||||
#if UE_5_0_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
#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 engine version or compiler!");
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SGCore/SGInterpolationSetArray.h"
|
||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||
#include "SGCoreTypes/SGInterpolationSetArray.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGTypes/SGVectorArray.h"
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ public class SenseGloveCoreKismet : ModuleRules
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"SenseGloveCore",
|
||||
"SenseGloveCoreTypes",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveKismet",
|
||||
"SenseGloveTypes",
|
||||
|
||||
@@ -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
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGDebug/SGDebugGizmo.h"
|
||||
|
||||
#include "DrawDebugHelpers.h"
|
||||
#include "Engine/World.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Math/Color.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
void FSGDebugGizmo::Draw(const UWorld* World, const FVector& Location, const FRotator& Rotation,
|
||||
const FSGDebugGizmoSettings& Settings)
|
||||
{
|
||||
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * Settings.LifeTimeModifier;
|
||||
|
||||
const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Settings.Length, 0.0f, 0.0f)));
|
||||
DrawDebugLine(World, Location, XAxisLineEnd,
|
||||
Settings.XAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
|
||||
|
||||
const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Settings.Length, 0.0f}));
|
||||
DrawDebugLine(World, Location, YAxisLineEnd,
|
||||
Settings.YAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
|
||||
|
||||
const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Settings.Length})};
|
||||
DrawDebugLine(World, Location, ZAxisLineEnd,
|
||||
Settings.ZAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* @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 "SGDebug/SGDebugVirtualHand.h"
|
||||
|
||||
#include "DrawDebugHelpers.h"
|
||||
#include "Engine/World.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Math/Color.h"
|
||||
#include "UObject/Object.h"
|
||||
|
||||
#include "SGDebug/SGDebugGizmo.h"
|
||||
|
||||
void FSGDebugVirtualHand::Draw(const UWorld* World, const FVector& WristLocation, const FRotator& WristRotation,
|
||||
const TArray<TArray<FVector>>& JointPositions,
|
||||
const TArray<TArray<FRotator>>& JointRotations,
|
||||
const FSGDebugVirtualHandSettings& Settings)
|
||||
{
|
||||
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||
TEXT("Invalid virtual hand drawing mode!"));
|
||||
|
||||
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * Settings.LifeTimeModifier;
|
||||
|
||||
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
|
||||
{
|
||||
DrawDebugBox(World, WristLocation, Settings.CubeExtent,
|
||||
WristRotation.Quaternion(), Settings.CubeColor,
|
||||
Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.CubeThickness);
|
||||
}
|
||||
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
|
||||
{
|
||||
FSGDebugGizmo::Draw(World,
|
||||
WristLocation, WristRotation,
|
||||
FSGDebugGizmoSettings{
|
||||
Settings.GizmoLength,
|
||||
Settings.GizmoThickness,
|
||||
Settings.GizmoXAxisColor,
|
||||
Settings.GizmoYAxisColor,
|
||||
Settings.GizmoZAxisColor,
|
||||
!!Settings.bPersistentLines,
|
||||
Settings.LifeTimeModifier,
|
||||
Settings.DepthPriority
|
||||
});
|
||||
}
|
||||
|
||||
uint32 JointRotationsIndex = -1;
|
||||
for (const TArray<FVector>& FingerJointPositions: JointPositions)
|
||||
{
|
||||
++JointRotationsIndex;
|
||||
uint32 FingerJointRotationsIndex = -1;
|
||||
const TArray<FRotator>& FingerJointRotations{JointRotations[JointRotationsIndex]};
|
||||
|
||||
for (const FVector& FingerJointPosition: FingerJointPositions)
|
||||
{
|
||||
++FingerJointRotationsIndex;
|
||||
const FRotator& FingerJointRotation(FingerJointRotations[FingerJointRotationsIndex]);
|
||||
|
||||
const FVector DrawJointLocation(WristRotation.RotateVector(FingerJointPosition) + WristLocation);
|
||||
|
||||
const FQuat JointQuat{FingerJointRotation};
|
||||
const FQuat WristQuat{WristRotation};
|
||||
const FRotator DrawJointRotation{WristQuat * JointQuat};
|
||||
|
||||
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
|
||||
{
|
||||
DrawDebugBox(World, DrawJointLocation, Settings.CubeExtent,
|
||||
DrawJointRotation.Quaternion(), Settings.CubeColor,
|
||||
Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.CubeThickness);
|
||||
}
|
||||
|
||||
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
|
||||
{
|
||||
FSGDebugGizmo::Draw(World,
|
||||
DrawJointLocation, DrawJointRotation,
|
||||
FSGDebugGizmoSettings{
|
||||
Settings.GizmoLength,
|
||||
Settings.GizmoThickness,
|
||||
Settings.GizmoXAxisColor,
|
||||
Settings.GizmoYAxisColor,
|
||||
Settings.GizmoZAxisColor,
|
||||
!!Settings.bPersistentLines,
|
||||
Settings.LifeTimeModifier,
|
||||
Settings.DepthPriority
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-4
@@ -33,8 +33,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "SenseGloveCoreTypes.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "SenseGloveCoreTypesModule.h"
|
||||
#include "SenseGloveDebug.h"
|
||||
|
||||
IMPLEMENT_MODULE(FSenseGloveCoreTypesModule, SenseGloveCoreTypes)
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
#include "SenseGloveDebugModule.h"
|
||||
|
||||
IMPLEMENT_MODULE(FSenseGloveDebugModule, SenseGloveDebug)
|
||||
+1
-1
@@ -35,4 +35,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CoreMinimal.h"
|
||||
+11
-10
@@ -33,29 +33,30 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "SenseGloveCoreTypesModule.h"
|
||||
#include "SenseGloveDebugModule.h"
|
||||
|
||||
#include "SGLog/SGLog.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FSenseGloveCoreTypesModule"
|
||||
#define LOCTEXT_NAMESPACE "FSenseGloveDebugModule"
|
||||
|
||||
void FSenseGloveCoreTypesModule::StartupModule()
|
||||
void FSenseGloveDebugModule::StartupModule()
|
||||
{
|
||||
SGLOG("Starting up SenseGloveCoreTypes module...");
|
||||
SGLOG("Starting up SenseGloveDebug module...");
|
||||
}
|
||||
|
||||
void FSenseGloveCoreTypesModule::PreUnloadCallback()
|
||||
void FSenseGloveDebugModule::PreUnloadCallback()
|
||||
{
|
||||
SGLOG("Unloading SenseGloveCoreTypes module...");
|
||||
SGLOG("Unloading SenseGloveDebug module...");
|
||||
}
|
||||
|
||||
void FSenseGloveCoreTypesModule::PostLoadCallback()
|
||||
void FSenseGloveDebugModule::PostLoadCallback()
|
||||
{
|
||||
SGLOG("Loading of SenseGloveCoreTypes module has succeeded!");
|
||||
SGLOG("Loading of SenseGloveDebug module has succeeded!");
|
||||
}
|
||||
|
||||
void FSenseGloveCoreTypesModule::ShutdownModule()
|
||||
void FSenseGloveDebugModule::ShutdownModule()
|
||||
{
|
||||
SGLOG("Shutting down SenseGloveCoreTypes module...");
|
||||
SGLOG("Shutting down SenseGloveDebug module...");
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
+2
-2
@@ -37,9 +37,9 @@
|
||||
|
||||
#include "Modules/ModuleInterface.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "SenseGloveCoreTypes"
|
||||
#define LOCTEXT_NAMESPACE "SenseGloveDebug"
|
||||
|
||||
class FSenseGloveCoreTypesModule : public IModuleInterface
|
||||
class FSenseGloveDebugModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override;
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @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 "Math/Rotator.h"
|
||||
#include "Math/Vector.h"
|
||||
|
||||
#include "SGSettings/SGDebugGizmoSettings.h"
|
||||
|
||||
class SENSEGLOVEDEBUG_API FSGDebugGizmo final
|
||||
{
|
||||
public:
|
||||
static void Draw(
|
||||
const UWorld* World,
|
||||
const FVector& Location, const FRotator& Rotation,
|
||||
const FSGDebugGizmoSettings& Settings);
|
||||
|
||||
public:
|
||||
FSGDebugGizmo() = delete;
|
||||
virtual ~FSGDebugGizmo() = delete;
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @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 "Math/Rotator.h"
|
||||
#include "Math/Vector.h"
|
||||
|
||||
#include "SGSettings/SGDebugVirtualHandSettings.h"
|
||||
|
||||
class UWorld;
|
||||
|
||||
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
|
||||
{
|
||||
public:
|
||||
static void Draw(
|
||||
const UWorld* World,
|
||||
const FVector& WristLocation, const FRotator& WristRotation,
|
||||
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
|
||||
const FSGDebugVirtualHandSettings& Settings);
|
||||
|
||||
public:
|
||||
FSGDebugVirtualHand() = delete;
|
||||
virtual ~FSGDebugVirtualHand() = delete;
|
||||
};
|
||||
+6
-11
@@ -36,9 +36,9 @@
|
||||
using System;
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class SenseGloveCoreTypes : ModuleRules
|
||||
public class SenseGloveDebug : ModuleRules
|
||||
{
|
||||
public SenseGloveCoreTypes(ReadOnlyTargetRules Target) : base(Target)
|
||||
public SenseGloveDebug(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
@@ -53,16 +53,11 @@ public class SenseGloveCoreTypes : ModuleRules
|
||||
new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"SenseGloveCore",
|
||||
"Engine",
|
||||
"SenseGloveLog",
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePathModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"SenseGloveCore",
|
||||
"SenseGloveSettings",
|
||||
"SenseGloveTypes",
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* A data class containing the minimum required data for a hand's forward
|
||||
* kinematics.
|
||||
* Used in both kinematics and calibration.
|
||||
*/
|
||||
|
||||
|
||||
#include "SGKismet/SGGrabComponentKismetLibrary.h"
|
||||
|
||||
#include "SenseGlove/Components/SGGrabComponent.h"
|
||||
|
||||
USGGrabComponent* UGrabComponentKismetLibrary::GetGrabComponent(const AActor* Actor)
|
||||
{
|
||||
return USGGrabComponent::GetGrabComponent(Actor);
|
||||
}
|
||||
|
||||
bool UGrabComponentKismetLibrary::IsGrabbable(const AActor* Actor)
|
||||
{
|
||||
return USGGrabComponent::IsGrabbable(Actor);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentLocationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentLocationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentLocationRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentLocationRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentLocationRule(InAttachmentLocationRule);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentRotationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentRotationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentRotationRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentRotationRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentRotationRule(InAttachmentRotationRule);
|
||||
}
|
||||
|
||||
EAttachmentRule UGrabComponentKismetLibrary::GetAttachmentScaleRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentScaleRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentScaleRule(USGGrabComponent* GrabComponent,
|
||||
const EAttachmentRule InAttachmentScaleRule)
|
||||
{
|
||||
GrabComponent->SetAttachmentScaleRule(InAttachmentScaleRule);
|
||||
}
|
||||
|
||||
bool UGrabComponentKismetLibrary::GetAttachmentWeldSimulatedBodies(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentWeldSimulatedBodies();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentWeldSimulatedBodies(USGGrabComponent* GrabComponent,
|
||||
const bool bInAttachmentWeldSimulatedBodies)
|
||||
{
|
||||
GrabComponent->SetAttachmentWeldSimulatedBodies(bInAttachmentWeldSimulatedBodies);
|
||||
}
|
||||
|
||||
const FName& UGrabComponentKismetLibrary::GetAttachmentSocketName(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetAttachmentSocketName();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetAttachmentSocketName(USGGrabComponent* GrabComponent,
|
||||
const FName& InAttachmentSocketName)
|
||||
{
|
||||
GrabComponent->SetAttachmentSocketName(InAttachmentSocketName);
|
||||
}
|
||||
|
||||
EDetachmentRule UGrabComponentKismetLibrary::GetDetachmentLocationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetDetachmentLocationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetDetachmentLocationRule(USGGrabComponent* GrabComponent,
|
||||
const EDetachmentRule InDetachmentLocationRule)
|
||||
{
|
||||
GrabComponent->SetDetachmentLocationRule(InDetachmentLocationRule);
|
||||
}
|
||||
|
||||
EDetachmentRule UGrabComponentKismetLibrary::GetDetachmentRotationRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetDetachmentRotationRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetDetachmentRotationRule(USGGrabComponent* GrabComponent,
|
||||
const EDetachmentRule InDetachmentRotationRule)
|
||||
{
|
||||
GrabComponent->SetDetachmentRotationRule(InDetachmentRotationRule);
|
||||
}
|
||||
|
||||
EDetachmentRule UGrabComponentKismetLibrary::GetDetachmentScaleRule(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetDetachmentScaleRule();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetDetachmentScaleRule(USGGrabComponent* GrabComponent,
|
||||
const EDetachmentRule InDetachmentScaleRule)
|
||||
{
|
||||
GrabComponent->SetDetachmentScaleRule(InDetachmentScaleRule);
|
||||
}
|
||||
|
||||
bool UGrabComponentKismetLibrary::GetDetachmentInCallModify(const USGGrabComponent* GrabComponent)
|
||||
{
|
||||
return GrabComponent->GetDetachmentInCallModify();
|
||||
}
|
||||
|
||||
void UGrabComponentKismetLibrary::SetDetachmentInCallModify(USGGrabComponent* GrabComponent,
|
||||
const bool bInDetachmentInCallModify)
|
||||
{
|
||||
GrabComponent->SetDetachmentInCallModify(bInDetachmentInCallModify);
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "SGKismet/SGPawnKismetLibrary.h"
|
||||
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||
@@ -51,17 +52,188 @@ USGWristTrackerComponent* UPawnKismetLibrary::GetWristTrackerLeft(const ASGPawn*
|
||||
return Pawn->GetWristTrackerLeft();
|
||||
}
|
||||
|
||||
USGWristTrackerComponent* UPawnKismetLibrary::GetWristTrackerRight(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetWristTrackerRight();
|
||||
}
|
||||
|
||||
USGVirtualHandComponent* UPawnKismetLibrary::GetHandLeft(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetHandLeft();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftThumbFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftThumbFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftIndexFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftIndexFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftMiddleFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftMiddleFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftThumbFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftThumbFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftIndexFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftIndexFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftMiddleFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftMiddleFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftRingFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftRingFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetLeftPinkyFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetLeftPinkyFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USGWristTrackerComponent* UPawnKismetLibrary::GetWristTrackerRight(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetWristTrackerRight();
|
||||
}
|
||||
|
||||
USGVirtualHandComponent* UPawnKismetLibrary::GetHandRight(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetHandRight();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightThumbFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightThumbFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightIndexFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightIndexFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightMiddleFingertipGrabCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightMiddleFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightThumbFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightThumbFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightIndexFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightIndexFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightMiddleFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightMiddleFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightRingFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightRingFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UPawnKismetLibrary::GetRightPinkyFingertipTouchCollider(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->GetRightPinkyFingertipTouchCollider();
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::CanLeftHandGrab(const ASGPawn* Pawn, const AActor* Actor)
|
||||
{
|
||||
return Pawn->CanLeftHandGrab(Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsLeftHandGrabbing_Actor(const ASGPawn* Pawn, const AActor* Actor)
|
||||
{
|
||||
return Pawn->IsLeftHandGrabbing(Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsLeftHandGrabbing_OutActor(const ASGPawn* Pawn, AActor*& OutActor)
|
||||
{
|
||||
return Pawn->IsLeftHandGrabbing(OutActor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsLeftHandGrabbing(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->IsLeftHandGrabbing();
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::CanRightHandGrab(const ASGPawn* Pawn, const AActor* Actor)
|
||||
{
|
||||
return Pawn->CanRightHandGrab(Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsRightHandGrabbing_Actor(const ASGPawn* Pawn, const AActor* Actor)
|
||||
{
|
||||
return Pawn->IsRightHandGrabbing(Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsRightHandGrabbing_OutActor(const ASGPawn* Pawn)
|
||||
{
|
||||
return Pawn->IsRightHandGrabbing();
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsRightHandGrabbing(const ASGPawn* Pawn, AActor*& OutActor)
|
||||
{
|
||||
return Pawn->IsRightHandGrabbing();
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::CanGrab(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand, const AActor* Actor)
|
||||
{
|
||||
return Pawn->CanGrab(Hand, Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsGrabbing_Actor(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand, const AActor* Actor)
|
||||
{
|
||||
return Pawn->IsGrabbing(Hand, Actor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsGrabbing_OutActor(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand,
|
||||
AActor*& OutActor)
|
||||
{
|
||||
return Pawn->IsGrabbing(Hand, OutActor);
|
||||
}
|
||||
|
||||
bool UPawnKismetLibrary::IsGrabbing(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand)
|
||||
{
|
||||
return Pawn->IsGrabbing(Hand);
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::GrabLeft(ASGPawn* Pawn, AActor* Actor)
|
||||
{
|
||||
Pawn->GrabLeft(Actor);
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::GrabRight(ASGPawn* Pawn, AActor* Actor)
|
||||
{
|
||||
Pawn->GrabRight(Actor);
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::Grab(ASGPawn* Pawn, USGVirtualHandComponent* Hand, AActor* Actor)
|
||||
{
|
||||
Pawn->Grab(Hand, Actor);
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::ReleaseLeft(ASGPawn* Pawn)
|
||||
{
|
||||
Pawn->ReleaseLeft();
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::ReleaseRight(ASGPawn* Pawn)
|
||||
{
|
||||
Pawn->ReleaseRight();
|
||||
}
|
||||
|
||||
void UPawnKismetLibrary::Release(ASGPawn* Pawn, const USGVirtualHandComponent* Hand)
|
||||
{
|
||||
Pawn->Release(Hand);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* A data class containing the minimum required data for a hand's forward
|
||||
* kinematics.
|
||||
* Used in both kinematics and calibration.
|
||||
*/
|
||||
|
||||
|
||||
#include "SGKismet/SGTouchComponentKismetLibrary.h"
|
||||
|
||||
#include "SenseGlove/Components/SGTouchComponent.h"
|
||||
|
||||
USGTouchComponent* UTouchComponentKismetLibrary::GetTouchComponent(const AActor* Actor)
|
||||
{
|
||||
return USGTouchComponent::GetTouchComponent(Actor);
|
||||
}
|
||||
|
||||
bool UTouchComponentKismetLibrary::IsTouchable(const AActor* Actor)
|
||||
{
|
||||
return USGTouchComponent::IsTouchable(Actor);
|
||||
}
|
||||
|
||||
int32 UTouchComponentKismetLibrary::GetBuzzLevel(const USGTouchComponent* TouchComponent)
|
||||
{
|
||||
return TouchComponent->GetBuzzLevel();
|
||||
}
|
||||
|
||||
void UTouchComponentKismetLibrary::SetBuzzLevel(USGTouchComponent* TouchComponent, const int32 Level)
|
||||
{
|
||||
TouchComponent->SetBuzzLevel(Level);
|
||||
}
|
||||
|
||||
float UTouchComponentKismetLibrary::GetBuzzDuration(const USGTouchComponent* TouchComponent)
|
||||
{
|
||||
return TouchComponent->GetBuzzDuration();
|
||||
}
|
||||
|
||||
void UTouchComponentKismetLibrary::SetBuzzDuration(USGTouchComponent* TouchComponent, const float Duration)
|
||||
{
|
||||
TouchComponent->SetBuzzDuration(Duration);
|
||||
}
|
||||
|
||||
int32 UTouchComponentKismetLibrary::GetForceFeedbackLevel(const USGTouchComponent* TouchComponent)
|
||||
{
|
||||
return TouchComponent->GetForceFeedbackLevel();
|
||||
}
|
||||
|
||||
void UTouchComponentKismetLibrary::SetForceFeedbackLevel(USGTouchComponent* TouchComponent, const int32 Level)
|
||||
{
|
||||
TouchComponent->SetForceFeedbackLevel(Level);
|
||||
}
|
||||
@@ -35,18 +35,67 @@
|
||||
|
||||
#include "SGKismet/SGVirtualHandActorKismetLibrary.h"
|
||||
|
||||
#include "Components/SphereComponent.h"
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
#include "SenseGlove/Components/SGWristTrackerComponent.h"
|
||||
#include "SenseGlove/GameFramework/SGVirtualHandActor.h"
|
||||
|
||||
USGWristTrackerComponent* UVirtualHandActorKismetLibrary::GetWristTracker(const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetWristTracker();
|
||||
}
|
||||
|
||||
USGVirtualHandComponent* UVirtualHandActorKismetLibrary::GetVirtualHand(const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetVirtualHand();
|
||||
}
|
||||
|
||||
USGWristTrackerComponent* UVirtualHandActorKismetLibrary::GetWristTracker(const ASGVirtualHandActor* VirtualHandActor)
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetThumbFingertipGrabCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetWristTracker();
|
||||
return VirtualHandActor->GetThumbFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetIndexFingertipGrabCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetIndexFingertipGrabCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetMiddleFingertipGrabCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetMiddleFingertipGrabCollider();
|
||||
}
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetThumbFingertipTouchCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetThumbFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetIndexFingertipTouchCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetIndexFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetMiddleFingertipTouchCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetMiddleFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetRingFingertipTouchCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetRingFingertipTouchCollider();
|
||||
}
|
||||
|
||||
USphereComponent* UVirtualHandActorKismetLibrary::GetPinkyFingertipTouchCollider(
|
||||
const ASGVirtualHandActor* VirtualHandActor)
|
||||
{
|
||||
return VirtualHandActor->GetPinkyFingertipTouchCollider();
|
||||
}
|
||||
|
||||
bool UVirtualHandActorKismetLibrary::IsLeft(const ASGVirtualHandActor* VirtualHandActor)
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
||||
#include "SGCore/SGHandPose.h"
|
||||
#include "SGCore/SGHapticGlove.h"
|
||||
#include "SGUtils/SGArrayUtils.h"
|
||||
|
||||
TArray<FSGNameArray> UVirtualHandComponentKismetLibrary::GetLeftHandFingerBoneNames()
|
||||
@@ -89,30 +90,161 @@ void UVirtualHandComponentKismetLibrary::SetHiddenIfNoGloveDetected(
|
||||
VirtualHandComponent->SetHiddenIfNoGloveDetected(bInHiddenIfNoGloveDetected);
|
||||
}
|
||||
|
||||
bool UVirtualHandComponentKismetLibrary::IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent) const
|
||||
bool UVirtualHandComponentKismetLibrary::AutoStopsAllHapticsOnEndPlay(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->AutoStopsAllHapticsOnEndPlay();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetAutoStopAllHapticsOnEndPlay(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const bool bInAutoStopAllHapticsOnEndPlay)
|
||||
{
|
||||
VirtualHandComponent->SetAutoStopAllHapticsOnEndPlay(bInAutoStopAllHapticsOnEndPlay);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetGrabSocketName();
|
||||
}
|
||||
|
||||
const FVector& UVirtualHandComponentKismetLibrary::GetDefaultFingertipsGrabColliderSize(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetDefaultFingertipsGrabColliderSize();
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetThumbFingertipGrabSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetThumbFingertipGrabSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetThumbFingertipGrabSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetThumbFingertipGrabSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetIndexFingertipGrabSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetIndexFingertipGrabSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetIndexFingertipGrabSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetIndexFingertipGrabSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetMiddleFingertipGrabSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetMiddleFingertipGrabSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetMiddleFingertipGrabSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetMiddleFingertipGrabSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FVector& UVirtualHandComponentKismetLibrary::GetDefaultFingertipsTouchColliderSize(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetDefaultFingertipsTouchColliderSize();
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetThumbFingertipTouchSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetThumbFingertipTouchSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetThumbFingertipTouchSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetThumbFingertipTouchSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetIndexFingertipTouchSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetIndexFingertipTouchSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetIndexFingertipTouchSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetIndexFingertipTouchSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetMiddleFingertipTouchSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetMiddleFingertipTouchSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetMiddleFingertipTouchSocketName(
|
||||
USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetMiddleFingertipTouchSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetRingFingertipTouchSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetRingFingertipTouchSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetRingFingertipTouchSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetRingFingertipTouchSocketName(SocketName);
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetPinkyFingertipTouchSocketName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetPinkyFingertipTouchSocketName();
|
||||
}
|
||||
|
||||
void UVirtualHandComponentKismetLibrary::SetPinkyFingertipTouchSocketName(USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName)
|
||||
{
|
||||
VirtualHandComponent->SetPinkyFingertipTouchSocketName(SocketName);
|
||||
}
|
||||
|
||||
bool UVirtualHandComponentKismetLibrary::IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->IsGloveConnected();
|
||||
}
|
||||
|
||||
USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetConnectedGlove();
|
||||
}
|
||||
|
||||
USGHandPose* UVirtualHandComponentKismetLibrary::GetHandPose(USGVirtualHandComponent* VirtualHandComponent)
|
||||
{
|
||||
return VirtualHandComponent->GetHandPose();
|
||||
}
|
||||
|
||||
const FName& UVirtualHandComponentKismetLibrary::GetFingerBoneName(
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint) const
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint)
|
||||
{
|
||||
return VirtualHandComponent->GetFingerBoneName(Finger, Joint);
|
||||
}
|
||||
|
||||
const FTransform& UVirtualHandComponentKismetLibrary::GetFingerBoneRefTransform(
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint) const
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint)
|
||||
{
|
||||
return VirtualHandComponent->GetFingerBoneRefTransform(Finger, Joint);
|
||||
}
|
||||
|
||||
FRotator UVirtualHandComponentKismetLibrary::GetFingerBoneRefRotation(
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint) const
|
||||
const USGVirtualHandComponent* VirtualHandComponent, const int32 Finger, const int32 Joint)
|
||||
{
|
||||
return VirtualHandComponent->GetFingerBoneRefRotation(Finger, Joint);
|
||||
}
|
||||
|
||||
@@ -49,162 +49,17 @@ void UWristTrackerComponentKismetLibrary::OverridePluginWristTrackingSettings(
|
||||
WristTrackerComponent->OverridePluginWristTrackingSettings(bInOverridePluginWristTrackingSettings);
|
||||
}
|
||||
|
||||
ESGPositionalTrackingHardware UWristTrackerComponentKismetLibrary::GetTrackingHardware(
|
||||
const FSGWristTrackingSettings& UWristTrackerComponentKismetLibrary::GetWristTrackingSettings(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetTrackingHardware();
|
||||
return WristTrackerComponent->GetWristTrackingSettings();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetTrackingHardware(
|
||||
USGWristTrackerComponent* WristTrackerComponent, ESGPositionalTrackingHardware InTrackingHardware)
|
||||
{
|
||||
WristTrackerComponent->SetTrackingHardware(InTrackingHardware);
|
||||
}
|
||||
|
||||
const FVector& UWristTrackerComponentKismetLibrary::GetTrackingHardwareLocationOffset(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetTrackingHardwareLocationOffset();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetTrackingHardwareLocationOffset(
|
||||
void UWristTrackerComponentKismetLibrary::SetWristTrackingSettings(
|
||||
USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FVector& InTrackingHardwareLocationOffset)
|
||||
const FSGWristTrackingSettings& InWristTrackingSettings)
|
||||
{
|
||||
WristTrackerComponent->SetTrackingHardwareLocationOffset(InTrackingHardwareLocationOffset);
|
||||
}
|
||||
|
||||
const FRotator& UWristTrackerComponentKismetLibrary::GetTrackingHardwareRotationOffset(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetTrackingHardwareRotationOffset();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetTrackingHardwareRotationOffset(
|
||||
USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FRotator& InTrackingHardwareRotationOffset)
|
||||
{
|
||||
WristTrackerComponent->SetTrackingHardwareRotationOffset(InTrackingHardwareRotationOffset);
|
||||
}
|
||||
|
||||
bool UWristTrackerComponentKismetLibrary::OverridesPluginWristTrackingDebugSettings(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->OverridesPluginWristTrackingDebugSettings();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::OverridePluginWristTrackingDebugSettings(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const bool bInOverridePluginWristTrackingDebugSettings)
|
||||
{
|
||||
WristTrackerComponent->OverridePluginWristTrackingDebugSettings(bInOverridePluginWristTrackingDebugSettings);
|
||||
}
|
||||
|
||||
bool UWristTrackerComponentKismetLibrary::GetDrawDebugWristTrackerGizmo(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDrawDebugWristTrackerGizmo();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDrawDebugWristTrackerGizmo(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const bool bInDrawDebugWristTrackerGizmo)
|
||||
{
|
||||
WristTrackerComponent->SetDrawDebugWristTrackerGizmo(bInDrawDebugWristTrackerGizmo);
|
||||
}
|
||||
|
||||
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoLength(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoLength();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoLength(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoLength)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoLength(InDebugWristTrackerGizmoLength);
|
||||
}
|
||||
|
||||
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoXAxisColor(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoXAxisColor();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoXAxisColor(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoXAxisColor)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoXAxisColor(InDebugWristTrackerGizmoXAxisColor);
|
||||
}
|
||||
|
||||
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoYAxisColor(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoYAxisColor();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoYAxisColor(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoYAxisColor)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoYAxisColor(InDebugWristTrackerGizmoYAxisColor);
|
||||
}
|
||||
|
||||
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoZAxisColor(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoZAxisColor();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoZAxisColor(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoZAxisColor)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoZAxisColor(InDebugWristTrackerGizmoZAxisColor);
|
||||
}
|
||||
|
||||
bool UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoPersistentLines(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoPersistentLines();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoPersistentLines(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const bool bInDebugWristTrackerGizmoPersistentLines)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoPersistentLines(bInDebugWristTrackerGizmoPersistentLines);
|
||||
}
|
||||
|
||||
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoLifeTimeModifier(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoLifeTimeModifier();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoLifeTimeModifier(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoLifeTimeModifier)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoLifeTimeModifier(InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
}
|
||||
|
||||
uint8 UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoDepthPriority(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoDepthPriority();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoDepthPriority(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const uint8 InDebugWristTrackerGizmoDepthPriority)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoDepthPriority(InDebugWristTrackerGizmoDepthPriority);
|
||||
}
|
||||
|
||||
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoThickness(
|
||||
const USGWristTrackerComponent* WristTrackerComponent)
|
||||
{
|
||||
return WristTrackerComponent->GetDebugWristTrackerGizmoThickness();
|
||||
}
|
||||
|
||||
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoThickness(
|
||||
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoThickness)
|
||||
{
|
||||
WristTrackerComponent->SetDebugWristTrackerGizmoThickness(InDebugWristTrackerGizmoThickness);
|
||||
WristTrackerComponent->SetWristTrackingSettings(InWristTrackingSettings);
|
||||
}
|
||||
|
||||
bool UWristTrackerComponentKismetLibrary::IsLeft(const USGWristTrackerComponent* WristTrackerComponent)
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* A data class containing the minimum required data for a hand's forward
|
||||
* kinematics.
|
||||
* Used in both kinematics and calibration.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||
|
||||
#include "SGGrabComponentKismetLibrary.generated.h"
|
||||
|
||||
class AActor;
|
||||
class USGGrabComponent;
|
||||
|
||||
UCLASS(meta=(ScriptName = "SesneGloveGrabComponentKismetLibrary"))
|
||||
class SENSEGLOVEKISMET_API UGrabComponentKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static USGGrabComponent* GetGrabComponent(const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static bool IsGrabbable(const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentLocationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentLocationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentLocationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentRotationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentRotationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentRotationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EAttachmentRule GetAttachmentScaleRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentScaleRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EAttachmentRule InAttachmentScaleRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static bool GetAttachmentWeldSimulatedBodies(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentWeldSimulatedBodies(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
bool bInAttachmentWeldSimulatedBodies);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static const FName& GetAttachmentSocketName(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetAttachmentSocketName(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
const FName& InAttachmentSocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EDetachmentRule GetDetachmentLocationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetDetachmentLocationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EDetachmentRule InDetachmentLocationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EDetachmentRule GetDetachmentRotationRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetDetachmentRotationRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EDetachmentRule InDetachmentRotationRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static EDetachmentRule GetDetachmentScaleRule(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetDetachmentScaleRule(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
EDetachmentRule InDetachmentScaleRule);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Grab Component")
|
||||
static bool GetDetachmentInCallModify(const USGGrabComponent* GrabComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Grab Component")
|
||||
static void SetDetachmentInCallModify(UPARAM(ref) USGGrabComponent* GrabComponent,
|
||||
bool bInDetachmentInCallModify);
|
||||
};
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "SGPawnKismetLibrary.generated.h"
|
||||
|
||||
class UCameraComponent;
|
||||
class USphereComponent;
|
||||
|
||||
class ASGPawn;
|
||||
class USGVirtualHandComponent;
|
||||
@@ -67,12 +68,114 @@ public:
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USGWristTrackerComponent* GetWristTrackerLeft(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USGWristTrackerComponent* GetWristTrackerRight(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USGVirtualHandComponent* GetHandLeft(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftThumbFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftIndexFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftMiddleFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftThumbFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftIndexFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftMiddleFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftRingFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetLeftPinkyFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USGWristTrackerComponent* GetWristTrackerRight(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USGVirtualHandComponent* GetHandRight(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightThumbFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightIndexFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightMiddleFingertipGrabCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightThumbFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightIndexFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightMiddleFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightRingFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static USphereComponent* GetRightPinkyFingertipTouchCollider(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool CanLeftHandGrab(const ASGPawn* Pawn, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsLeftHandGrabbing_Actor(const ASGPawn* Pawn, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsLeftHandGrabbing_OutActor(const ASGPawn* Pawn, AActor*& OutActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsLeftHandGrabbing(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool CanRightHandGrab(const ASGPawn* Pawn, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsRightHandGrabbing_Actor(const ASGPawn* Pawn, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsRightHandGrabbing_OutActor(const ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsRightHandGrabbing(const ASGPawn* Pawn, AActor*& OutActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool CanGrab(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsGrabbing_Actor(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand, const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsGrabbing_OutActor(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand, AActor*& OutActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Pawn")
|
||||
static bool IsGrabbing(const ASGPawn* Pawn, const USGVirtualHandComponent* Hand);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
static void GrabLeft(UPARAM(ref) ASGPawn* Pawn, AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
static void GrabRight(UPARAM(ref) ASGPawn* Pawn, AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
void Grab(UPARAM(ref) ASGPawn* Pawn, USGVirtualHandComponent* Hand, AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
void ReleaseLeft(UPARAM(ref) ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
void ReleaseRight(UPARAM(ref) ASGPawn* Pawn);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Game Framework | Pawn")
|
||||
static void Release(UPARAM(ref) ASGPawn* Pawn, const USGVirtualHandComponent* Hand);
|
||||
};
|
||||
@@ -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
|
||||
*
|
||||
* A data class containing the minimum required data for a hand's forward
|
||||
* kinematics.
|
||||
* Used in both kinematics and calibration.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||
|
||||
#include "SGTouchComponentKismetLibrary.generated.h"
|
||||
|
||||
class AActor;
|
||||
class USGTouchComponent;
|
||||
|
||||
UCLASS(meta=(ScriptName = "SesneGloveTouchComponentKismetLibrary"))
|
||||
class SENSEGLOVEKISMET_API UTouchComponentKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||
static USGTouchComponent* GetTouchComponent(const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||
static bool IsTouchable(const AActor* Actor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||
static int32 GetBuzzLevel(const USGTouchComponent* TouchComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||
static void SetBuzzLevel(UPARAM(ref) USGTouchComponent* TouchComponent, int32 Level);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||
static float GetBuzzDuration(const USGTouchComponent* TouchComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||
static void SetBuzzDuration(UPARAM(ref) USGTouchComponent* TouchComponent, float Duration);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Touch Component")
|
||||
static int32 GetForceFeedbackLevel(const USGTouchComponent* TouchComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Touch Component")
|
||||
static void SetForceFeedbackLevel(UPARAM(ref) USGTouchComponent* TouchComponent, int32 Level);
|
||||
};
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#include "SGVirtualHandActorKismetLibrary.generated.h"
|
||||
|
||||
class USphereComponent;
|
||||
|
||||
class ASGVirtualHandActor;
|
||||
class USGVirtualHandComponent;
|
||||
class USGWristTrackerComponent;
|
||||
@@ -51,11 +53,35 @@ class SENSEGLOVEKISMET_API UVirtualHandActorKismetLibrary final : public USGBlue
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USGWristTrackerComponent* GetWristTracker(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USGVirtualHandComponent* GetVirtualHand(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USGWristTrackerComponent* GetWristTracker(const ASGVirtualHandActor* VirtualHandActor);
|
||||
static USphereComponent* GetThumbFingertipGrabCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetIndexFingertipGrabCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetMiddleFingertipGrabCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetThumbFingertipTouchCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetIndexFingertipTouchCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetMiddleFingertipTouchCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetRingFingertipTouchCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static USphereComponent* GetPinkyFingertipTouchCollider(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Game Framework | Virtual Hand")
|
||||
static bool IsLeft(const ASGVirtualHandActor* VirtualHandActor);
|
||||
|
||||
@@ -52,6 +52,7 @@ class USkeletalMeshComponent;
|
||||
|
||||
class USGVirtualHandComponent;
|
||||
class USGHandPose;
|
||||
class USGHapticGlove;
|
||||
|
||||
UCLASS(meta=(ScriptName = "SesneGloveVirtualHandComponentKismetLibrary"))
|
||||
class SENSEGLOVEKISMET_API UVirtualHandComponentKismetLibrary final : public USGBlueprintFunctionLibrary
|
||||
@@ -88,23 +89,98 @@ public:
|
||||
bool bInHiddenIfNoGloveDetected);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
bool IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent) const;
|
||||
static bool AutoStopsAllHapticsOnEndPlay(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
USGHandPose* GetHandPose(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent);
|
||||
static void SetAutoStopAllHapticsOnEndPlay(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const bool bInAutoStopAllHapticsOnEndPlay);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
const FName& GetFingerBoneName(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint) const;
|
||||
static const FName& GetGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
const FTransform& GetFingerBoneRefTransform(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint) const;
|
||||
static const FVector& GetDefaultFingertipsGrabColliderSize(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
FRotator GetFingerBoneRefRotation(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint) const;
|
||||
static const FName& GetThumbFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
TMap<FName, FRotator> GetFingersBonesRotations(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent);
|
||||
static void SetThumbFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetIndexFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetIndexFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetMiddleFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetMiddleFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FVector& GetDefaultFingertipsTouchColliderSize(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetThumbFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetThumbFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetIndexFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetIndexFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetMiddleFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetMiddleFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetRingFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetRingFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetPinkyFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static void SetPinkyFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
|
||||
const FName& SocketName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static bool IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static USGHapticGlove* GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static USGHandPose* GetHandPose(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FName& GetFingerBoneName(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static const FTransform& GetFingerBoneRefTransform(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static FRotator GetFingerBoneRefRotation(const USGVirtualHandComponent* VirtualHandComponent,
|
||||
int32 Finger, int32 Joint);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
|
||||
static TMap<FName, FRotator> GetFingersBonesRotations(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent);
|
||||
};
|
||||
@@ -38,7 +38,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGSettings/SGWristTrackingSettings.h"
|
||||
|
||||
#include "SGWristTrackerComponentKismetLibrary.generated.h"
|
||||
|
||||
@@ -61,98 +61,12 @@ public:
|
||||
bool bInOverridePluginWristTrackingSettings);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static ESGPositionalTrackingHardware GetTrackingHardware(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetTrackingHardware(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
ESGPositionalTrackingHardware InTrackingHardware);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static const FVector& GetTrackingHardwareLocationOffset(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetTrackingHardwareLocationOffset(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FVector& InTrackingHardwareLocationOffset);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static const FRotator& GetTrackingHardwareRotationOffset(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetTrackingHardwareRotationOffset(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FRotator& InTrackingHardwareRotationOffset);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static bool OverridesPluginWristTrackingDebugSettings(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void OverridePluginWristTrackingDebugSettings(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
bool bInOverridePluginWristTrackingDebugSettings);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static bool GetDrawDebugWristTrackerGizmo(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDrawDebugWristTrackerGizmo(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
bool bInDrawDebugWristTrackerGizmo);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static float GetDebugWristTrackerGizmoLength(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoLength(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
float InDebugWristTrackerGizmoLength);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static const FColor& GetDebugWristTrackerGizmoXAxisColor(
|
||||
static const FSGWristTrackingSettings& GetWristTrackingSettings(
|
||||
const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoXAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FColor& InDebugWristTrackerGizmoXAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static const FColor& GetDebugWristTrackerGizmoYAxisColor(
|
||||
const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoYAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FColor& InDebugWristTrackerGizmoYAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static const FColor& GetDebugWristTrackerGizmoZAxisColor(
|
||||
const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoZAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FColor& InDebugWristTrackerGizmoZAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static bool GetDebugWristTrackerGizmoPersistentLines(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoPersistentLines(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
bool bInDebugWristTrackerGizmoPersistentLines);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static float GetDebugWristTrackerGizmoLifeTimeModifier(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoLifeTimeModifier(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
float InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static uint8 GetDebugWristTrackerGizmoDepthPriority(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoDepthPriority(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
uint8 InDebugWristTrackerGizmoDepthPriority);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static float GetDebugWristTrackerGizmoThickness(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static void SetDebugWristTrackerGizmoThickness(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
float InDebugWristTrackerGizmoThickness);
|
||||
static void SetWristTrackingSettings(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
|
||||
const FSGWristTrackingSettings& InWristTrackingSettings);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
|
||||
static bool IsLeft(const USGWristTrackerComponent* WristTrackerComponent);
|
||||
|
||||
@@ -58,6 +58,7 @@ public class SenseGloveKismet : ModuleRules
|
||||
"SenseGlove",
|
||||
"SenseGloveCore",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveSettings",
|
||||
"SenseGloveTypes",
|
||||
"SenseGloveUtils",
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGSettings/SGDebugGizmoSettings.h"
|
||||
|
||||
FSGDebugGizmoSettings::FSGDebugGizmoSettings(
|
||||
const float InLength, const float InThickness,
|
||||
const FColor& InXAxisColor, const FColor& InYAxisColor, const FColor& InZAxisColor,
|
||||
const bool bInPersistentLines, const float InLifeTimeModifier, const uint8 InDepthPriority)
|
||||
: Length(InLength),
|
||||
Thickness(InThickness),
|
||||
XAxisColor(InXAxisColor),
|
||||
YAxisColor(InYAxisColor),
|
||||
ZAxisColor(InZAxisColor),
|
||||
bPersistentLines(bInPersistentLines),
|
||||
LifeTimeModifier(InLifeTimeModifier),
|
||||
DepthPriority(InDepthPriority)
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGSettings/SGDebugVirtualHandSettings.h"
|
||||
|
||||
FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings()
|
||||
: bDrawDebugVirtualHand(false),
|
||||
DrawingMode(ESGDebugVirtualHandDrawingMode::None),
|
||||
CubeExtent(FVector(0.5f, 0.5f, 0.5f)),
|
||||
CubeColor(255, 0, 0, 255),
|
||||
CubeThickness(0.1f),
|
||||
GizmoLength(1.0f),
|
||||
GizmoThickness(1.0f),
|
||||
GizmoXAxisColor(255, 0, 0, 255),
|
||||
GizmoYAxisColor(255, 0, 0, 255),
|
||||
GizmoZAxisColor(255, 0, 0, 255),
|
||||
bPersistentLines(false),
|
||||
LifeTimeModifier(1.1f),
|
||||
DepthPriority(0)
|
||||
{
|
||||
}
|
||||
|
||||
FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings(
|
||||
const bool bInDrawDebugVirtualHand,
|
||||
const ESGDebugVirtualHandDrawingMode InDrawingMode,
|
||||
const FVector& InCubeExtent, const FColor& InCubeColor, const float InCubeThickness,
|
||||
const float InGizmoLength, const float InGizmoThickness,
|
||||
const FColor& InGizmoXAxisColor, const FColor& InGizmoYAxisColor, const FColor& InGizmoZAxisColor,
|
||||
const bool bInPersistentLines, const float InLifeTimeModifier, const uint8 InDepthPriority)
|
||||
: bDrawDebugVirtualHand(bInDrawDebugVirtualHand),
|
||||
DrawingMode(InDrawingMode),
|
||||
CubeExtent(InCubeExtent),
|
||||
CubeColor(InCubeColor),
|
||||
CubeThickness(InCubeThickness),
|
||||
GizmoLength(InGizmoLength),
|
||||
GizmoThickness(InGizmoThickness),
|
||||
GizmoXAxisColor(InGizmoXAxisColor),
|
||||
GizmoYAxisColor(InGizmoYAxisColor),
|
||||
GizmoZAxisColor(InGizmoZAxisColor),
|
||||
bPersistentLines(bInPersistentLines),
|
||||
LifeTimeModifier(InLifeTimeModifier),
|
||||
DepthPriority(InDepthPriority)
|
||||
{
|
||||
}
|
||||
@@ -42,10 +42,6 @@
|
||||
|
||||
struct USGSettings::FImpl
|
||||
{
|
||||
/************************
|
||||
* Static methods
|
||||
************************/
|
||||
|
||||
/************************
|
||||
* Owner object
|
||||
************************/
|
||||
@@ -65,16 +61,15 @@ struct USGSettings::FImpl
|
||||
|
||||
FImpl(const FImpl& Rhs) = default;
|
||||
FImpl& operator=(const FImpl& Rhs) = default;
|
||||
|
||||
/************************
|
||||
* Methods
|
||||
************************/
|
||||
|
||||
void ResetTrackingHardwareValuesToZero();
|
||||
};
|
||||
|
||||
USGSettings* USGSettings::GetInstance()
|
||||
{
|
||||
if (!ensureAlwaysMsgf(GEngine, TEXT("The engine has not been initialized!")))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
USGSettings* Instance{GEngine->GetEngineSubsystem<USGSettings>()};
|
||||
return Instance;
|
||||
}
|
||||
@@ -82,241 +77,23 @@ USGSettings* USGSettings::GetInstance()
|
||||
USGSettings::USGSettings()
|
||||
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
|
||||
{
|
||||
TrackingHardware = ESGPositionalTrackingHardware::None;
|
||||
|
||||
Pimpl->ResetTrackingHardwareValuesToZero();
|
||||
|
||||
bDrawDebugWristTrackerGizmo = false;
|
||||
TrackingHardware = ESGPositionalTrackingHardware::None;
|
||||
TrackingHardwareLocationOffsetLeftHand = FVector::ZeroVector;
|
||||
TrackingHardwareLocationOffsetRightHand = FVector::ZeroVector;
|
||||
TrackingHardwareRotationOffsetLeftHand = FRotator::ZeroRotator;
|
||||
TrackingHardwareRotationOffsetRightHand = FRotator::ZeroRotator;
|
||||
|
||||
bDrawDebugWristTrackerGizmo = false;
|
||||
DebugWristTrackerGizmoLength = 1.0f;
|
||||
DebugWristTrackerGizmoXAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
DebugWristTrackerGizmoYAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
DebugWristTrackerGizmoZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
bDebugWristTrackerGizmoPersistentLines = false;
|
||||
DebugWristTrackerGizmoLifeTimeModifier = 1.1f;
|
||||
DebugWristTrackerGizmoDepthPriority = 0;
|
||||
DebugWristTrackerGizmoThickness = 1.0f;
|
||||
}
|
||||
|
||||
const FVector& USGSettings::GetTrackingHardwareLocationOffsetLeftHand() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Getting TrackingHardwareLocationOffsetLeftHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
return TrackingHardwareLocationOffsetLeftHand;
|
||||
}
|
||||
|
||||
void USGSettings::SetTrackingHardwareLocationOffsetLeftHand(const FVector& InTrackingHardwareLocationOffsetLeftHand)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Setting TrackingHardwareLocationOffsetLeftHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
TrackingHardwareLocationOffsetLeftHand = InTrackingHardwareLocationOffsetLeftHand;
|
||||
}
|
||||
|
||||
const FVector& USGSettings::GetTrackingHardwareLocationOffsetRightHand() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Getting TrackingHardwareLocationOffsetRightHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
return TrackingHardwareLocationOffsetRightHand;
|
||||
}
|
||||
|
||||
void USGSettings::SetTrackingHardwareLocationOffsetRightHand(const FVector& InTrackingHardwareLocationOffsetRightHand)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Setting TrackingHardwareLocationOffsetRightHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
TrackingHardwareLocationOffsetRightHand = InTrackingHardwareLocationOffsetRightHand;
|
||||
}
|
||||
|
||||
const FRotator& USGSettings::GetTrackingHardwareRotationOffsetLeftHand() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT( "Getting TrackingHardwareRotationOffsetLeftHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
return TrackingHardwareRotationOffsetLeftHand;
|
||||
}
|
||||
|
||||
void USGSettings::SetTrackingHardwareRotationOffsetLeftHand(
|
||||
const FRotator& InTrackingHardwareRotationOffsetLeftHand)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT("Setting TrackingHardwareRotationOffsetRightHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
TrackingHardwareRotationOffsetLeftHand = InTrackingHardwareRotationOffsetLeftHand;
|
||||
}
|
||||
|
||||
const FRotator& USGSettings::GetTrackingHardwareRotationOffsetRightHand() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT("Getting TrackingHardwareRotationOffsetRightHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
return TrackingHardwareRotationOffsetRightHand;
|
||||
}
|
||||
|
||||
void USGSettings::SetTrackingHardwareRotationOffsetRightHand(
|
||||
const FRotator& InTrackingHardwareRotationOffsetRightHand)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
TrackingHardware == ESGPositionalTrackingHardware::Custom,
|
||||
TEXT("Setting TrackingHardwareRotationOffsetRightHand is only permitted when TrackingHardware is set to"
|
||||
" Custom!"));
|
||||
TrackingHardwareRotationOffsetRightHand = InTrackingHardwareRotationOffsetRightHand;
|
||||
}
|
||||
|
||||
float USGSettings::GetDebugWristTrackerGizmoLength() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
return DebugWristTrackerGizmoLength;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoLength(const float InDebugWristTrackerGizmoLength)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
DebugWristTrackerGizmoLength = InDebugWristTrackerGizmoLength;
|
||||
}
|
||||
|
||||
const FColor& USGSettings::GetDebugWristTrackerGizmoXAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoXAxisColor;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
DebugWristTrackerGizmoXAxisColor = InDebugWristTrackerGizmoXAxisColor;
|
||||
}
|
||||
|
||||
const FColor& USGSettings::GetDebugWristTrackerGizmoYAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoXAxisColor;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
DebugWristTrackerGizmoYAxisColor = InDebugWristTrackerGizmoYAxisColor;
|
||||
}
|
||||
|
||||
const FColor& USGSettings::GetDebugWristTrackerGizmoZAxisColor() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoZAxisColor;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
DebugWristTrackerGizmoZAxisColor = InDebugWristTrackerGizmoZAxisColor;
|
||||
}
|
||||
|
||||
bool USGSettings::GetDebugWristTrackerGizmoPersistentLines() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return !!bDebugWristTrackerGizmoPersistentLines;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoPersistentLines(const bool bInDebugWristTrackerGizmoPersistentLines)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
bDebugWristTrackerGizmoPersistentLines = bInDebugWristTrackerGizmoPersistentLines;
|
||||
}
|
||||
|
||||
float USGSettings::GetDebugWristTrackerGizmoLifeTimeModifier() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoLifeTimeModifier;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoLifeTimeModifier(const float InDebugWristTrackerGizmoLifeTimeModifier)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
DebugWristTrackerGizmoLifeTimeModifier = InDebugWristTrackerGizmoLifeTimeModifier;
|
||||
}
|
||||
|
||||
uint8 USGSettings::GetDebugWristTrackerGizmoDepthPriority() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoDepthPriority;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoDepthPriority(const uint8 InDebugWristTrackerGizmoDepthPriority)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
|
||||
DebugWristTrackerGizmoDepthPriority = InDebugWristTrackerGizmoDepthPriority;
|
||||
}
|
||||
|
||||
float USGSettings::GetDebugWristTrackerGizmoThickness() const
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Getting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
return DebugWristTrackerGizmoThickness;
|
||||
}
|
||||
|
||||
void USGSettings::SetDebugWristTrackerGizmoThickness(const float InDebugWristTrackerGizmoThickness)
|
||||
{
|
||||
ensureAlwaysMsgf(
|
||||
GetDrawDebugWristTrackerGizmo(),
|
||||
TEXT("Setting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is"
|
||||
" enabled!"));
|
||||
DebugWristTrackerGizmoThickness = InDebugWristTrackerGizmoThickness;
|
||||
WristTrackingSettings = FSGWristTrackingSettings(
|
||||
ESGPositionalTrackingHardware::None,
|
||||
FVector::ZeroVector,
|
||||
FVector::ZeroVector,
|
||||
FRotator::ZeroRotator,
|
||||
FRotator::ZeroRotator,
|
||||
EControllerHand::Left,
|
||||
EControllerHand::Right,
|
||||
false,
|
||||
FSGDebugGizmoSettings(
|
||||
4.0f, 1.0f,
|
||||
FColor(255, 0, 0, 255),
|
||||
FColor(0, 255, 0, 255),
|
||||
FColor(0, 0, 255, 255),
|
||||
false, 1.1f, 0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
bool USGSettings::ShouldCreateSubsystem(UObject* Outer) const
|
||||
@@ -346,41 +123,6 @@ void USGSettings::Deinitialize()
|
||||
SGLOG("The SenseGlove settings singleton has been successfully de-initialized!");
|
||||
}
|
||||
|
||||
#if WITH_EDITOR
|
||||
bool USGSettings::CanEditChange(const FProperty* InProperty) const
|
||||
{
|
||||
bool bCanEditChange = Super::CanEditChange(InProperty);
|
||||
|
||||
/*const FName PropertyName{InProperty ? InProperty->GetFName() : NAME_None};
|
||||
|
||||
if (PropertyName == GET_MEMBER_NAME_CHECKED(USGSettings, TrackingHardware))
|
||||
{
|
||||
return TrackingHardware == ESGPositionalTrackingHardware::Custom;
|
||||
}*/
|
||||
|
||||
return bCanEditChange;
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
#if WITH_EDITOR
|
||||
void USGSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
|
||||
{
|
||||
Super::PostEditChangeProperty(PropertyChangedEvent);
|
||||
|
||||
const FName PropertyName{
|
||||
PropertyChangedEvent.Property
|
||||
? PropertyChangedEvent.Property->GetFName()
|
||||
: NAME_None
|
||||
};
|
||||
|
||||
if (PropertyName == GET_MEMBER_NAME_CHECKED(USGSettings, TrackingHardware))
|
||||
{
|
||||
Pimpl->ResetTrackingHardwareValuesToZero();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif /* WITH_EDITOR */
|
||||
|
||||
USGSettings::FImpl::FImpl(USGSettings* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
@@ -388,14 +130,6 @@ USGSettings::FImpl::FImpl(USGSettings* InOwner)
|
||||
|
||||
USGSettings::FImpl::~FImpl() = default;
|
||||
|
||||
void USGSettings::FImpl::ResetTrackingHardwareValuesToZero()
|
||||
{
|
||||
Owner->TrackingHardwareLocationOffsetLeftHand = FVector::ZeroVector;
|
||||
Owner->TrackingHardwareLocationOffsetRightHand = FVector::ZeroVector;
|
||||
Owner->TrackingHardwareRotationOffsetLeftHand = FRotator::ZeroRotator;
|
||||
Owner->TrackingHardwareRotationOffsetRightHand = FRotator::ZeroRotator;
|
||||
}
|
||||
|
||||
void USGSettings::FImplDeleter::operator()(const FImpl* P) const
|
||||
{
|
||||
delete P;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @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 "SGSettings/SGWristTrackingSettings.h"
|
||||
|
||||
FSGWristTrackingSettings::FSGWristTrackingSettings()
|
||||
: TrackingHardware(ESGPositionalTrackingHardware::None),
|
||||
TrackingHardwareLocationOffsetLeftHand(FVector::ZeroVector),
|
||||
TrackingHardwareLocationOffsetRightHand(FVector::ZeroVector),
|
||||
TrackingHardwareRotationOffsetLeftHand(FRotator::ZeroRotator),
|
||||
TrackingHardwareRotationOffsetRightHand(FRotator::ZeroRotator),
|
||||
LeftHandMotionSource(EControllerHand::Left),
|
||||
RightHandMotionSource(EControllerHand::Right),
|
||||
bDrawWristTrackerDebugGizmo(false),
|
||||
WristTrackerDebugGizmoSettings(FSGDebugGizmoSettings())
|
||||
{
|
||||
}
|
||||
|
||||
FSGWristTrackingSettings::FSGWristTrackingSettings(
|
||||
const ESGPositionalTrackingHardware InTrackingHardware,
|
||||
const FVector& InTrackingHardwareLocationOffsetLeftHand,
|
||||
const FVector& InTrackingHardwareLocationOffsetRightHand,
|
||||
const FRotator& InTrackingHardwareRotationOffsetLeftHand,
|
||||
const FRotator& InTrackingHardwareRotationOffsetRightHand,
|
||||
const EControllerHand InLeftHandMotionSource,
|
||||
const EControllerHand InRightHandMotionSource,
|
||||
const bool bInDrawWristTrackerDebugGizmo,
|
||||
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
|
||||
: TrackingHardware(InTrackingHardware),
|
||||
TrackingHardwareLocationOffsetLeftHand(InTrackingHardwareLocationOffsetLeftHand),
|
||||
TrackingHardwareLocationOffsetRightHand(InTrackingHardwareLocationOffsetRightHand),
|
||||
TrackingHardwareRotationOffsetLeftHand(InTrackingHardwareRotationOffsetLeftHand),
|
||||
TrackingHardwareRotationOffsetRightHand(InTrackingHardwareRotationOffsetRightHand),
|
||||
LeftHandMotionSource(InLeftHandMotionSource),
|
||||
RightHandMotionSource(InRightHandMotionSource),
|
||||
bDrawWristTrackerDebugGizmo(bInDrawWristTrackerDebugGizmo),
|
||||
WristTrackerDebugGizmoSettings(InWristTrackerDebugGizmoSettings)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* @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 "SGDebugGizmoSettings.generated.h"
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVESETTINGS_API FSGDebugGizmoSettings
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
float Length;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
float Thickness;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
FColor XAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
FColor YAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
FColor ZAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
uint8 bPersistentLines : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
float LifeTimeModifier;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
|
||||
uint8 DepthPriority;
|
||||
|
||||
public:
|
||||
explicit FSGDebugGizmoSettings(float InLength = 1.0f,
|
||||
float InThickness = 1.0f,
|
||||
const FColor& InXAxisColor = FColor(255, 0, 0, 255),
|
||||
const FColor& InYAxisColor = FColor(0, 255, 0, 255),
|
||||
const FColor& InZAxisColor = FColor(0, 0, 255, 255),
|
||||
bool bInPersistentLines = false,
|
||||
float InLifeTimeModifier = 1.1f,
|
||||
uint8 InDepthPriority = 0);
|
||||
};
|
||||
@@ -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
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGTypes/SGDebugTypes.h"
|
||||
|
||||
#include "SGDebugVirtualHandSettings.generated.h"
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVESETTINGS_API FSGDebugVirtualHandSettings
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings")
|
||||
uint8 bDrawDebugVirtualHand : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="bDrawDebugVirtualHand", EditConditionHides))
|
||||
ESGDebugVirtualHandDrawingMode DrawingMode;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
|
||||
FVector CubeExtent;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
|
||||
FColor CubeColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
|
||||
float CubeThickness;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
float GizmoLength;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
float GizmoThickness;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
FColor GizmoXAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
FColor GizmoYAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
FColor GizmoZAxisColor;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
uint8 bPersistentLines : 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
float LifeTimeModifier;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
|
||||
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
|
||||
uint8 DepthPriority;
|
||||
|
||||
public:
|
||||
FSGDebugVirtualHandSettings();
|
||||
|
||||
explicit FSGDebugVirtualHandSettings(
|
||||
bool bInDrawDebugVirtualHand,
|
||||
ESGDebugVirtualHandDrawingMode InDrawingMode = ESGDebugVirtualHandDrawingMode::None,
|
||||
const FVector& InCubeExtent = FVector(0.5f, 0.5f, 0.5f),
|
||||
const FColor& InCubeColor = FColor(255, 0, 0, 255),
|
||||
float InCubeThickness = 0.1f,
|
||||
float InGizmoLength = 1.0f,
|
||||
float InGizmoThickness = 0.2f,
|
||||
const FColor& InGizmoXAxisColor = FColor(255, 0, 0, 255),
|
||||
const FColor& InGizmoYAxisColor = FColor(0, 255, 0, 255),
|
||||
const FColor& InGizmoZAxisColor = FColor(0, 0, 255, 255),
|
||||
bool bInPersistentLines = false,
|
||||
float InLifeTimeModifier = 1.1f,
|
||||
uint8 InDepthPriority = 0);
|
||||
};
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "Templates/UniquePtr.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGSettings/SGWristTrackingSettings.h"
|
||||
|
||||
#include "SGSettings.generated.h"
|
||||
|
||||
@@ -66,171 +66,26 @@ private:
|
||||
FImplDeleter PimplDeleter;
|
||||
|
||||
private:
|
||||
/**
|
||||
* If set to Custom, any desired location and rotation can be specified.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking")
|
||||
ESGPositionalTrackingHardware TrackingHardware;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FVector TrackingHardwareLocationOffsetLeftHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FVector TrackingHardwareLocationOffsetRightHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FRotator TrackingHardwareRotationOffsetLeftHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FRotator TrackingHardwareRotationOffsetRightHand;
|
||||
|
||||
/**
|
||||
* If enabled, draws debug Wrist trackers where possible.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug")
|
||||
uint8 bDrawDebugWristTrackerGizmo : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
float DebugWristTrackerGizmoLength;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoXAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoYAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
FColor DebugWristTrackerGizmoZAxisColor;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
uint8 bDebugWristTrackerGizmoPersistentLines : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
float DebugWristTrackerGizmoLifeTimeModifier;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
uint8 DebugWristTrackerGizmoDepthPriority;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
|
||||
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
|
||||
float DebugWristTrackerGizmoThickness;
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "SenseGlove")
|
||||
FSGWristTrackingSettings WristTrackingSettings;
|
||||
|
||||
public:
|
||||
USGSettings();
|
||||
|
||||
public:
|
||||
FORCEINLINE ESGPositionalTrackingHardware GetTrackingHardware() const
|
||||
FORCEINLINE const FSGWristTrackingSettings& GetWristTrackingSettings() const
|
||||
{
|
||||
return TrackingHardware;
|
||||
return WristTrackingSettings;
|
||||
}
|
||||
|
||||
FORCEINLINE void SetTrackingHardware(const ESGPositionalTrackingHardware InTrackingHardware)
|
||||
void SetWristTrackingSettings(const FSGWristTrackingSettings& InWristTrackingSettings)
|
||||
{
|
||||
TrackingHardware = InTrackingHardware;
|
||||
WristTrackingSettings = InWristTrackingSettings;
|
||||
}
|
||||
|
||||
const FVector& GetTrackingHardwareLocationOffsetLeftHand() const;
|
||||
void SetTrackingHardwareLocationOffsetLeftHand(const FVector& InTrackingHardwareLocationOffsetLeftHand);
|
||||
|
||||
const FVector& GetTrackingHardwareLocationOffsetRightHand() const;
|
||||
void SetTrackingHardwareLocationOffsetRightHand(const FVector& InTrackingHardwareLocationOffsetRightHand);
|
||||
|
||||
const FRotator& GetTrackingHardwareRotationOffsetLeftHand() const;
|
||||
void SetTrackingHardwareRotationOffsetLeftHand(const FRotator& InTrackingHardwareRotationOffsetLeftHand);
|
||||
|
||||
const FRotator& GetTrackingHardwareRotationOffsetRightHand() const;
|
||||
void SetTrackingHardwareRotationOffsetRightHand(const FRotator& InTrackingHardwareRotationOffsetRightHand);
|
||||
|
||||
FORCEINLINE bool GetDrawDebugWristTrackerGizmo() const
|
||||
{
|
||||
return !!bDrawDebugWristTrackerGizmo;
|
||||
}
|
||||
|
||||
void SetDrawDebugWristTrackerGizmo(const bool bInDrawDebugWristTrackerGizmo)
|
||||
{
|
||||
bDrawDebugWristTrackerGizmo = bInDrawDebugWristTrackerGizmo;
|
||||
}
|
||||
|
||||
float GetDebugWristTrackerGizmoLength() const;
|
||||
void SetDebugWristTrackerGizmoLength(float InDebugWristTrackerGizmoLength);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoXAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoYAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor);
|
||||
|
||||
const FColor& GetDebugWristTrackerGizmoZAxisColor() const;
|
||||
void SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor);
|
||||
|
||||
bool GetDebugWristTrackerGizmoPersistentLines() const;
|
||||
void SetDebugWristTrackerGizmoPersistentLines(bool bInDebugWristTrackerGizmoPersistentLines);
|
||||
|
||||
float GetDebugWristTrackerGizmoLifeTimeModifier() const;
|
||||
void SetDebugWristTrackerGizmoLifeTimeModifier(float InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
|
||||
uint8 GetDebugWristTrackerGizmoDepthPriority() const;
|
||||
void SetDebugWristTrackerGizmoDepthPriority(uint8 InDebugWristTrackerGizmoDepthPriority);
|
||||
|
||||
float GetDebugWristTrackerGizmoThickness() const;
|
||||
void SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness);
|
||||
|
||||
public:
|
||||
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
|
||||
|
||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||
virtual void Deinitialize() override;
|
||||
|
||||
public:
|
||||
#if WITH_EDITOR
|
||||
virtual bool CanEditChange(const FProperty* InProperty) const override;
|
||||
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
||||
#endif /* WITH_EDITOR */
|
||||
};
|
||||
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* @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 "InputCoreTypes.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
#include "SGSettings/SGDebugGizmoSettings.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
|
||||
#include "SGWristTrackingSettings.generated.h"
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct SENSEGLOVESETTINGS_API FSGWristTrackingSettings
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
/**
|
||||
* If set to Custom, any desired location and rotation can be specified.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking")
|
||||
ESGPositionalTrackingHardware TrackingHardware;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FVector TrackingHardwareLocationOffsetLeftHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FVector TrackingHardwareLocationOffsetRightHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FRotator TrackingHardwareRotationOffsetLeftHand;
|
||||
|
||||
/**
|
||||
* Valid only if TrackingHardware is set to Custom.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking",
|
||||
meta=(EditCondition="TrackingHardware == ESGPositionalTrackingHardware::Custom", EditConditionHides))
|
||||
FRotator TrackingHardwareRotationOffsetRightHand;
|
||||
|
||||
/**
|
||||
* Determines which motion source to use.
|
||||
* For Oculus this is usually Left, and for VIVE usually LeftFoot.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Wrist Tracking")
|
||||
EControllerHand LeftHandMotionSource;
|
||||
|
||||
/**
|
||||
* Determines which motion source to use.
|
||||
* For Oculus this is usually Right, and for VIVE usually RightFoot.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category="Wrist Tracking")
|
||||
EControllerHand RightHandMotionSource;
|
||||
|
||||
/**
|
||||
* If enabled, draws debug Wrist trackers where possible.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Wrist Tracking")
|
||||
uint8 bDrawWristTrackerDebugGizmo : 1;
|
||||
|
||||
/**
|
||||
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
|
||||
*/
|
||||
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Wrist Tracking",
|
||||
meta=(EditCondition="bDrawWristTrackerDebugGizmo", EditConditionHides))
|
||||
FSGDebugGizmoSettings WristTrackerDebugGizmoSettings;
|
||||
|
||||
public:
|
||||
FSGWristTrackingSettings();
|
||||
|
||||
explicit FSGWristTrackingSettings(
|
||||
ESGPositionalTrackingHardware InTrackingHardware,
|
||||
const FVector& InTrackingHardwareLocationOffsetLeftHand,
|
||||
const FVector& InTrackingHardwareLocationOffsetRightHand,
|
||||
const FRotator& InTrackingHardwareRotationOffsetLeftHand,
|
||||
const FRotator& InTrackingHardwareRotationOffsetRightHand,
|
||||
EControllerHand InLeftHandMotionSource,
|
||||
EControllerHand InRightHandMotionSource,
|
||||
bool bInDrawWristTrackerDebugGizmo,
|
||||
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
|
||||
};
|
||||
@@ -54,6 +54,7 @@ public class SenseGloveSettings : ModuleRules
|
||||
{
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"InputCore",
|
||||
"SenseGloveCore",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveTypes",
|
||||
|
||||
+5
-148
@@ -42,156 +42,13 @@ USGSettings* USGSettingsKismetLibrary::GetInstance()
|
||||
return USGSettings::GetInstance();
|
||||
}
|
||||
|
||||
ESGPositionalTrackingHardware USGSettingsKismetLibrary::GetTrackingHardware(const USGSettings* Settings)
|
||||
const FSGWristTrackingSettings& USGSettingsKismetLibrary::GetWristTrackingSettings(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetTrackingHardware();
|
||||
return Settings->GetWristTrackingSettings();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetTrackingHardware(
|
||||
USGSettings* Settings, const ESGPositionalTrackingHardware InTrackingHardware)
|
||||
void USGSettingsKismetLibrary::SetWristTrackingSettings(
|
||||
USGSettings* Settings, const FSGWristTrackingSettings& InWristTrackingSettings)
|
||||
{
|
||||
Settings->SetTrackingHardware(InTrackingHardware);
|
||||
}
|
||||
|
||||
const FVector& USGSettingsKismetLibrary::GetTrackingHardwareLocationOffsetLeftHand(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetTrackingHardwareLocationOffsetLeftHand();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetTrackingHardwareLocationOffsetLeftHand(
|
||||
USGSettings* Settings, const FVector& InTrackingHardwareLocationOffsetLeftHand)
|
||||
{
|
||||
Settings->SetTrackingHardwareLocationOffsetLeftHand(InTrackingHardwareLocationOffsetLeftHand);
|
||||
}
|
||||
|
||||
const FVector& USGSettingsKismetLibrary::GetTrackingHardwareLocationOffsetRightHand(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetTrackingHardwareLocationOffsetRightHand();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetTrackingHardwareLocationOffsetRightHand(
|
||||
USGSettings* Settings, const FVector& InTrackingHardwareLocationOffsetRightHand)
|
||||
{
|
||||
Settings->SetTrackingHardwareLocationOffsetRightHand(InTrackingHardwareLocationOffsetRightHand);
|
||||
}
|
||||
|
||||
const FRotator& USGSettingsKismetLibrary::GetTrackingHardwareRotationOffsetLeftHand(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetTrackingHardwareRotationOffsetLeftHand();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetTrackingHardwareRotationOffsetLeftHand(
|
||||
USGSettings* Settings, const FRotator& InTrackingHardwareRotationOffsetLeftHand)
|
||||
{
|
||||
Settings->SetTrackingHardwareRotationOffsetLeftHand(InTrackingHardwareRotationOffsetLeftHand);
|
||||
}
|
||||
|
||||
const FRotator& USGSettingsKismetLibrary::GetTrackingHardwareRotationOffsetRightHand(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetTrackingHardwareRotationOffsetRightHand();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetTrackingHardwareRotationOffsetRightHand(
|
||||
USGSettings* Settings, const FRotator& InTrackingHardwareRotationOffsetRightHand)
|
||||
{
|
||||
Settings->SetTrackingHardwareRotationOffsetRightHand(InTrackingHardwareRotationOffsetRightHand);
|
||||
}
|
||||
|
||||
bool USGSettingsKismetLibrary::GetDrawDebugWristTrackerGizmo(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDrawDebugWristTrackerGizmo();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDrawDebugWristTrackerGizmo(
|
||||
USGSettings* Settings, const bool bInDrawDebugWristTrackerGizmo)
|
||||
{
|
||||
Settings->SetDrawDebugWristTrackerGizmo(bInDrawDebugWristTrackerGizmo);
|
||||
}
|
||||
|
||||
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoLength(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoLength();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoLength(
|
||||
USGSettings* Settings, const float InDebugWristTrackerGizmoLength)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoLength(InDebugWristTrackerGizmoLength);
|
||||
}
|
||||
|
||||
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoXAxisColor(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoXAxisColor();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoXAxisColor(
|
||||
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoXAxisColor)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoXAxisColor(InDebugWristTrackerGizmoXAxisColor);
|
||||
}
|
||||
|
||||
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoYAxisColor(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoYAxisColor();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoYAxisColor(
|
||||
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoYAxisColor)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoYAxisColor(InDebugWristTrackerGizmoYAxisColor);
|
||||
}
|
||||
|
||||
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoZAxisColor(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoZAxisColor();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoZAxisColor(
|
||||
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoZAxisColor)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoZAxisColor(InDebugWristTrackerGizmoZAxisColor);
|
||||
}
|
||||
|
||||
bool USGSettingsKismetLibrary::GetDebugWristTrackerGizmoPersistentLines(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoPersistentLines();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoPersistentLines(
|
||||
USGSettings* Settings, const bool bInDebugWristTrackerGizmoPersistentLines)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoPersistentLines(bInDebugWristTrackerGizmoPersistentLines);
|
||||
}
|
||||
|
||||
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoLifeTimeModifier(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoLifeTimeModifier();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoLifeTimeModifier(
|
||||
USGSettings* Settings, const float InDebugWristTrackerGizmoLifeTimeModifier)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoLifeTimeModifier(InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
}
|
||||
|
||||
uint8 USGSettingsKismetLibrary::GetDebugWristTrackerGizmoDepthPriority(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoDepthPriority();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoDepthPriority(
|
||||
USGSettings* Settings, const uint8 InDebugWristTrackerGizmoDepthPriority)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoDepthPriority(InDebugWristTrackerGizmoDepthPriority);
|
||||
}
|
||||
|
||||
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoThickness(const USGSettings* Settings)
|
||||
{
|
||||
return Settings->GetDebugWristTrackerGizmoThickness();
|
||||
}
|
||||
|
||||
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoThickness(
|
||||
USGSettings* Settings, const float InDebugWristTrackerGizmoThickness)
|
||||
{
|
||||
Settings->SetDebugWristTrackerGizmoThickness(InDebugWristTrackerGizmoThickness);
|
||||
Settings->SetWristTrackingSettings(InWristTrackingSettings);
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "SGKismet/SGBlueprintFunctionLibrary.h"
|
||||
#include "SGTypes/SGCoreTypes.h"
|
||||
#include "SGSettings/SGWristTrackingSettings.h"
|
||||
|
||||
#include "SGSettingsKismetLibrary.generated.h"
|
||||
|
||||
@@ -52,98 +52,9 @@ public:
|
||||
static USGSettings* GetInstance();
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static ESGPositionalTrackingHardware GetTrackingHardware(const USGSettings* Settings);
|
||||
static const FSGWristTrackingSettings& GetWristTrackingSettings(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetTrackingHardware(UPARAM(ref) USGSettings* Settings, ESGPositionalTrackingHardware InTrackingHardware);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FVector& GetTrackingHardwareLocationOffsetLeftHand(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetTrackingHardwareLocationOffsetLeftHand(UPARAM(ref) USGSettings* Settings,
|
||||
const FVector& InTrackingHardwareLocationOffsetLeftHand);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FVector& GetTrackingHardwareLocationOffsetRightHand(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetTrackingHardwareLocationOffsetRightHand(UPARAM(ref) USGSettings* Settings,
|
||||
const FVector& InTrackingHardwareLocationOffsetRightHand);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FRotator& GetTrackingHardwareRotationOffsetLeftHand(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetTrackingHardwareRotationOffsetLeftHand(UPARAM(ref) USGSettings* Settings,
|
||||
const FRotator& InTrackingHardwareRotationOffsetLeftHand);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FRotator& GetTrackingHardwareRotationOffsetRightHand(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetTrackingHardwareRotationOffsetRightHand(UPARAM(ref) USGSettings* Settings,
|
||||
const FRotator& InTrackingHardwareRotationOffsetRightHand);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static bool GetDrawDebugWristTrackerGizmo(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDrawDebugWristTrackerGizmo(UPARAM(ref) USGSettings* Settings, bool bInDrawDebugWristTrackerGizmo);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static float GetDebugWristTrackerGizmoLength(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoLength(UPARAM(ref) USGSettings* Settings,
|
||||
float InDebugWristTrackerGizmoLength);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FColor& GetDebugWristTrackerGizmoXAxisColor(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoXAxisColor(UPARAM(ref) USGSettings* Settings,
|
||||
const FColor& InDebugWristTrackerGizmoXAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FColor& GetDebugWristTrackerGizmoYAxisColor(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoYAxisColor(UPARAM(ref) USGSettings* Settings,
|
||||
const FColor& InDebugWristTrackerGizmoYAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static const FColor& GetDebugWristTrackerGizmoZAxisColor(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoZAxisColor(UPARAM(ref) USGSettings* Settings,
|
||||
const FColor& InDebugWristTrackerGizmoZAxisColor);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static bool GetDebugWristTrackerGizmoPersistentLines(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoPersistentLines(UPARAM(ref) USGSettings* Settings,
|
||||
bool bInDebugWristTrackerGizmoPersistentLines);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static float GetDebugWristTrackerGizmoLifeTimeModifier(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoLifeTimeModifier(UPARAM(ref) USGSettings* Settings,
|
||||
float InDebugWristTrackerGizmoLifeTimeModifier);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static uint8 GetDebugWristTrackerGizmoDepthPriority(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoDepthPriority(UPARAM(ref) USGSettings* Settings,
|
||||
uint8 InDebugWristTrackerGizmoDepthPriority);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
|
||||
static float GetDebugWristTrackerGizmoThickness(const USGSettings* Settings);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
|
||||
static void SetDebugWristTrackerGizmoThickness(UPARAM(ref) USGSettings* Settings,
|
||||
float InDebugWristTrackerGizmoThickness);
|
||||
static void SetWristTrackingSettings(UPARAM(ref) USGSettings* Settings,
|
||||
const FSGWristTrackingSettings& InWristTrackingSettings);
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @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 "SGTypes/SGDebugTypes.h"
|
||||
@@ -256,20 +256,17 @@ enum class ESGPositionalTrackingHardware : uint8
|
||||
/* Custom tracking hardware, we don't apply any offsets. */
|
||||
Custom UMETA(DisplayName = "Custom"),
|
||||
|
||||
/* HTC Vive Tracker (v1.0 or v2.0). */
|
||||
ViveTracker UMETA(DisplayName = "Vive Tracker"),
|
||||
|
||||
/* Oculus Touch controller (left or right) for Rift S and Quest 1. */
|
||||
OculusTouch UMETA(DisplayName = "Oculus Touch"),
|
||||
/* HTC VIVE Tracker (v1.0 or v2.0). */
|
||||
ViveTracker UMETA(DisplayName = "VIVE Tracker"),
|
||||
|
||||
/* Touch controller for Oculus Quest 2. */
|
||||
Quest2Controller UMETA(DisplayName = "Quest2 Controller"),
|
||||
Quest2Controller UMETA(DisplayName = "Quest 2 Controller"),
|
||||
|
||||
/* Pico Neo 2 Controller(s). */
|
||||
PicoNeo2 UMETA(DisplayName = "Pico Neo 2"),
|
||||
/* Wrist tracker for the VIVE Focus 3. */
|
||||
ViveFocus3WristTracker UMETA(DisplayName = "VIVE Focus 3 Wrist Tracker"),
|
||||
|
||||
/* Pico Neo 2 Controller(s). */
|
||||
PicoNeo3 UMETA(DisplayName = "Pico Neo 3"),
|
||||
/* Oculus Touch Controller that comes with the Meta Quest Pro. */
|
||||
QuestProController UMETA(DisplayName = "Quest Pro Controller"),
|
||||
};
|
||||
|
||||
/* Indices to access Sensor Data in Shared Memory. */
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @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 "CoreTypes.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
/**
|
||||
* Determines the debug virtual hand drawing mode.
|
||||
*/
|
||||
UENUM(BlueprintType)
|
||||
enum class ESGDebugVirtualHandDrawingMode : uint8
|
||||
{
|
||||
/** Do not draw any debug virtual hands. */
|
||||
None UMETA(DisplayName = "None"),
|
||||
|
||||
/** Draw a debug virtual hand with cubic joints. */
|
||||
CubicJoints UMETA(DisplayName = "Cubic Joints"),
|
||||
|
||||
/** Draw a debug virtual hand with gizmo joints. */
|
||||
GizmoJoints UMETA(DisplayName = "Gizmo Joints"),
|
||||
};
|
||||
@@ -50,18 +50,18 @@ public:
|
||||
static FORCEINLINE float TransformToSenseGlove(const int32 Movement, const float Direction)
|
||||
{
|
||||
// 0 = twist, 1 = flexion/extension, 2 = abduction
|
||||
return FMath::DegreesToRadians(Movement != 1 ? Direction * -1.0f : Direction);
|
||||
return FMath::DegreesToRadians(Movement != 1 ? -Direction : Direction);
|
||||
}
|
||||
|
||||
static FORCEINLINE FVector TransformToSenseGlove(const FVector& Vector)
|
||||
{
|
||||
return FMath::DegreesToRadians(FVector(Vector.Y * -1.0f, Vector.X, Vector.Z));
|
||||
return FMath::DegreesToRadians(FVector(-Vector.Y, Vector.X, Vector.Z));
|
||||
}
|
||||
|
||||
template<typename V>
|
||||
static FORCEINLINE V TransformToSenseGlove(const FVector& Vector)
|
||||
{
|
||||
return FMath::DegreesToRadians(V(Vector.Y * -1.0f, Vector.X, Vector.Z));
|
||||
return FMath::DegreesToRadians(V(-Vector.Y, Vector.X, Vector.Z));
|
||||
}
|
||||
|
||||
static FORCEINLINE float TransformToUnreal(const float Radians)
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
/// values require validation.
|
||||
|
||||
// 0 = twist, 1 = flexion/extension, 2 = abduction
|
||||
return Movement != 1 ? Direction * -1.0f : Direction;
|
||||
return Movement != 1 ? -Direction : Direction;
|
||||
}
|
||||
|
||||
static FORCEINLINE constexpr float TransformToUnreal(const ESGFingerMovement Movement, const float Direction)
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
/// Which flexions should be ignored?
|
||||
return (Movement != ESGFingerMovement::McpFlexion && Movement != ESGFingerMovement::PipFlexion && Movement !=
|
||||
ESGFingerMovement::PipFlexion)
|
||||
? Direction * -1.0f
|
||||
? -Direction
|
||||
: Direction;
|
||||
}
|
||||
|
||||
@@ -108,19 +108,19 @@ public:
|
||||
Movement != ESGThumbMovement::CmcFlexion
|
||||
&& Movement != ESGThumbMovement::McpFlexion
|
||||
&& Movement != ESGThumbMovement::IpFlexion
|
||||
? Direction * -1.0f
|
||||
? -Direction
|
||||
: Direction);
|
||||
}
|
||||
|
||||
static FORCEINLINE FVector TransformToUnreal(const FVector& Vector)
|
||||
{
|
||||
return FMath::RadiansToDegrees(FVector(Vector.Y * -1.0f, Vector.X, Vector.Z));
|
||||
return FMath::RadiansToDegrees(FVector(-Vector.Y, Vector.X, Vector.Z));
|
||||
}
|
||||
|
||||
template<typename V>
|
||||
static FORCEINLINE FVector TransformToUnreal(const V& Vector)
|
||||
{
|
||||
return FMath::RadiansToDegrees(FVector(Vector.GetY() * -1.0f, Vector.GetX(), Vector.GetZ()));
|
||||
return FMath::RadiansToDegrees(FVector(-Vector.GetY(), Vector.GetX(), Vector.GetZ()));
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user