Compare commits

...
51 Commits
Author SHA1 Message Date
Mamadou Babaei d515c87613 bump the plugin version to v1.0.4 2022-12-02 12:39:18 +01:00
Mamadou Babaei 68210423a5 simplify the move constructors / move assignment operators' noexcept ifdefs 2022-12-02 12:39:18 +01:00
Mamadou Babaei a953f197ae fix ue 4.22 - 4.27 build issues on msvc 2017 2022-12-02 12:39:18 +01:00
Mamadou Babaei 248919b080 move sgplatform headers to the public folder 2022-12-02 12:39:18 +01:00
Mamadou Babaei dcea66c48c update the platform support matrix 2022-12-02 12:39:18 +01:00
Mamadou Babaei c953e3afac fix ue >= 5.0 ubt errors 2022-12-02 12:39:17 +01:00
Mamadou Babaei f0e0b30685 upgrade senseglove third-party libraries for linux and android to to v2.0.4 2022-12-02 12:39:17 +01:00
Mamadou Babaei 005eb48232 add macros for C++17 detection 2022-12-02 12:39:16 +01:00
Mamadou Babaei 208ce5f96a apply const correctness to method parameters 2022-12-02 12:39:16 +01:00
Mamadou Babaei d85252c69f upgrade sglibraries binaries for windows/msvc to to v2.0.4 and add msvc 2017 binaries 2022-12-02 12:39:16 +01:00
Mamadou Babaei da570f30c2 upgrade sglibraries third-party headers to v2.0.4 2022-12-02 12:39:15 +01:00
Mamadou Babaei 48a62f7aee add support for msvc 2017 to the build.cs files 2022-12-02 12:39:15 +01:00
Mamadou Babaei aac0d9d348 bump the plugin version to v1.0.3 2022-11-30 14:33:21 +01:00
Mamadou Babaei f9f93fd301 adjust Config/FilterPlugin.ini in order to conform to Epic's market place guidelines 2022-11-30 14:28:34 +01:00
Mamadou Babaei 26078b6cf6 bump the plugin version to v1.0.2 2022-11-27 14:44:20 +01:00
Mamadou Babaei 324861820c fix the third-party license mark down file formatting 2022-11-27 14:44:20 +01:00
Mamadou Babaei f5d38f0975 add the SenseGlove SDK license 2022-11-27 14:44:20 +01:00
Mamadou Babaei 4e86707676 fix readme typos and errors 2022-11-27 14:14:28 +01:00
Mamadou Babaei 8c652038b5 add missing the copyright notice and include directive 2022-11-27 14:14:28 +01:00
Mamadou Babaei c63e5af789 list the dot files inside the FilterPlugin.ini file 2022-11-27 13:56:02 +01:00
Mamadou Babaei bd9e3f0f3c add the marketplace url to the .uplugin file 2022-11-27 13:56:02 +01:00
Mamadou Babaei 51388d14f9 bump the plugin version to v1.0.1 2022-11-25 15:21:53 +01:00
Mamadou Babaei 585e8fb9d0 * Expose SenseGloveTypes as a public dependency in SenseGloveConnect and
SenseGloveCore modules, so that the C++ users of the API don't need to
 explicitly add it as a dependency
* Clean up the redundant headers/modules dependency from SGCore headers
* Fix RunUAT build issues for Epic Store submission
2022-11-25 15:08:09 +01:00
Mamadou Babaei 9d897c7f08 update documentation, add changelog, and prepare for v1.0.0 release 2022-11-24 17:08:59 +01:00
Mamadou Babaei ab0abee814 huge patch fixing 4.22 through 4.24 build issues on msvc and llvm/clang 2022-11-24 01:17:43 +01:00
Mamadou Babaei 8701964cc6 fix a mangled method name in layer 4 2022-11-23 21:19:54 +01:00
Mamadou Babaei 29b468bdc5 replace IMPLEMENT_GAME_MODULE with IMPLEMENT_MODULE 2022-11-19 13:07:23 +01:00
Mamadou Babaei 1cee88159b fix module types and loading order 2022-11-19 06:22:22 +01:00
Mamadou Babaei f41ff82013 add the docs url 2022-11-18 15:07:42 +01:00
Mamadou Babaei 73d87cb94a import sg libraries v2.0.3 binaries for msvc/windows 2022-11-18 15:02:48 +01:00
Mamadou Babaei cee6d98636 import sg libraries headers v2.0.3 and linux binaries and adjust to the latest changes 2022-11-18 15:02:47 +01:00
Mamadou Babaei 15eaa1650b add more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei eedac54709 add missing sense glove wrappers in layer 1/2/3/4 of the api and also more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei dcf82891f1 add missing nova glove info rotator conversions to layer 3/4 of the api and also more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei 0527b7e727 add missing nova glove hand profile wrappers in layer 3/4 of the api and also more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei 25b3bdef58 add more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei 6a5ee47681 add missing sg device wrappers in layer 4 of the api and also more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei ba578eec6b add more documentation 2022-11-18 15:02:47 +01:00
Mamadou Babaei 115ee6b915 document some parts of the layer 3 and 4 api 2022-11-18 15:02:47 +01:00
Mamadou Babaei 179ad610f0 translate senseglove/unreal angles/directions 2022-11-18 15:02:47 +01:00
Mamadou Babaei a1b79aba1f implement proper mm/cm conversions 2022-11-17 02:30:16 +01:00
Mamadou Babaei 2156f793cc introduce more utility templates for metric unit conversions 2022-11-17 02:30:16 +01:00
Mamadou Babaei 3a2c558df8 remove unit conversions from the internal vect3d wrappers 2022-11-17 02:30:16 +01:00
Mamadou Babaei 796242627b bump sg libraries to v2.0.2 and adjust to the latest changes 2022-11-17 02:30:15 +01:00
Mamadou Babaei c65f968678 consider millimeters/centimeters conversion, introduce units, and minor array utils refactoring 2022-11-17 02:30:15 +01:00
Mamadou Babaei 0af8eb3c51 fix wrong readme header 2022-11-14 17:19:59 +01:00
Mamadou Babaei fe3515f6f2 shorten mangled blueprint nodes in order to avoid doc generation issues 2022-11-14 17:15:57 +01:00
Mamadou Babaei a0d009c7de separate the unreal c++/bp implementation of SGConnect wrappers 2022-11-12 00:35:11 +01:00
Mamadou Babaei 637479655b add FRotator overloads for every method that accepts or returns FQuat and some other bug fixes 2022-11-11 11:41:42 +01:00
Mamadou Babaei 0d8fcf75d3 bump engine version to 4.26 2022-11-11 11:41:42 +01:00
Mamadou Babaei e72d052799 fix unreal/senseglove coordinates translation calculations 2022-11-11 11:41:41 +01:00
382 changed files with 11175 additions and 2418 deletions
+53 -1
View File
@@ -1,7 +1,59 @@
# Changelog
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).
## [Unreleased]
## [1.0.4] - 2022-12-02
This is a minor release focusing mostly on adherence to the Unreal Engine Marketplace Guidelines based on the feedback from Epic Games.
### Added
- Added support for MSVC 2017
### Changed
- Updated SenseGlove libraries (SGCore/SGConnect) to v2.0.4.
## [1.0.3] - 2022-11-29
This is a minor release focusing on adherence to the Unreal Engine Marketplace Guidelines based on the feedback from Epic Games.
### Changed
- Adjust Config/FilterPlugin.ini in order to conform to Epic's Market Place Guidelines.
## [1.0.2] - 2022-11-27
This is a minor release focusing on adherence to the Unreal Engine Marketplace Guidelines based on the feedback from Epic Games.
### 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.
- Add the copyright notice to the source files missing it.
- Add the SenseGlove SDK license to the third-party license file.
### Fixed
- Fix the readme typos and errors.
- Minor fixes in the changelog for previous releases.
## [1.0.1] - 2022-11-25
### Changed
- Exposed SenseGloveTypes as a public dependency in SenseGloveConnect and SenseGloveCore modules, so that the C++ users of the API don't need to explicitly add it as a dependency.
- Cleaned up the redundant headers/modules dependencies from SGCore headers.
### Fixed
- Fix RunUAT build issues prior to Epic Store submission.
## [1.0.0] - 2022-11-24
### Added
- Initial public release of the SenseGlove haptic API for Unreal Engine with support for Microsoft Windows and GNU/Linux.
-3
View File
@@ -1,6 +1,3 @@
[FilterPlugin]
/CHANGELOG.md
/Config/FilterPlugin.ini
/LICENSE.md
/LICENSE-THIRD-PARTY.md
/README.md
+47 -3
View File
@@ -2,6 +2,39 @@
Please note that while the SenseGlove plug-in for Unreal Engine is made available under the [MIT License](LICENSE.md), it utilizes a few third-party libraries with permissive free licenses as well, in order to power various components. For a list of these libraries and their own respective open-source licenses take a look at [LICENSE-THIRD-PARTY.md](LICENSE-THIRD-PARTY.md), please.
### SenseGlove SDK
```
SENSEGLOVE SDK LICENSE
Purchase of the Product does not entitle you to ownership or a license to any
software generated by SenseGlove for use with the Product (the “Software”).
To the extent that SenseGlove, in its sole discretion, grants you access to any
such Software, the Software is licensed by us or by the relevant licensor/owner
subject to the relevant end-user license agreement or other license terms
included with the Product and/or on the SenseGlove Websites including the Github
page of SenseGlove (the “License Terms“).
Specifically, SenseGlove shall have sole discretion to determine and change the
availability, nature, features, content, versioning of any Software that it
makes available to you, for download through the the Github page of SenseGlove
or otherwise (including the SenseGlove software developer kit (“SDK”)).
Purchase of a Product does not entitle you to access to any specific features,
content or version of the SDK, including and especially versions of the SDK that
have not yet been made available to the public. SenseGlove will have no
obligation to provide any updates or upgrades to any Software it makes available
to you, but in the event that it does, such updates, upgrades and any
documentation will be subject to the License Terms available at
https://www.senseglove.com/solutions/.
Except to the extent expressly provided by us in writing or under the License
Terms, the Software is provided “AS IS” without any warranties, terms or
conditions as to quality, fitness for purpose, non-infringement, performance or
correspondence with description and we do not offer any warranties or guarantees
in relation to the Software installation, configuration or error/defect
correction.
```
## Boost C++ Libraries License
```
@@ -35,9 +68,20 @@ DEALINGS IN THE SOFTWARE.
```
Copyright (c) 2012 William Woodall, John Harrison
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:
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 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.
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.
```
+18 -22
View File
@@ -1,25 +1,21 @@
# The SenseGlove Unreal Engine Plugin
## ⚠️ DISCLAIMER: Experimental Release
This is an initial experimental release for public evaluation and may not be considered *production ready*, yet. This repository is under active development and there might be known or unknown bugs lurking around. Use it at your own risk.
## How to Download
This repository relies on Git LFS for storing binary blobs (e.g. third-party libraries). Sadly, there is a known issue with Microsoft Azure public LFS repositories that requires credential for LFS checkouts on https (LFS ssh checkouts are not supported at all). Unless, you are part of SenseGlove organization on Microsoft Azure there is no easy way to fully clone this repository using Git. Thus, the best way to download this repository is to use the 'kebab' (three vertical dots) menu next to the clone button, in order to download the whole repository including LFS objects as a unified zip file.
## Platform Support Matrix
| | **Windows<br>(MSVC 2019)** | **Windows<br>(MSVC 2022)** | **Linux<br>(Native Toolchain)** | **macOS** | **Oculus Mobile<br>(Android NDK r21b)** |
|----------|:--------------------------:|:--------------------------:|:-------------------------------:|:---------:|:---------------------------------------:|
| **4.22** | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.23** | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.24** | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.25** | ✅ | ❌ | ✅ | ❌ | ❓ |
| **4.26** | ✅ | ❌ | ✅ | ❌ | ❓ |
| **4.27** | ✅ | ✅ | ✅ | ❌ | ❓ |
| **5.0** | ✅ | ✅ | ✅ | ❌ | ❓ |
| **5.1** | ✅ | ✅ | ✅ | ❌ | ❓ |
| | **Windows<br>(MSVC 2017)** | **Windows<br>(MSVC 2019)** | **Windows<br>(MSVC 2022)** | **Linux<br>(Native Toolchain)** | **macOS** | **Oculus Mobile<br>(Android NDK r21b)** |
|----------|:--------------------------:|:--------------------------:|:--------------------------:|:-------------------------------:|:---------:|:---------------------------------------:|
| **4.22** | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.23** | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.24** | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
| **4.25** | ✅ | ✅ | ❌ | ✅ | ❌ | ❓ |
| **4.26** | ✅ | ✅ | ❌ | ✅ | ❌ | ❓ |
| **4.27** | ✅ | ✅ | ✅ | ✅ | ❌ | ❓ |
| **5.0** | ❌ | ✅ | ✅ | ✅ | ❌ | ❓ |
| **5.1** | ❌ | ✅ | ✅ | ✅ | ❌ | ❓ |
* <code>✅</code> Supported
* <code>❌</code> Not Supported
@@ -32,13 +28,13 @@ Remarks:
* Supporting Unreal Engine 4.22 through 4.24 for Oculus development is a huge challenge due to limited Android NDK support (r14b to r18b); firstly, because of uncomplete C++11 standard library support, and second, as a result of a known bug in Unreal Engine, which falsely detects NDK r18b as unsupported r18c. Thus, only Unreal Engine 4.25+ support is provided for Android/Oculus development. Third, [wjwwood/serial](https://github.com/wjwwood/serial) requires Android NDK API Level 28+ in order to be built successfully, thus some older NDKs such as r14b, which is the recommended NDK by Epic Games for 4.22 to 4.24 cannot build the serial library.
* All third-party libraries target Android NDK API Level 29, thus any project relying on the plug-in should be build with the same NDK API Level.
## Documentation
## Changelog
We maintain [a detailed changelog for this project](CHANGELOG.md) as well. Please consult the changelog before upgrading to any newer release.
## Documentation
The Blueprints documentation will be coming soon.
[The Blueprints documentation is hosted on SenseGlove Docs](https://senseglove.gitlab.io/unreal-blueprint-docs/).
For the C++ documentation, since this plugin builds on top of [SGConnect](https://senseglove.gitlab.io/SenseGloveDocs/native/core-api-intro.html#sgconnect) and [SGCoreCpp](https://senseglove.gitlab.io/SenseGloveDocs/native/core-api-intro.html#sgcorecpp) third-party C++ libraries, please refer to [the upstream documentation](https://senseglove.gitlab.io/SenseGloveDocs/native/cpp-reference.html).
@@ -65,17 +61,17 @@ Source
├── SenseGlove (the UE-specific high-level API)
├── SenseGloveBuildHacks (uses Excepttions and RTTI, internally used for compiler-specific build hacks)
├── SenseGloveBuildHacks (uses Exceptions and RTTI, internally used for compiler-specific build hacks)
├── SenseGloveConnect (exposes part of the SGConnect low-level API to C++ and Blueprints)
├── SenseGloveConnect (exposes part of the SGConnect low-level API to C++)
├── SenseGloveConnectImpl (uses Excepttions and RTTI, intended for internal use only)
├── SenseGloveConnectImpl (uses Exceptions and RTTI, intended for internal use only)
├── SenseGloveConnectKismet (SGConnect functionality exposed to Blueprints)
├── SenseGloveCore (exposes part of the SGCoreCpp low-level API to C++ and Blueprints)
├── SenseGloveCore (exposes part of the SGCoreCpp low-level API to C++)
├── SenseGloveCoreImpl (uses Excepttions and RTTI, intended for internal use only)
├── SenseGloveCoreImpl (uses Exceptions and RTTI, intended for internal use only)
├── SenseGloveCoreKismet (SGCoreCpp functionality exposed to Blueprints)
@@ -139,7 +135,7 @@ Source
│ │ │
│ │ └── release
│ │
│ └── v20 (UE 5.0 Linux dependencies)
│ └── v20 (UE 5.0 and 5.1 Linux dependencies)
│ │
│ ├── debug
│ │
+18 -17
View File
@@ -1,15 +1,16 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0.0",
"VersionName": "1.0.4",
"FriendlyName": "SenseGlove",
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
"Category": "Virtual Reality",
"CreatedBy": "SenseGlove",
"CreatedByURL": "https://www.senseglove.com/",
"DocsURL": "",
"MarketplaceURL": "",
"DocsURL": "https://senseglove.gitlab.io/unreal-blueprint-docs/",
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/5e1d408f517b4966a269ec1035de0b9e",
"SupportURL": "https://www.senseglove.com/support/",
"EngineVersion": "4.26.0",
"CanContainContent": true,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
@@ -31,7 +32,7 @@
{
"Name": "SenseGloveBuildHacks",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -40,7 +41,7 @@
{
"Name": "SenseGloveConnect",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -49,7 +50,7 @@
{
"Name": "SenseGloveConnectImpl",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -58,7 +59,7 @@
{
"Name": "SenseGloveConnectKismet",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -67,7 +68,7 @@
{
"Name": "SenseGloveCore",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -76,7 +77,7 @@
{
"Name": "SenseGloveCoreImpl",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -85,7 +86,7 @@
{
"Name": "SenseGloveCoreKismet",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -93,8 +94,8 @@
},
{
"Name": "SenseGloveEditor",
"Type": "Runtime",
"LoadingPhase": "Default",
"Type": "Editor",
"LoadingPhase": "PostEngineInit",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -103,7 +104,7 @@
{
"Name": "SenseGloveInterop",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -112,7 +113,7 @@
{
"Name": "SenseGloveKismet",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -121,7 +122,7 @@
{
"Name": "SenseGloveLog",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -130,7 +131,7 @@
{
"Name": "SenseGloveTypes",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -139,7 +140,7 @@
{
"Name": "SenseGloveUtils",
"Type": "Runtime",
"LoadingPhase": "Default",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Linux",
"Win64"
@@ -34,20 +34,21 @@
#include "SGConnect/SGConnect.h"
#include "SGConnectImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FString.h"
int32 USGConnect::Init()
int32 FSGConnect::Init()
{
return SGConnect_Init();
}
int32 USGConnect::Dispose()
int32 FSGConnect::Dispose()
{
return SGConnect_Dispose();
}
FString USGConnect::GetLibraryVersion()
FString FSGConnect::GetLibraryVersion()
{
FSGIC_FString Container;
SGConnect_GetLibraryVersion(&Container);
@@ -43,8 +43,8 @@
void FSenseGloveConnectModule::StartupModule()
{
SGLOG("Starting up SenseGloveConnect module...");
SGLOG(FString::Printf(TEXT("The Unreal Engine implementation of '%s' has been loaded successfully!"), *USGConnect::
GetLibraryVersion()));
SGLOG(FString::Printf(TEXT("The Unreal Engine implementation of '%s' has been loaded successfully!"),
*FSGConnect::GetLibraryVersion()));
}
void FSenseGloveConnectModule::PreUnloadCallback()
@@ -35,12 +35,12 @@
#pragma once
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGConnect.generated.h"
UCLASS(BlueprintType)
class SENSEGLOVECONNECT_API USGConnect: public UObject
USTRUCT()
struct SENSEGLOVECONNECT_API FSGConnect
{
GENERATED_BODY()
@@ -55,7 +55,6 @@ public:
* 0 : Device Scanning is already running in within this program.
* 1 : Successfully started up DeviceScanning from the current program.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static int32 Init();
/**
@@ -69,12 +68,10 @@ public:
* 1 : Successfully disposed of DeviceScanner resources.
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static int32 Dispose();
/**
* Check which version of SGConnect you are using.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static FString GetLibraryVersion();
};
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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 "SGConnectImpl/SGPlatform.h"
@@ -0,0 +1,42 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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
#if ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L )
#define SG_CPP17 1
#else /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L ) */
#define SG_CPP17 0
#endif /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L ) */
@@ -133,11 +133,17 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break;
#endif
#if ! UE_5_0_OR_LATER && UE_4_17_OR_LATER
case WindowsCompiler.VisualStudio2017:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc141"));
break;
#endif
default:
Debug.Assert(false, "Unsupported compiler!");
break;
}
LibraryName = string.Format("{0}.lib", LibraryName);
}
else
@@ -222,11 +228,17 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break;
#endif
#if ! UE_5_0_OR_LATER && UE_4_17_OR_LATER
case WindowsCompiler.VisualStudio2017:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc141"));
break;
#endif
default:
Debug.Assert(false, "Unsupported compiler!");
break;
}
LibraryName = string.Format("{0}.lib", LibraryName);
}
else
@@ -0,0 +1,53 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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 "SGConnectKismet/SGConnectKismetLibrary.h"
#include "SGConnect/SGConnect.h"
int32 USGConnectKismetLibrary::Init()
{
return FSGConnect::Init();
}
int32 USGConnectKismetLibrary::Dispose()
{
return FSGConnect::Dispose();
}
FString USGConnectKismetLibrary::GetLibraryVersion()
{
return FSGConnect::GetLibraryVersion();
}
@@ -0,0 +1,84 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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 "HAL/Platform.h"
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGConnectKismetLibrary.generated.h"
UCLASS(meta=(ScriptName = "SesneGloveConnectKismetLibrary"))
class SENSEGLOVECONNECTKISMET_API USGConnectKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
public:
/**
* Begin Scanning for Sense Glove Devices and set up communications with them.
*
* @return
* -3 : An Unexpected error occured. Please try again.
* -2 : Device Scanning is already running within a different program.
* -1 : Device Scanning already being initialized (function called twice in short succession).
* 0 : Device Scanning is already running in within this program.
* 1 : Successfully started up DeviceScanning from the current program.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static int32 Init();
/**
* Dispose of unmanaged resources and finalize Sense Glove devices.
*
* @return
* -3 : An Unexpected error occured. Please try again.
* -2 : Not allowed to dispose of Device Scanning because this is not the program which started it.
* -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).
* 0 : There is no deviceScanner running from any program, so disposing is skipped.
* 1 : Successfully disposed of DeviceScanner resources.
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static int32 Dispose();
/**
* Check which version of SGConnect you are using.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Connect")
static FString GetLibraryVersion();
};
@@ -55,16 +55,10 @@ public class SenseGloveConnectKismet : ModuleRules
"CoreUObject",
"Engine",
"SenseGloveConnect",
"SenseGloveKismet",
"SenseGloveLog",
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveKismet",
}
);
}
}
@@ -68,14 +68,14 @@ float FSGAnatomy::GetThumbJointLimit(const bool bRightHanded, const int32 Joint,
return SGCoreImpl_FSGAnatomyImpl_GetThumbJointLimit(bRightHanded, Joint, Movement, bMax);
}
float FSGAnatomy::NormalizeFingerFlex(const float FlexionInRadians)
float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInRadians)
{
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlex(FlexionInRadians);
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInRadians);
}
float FSGAnatomy::NormalizeThumbFlex(float FlexionInRadians)
float FSGAnatomy::NormalizeThumbFlexion(const float FlexionInRadians)
{
return SGCoreImpl_FSGAnatomyImpl_NormalizeThumbFlex(FlexionInRadians);
return SGCoreImpl_FSGAnatomyImpl_NormalizeThumbFlexion(FlexionInRadians);
}
TArray<TArray<FVector>> FSGAnatomy::GetDefaultHandAngles(const bool bRightHanded)
@@ -85,21 +85,21 @@ TArray<TArray<FVector>> FSGAnatomy::GetDefaultHandAngles(const bool bRightHanded
return MoveTemp(OutAnglesContainer.Array);
}
TArray<TArray<FVector>> FSGAnatomy::GetFlatHandAngles(bool bRightHanded)
TArray<TArray<FVector>> FSGAnatomy::GetFlatHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetFlatHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<TArray<FVector>> FSGAnatomy::GetThumbsUpHandAngles(bool bRightHanded)
TArray<TArray<FVector>> FSGAnatomy::GetThumbsUpHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetThumbsUpHandAngles(&OutAnglesContainer, bRightHanded);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<TArray<FVector>> FSGAnatomy::GetFistHandAngles(bool bRightHanded)
TArray<TArray<FVector>> FSGAnatomy::GetFistHandAngles(const bool bRightHanded)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGAnatomyImpl_GetFistHandAngles(&OutAnglesContainer, bRightHanded);
@@ -47,6 +47,7 @@
#include "SGInterop/SGIC_TArray_FQuat.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TArray_float.h"
#include "SGUtils/SGArrayUtils.h"
struct USGBasicHandModel::FImpl
{
@@ -118,7 +119,7 @@ USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bo
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPosition(
@@ -143,6 +144,22 @@ USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bo
return NewBasicHandModel(Outer, MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl));
}
USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bool bRightHanded,
const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions,
const TArray<FRotator>& StartRotations)
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPositions_StartRotations(
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer,
&StartPositionsContainer, &StartRotationsContainer);
return NewBasicHandModel(Outer, MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl));
}
USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bool bRightHanded,
const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions,
@@ -150,7 +167,7 @@ USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bo
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{StartRotations};
@@ -161,6 +178,24 @@ USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bo
return NewBasicHandModel(Outer, MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl));
}
USGBasicHandModel* USGBasicHandModel::NewBasicHandModel(UObject* Outer, const bool bRightHanded,
const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions,
const TArray<FRotator>& StartRotations)
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPositions_StartRotations(
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer,
&StartPositionsContainer, &StartRotationsContainer);
return NewBasicHandModel(Outer, MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl));
}
USGBasicHandModel* USGBasicHandModel::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
@@ -190,20 +225,20 @@ TArray<FVector> USGBasicHandModel::GetBaseJointPositions()
return MoveTemp(OutPositionsContainer.Array);
}
TArray<FVector> USGBasicHandModel::GetBaseJointRotations()
TArray<FVector> USGBasicHandModel::GetBaseJointAngles()
{
FSGIC_TArray_FVector OutRotationsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetBaseJointRotations(&OutRotationsContainer);
SGCoreImpl_FSGBasicHandModelImpl_GetBaseJointAngles(&OutRotationsContainer);
return MoveTemp(OutRotationsContainer.Array);
}
USGBasicHandModel::USGBasicHandModel()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
SGCoreImpl_FSGBasicHandModelImpl_ctor(&OutBasicHandModelImplContainer);
@@ -215,11 +250,11 @@ USGBasicHandModel::USGBasicHandModel()
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
@@ -234,15 +269,15 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArra
USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPosition(
@@ -255,11 +290,11 @@ USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArr
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
@@ -273,18 +308,39 @@ USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArra
Pimpl->SyncUProperties();
}
USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{Lengths};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPositions_StartRotations(
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer,
&StartPositionsContainer, &StartRotationsContainer);
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
Pimpl->SyncUProperties();
}
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{StartRotations};
@@ -296,13 +352,36 @@ USGBasicHandModel::USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArr
Pimpl->SyncUProperties();
}
USGBasicHandModel::USGBasicHandModel(const FSGBasicHandModelImpl& BasicHandModelImpl)
USGBasicHandModel::USGBasicHandModel(const bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGBasicHandModelImpl OutBasicHandModelImplContainer;
FSGIC_TArray_TArray_float LengthsContainer{
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(Lengths)
};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
SGCoreImpl_FSGBasicHandModelImpl_ctor_bRightHanded_Lengths_StartPositions_StartRotations(
&OutBasicHandModelImplContainer, bRightHanded, &LengthsContainer,
&StartPositionsContainer, &StartRotationsContainer);
Pimpl->BasicHandModelImpl = MoveTemp(OutBasicHandModelImplContainer.BasicHandModelImpl);
Pimpl->SyncUProperties();
}
USGBasicHandModel::USGBasicHandModel(const FSGBasicHandModelImpl& BasicHandModelImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetBasicHandModelImpl(BasicHandModelImpl);
Pimpl->SyncUProperties();
@@ -432,7 +511,7 @@ void USGBasicHandModel::SetStartJointPosition(const uint8 Finger, const FVector&
Pimpl->SyncUProperties();
}
TArray<FQuat> USGBasicHandModel::GetStartJointRotations() const
TArray<FQuat> USGBasicHandModel::GetStartJointRotationsQ() const
{
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
@@ -440,6 +519,14 @@ TArray<FQuat> USGBasicHandModel::GetStartJointRotations() const
return MoveTemp(OutRotationsContainer.Array);
}
TArray<FRotator> USGBasicHandModel::GetStartJointRotations() const
{
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGBasicHandModelImpl_GetStartJointRotations(&InstanceContainer, &OutRotationsContainer);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
FVector USGBasicHandModel::GetJointPosition(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
@@ -464,7 +551,7 @@ void USGBasicHandModel::SetJointPosition(const FVector& NewPosition, const ESGFi
Pimpl->SyncUProperties();
}
FQuat USGBasicHandModel::GetJointRotation(const ESGFinger Finger) const
FQuat USGBasicHandModel::GetJointRotationQ(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
@@ -476,6 +563,18 @@ FQuat USGBasicHandModel::GetJointRotation(const ESGFinger Finger) const
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGBasicHandModel::GetJointRotation(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_FQuat OutRotationContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_GetJointRotation(&InstanceContainer, &OutRotationContainer, &FingerContainer);
return OutRotationContainer.Quat.Rotator();
}
void USGBasicHandModel::SetJointRotation(const FQuat& NewRotation, const ESGFinger Finger)
{
Pimpl->SyncImplObject();
@@ -488,6 +587,18 @@ void USGBasicHandModel::SetJointRotation(const FQuat& NewRotation, const ESGFing
Pimpl->SyncUProperties();
}
void USGBasicHandModel::SetJointRotation(const FRotator& NewRotation, const ESGFinger Finger)
{
Pimpl->SyncImplObject();
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
FSGIC_FQuat NewRotationContainer{NewRotation.Quaternion()};
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBasicHandModelImpl_SetJointRotation(&InstanceContainer, &NewRotationContainer, &FingerContainer);
Pimpl->SyncUProperties();
}
TArray<float> USGBasicHandModel::GetTotalLengths() const
{
FSGIC_FSGBasicHandModelImpl InstanceContainer{ToBasicHandModelImpl()};
@@ -129,11 +129,11 @@ USGBetaDevice* USGBetaDevice::Parse(UObject* Outer, const FString& String)
USGBetaDevice::USGBetaDevice()
: USGDevice(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
SGCoreImpl_FSGBetaDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -146,11 +146,11 @@ USGBetaDevice::USGBetaDevice(const FString& ConstantsString, const FString& Devi
const FString& HardwareVersion,
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
: USGDevice(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
FSGIC_FString ConstantsStringContainer{ConstantsString};
@@ -166,22 +166,22 @@ USGBetaDevice::USGBetaDevice(const FString& ConstantsString, const FString& Devi
USGBetaDevice::USGBetaDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
: USGDevice(BetaDeviceImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGBetaDevice::USGBetaDevice(TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl)
: USGDevice(MoveTemp(BetaDeviceImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -141,11 +141,11 @@ USGBuzzCommand* USGBuzzCommand::Off(UObject* Outer)
USGBuzzCommand::USGBuzzCommand()
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -156,11 +156,11 @@ USGBuzzCommand::USGBuzzCommand()
USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
: USGFingerCommand(BuzzLevels),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
@@ -174,11 +174,11 @@ USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
USGBuzzCommand::USGBuzzCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
@@ -190,11 +190,11 @@ USGBuzzCommand::USGBuzzCommand(
USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
@@ -207,22 +207,22 @@ USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
USGBuzzCommand::USGBuzzCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
: USGFingerCommand(BuzzCommandImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGBuzzCommand::USGBuzzCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
: USGFingerCommand(MoveTemp(BuzzCommandImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -108,11 +108,11 @@ USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
USGCalibrationDataPoint::USGCalibrationDataPoint()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
@@ -123,11 +123,11 @@ USGCalibrationDataPoint::USGCalibrationDataPoint()
USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
@@ -140,11 +140,11 @@ USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const
USGCalibrationDataPoint::USGCalibrationDataPoint(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetCalibrationDataPointImpl(CalibrationDataPointImpl);
Pimpl->SyncUProperties();
@@ -111,11 +111,11 @@ FString USGDevice::ToString(const ESGDeviceType DeviceType)
USGDevice::USGDevice()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGDeviceImpl OutSharedPtrContainer;
SGCoreImpl_FSGDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -126,11 +126,11 @@ USGDevice::USGDevice()
USGDevice::USGDevice(const FSGDeviceImpl& SGDeviceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGDeviceImpl OutSharedPtrContainer;
FSGIC_FSGDeviceImpl RhsContainer{SGDeviceImpl};
@@ -142,11 +142,11 @@ USGDevice::USGDevice(const FSGDeviceImpl& SGDeviceImpl)
USGDevice::USGDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBetaDeviceImpl OutSharedPtrContainer;
FSGIC_FSGBetaDeviceImpl RhsContainer{BetaDeviceImpl};
@@ -157,11 +157,11 @@ USGDevice::USGDevice(const FSGBetaDeviceImpl& BetaDeviceImpl)
USGDevice::USGDevice(const FSGHapticGloveImpl& HapticGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveImpl RhsContainer{HapticGloveImpl};
@@ -173,11 +173,11 @@ USGDevice::USGDevice(const FSGHapticGloveImpl& HapticGloveImpl)
USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
FSGIC_FSGNovaGloveImpl RhsContainer{NovaGloveImpl};
@@ -189,11 +189,11 @@ USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl)
USGDevice::USGDevice(const FSGSenseGloveImpl& SenseGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
FSGIC_FSGSenseGloveImpl RhsContainer{SenseGloveImpl};
@@ -205,11 +205,11 @@ USGDevice::USGDevice(const FSGSenseGloveImpl& SenseGloveImpl)
USGDevice::USGDevice(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SGDeviceImpl = MoveTemp(SGDeviceImpl);
Pimpl->SyncUProperties();
@@ -217,11 +217,11 @@ USGDevice::USGDevice(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
USGDevice::USGDevice(TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SGDeviceImpl = MoveTemp(BetaDeviceImpl);
Pimpl->SyncUProperties();
@@ -229,11 +229,11 @@ USGDevice::USGDevice(TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl)
USGDevice::USGDevice(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
Pimpl->SyncUProperties();
@@ -241,11 +241,11 @@ USGDevice::USGDevice(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SGDeviceImpl = MoveTemp(NovaGloveImpl);
Pimpl->SyncUProperties();
@@ -253,11 +253,11 @@ USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
USGDevice::USGDevice(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SGDeviceImpl = MoveTemp(SenseGloveImpl);
Pimpl->SyncUProperties();
@@ -426,12 +426,12 @@ int32 USGDevice::GetDeviceIndex() const
return SGCoreImpl_FSGDeviceImpl_GetDeviceIndex(&InstanceContainer);
}
void USGDevice::SetDeviceIndex(const int32 Index)
void USGDevice::SetDeviceIndex(const int32 NewIndex)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
SGCoreImpl_FSGDeviceImpl_SetDeviceIndex(&InstanceContainer, Index);
SGCoreImpl_FSGDeviceImpl_SetDeviceIndex(&InstanceContainer, NewIndex);
SyncUProperties();
}
@@ -121,11 +121,11 @@ void USGDeviceModel::ParseFirmware(const FString& RawFirmware, int32& OutMainVer
USGDeviceModel::USGDeviceModel()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGDeviceModelImpl OutDeviceModelImplContainer;
SGCoreImpl_FSGDeviceModelImpl_ctor(&OutDeviceModelImplContainer);
@@ -137,11 +137,11 @@ USGDeviceModel::USGDeviceModel()
USGDeviceModel::USGDeviceModel(const FString& Id, const FString& HardwareVersion,
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGDeviceModelImpl OutDeviceModelImplContainer;
FSGIC_FString IdContainer{Id};
@@ -155,11 +155,11 @@ USGDeviceModel::USGDeviceModel(const FString& Id, const FString& HardwareVersion
USGDeviceModel::USGDeviceModel(const FSGDeviceModelImpl& DeviceModelImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetDeviceModelImpl(DeviceModelImpl);
Pimpl->SyncUProperties();
@@ -88,11 +88,11 @@ struct USGFingerCommand::FImpl
USGFingerCommand::USGFingerCommand()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -103,11 +103,11 @@ USGFingerCommand::USGFingerCommand()
USGFingerCommand::USGFingerCommand(const TArray<int32>& InLevels)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 LevelsContainer{InLevels};
@@ -119,11 +119,11 @@ USGFingerCommand::USGFingerCommand(const TArray<int32>& InLevels)
USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
@@ -136,11 +136,11 @@ USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl
USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
@@ -153,11 +153,11 @@ USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
@@ -170,11 +170,11 @@ USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedb
USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
@@ -187,11 +187,11 @@ USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzComma
USGFingerCommand::USGFingerCommand(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
Pimpl->SyncUProperties();
@@ -199,11 +199,11 @@ USGFingerCommand::USGFingerCommand(TSharedRef<FSGFingerCommandImpl> FingerComman
USGFingerCommand::USGFingerCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
Pimpl->SyncUProperties();
@@ -211,11 +211,11 @@ USGFingerCommand::USGFingerCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImp
USGFingerCommand::USGFingerCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
Pimpl->SyncUProperties();
@@ -223,11 +223,11 @@ USGFingerCommand::USGFingerCommand(TSharedRef<FSGForceFeedbackCommandImpl> Force
USGFingerCommand::USGFingerCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
Pimpl->SyncUProperties();
@@ -145,11 +145,11 @@ USGForceFeedbackCommand* USGForceFeedbackCommand::Off(UObject* Outer)
USGForceFeedbackCommand::USGForceFeedbackCommand()
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -160,11 +160,11 @@ USGForceFeedbackCommand::USGForceFeedbackCommand()
USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedbackLevels)
: USGFingerCommand(ForceFeedbackLevels),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
@@ -178,11 +178,11 @@ USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedb
USGForceFeedbackCommand::USGForceFeedbackCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
@@ -194,11 +194,11 @@ USGForceFeedbackCommand::USGForceFeedbackCommand(
USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
@@ -211,22 +211,22 @@ USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const i
USGForceFeedbackCommand::USGForceFeedbackCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
: USGFingerCommand(ForceFeedbackCommandImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGForceFeedbackCommand::USGForceFeedbackCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
: USGFingerCommand(MoveTemp(ForceFeedbackCommandImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGInterpolationSet.h"
#include "SGCoreImpl/SGInterpolationSetImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandInterpolatorImpl.h"
@@ -151,6 +152,21 @@ USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FQuat& CmcStartRotation)
@@ -169,6 +185,24 @@ USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
@@ -223,11 +257,11 @@ TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(const USGHand
USGHandInterpolator::USGHandInterpolator()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
SGCoreImpl_FSGHandInterpolatorImpl_ctor(&OutHandInterpolatorImplContainer);
@@ -238,11 +272,11 @@ USGHandInterpolator::USGHandInterpolator()
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
@@ -257,11 +291,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
@@ -280,11 +314,11 @@ USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>&
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FQuat& CmcStartRotation)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
@@ -298,14 +332,35 @@ USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet
Pimpl->SyncUProperties();
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FQuat& CmcStartRotation)
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FRotator& CmcStartRotation)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
Pimpl->SyncUProperties();
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FQuat& CmcStartRotation)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
@@ -322,13 +377,37 @@ USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>&
Pimpl->SyncUProperties();
}
USGHandInterpolator::USGHandInterpolator(const FSGHandInterpolatorImpl& HandInterpolatorImpl)
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FRotator& CmcStartRotation)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
Pimpl->SyncUProperties();
}
USGHandInterpolator::USGHandInterpolator(const FSGHandInterpolatorImpl& HandInterpolatorImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetHandInterpolatorImpl(HandInterpolatorImpl);
Pimpl->SyncUProperties();
@@ -365,7 +444,7 @@ TArray<TArray<USGInterpolationSet*>> USGHandInterpolator::GetJointInterpolations
return JointInterpolations;
}
FQuat USGHandInterpolator::GetCmcStartRotation() const
FQuat USGHandInterpolator::GetCmcStartRotationQ() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
@@ -373,6 +452,14 @@ FQuat USGHandInterpolator::GetCmcStartRotation() const
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGHandInterpolator::GetCmcStartRotation() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetCmcStartRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const int32 Movement, const float Value) const
{
Pimpl->SyncImplObject();
@@ -36,7 +36,9 @@
#include "SGCore/SGHandPose.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGRotatorArray.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandPoseImpl.h"
#include "SGInterop/SGIC_ESGFinger.h"
@@ -114,6 +116,23 @@ USGHandPose* USGHandPose::NewHandPose(
return NewHandPose(Outer, MoveTemp(OutHandPoseImplContainer.HandPoseImpl));
}
USGHandPose* USGHandPose::NewHandPose(
UObject* Outer,
const bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles)
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{FSGArrayUtils::RotatorsToQuats(JointRotations)};
FSGIC_TArray_TArray_FVector HandAnglesContainer{HandAngles};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &HandAnglesContainer);
return NewHandPose(Outer, MoveTemp(OutHandPoseImplContainer.HandPoseImpl));
}
USGHandPose* USGHandPose::NewHandPose(
UObject* Outer,
const bool bRightHanded, const TArray<FSGVectorArray>& JointPositions, const TArray<FSGQuatArray>& JointRotations,
@@ -121,13 +140,36 @@ USGHandPose* USGHandPose::NewHandPose(
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::FromBPNestedArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
FSGArrayUtils::FromNestedBPArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector HandAnglesContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &HandAnglesContainer);
return NewHandPose(Outer, MoveTemp(OutHandPoseImplContainer.HandPoseImpl));
}
USGHandPose* USGHandPose::NewHandPose(
UObject* Outer,
const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions, const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles)
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::RotatorsToQuats<FSGRotatorArray, &FSGRotatorArray::RotatorArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector HandAnglesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
@@ -243,11 +285,11 @@ USGHandPose* USGHandPose::Fist(UObject* Outer, const bool bRightHanded)
USGHandPose::USGHandPose()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
SGCoreImpl_FSGHandPoseImpl_ctor(&OutHandPoseImplContainer);
@@ -256,14 +298,15 @@ USGHandPose::USGHandPose()
Pimpl->SyncUProperties();
}
USGHandPose::USGHandPose(const bool bRightHanded, const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FQuat>>& JointRotations, const TArray<TArray<FVector>>& HandAngles)
USGHandPose::USGHandPose(const bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
@@ -277,24 +320,75 @@ USGHandPose::USGHandPose(const bool bRightHanded, const TArray<TArray<FVector>>&
Pimpl->SyncUProperties();
}
USGHandPose::USGHandPose(const bool bRightHanded, const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGQuatArray>& JointRotations, const TArray<FSGVectorArray>& HandAngles)
USGHandPose::USGHandPose(const bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{FSGArrayUtils::RotatorsToQuats(JointRotations)};
FSGIC_TArray_TArray_FVector HandAnglesContainer{HandAngles};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &HandAnglesContainer);
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
Pimpl->SyncUProperties();
}
USGHandPose::USGHandPose(const bool bRightHanded, const
TArray<FSGVectorArray>& JointPositions, const TArray<FSGQuatArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::FromBPNestedArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
FSGArrayUtils::FromNestedBPArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector HandAnglesContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &HandAnglesContainer);
Pimpl->HandPoseImpl = MoveTemp(OutHandPoseImplContainer.HandPoseImpl);
Pimpl->SyncUProperties();
}
USGHandPose::USGHandPose(const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions, const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandPoseImpl OutHandPoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::RotatorsToQuats<FSGRotatorArray, &FSGRotatorArray::RotatorArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector HandAnglesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(HandAngles)
};
SGCoreImpl_FSGHandPoseImpl_ctor_bRightHanded_JointPositions_JointRotations_HandAngles(
&OutHandPoseImplContainer, bRightHanded, &JointPositionsContainer,
@@ -306,11 +400,11 @@ USGHandPose::USGHandPose(const bool bRightHanded, const TArray<FSGVectorArray>&
USGHandPose::USGHandPose(const FSGHandPoseImpl& HandPoseImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetHandPoseImpl(HandPoseImpl);
Pimpl->SyncUProperties();
@@ -346,7 +440,7 @@ TArray<TArray<FVector>> USGHandPose::GetJointPositions() const
return MoveTemp(OutPositionsContainer.Array);
}
TArray<TArray<FQuat>> USGHandPose::GetJointRotations() const
TArray<TArray<FQuat>> USGHandPose::GetJointRotationsQ() const
{
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_TArray_FQuat OutRotationsContainer;
@@ -354,6 +448,14 @@ TArray<TArray<FQuat>> USGHandPose::GetJointRotations() const
return MoveTemp(OutRotationsContainer.Array);
}
TArray<TArray<FRotator>> USGHandPose::GetJointRotations() const
{
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_TArray_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGHandPoseImpl_GetJointRotations(&InstanceContainer, &OutRotationsContainer);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
TArray<TArray<FVector>> USGHandPose::GetHandAngles() const
{
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
@@ -37,6 +37,8 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
@@ -185,11 +187,11 @@ void USGHandProfile::ResetCalibration(const bool bOnDisk)
USGHandProfile::USGHandProfile()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
@@ -202,11 +204,11 @@ USGHandProfile::USGHandProfile(const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
@@ -222,11 +224,11 @@ USGHandProfile::USGHandProfile(const bool bRightHanded,
USGHandProfile::USGHandProfile(const FSGHandProfileImpl& HandProfileImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetHandProfileImpl(HandProfileImpl);
Pimpl->SyncUProperties();
@@ -156,11 +156,11 @@ bool USGHapticGlove::GetGlove(UObject* Outer, const bool bRightHanded, USGHaptic
USGHapticGlove::USGHapticGlove()
: USGDevice(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGBetaDeviceImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -171,88 +171,88 @@ USGHapticGlove::USGHapticGlove()
USGHapticGlove::USGHapticGlove(const FSGDeviceImpl& SGDeviceImpl)
: USGDevice(SGDeviceImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(const FSGHapticGloveImpl& HapticGloveImpl)
: USGDevice(HapticGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(const FSGNovaGloveImpl& NovaGloveImpl)
: USGDevice(NovaGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(const FSGSenseGloveImpl& SenseGloveImpl)
: USGDevice(SenseGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
: USGDevice(MoveTemp(SGDeviceImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
: USGDevice(MoveTemp(HapticGloveImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
: USGDevice(MoveTemp(NovaGloveImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGHapticGlove::USGHapticGlove(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
: USGDevice(MoveTemp(SenseGloveImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -349,6 +349,24 @@ bool USGHapticGlove::GetImuRotation(FQuat& OutImu)
return bResult;
}
bool USGHapticGlove::GetImuRotation(FRotator& OutImu)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FQuat OutImuContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
SyncUProperties();
if (bResult)
{
OutImu = OutImuContainer.Quat.Rotator();
}
return bResult;
}
bool USGHapticGlove::GetHandPose(
UObject* Outer,
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
@@ -628,6 +646,28 @@ void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FQ
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGHapticGloveImpl_GetWristLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
@@ -651,6 +691,29 @@ void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FQ
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGHapticGloveImpl_GetGloveLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
USGHapticGlove::FImpl::FImpl(USGHapticGlove* InOwner)
: Owner(InOwner)
{
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGCalibrationStage.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
@@ -176,11 +177,11 @@ bool USGHapticGloveCalibrationCheck::MatchesLast(const TArray<FVector>& CurrentR
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor(&OutHapticGloveCalibrationCheckImplContainer);
@@ -192,11 +193,11 @@ USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck()
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(const USGSensorRange* LastCalibrationRange)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
FSGIC_FSGSensorRangeImpl LastCalibrationRangeContainer{LastCalibrationRange->ToSensorRangeImpl()};
@@ -211,11 +212,11 @@ USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(const USGSensorRa
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(
const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetHapticGloveCalibrationCheckImpl(HapticGloveCalibrationCheckImpl);
Pimpl->SyncUProperties();
@@ -37,6 +37,11 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGCalibrationDataPoint.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
@@ -150,11 +155,11 @@ bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -165,11 +170,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence()
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
@@ -183,11 +188,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(const USGHa
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
const FSGHapticGloveCalibrationSequenceImpl& HapticGloveCalibrationSequenceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveCalibrationSequenceImpl RhsContainer{HapticGloveCalibrationSequenceImpl};
@@ -201,11 +206,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveQuickCalibrationImpl RhsContainer{HapticGloveQuickCalibrationImpl};
@@ -219,11 +224,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveCalibrationSequenceImpl);
Pimpl->SyncUProperties();
@@ -232,11 +237,11 @@ USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveQuickCalibrationImpl);
Pimpl->SyncUProperties();
@@ -123,11 +123,11 @@ int32 USGHapticGloveCommandBuffer::GetMaxThumpCommands()
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGHapticGloveCommandBufferImpl OutHapticGloveCommandBufferImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ctor(&OutHapticGloveCommandBufferImplContainer);
@@ -140,11 +140,11 @@ USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer()
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer(
const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetHapticGloveCommandBufferImpl(HapticGloveCommandBufferImpl);
Pimpl->SyncUProperties();
@@ -35,6 +35,7 @@
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
@@ -126,11 +126,11 @@ float USGHapticGloveQuickCalibration::GetDefaultAutoEndTimeout()
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration()
: USGHapticGloveCalibrationSequence(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -142,11 +142,11 @@ USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration()
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
const USGHapticGlove* GloveToCalibrate, const float AutoEndTimeout)
: USGHapticGloveCalibrationSequence(GloveToCalibrate),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl GloveToCalibrateContainer{GloveToCalibrate->ToHapticGloveImpl()};
@@ -160,11 +160,11 @@ USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
: USGHapticGloveCalibrationSequence(HapticGloveQuickCalibrationImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -172,11 +172,11 @@ USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
: USGHapticGloveCalibrationSequence(MoveTemp(HapticGloveQuickCalibrationImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -126,11 +126,11 @@ USGInterpolationSet* USGInterpolationSet::Deserialize(UObject* Outer, const FStr
USGInterpolationSet::USGInterpolationSet()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
SGCoreImpl_FSGInterpolationSetImpl_ctor(&OutInterpolationSetImplContainer);
@@ -141,11 +141,11 @@ USGInterpolationSet::USGInterpolationSet()
USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, const float To1, const float To2)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
SGCoreImpl_FSGInterpolationSetImpl_ctor_From1_From2_To1_To2(&OutInterpolationSetImplContainer,
@@ -158,11 +158,11 @@ USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, c
USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, const float To1, const float To2,
const float Min, const float Max)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGInterpolationSetImpl OutInterpolationSetImplContainer;
SGCoreImpl_FSGInterpolationSetImpl_ctor_From1_From2_To1_To2_Min_Max(&OutInterpolationSetImplContainer,
@@ -174,11 +174,11 @@ USGInterpolationSet::USGInterpolationSet(const float From1, const float From2, c
USGInterpolationSet::USGInterpolationSet(const FSGInterpolationSetImpl& InterpolationSetImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetInterpolationSetImpl(InterpolationSetImpl);
Pimpl->SyncUProperties();
@@ -54,14 +54,42 @@ bool FSGJointKinematics::ForwardKinematics(
FSGIC_TArray_FVector JointAnglesContainer{JointAngles};
FSGIC_TArray_FVector OutNewPositionsContainer;
FSGIC_TArray_FQuat OutNewRotationsContainer;
return
const bool bResult =
SGCoreImpl_FSGJointKinematicsImpl_ForwardKinematics_StartPosition_StartRotation_JointLengths_JointAngles_OutNewPositions_OutNewRotations(
&StartPositionContainer, &StartRotationContainer, &JointLengthsContainer, &JointAnglesContainer,
&OutNewPositionsContainer, &OutNewRotationsContainer);
OutNewPositions = MoveTemp(OutNewPositionsContainer.Array);
OutNewRotations = MoveTemp(OutNewRotationsContainer.Array);
return bResult;
}
bool FSGJointKinematics::ForwardKinematics(
const USGBasicHandModel* Profile, ESGFinger Finger, const TArray<FVector>& JointAngles,
const FVector& StartPosition, const FRotator& StartRotation, const TArray<FVector>& JointLengths,
const TArray<FVector>& JointAngles, TArray<FVector>& OutNewPositions, TArray<FRotator>& OutNewRotations)
{
FSGIC_FVector StartPositionContainer{StartPosition};
FSGIC_FQuat StartRotationContainer{StartRotation.Quaternion()};
FSGIC_TArray_FVector JointLengthsContainer{JointLengths};
FSGIC_TArray_FVector JointAnglesContainer{JointAngles};
FSGIC_TArray_FVector OutNewPositionsContainer;
FSGIC_TArray_FQuat OutNewRotationsContainer;
const bool bResult =
SGCoreImpl_FSGJointKinematicsImpl_ForwardKinematics_StartPosition_StartRotation_JointLengths_JointAngles_OutNewPositions_OutNewRotations(
&StartPositionContainer, &StartRotationContainer, &JointLengthsContainer, &JointAnglesContainer,
&OutNewPositionsContainer, &OutNewRotationsContainer);
OutNewPositions = MoveTemp(OutNewPositionsContainer.Array);
OutNewRotations = FSGArrayUtils::QuatsToRotators(OutNewRotationsContainer.Array);
return bResult;
}
bool FSGJointKinematics::ForwardKinematics(
const USGBasicHandModel* Profile, const ESGFinger Finger, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FQuat>& OutNewRotations)
{
FSGIC_FSGBasicHandModelImpl ProfileContainer{Profile->ToBasicHandModelImpl()};
@@ -69,7 +97,35 @@ bool FSGJointKinematics::ForwardKinematics(
FSGIC_TArray_FVector JointAnglesContainer{JointAngles};
FSGIC_TArray_FVector OutNewPositionsContainer;
FSGIC_TArray_FQuat OutNewRotationsContainer;
return
const bool bResult =
SGCoreImpl_FSGJointKinematicsImpl_ForwardKinematics_Profile_Finger_JointAngles_OutNewPositions_OutNewRotations(
&ProfileContainer, &FingerContainer, &JointAnglesContainer, &OutNewPositions, &OutNewRotations);
&ProfileContainer, &FingerContainer, &JointAnglesContainer,
&OutNewPositionsContainer, &OutNewRotationsContainer);
OutNewPositions = MoveTemp(OutNewPositionsContainer.Array);
OutNewRotations = MoveTemp(OutNewRotationsContainer.Array);
return bResult;
}
bool FSGJointKinematics::ForwardKinematics(
const USGBasicHandModel* Profile, const ESGFinger Finger, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FRotator>& OutNewRotations)
{
FSGIC_FSGBasicHandModelImpl ProfileContainer{Profile->ToBasicHandModelImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_TArray_FVector JointAnglesContainer{JointAngles};
FSGIC_TArray_FVector OutNewPositionsContainer;
FSGIC_TArray_FQuat OutNewRotationsContainer;
const bool bResult =
SGCoreImpl_FSGJointKinematicsImpl_ForwardKinematics_Profile_Finger_JointAngles_OutNewPositions_OutNewRotations(
&ProfileContainer, &FingerContainer, &JointAnglesContainer,
&OutNewPositionsContainer, &OutNewRotationsContainer);
OutNewPositions = MoveTemp(OutNewPositionsContainer.Array);
OutNewRotations = FSGArrayUtils::QuatsToRotators(OutNewRotationsContainer.Array);
return bResult;
}
@@ -37,9 +37,14 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGDeviceImplCast.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGNovaGloveInfo.h"
#include "SGCore/SGNovaGloveSensorData.h"
#include "SGCore/SGThumperCommand.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
@@ -247,6 +252,25 @@ void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, cons
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutGlovePosition, FRotator& OutGloveRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNovaGloveImpl_CalculateGloveLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutWristPosition, FQuat& OutWristRotation)
@@ -266,6 +290,25 @@ void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, cons
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutWristPosition, FRotator& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNovaGloveImpl_CalculateWristLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
FString USGNovaGlove::ToBytes(const USGThumperCommand* ThumperCommand)
{
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
@@ -293,11 +336,11 @@ FString USGNovaGlove::ToBytes(const USGBuzzCommand* BuzzCommand)
USGNovaGlove::USGNovaGlove()
: USGHapticGlove(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGSenseGloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -308,11 +351,11 @@ USGNovaGlove::USGNovaGlove()
USGNovaGlove::USGNovaGlove(const USGNovaGloveInfo& DeviceInfo)
: USGHapticGlove(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
FSGIC_FSGNovaGloveInfoImpl DeviceInfoContainer{DeviceInfo.ToNovaGloveInfoImpl()};
@@ -324,66 +367,66 @@ USGNovaGlove::USGNovaGlove(const USGNovaGloveInfo& DeviceInfo)
USGNovaGlove::USGNovaGlove(const FSGDeviceImpl& SGDeviceImpl)
: USGHapticGlove(SGDeviceImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGNovaGlove::USGNovaGlove(const FSGHapticGloveImpl& HapticGloveImpl)
: USGHapticGlove(HapticGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGNovaGlove::USGNovaGlove(const FSGNovaGloveImpl& NovaGloveImpl)
: USGHapticGlove(NovaGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGDeviceImpl> SGDeviceImpl)
: USGHapticGlove(SGDeviceImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
: USGHapticGlove(HapticGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGNovaGlove::USGNovaGlove(const TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
: USGHapticGlove(NovaGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -521,6 +564,24 @@ bool USGNovaGlove::GetImuRotation(FQuat& OutImu)
return bResult;
}
bool USGNovaGlove::GetImuRotation(FRotator& OutImu)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FQuat OutImuContainer;
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
SyncUProperties();
if (bResult)
{
OutImu = OutImuContainer.Quat.Rotator();
}
return bResult;
}
bool USGNovaGlove::GetHandPose(
UObject* Outer, const USGBasicHandModel* HandModel, const USGNovaGloveHandProfile* Profile,
USGHandPose*& OutHandPose)
@@ -700,6 +761,29 @@ void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FQua
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNovaGloveImpl_GetGloveLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const
@@ -722,6 +806,28 @@ void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FQua
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNovaGloveImpl_GetWristLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
FString USGNovaGlove::ToString() const
{
SyncImplObject();
@@ -35,6 +35,8 @@
#include "SGCore/SGNovaGloveCalibration.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
@@ -107,13 +108,31 @@ USGNovaGloveHandProfile* USGNovaGloveHandProfile::NewNovaGloveHandProfile(
return NewNovaGloveHandProfile(Outer, MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl));
}
USGNovaGloveHandProfile* USGNovaGloveHandProfile::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_Default(&OutNovaGloveHandProfileImplContainer, bRightHanded);
return NewNovaGloveHandProfile(Outer, MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl));
}
USGNovaGloveHandProfile* USGNovaGloveHandProfile::Deserialize(UObject* Outer, const FString& SerializedString)
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGNovaGloveHandProfileImpl_Deserialize(&OutNovaGloveHandProfileImplContainer,
&SerializedStringContainer);
return NewNovaGloveHandProfile(Outer, MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl));
}
USGNovaGloveHandProfile::USGNovaGloveHandProfile()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor(&OutNovaGloveHandProfileImplContainer);
@@ -124,11 +143,11 @@ USGNovaGloveHandProfile::USGNovaGloveHandProfile()
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const bool bRightHanded, const USGHandInterpolator* Interpolator)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
@@ -141,11 +160,11 @@ USGNovaGloveHandProfile::USGNovaGloveHandProfile(const bool bRightHanded, const
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetNovaGloveHandProfileImpl(NovaGloveHandProfileImpl);
Pimpl->SyncUProperties();
@@ -135,11 +135,11 @@ USGNovaGloveInfo* USGNovaGloveInfo::Deserialize(UObject* Outer, const FString& S
USGNovaGloveInfo::USGNovaGloveInfo()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveInfoImpl OutNovaGloveInfoImplContainer;
SGCoreImpl_FSGNovaGloveInfoImpl_ctor(&OutNovaGloveInfoImplContainer);
@@ -153,11 +153,11 @@ USGNovaGloveInfo::USGNovaGloveInfo(
const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion,
const bool bRightHanded, const FQuat& ImuCorrection, const int32 NumberOfSensors)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveInfoImpl OutNovaGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
@@ -174,11 +174,11 @@ USGNovaGloveInfo::USGNovaGloveInfo(
USGNovaGloveInfo::USGNovaGloveInfo(const FSGNovaGloveInfoImpl& NovaGloveInfoImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetNovaGloveInfoImpl(NovaGloveInfoImpl);
Pimpl->SyncUProperties();
@@ -240,7 +240,7 @@ bool USGNovaGloveInfo::IsRight() const
return SGCoreImpl_FSGNovaGloveInfoImpl_IsRight(&InstanceContainer);
}
FQuat USGNovaGloveInfo::GetImuCorrection() const
FQuat USGNovaGloveInfo::GetImuCorrectionQ() const
{
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
FSGIC_FQuat OutCorrectionContainer;
@@ -248,6 +248,14 @@ FQuat USGNovaGloveInfo::GetImuCorrection() const
return MoveTemp(OutCorrectionContainer.Quat);
}
FRotator USGNovaGloveInfo::GetImuCorrection() const
{
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
FSGIC_FQuat OutCorrectionContainer;
SGCoreImpl_FSGNovaGloveInfoImpl_GetImuCorrection(&InstanceContainer, &OutCorrectionContainer);
return OutCorrectionContainer.Quat.Rotator();
}
int32 USGNovaGloveInfo::GetNumberOfSensors() const
{
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGNovaGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNovaGloveSensorDataImpl.h"
#include "SGInterop/SGIC_FQuat.h"
@@ -111,6 +112,20 @@ USGNovaGloveSensorData* USGNovaGloveSensorData::NewNovaGloveSensorData(
return NewNovaGloveSensorData(Outer, MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl));
}
USGNovaGloveSensorData* USGNovaGloveSensorData::NewNovaGloveSensorData(
UObject* Outer, const TArray<FVector>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed, const float BatteryLevel, const bool bCharging)
{
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
FSGIC_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNovaGloveSensorDataImpl_ctor_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNovaGloveSensorDataImplContainer, &ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
return NewNovaGloveSensorData(Outer, MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl));
}
USGNovaGloveSensorData* USGNovaGloveSensorData::Empty(UObject* Outer)
{
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
@@ -142,11 +157,11 @@ USGNovaGloveSensorData* USGNovaGloveSensorData::Deserialize(UObject* Outer, cons
USGNovaGloveSensorData::USGNovaGloveSensorData()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
SGCoreImpl_FSGNovaGloveSensorDataImpl_ctor(&OutNovaGloveSensorDataImplContainer);
@@ -159,11 +174,11 @@ USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, co
const FQuat& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
FSGIC_TArray_FVector ValuesContainer{Values};
@@ -176,13 +191,34 @@ USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, co
Pimpl->SyncUProperties();
}
USGNovaGloveSensorData::USGNovaGloveSensorData(const FSGNovaGloveSensorDataImpl& NovaGloveSensorDataImpl)
USGNovaGloveSensorData::USGNovaGloveSensorData(const TArray<FVector>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGNovaGloveSensorDataImpl OutNovaGloveSensorDataImplContainer;
FSGIC_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNovaGloveSensorDataImpl_ctor_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNovaGloveSensorDataImplContainer, &ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
Pimpl->NovaGloveSensorDataImpl = MoveTemp(OutNovaGloveSensorDataImplContainer.NovaGloveSensorDataImpl);
Pimpl->SyncUProperties();
}
USGNovaGloveSensorData::USGNovaGloveSensorData(const FSGNovaGloveSensorDataImpl& NovaGloveSensorDataImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetNovaGloveSensorDataImpl(NovaGloveSensorDataImpl);
Pimpl->SyncUProperties();
@@ -212,7 +248,7 @@ TArray<FVector> USGNovaGloveSensorData::GetSensorValues() const
return MoveTemp(OutValuesContainer.Array);
}
FQuat USGNovaGloveSensorData::GetImuRotation() const
FQuat USGNovaGloveSensorData::GetImuRotationQ() const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
@@ -220,6 +256,14 @@ FQuat USGNovaGloveSensorData::GetImuRotation() const
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGNovaGloveSensorData::GetImuRotation() const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGNovaGloveSensorDataImpl_GetImuRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
int32 USGNovaGloveSensorData::GetParsedValues() const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGRotatorArray.h"
@@ -47,6 +47,7 @@
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_ESGSenseGloveThumperCommand.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGBasicHandModelImpl.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
@@ -276,6 +277,28 @@ void USGSenseGlove::CalculateGloveLocation(const FVector& ReferencePosition, con
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGSenseGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
const bool bRightHanded, const ESGFinger MountedOn,
FVector& OutGlovePosition, FRotator& OutGloveRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_ESGFinger MountedOnContainer{MountedOn};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_CalculateGloveLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
bRightHanded, &MountedOnContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGSenseGlove::CalculateWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
const bool bRightHanded, const ESGFinger MountedOn,
@@ -303,13 +326,40 @@ void USGSenseGlove::CalculateWristLocation(const FVector& ReferencePosition, con
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGSenseGlove::CalculateWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
const bool bRightHanded, const ESGFinger MountedOn,
const FVector& GloveWristPositionOffset,
const FRotator& GloveWristRotationOffset,
FVector& OutWristPosition, FRotator& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_ESGFinger MountedOnContainer{MountedOn};
FSGIC_FVector GloveWristPositionOffsetContainer{GloveWristPositionOffset};
FSGIC_FQuat GloveWristRotationOffsetContainer{GloveWristRotationOffset.Quaternion()};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_CalculateWristLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
bRightHanded, &MountedOnContainer,
&GloveWristPositionOffsetContainer, &GloveWristRotationOffsetContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
USGSenseGlove::USGSenseGlove()
: USGHapticGlove(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGSenseGloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
@@ -320,11 +370,11 @@ USGSenseGlove::USGSenseGlove()
USGSenseGlove::USGSenseGlove(const USGSenseGloveInfo& Model)
: USGHapticGlove(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGSenseGloveImpl OutSharedPtrContainer;
FSGIC_FSGSenseGloveInfoImpl ModelContainer{Model.ToSenseGloveInfoImpl()};
@@ -336,66 +386,66 @@ USGSenseGlove::USGSenseGlove(const USGSenseGloveInfo& Model)
USGSenseGlove::USGSenseGlove(const FSGDeviceImpl& SGDeviceImpl)
: USGHapticGlove(SGDeviceImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGSenseGlove::USGSenseGlove(const FSGHapticGloveImpl& HapticGloveImpl)
: USGHapticGlove(HapticGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGSenseGlove::USGSenseGlove(const FSGSenseGloveImpl& SenseGloveImpl)
: USGHapticGlove(SenseGloveImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGSenseGlove::USGSenseGlove(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
: USGHapticGlove(MoveTemp(SGDeviceImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGSenseGlove::USGSenseGlove(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
: USGHapticGlove(MoveTemp(HapticGloveImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGSenseGlove::USGSenseGlove(TSharedRef<FSGSenseGloveImpl> SenseGloveImpl)
: USGHapticGlove(MoveTemp(SenseGloveImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -520,6 +570,24 @@ bool USGSenseGlove::GetImuRotation(FQuat& OutImu)
return bResult;
}
bool USGSenseGlove::GetImuRotation(FRotator& OutImu)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FQuat OutImuContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
SyncUProperties();
if (bResult)
{
OutImu = OutImuContainer.Quat.Rotator();
}
return bResult;
}
bool USGSenseGlove::GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePose)
{
SyncImplObject();
@@ -625,13 +693,50 @@ bool USGSenseGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfil
return bResult;
}
bool USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, const USGBuzzCommand* BuzzCommand,
ESGSenseGloveThumperCommand ThumperCommand)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{
BuzzCommand->ToBuzzCommandImpl().Get()
};
FSGIC_ESGSenseGloveThumperCommand ThumperCommandContainer{ThumperCommand};
const bool bResult =
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ESenseGloveThumperCommand(
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
SyncUProperties();
return bResult;
}
bool USGSenseGlove::SendHaptics(ESGSenseGloveThumperCommand ThumperCommand)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_ESGSenseGloveThumperCommand ThumperCommandContainer{ThumperCommand};
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ThumperCommand(
&InstanceContainer, &ThumperCommandContainer);
SyncUProperties();
return bResult;
}
void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand)
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
};
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
SyncUProperties();
@@ -656,7 +761,8 @@ void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackComm
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
@@ -738,6 +844,29 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQu
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_GetGloveLocation_ReferencePosition_ReferenceRotation_TrackingHardware_OutGlovePosition_OutGloveRotation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const ESGFinger MountedOn,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
@@ -762,6 +891,30 @@ void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQu
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const ESGFinger MountedOn,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_ESGFinger MountedOnContainer{MountedOn};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_GetGloveLocation_ReferencePosition_ReferenceRotation_TrackingHardware_MountedOn_OutGlovePosition_OutGloveRotation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, &MountedOnContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const
@@ -784,6 +937,28 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQu
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_GetWristLocation_ReferencePosition_ReferenceRotation_TrackingHardware_OutWristPosition_OutWristRotation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
const FVector& GloveWristPositionOffset,
@@ -811,6 +986,33 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FQu
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
const FVector& GloveWristPositionOffset,
const FRotator& GloveWristRotationOffset,
FVector& OutWristPosition, FRotator& OutWristRotation) const
{
SyncImplObject();
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector GloveWristPositionOffsetContainer{GloveWristPositionOffset};
FSGIC_FQuat GloveWristRotationOffsetContainer{GloveWristRotationOffset.Quaternion()};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGSenseGloveImpl_GetWristLocation_ReferencePosition_ReferenceRotation_TrackingHardware_GloveWristPositionOffset_GloveWristRotationOffset_OutWristPosition_OutWristRotation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&GloveWristPositionOffsetContainer, &GloveWristRotationOffsetContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
FString USGSenseGlove::ToString() const
{
SyncImplObject();
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_ESGFingerSolver.h"
@@ -142,11 +143,11 @@ FVector USGSenseGloveHandProfile::GetDefaultThimbleOffset()
USGSenseGloveHandProfile::USGSenseGloveHandProfile()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor(&OutSenseGloveHandProfileImplContainer);
@@ -159,11 +160,11 @@ USGSenseGloveHandProfile::USGSenseGloveHandProfile(const bool bRightHanded, cons
const ESGThumbSolver ThumbSolver, const ESGFingerSolver FingerSolver,
const TArray<FVector>& FingerThimbleOffset)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
@@ -180,11 +181,11 @@ USGSenseGloveHandProfile::USGSenseGloveHandProfile(const bool bRightHanded, cons
USGSenseGloveHandProfile::USGSenseGloveHandProfile(const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetSenseGloveHandProfileImpl(SenseGloveHandProfileImpl);
Pimpl->SyncUProperties();
@@ -101,9 +101,9 @@ USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer)
}
USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion,
int32 SubFirmwareVersion, bool bRightHanded,
int32 NumberOfSensors, const FQuat& ImuCorrection,
const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion, const bool bRightHanded,
const int32 NumberOfSensors, const FQuat& ImuCorrection,
const TArray<FVector>& StartPositions,
const TArray<FQuat>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths,
@@ -128,9 +128,36 @@ USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FS
}
USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion,
int32 SubFirmwareVersion, bool bRightHanded,
int32 NumberOfSensors, const FQuat& ImuCorrection,
const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion, const bool bRightHanded,
const int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions,
const TArray<FRotator>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths,
const TArray<bool>& Functions)
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FQuat ImuCorrectionContainer{ImuCorrection.Quaternion()};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{GloveLengths};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
&OutSenseGloveInfoImplContainer,
&DeviceIdContainer, &HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion,
bRightHanded, NumberOfSensors, &ImuCorrectionContainer,
&StartPositionsContainer, &StartRotationsContainer,
&GloveLengthsContainer, &FunctionsContainer);
return NewSenseGloveInfo(Outer, MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl));
}
USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion, const bool bRightHanded,
const int32 NumberOfSensors, const FQuat& ImuCorrection,
const TArray<FVector>& StartPositions,
const TArray<FQuat>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths,
@@ -143,7 +170,36 @@ USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FS
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{StartRotations};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
&OutSenseGloveInfoImplContainer,
&DeviceIdContainer, &HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion,
bRightHanded, NumberOfSensors, &ImuCorrectionContainer,
&StartPositionsContainer, &StartRotationsContainer,
&GloveLengthsContainer, &FunctionsContainer);
return NewSenseGloveInfo(Outer, MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl));
}
USGSenseGloveInfo* USGSenseGloveInfo::NewSenseGloveInfo(UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion, const bool bRightHanded,
const int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions,
const TArray<FRotator>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths,
const TArray<bool>& Functions)
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FQuat ImuCorrectionContainer{ImuCorrection.Quaternion()};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
@@ -183,11 +239,11 @@ USGSenseGloveInfo* USGSenseGloveInfo::Deserialize(UObject* Outer, const FString&
USGSenseGloveInfo::USGSenseGloveInfo()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
SGCoreImpl_FSGSenseGloveInfoImpl_ctor(&OutSenseGloveInfoImplContainer);
@@ -203,11 +259,11 @@ USGSenseGloveInfo::USGSenseGloveInfo(
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
@@ -228,6 +284,38 @@ USGSenseGloveInfo::USGSenseGloveInfo(
Pimpl->SyncUProperties();
}
USGSenseGloveInfo::USGSenseGloveInfo(
const FString& DeviceId,
const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion,
const bool bRightHanded, const int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FQuat ImuCorrectionContainer{ImuCorrection.Quaternion()};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{GloveLengths};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
&OutSenseGloveInfoImplContainer,
&DeviceIdContainer, &HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion,
bRightHanded, NumberOfSensors, &ImuCorrectionContainer,
&StartPositionsContainer, &StartRotationsContainer,
&GloveLengthsContainer, &FunctionsContainer);
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
Pimpl->SyncUProperties();
}
USGSenseGloveInfo::USGSenseGloveInfo(
const FString& DeviceId,
const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion,
@@ -242,7 +330,35 @@ USGSenseGloveInfo::USGSenseGloveInfo(
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{StartRotations};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
&OutSenseGloveInfoImplContainer,
&DeviceIdContainer, &HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion,
bRightHanded, NumberOfSensors, &ImuCorrectionContainer,
&StartPositionsContainer, &StartRotationsContainer,
&GloveLengthsContainer, &FunctionsContainer);
Pimpl->SenseGloveInfoImpl = MoveTemp(OutSenseGloveInfoImplContainer.SenseGloveInfoImpl);
Pimpl->SyncUProperties();
}
USGSenseGloveInfo::USGSenseGloveInfo(
const FString& DeviceId,
const FString& HardwareVersion, const int32 FirmwareVersion, const int32 SubFirmwareVersion,
const bool bRightHanded, const int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths, const TArray<bool>& Functions)
{
FSGIC_FSGSenseGloveInfoImpl OutSenseGloveInfoImplContainer;
FSGIC_FString DeviceIdContainer{DeviceId};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FQuat ImuCorrectionContainer{ImuCorrection.Quaternion()};
FSGIC_TArray_FVector StartPositionsContainer{StartPositions};
FSGIC_TArray_FQuat StartRotationsContainer{FSGArrayUtils::RotatorsToQuats(StartRotations)};
FSGIC_TArray_TArray_FVector GloveLengthsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveLengths)
};
FSGIC_TArray_bool FunctionsContainer{Functions};
SGCoreImpl_FSGSenseGloveInfoImpl_ctor_DeviceId_HardwareVersion_FirmwareVersion_SubFirmwareVersion_bRightHanded_NumberOfSensors_ImuCorrection_StartPositions_StartRotations_GloveLengths_Functions(
@@ -258,11 +374,11 @@ USGSenseGloveInfo::USGSenseGloveInfo(
USGSenseGloveInfo::USGSenseGloveInfo(const FSGSenseGloveInfoImpl& SenseGloveInfoImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetSenseGloveInfoImpl(SenseGloveInfoImpl);
Pimpl->SyncUProperties();
@@ -330,7 +446,7 @@ int32 USGSenseGloveInfo::GetNumberOfSensors() const
return SGCoreImpl_FSGSenseGloveInfoImpl_GetNumberOfSensors(&InstanceContainer);
}
FQuat USGSenseGloveInfo::GetImuCorrection() const
FQuat USGSenseGloveInfo::GetImuCorrectionQ() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_FQuat OutCorrectionContainer;
@@ -338,6 +454,14 @@ FQuat USGSenseGloveInfo::GetImuCorrection() const
return MoveTemp(OutCorrectionContainer.Quat);
}
FRotator USGSenseGloveInfo::GetImuCorrection() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_FQuat OutCorrectionContainer;
SGCoreImpl_FSGSenseGloveInfoImpl_GetImuCorrection(&InstanceContainer, &OutCorrectionContainer);
return OutCorrectionContainer.Quat.Rotator();
}
TArray<FVector> USGSenseGloveInfo::GetStartPositions() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
@@ -346,7 +470,7 @@ TArray<FVector> USGSenseGloveInfo::GetStartPositions() const
return MoveTemp(OutPositionsContainer.Array);
}
TArray<FQuat> USGSenseGloveInfo::GetStartRotations() const
TArray<FQuat> USGSenseGloveInfo::GetStartRotationsQ() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
@@ -354,6 +478,14 @@ TArray<FQuat> USGSenseGloveInfo::GetStartRotations() const
return MoveTemp(OutRotationsContainer.Array);
}
TArray<FRotator> USGSenseGloveInfo::GetStartRotations() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGSenseGloveInfoImpl_GetStartRotations(&InstanceContainer, &OutRotationsContainer);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
TArray<TArray<FVector>> USGSenseGloveInfo::GetGloveLengths() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
@@ -381,7 +513,7 @@ FVector USGSenseGloveInfo::GetStartPosition(const ESGFinger Finger) const
return MoveTemp(OutPositionContainer.Vector);
}
FQuat USGSenseGloveInfo::GetStartRotation(const ESGFinger Finger) const
FQuat USGSenseGloveInfo::GetStartRotationQ(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
@@ -392,6 +524,17 @@ FQuat USGSenseGloveInfo::GetStartRotation(const ESGFinger Finger) const
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGSenseGloveInfo::GetStartRotation(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_FQuat OutRotationContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGSenseGloveInfoImpl_GetStartRotation(&InstanceContainer, &OutRotationContainer, &FingerContainer);
return OutRotationContainer.Quat.Rotator();
}
TArray<FVector> USGSenseGloveInfo::GetGloveLengths(const ESGFinger Finger) const
{
Pimpl->SyncImplObject();
@@ -37,6 +37,8 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCore/SGSenseGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGlovePoseImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
@@ -115,6 +117,22 @@ USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const bo
return NewSenseGlovePose(Outer, MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl));
}
USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles)
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{FSGArrayUtils::RotatorsToQuats(JointRotations)};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{GloveAngles};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &GloveAnglesContainer);
return NewSenseGlovePose(Outer, MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl));
}
USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGQuatArray>& JointRotations,
@@ -122,13 +140,35 @@ USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const bo
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::FromBPNestedArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
FSGArrayUtils::FromNestedBPArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &GloveAnglesContainer);
return NewSenseGlovePose(Outer, MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl));
}
USGSenseGlovePose* USGSenseGlovePose::NewSenseGlovePose(UObject* Outer, const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles)
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::RotatorsToQuats<FSGRotatorArray, &FSGRotatorArray::RotatorArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
@@ -157,11 +197,11 @@ USGSenseGlovePose* USGSenseGlovePose::Deserialize(UObject* Outer, const FString&
USGSenseGlovePose::USGSenseGlovePose()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
SGCoreImpl_FSGSenseGlovePoseImpl_ctor(&OutSenseGlovePoseImplContainer);
@@ -175,11 +215,11 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
@@ -193,6 +233,29 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
Pimpl->SyncUProperties();
}
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{JointPositions};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{FSGArrayUtils::RotatorsToQuats(JointRotations)};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{GloveAngles};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &GloveAnglesContainer);
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
Pimpl->SyncUProperties();
}
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGQuatArray>& JointRotations,
@@ -200,13 +263,36 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::FromBPNestedArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
FSGArrayUtils::FromNestedBPArray<FQuat, FSGQuatArray, &FSGQuatArray::QuatArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{
FSGArrayUtils::FromBPNestedArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
&JointRotationsContainer, &GloveAnglesContainer);
Pimpl->SenseGlovePoseImpl = MoveTemp(OutSenseGlovePoseImplContainer.SenseGlovePoseImpl);
Pimpl->SyncUProperties();
}
USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles)
{
FSGIC_FSGSenseGlovePoseImpl OutSenseGlovePoseImplContainer;
FSGIC_TArray_TArray_FVector JointPositionsContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(JointPositions)
};
FSGIC_TArray_TArray_FQuat JointRotationsContainer{
FSGArrayUtils::RotatorsToQuats<FSGRotatorArray, &FSGRotatorArray::RotatorArray>(JointRotations)
};
FSGIC_TArray_TArray_FVector GloveAnglesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(GloveAngles)
};
SGCoreImpl_FSGSenseGlovePoseImpl_ctor_bRightHanded_JointPositions_JointRotations_GloveAngles(
&OutSenseGlovePoseImplContainer, bRightHanded, &JointPositionsContainer,
@@ -218,11 +304,11 @@ USGSenseGlovePose::USGSenseGlovePose(const bool bRightHanded,
USGSenseGlovePose::USGSenseGlovePose(const FSGSenseGlovePoseImpl& SenseGlovePoseImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetSenseGlovePoseImpl(SenseGlovePoseImpl);
Pimpl->SyncUProperties();
@@ -258,7 +344,7 @@ TArray<TArray<FVector>> USGSenseGlovePose::GetJointPositions() const
return MoveTemp(OutPositionsContainer.Array);
}
TArray<TArray<FQuat>> USGSenseGlovePose::GetJointRotations() const
TArray<TArray<FQuat>> USGSenseGlovePose::GetJointRotationsQ() const
{
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
FSGIC_TArray_TArray_FQuat OutRotationsContainer;
@@ -266,6 +352,14 @@ TArray<TArray<FQuat>> USGSenseGlovePose::GetJointRotations() const
return MoveTemp(OutRotationsContainer.Array);
}
TArray<TArray<FRotator>> USGSenseGlovePose::GetJointRotations() const
{
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
FSGIC_TArray_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGSenseGlovePoseImpl_GetJointRotations(&InstanceContainer, &OutRotationsContainer);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
TArray<TArray<FVector>> USGSenseGlovePose::GetGloveAngles() const
{
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
@@ -284,7 +378,7 @@ TArray<FVector> USGSenseGlovePose::GetThimblePositions() const
return MoveTemp(OutPositionsContainer.Array);
}
TArray<FQuat> USGSenseGlovePose::GetThimbleRotations() const
TArray<FQuat> USGSenseGlovePose::GetThimbleRotationsQ() const
{
Pimpl->SyncImplObject();
@@ -294,6 +388,16 @@ TArray<FQuat> USGSenseGlovePose::GetThimbleRotations() const
return MoveTemp(OutRotationsContainer.Array);
}
TArray<FRotator> USGSenseGlovePose::GetThimbleRotations() const
{
Pimpl->SyncImplObject();
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
FSGIC_TArray_FQuat OutRotationsContainer;
SGCoreImpl_FSGSenseGlovePoseImpl_GetThimbleRotations(&InstanceContainer, &OutRotationsContainer);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
TArray<FVector> USGSenseGlovePose::GetTotalGloveAngles() const
{
Pimpl->SyncImplObject();
@@ -112,13 +112,26 @@ USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
return NewSenseGloveSensorData(Outer, MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl));
}
USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
UObject* Outer, const TArray<TArray<float>>& SensorAngles,
const FRotator& ImuRotation, const int32 ParsedValues, const bool bImuParsed)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
return NewSenseGloveSensorData(Outer, MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl));
}
USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
UObject* Outer, const TArray<FSGFloatArray>& SensorAngles,
const FQuat& ImuRotation, const int32 ParsedValues, const bool bImuParsed)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
@@ -127,6 +140,21 @@ USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
return NewSenseGloveSensorData(Outer, MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl));
}
USGSenseGloveSensorData* USGSenseGloveSensorData::NewSenseGloveSensorData(
UObject* Outer, const TArray<FSGFloatArray>& SensorAngles,
const FRotator& ImuRotation, const int32 ParsedValues, const bool bImuParsed)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
return NewSenseGloveSensorData(Outer, MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl));
}
USGSenseGloveSensorData* USGSenseGloveSensorData::Empty(UObject* Outer)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
@@ -159,11 +187,11 @@ USGSenseGloveSensorData* USGSenseGloveSensorData::Deserialize(UObject* Outer, co
USGSenseGloveSensorData::USGSenseGloveSensorData()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor(&OutSenseGloveSensorDataImplContainer);
@@ -175,11 +203,11 @@ USGSenseGloveSensorData::USGSenseGloveSensorData()
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles, const FQuat& ImuRotation,
const int32 ParsedValues, const bool bImuParsed)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
@@ -191,12 +219,31 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& Se
Pimpl->SyncUProperties();
}
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles, const FRotator& ImuRotation,
const int32 ParsedValues, const bool bImuParsed)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{SensorAngles};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
Pimpl->SyncUProperties();
}
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles, const FQuat& ImuRotation,
const int32 ParsedValues, const bool bImuParsed)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{
FSGArrayUtils::FromBPNestedArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
@@ -206,13 +253,28 @@ USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& Se
Pimpl->SyncUProperties();
}
USGSenseGloveSensorData::USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles, const FRotator& ImuRotation,
const int32 ParsedValues, const bool bImuParsed)
{
FSGIC_FSGSenseGloveSensorDataImpl OutSenseGloveSensorDataImplContainer;
FSGIC_TArray_TArray_float SensorAnglesContainer{
FSGArrayUtils::FromNestedBPArray<float, FSGFloatArray, &FSGFloatArray::FloatArray>(SensorAngles)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGSenseGloveSensorDataImpl_ctor_SensorAngles_ImuRotation_ParsedValues_bImuParsed(
&OutSenseGloveSensorDataImplContainer, &SensorAnglesContainer, &ImuRotationContainer, ParsedValues, bImuParsed);
Pimpl->SenseGloveSensorDataImpl = MoveTemp(OutSenseGloveSensorDataImplContainer.SenseGloveSensorDataImpl);
Pimpl->SyncUProperties();
}
USGSenseGloveSensorData::USGSenseGloveSensorData(const FSGSenseGloveSensorDataImpl& SenseGloveSensorDataImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetSenseGloveSensorDataImpl(SenseGloveSensorDataImpl);
Pimpl->SyncUProperties();
@@ -242,7 +304,7 @@ TArray<TArray<float>> USGSenseGloveSensorData::GetSensorAngles() const
return MoveTemp(OutAnglesContainer.Array);
}
FQuat USGSenseGloveSensorData::GetImuRotation() const
FQuat USGSenseGloveSensorData::GetImuRotationQ() const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
@@ -250,6 +312,14 @@ FQuat USGSenseGloveSensorData::GetImuRotation() const
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGSenseGloveSensorData::GetImuRotation() const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGSenseGloveSensorDataImpl_GetImuRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
int32 USGSenseGloveSensorData::GetParsedValues() const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
@@ -35,6 +35,7 @@
#include "SGCore/SGSenseGloveVars.h"
#include "SGCore/SGSenseGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGSenseGloveInfoImpl.h"
@@ -72,7 +73,7 @@ TArray<FVector> FSGSenseGloveVars::GetStartPositions(const FString& HardwareVers
return MoveTemp(OutPositionsContainer.Array);
}
TArray<FQuat> FSGSenseGloveVars::GetStartRotations(const FString& HardwareVersion, const bool bRightHanded)
TArray<FQuat> FSGSenseGloveVars::GetStartRotationsQ(const FString& HardwareVersion, const bool bRightHanded)
{
FSGIC_TArray_FQuat OutRotationsContainer;
FSGIC_FString HardwareVersionContainer{HardwareVersion};
@@ -80,6 +81,14 @@ TArray<FQuat> FSGSenseGloveVars::GetStartRotations(const FString& HardwareVersio
return MoveTemp(OutRotationsContainer.Array);
}
TArray<FRotator> FSGSenseGloveVars::GetStartRotations(const FString& HardwareVersion, const bool bRightHanded)
{
FSGIC_TArray_FQuat OutRotationsContainer;
FSGIC_FString HardwareVersionContainer{HardwareVersion};
SGCoreImpl_FSGSenseGloveVarsImpl_GetStartRotations(&OutRotationsContainer, &HardwareVersionContainer, bRightHanded);
return FSGArrayUtils::QuatsToRotators(OutRotationsContainer.Array);
}
TArray<TArray<FVector>> FSGSenseGloveVars::GetGloveLengths(const FString& HardwareVersion)
{
FSGIC_TArray_TArray_FVector OutLengthsContainer;
@@ -91,7 +100,7 @@ TArray<TArray<FVector>> FSGSenseGloveVars::GetGloveLengths(const FString& Hardwa
/*
TArray<FSGVectorArray> FSGSenseGloveVars::GetGloveLengths_BP(const FString& HardwareVersion)
{
return FSGArrayUtils::ToBPNestedArray<FVector, FSGVectorArray>(GetGloveLengths(HardwareVersion));
return FSGArrayUtils::ToNestedBPArray<FVector, FSGVectorArray>(GetGloveLengths(HardwareVersion));
}
*/
int32 FSGSenseGloveVars::GetSensors(const FString& HardwareVersion)
@@ -100,8 +109,8 @@ int32 FSGSenseGloveVars::GetSensors(const FString& HardwareVersion)
return SGCoreImpl_FSGSenseGloveVarsImpl_GetSensors(&HardwareVersionContainer);
}
FQuat FSGSenseGloveVars::GetImuCorrection(const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion)
FQuat FSGSenseGloveVars::GetImuCorrectionQ(const FString& HardwareVersion,
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
{
FSGIC_FQuat OutCorrectionContainer;
FSGIC_FString HardwareVersionContainer{HardwareVersion};
@@ -110,8 +119,18 @@ FQuat FSGSenseGloveVars::GetImuCorrection(const FString& HardwareVersion, const
return MoveTemp(OutCorrectionContainer.Quat);
}
TArray<bool> FSGSenseGloveVars::GetFunctions(const FString& HardwareVersion, const int32 FirmwareVersion,
const int32 SubFirmwareVersion)
FRotator FSGSenseGloveVars::GetImuCorrection(const FString& HardwareVersion,
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
{
FSGIC_FQuat OutCorrectionContainer;
FSGIC_FString HardwareVersionContainer{HardwareVersion};
SGCoreImpl_FSGSenseGloveVarsImpl_GetImuCorrection(&OutCorrectionContainer,
&HardwareVersionContainer, FirmwareVersion, SubFirmwareVersion);
return OutCorrectionContainer.Quat.Rotator();
}
TArray<bool> FSGSenseGloveVars::GetFunctions(const FString& HardwareVersion,
const int32 FirmwareVersion, const int32 SubFirmwareVersion)
{
FSGIC_TArray_bool OutFunctionsContainer;
FSGIC_FString HardwareVersionContainer{HardwareVersion};
@@ -141,11 +141,11 @@ void USGSensorRange::CheckMin(const FVector& CurrentValues, FVector& OutMinValue
USGSensorRange::USGSensorRange()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
SGCoreImpl_FSGSensorRangeImpl_ctor(&OutSensorRangeImplContainer);
@@ -156,11 +156,11 @@ USGSensorRange::USGSensorRange()
USGSensorRange::USGSensorRange(const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
FSGIC_TArray_FVector MinValuesContainer{MinValues};
@@ -174,11 +174,11 @@ USGSensorRange::USGSensorRange(const TArray<FVector>& MinValues, const TArray<FV
USGSensorRange::USGSensorRange(const FSGSensorRangeImpl& SensorRangeImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetSensorRangeImpl(SensorRangeImpl);
Pimpl->SyncUProperties();
@@ -107,11 +107,11 @@ USGThumperCommand* USGThumperCommand::Off(UObject* Outer)
USGThumperCommand::USGThumperCommand()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor(&OutThumperCommandImplContainer);
@@ -122,11 +122,11 @@ USGThumperCommand::USGThumperCommand()
USGThumperCommand::USGThumperCommand(const int32 Magnitude)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor_Magnitude(&OutThumperCommandImplContainer, Magnitude);
@@ -137,11 +137,11 @@ USGThumperCommand::USGThumperCommand(const int32 Magnitude)
USGThumperCommand::USGThumperCommand(const FSGThumperCommandImpl& ThumperCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetThumperCommandImpl(ThumperCommandImpl);
Pimpl->SyncUProperties();
@@ -38,6 +38,7 @@
#include "SGFingerCommandImplCast.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
@@ -132,11 +133,11 @@ USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
USGTimedBuzzCommand::USGTimedBuzzCommand()
: USGBuzzCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutTimedBuzzCommandImplContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_MakeShared(&OutTimedBuzzCommandImplContainer);
@@ -148,11 +149,11 @@ USGTimedBuzzCommand::USGTimedBuzzCommand()
USGTimedBuzzCommand::USGTimedBuzzCommand(const ESGFinger Finger, const int32 Magnitude,
const float DurationSeconds, const float StartTimeSeconds)
: USGBuzzCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
@@ -166,11 +167,11 @@ USGTimedBuzzCommand::USGTimedBuzzCommand(const ESGFinger Finger, const int32 Mag
USGTimedBuzzCommand::USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand,
const float DurationSeconds, const float StartTimeSeconds)
: USGBuzzCommand(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl BaseCommandContainer{BaseCommand->ToBuzzCommandImpl().Get()};
@@ -183,22 +184,22 @@ USGTimedBuzzCommand::USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand,
USGTimedBuzzCommand::USGTimedBuzzCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
: USGBuzzCommand(TimedBuzzCommandImpl),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
USGTimedBuzzCommand::USGTimedBuzzCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
: USGBuzzCommand(MoveTemp(TimedBuzzCommandImpl)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
Pimpl->SyncUProperties();
}
@@ -37,6 +37,7 @@
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGThumperCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedThumpCommandImpl.h"
@@ -117,11 +118,11 @@ USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
USGTimedThumpCommand::USGTimedThumpCommand()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor(&OutTimedThumpCommandImplContainer);
@@ -133,11 +134,11 @@ USGTimedThumpCommand::USGTimedThumpCommand()
USGTimedThumpCommand::USGTimedThumpCommand(const int32 Magnitude,
const float DurationSeconds, const float StartTimeSeconds)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_Magnitude_DurationSeconds_StartTimeSeconds(
@@ -150,11 +151,11 @@ USGTimedThumpCommand::USGTimedThumpCommand(const int32 Magnitude,
USGTimedThumpCommand::USGTimedThumpCommand(const USGThumperCommand* BaseCommand,
const float DurationSeconds, const float StartTimeSeconds)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
FSGIC_FSGThumperCommandImpl BaseCommandContainer{BaseCommand->ToThumperCommandImpl()};
@@ -167,11 +168,11 @@ USGTimedThumpCommand::USGTimedThumpCommand(const USGThumperCommand* BaseCommand,
USGTimedThumpCommand::USGTimedThumpCommand(const FSGTimedThumpCommandImpl& TimedThumpCommandImpl)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 )
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 24 ) */
{
SetTimedThumpCommandImpl(TimedThumpCommandImpl);
Pimpl->SyncUProperties();
@@ -43,6 +43,7 @@
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FQuat.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGUtils/SGArrayUtils.h"
void FSGTracking::CalculateLocation(const FVector& TrackedPosition, const FQuat& TrackedRotation,
const FVector& PositionOffset, const FQuat& RotationOffset,
@@ -64,6 +65,26 @@ void FSGTracking::CalculateLocation(const FVector& TrackedPosition, const FQuat&
OutNewRotation = MoveTemp(OutNewRotationContainer.Quat);
}
void FSGTracking::CalculateLocation(const FVector& TrackedPosition, const FRotator& TrackedRotation,
const FVector& PositionOffset, const FRotator& RotationOffset,
FVector& OutNewPosition, FRotator& OutNewRotation)
{
FSGIC_FVector TrackedPositionContainer{TrackedPosition};
FSGIC_FQuat TrackedRotationContainer{TrackedRotation.Quaternion()};
FSGIC_FVector PositionOffsetContainer{PositionOffset};
FSGIC_FQuat RotationOffsetContainer{RotationOffset.Quaternion()};
FSGIC_FVector OutNewPositionContainer;
FSGIC_FQuat OutNewRotationContainer;
SGCoreImpl_FSGTrackingImpl_CalculateLocation(
&TrackedPositionContainer, &TrackedRotationContainer,
&PositionOffsetContainer, &RotationOffsetContainer,
&OutNewPositionContainer, &OutNewRotationContainer);
OutNewPosition = MoveTemp(OutNewPositionContainer.Vector);
OutNewRotation = OutNewRotationContainer.Quat.Rotator();
}
TArray<FVector> FSGTracking::GetSenseGloveFingerToGlovePositionOrigin()
{
FSGIC_TArray_FVector OutOriginContainer;
@@ -71,13 +92,20 @@ TArray<FVector> FSGTracking::GetSenseGloveFingerToGlovePositionOrigin()
return MoveTemp(OutOriginContainer.Array);
}
TArray<FQuat> FSGTracking::GetSenseGloveFingerToGloveRotationOrigin()
TArray<FQuat> FSGTracking::GetSenseGloveFingerToGloveRotationOriginQ()
{
FSGIC_TArray_FQuat OutOriginContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveFingerToGloveRotationOrigin(&OutOriginContainer);
return MoveTemp(OutOriginContainer.Array);
}
TArray<FRotator> FSGTracking::GetSenseGloveFingerToGloveRotationOrigin()
{
FSGIC_TArray_FQuat OutOriginContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveFingerToGloveRotationOrigin(&OutOriginContainer);
return FSGArrayUtils::QuatsToRotators(OutOriginContainer.Array);
}
FVector FSGTracking::GetSenseGloveWristPositionOffset()
{
FSGIC_FVector OutOffsetContainer;
@@ -85,13 +113,20 @@ FVector FSGTracking::GetSenseGloveWristPositionOffset()
return MoveTemp(OutOffsetContainer.Vector);
}
FQuat FSGTracking::GetSenseGloveWristRotationOffset()
FQuat FSGTracking::GetSenseGloveWristRotationOffsetQ()
{
FSGIC_FQuat OutOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveWristRotationOffset(&OutOffsetContainer);
return MoveTemp(OutOffsetContainer.Quat);
}
FRotator FSGTracking::GetSenseGloveWristRotationOffset()
{
FSGIC_FQuat OutOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveWristRotationOffset(&OutOffsetContainer);
return OutOffsetContainer.Quat.Rotator();
}
void FSGTracking::GetSenseGloveMountOffset(const bool bRightHanded, const ESGFinger ToFinger,
FVector& OutIPosition, FQuat& OutIRotation)
{
@@ -106,6 +141,20 @@ void FSGTracking::GetSenseGloveMountOffset(const bool bRightHanded, const ESGFin
OutIRotation = MoveTemp(OutIRotationContainer.Quat);
}
void FSGTracking::GetSenseGloveMountOffset(const bool bRightHanded, const ESGFinger ToFinger,
FVector& OutIPosition, FRotator& OutIRotation)
{
FSGIC_ESGFinger ToFingerContainer{ToFinger};
FSGIC_FVector OutIPositionContainer;
FSGIC_FQuat OutIRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveMountOffset(bRightHanded, &ToFingerContainer,
&OutIPositionContainer, &OutIRotationContainer);
OutIPosition = MoveTemp(OutIPositionContainer.Vector);
OutIRotation = OutIRotationContainer.Quat.Rotator();
}
void FSGTracking::GetSenseGloveTrackerMountOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
@@ -121,6 +170,21 @@ void FSGTracking::GetSenseGloveTrackerMountOffset(const ESGPositionalTrackingHar
OutRotationOffset = MoveTemp(OutRotationOffsetContainer.Quat);
}
void FSGTracking::GetSenseGloveTrackerMountOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset)
{
FSGIC_ESGPositionalTrackingHardware HardwareContainer;
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveTrackerMountOffset(&HardwareContainer, bRightHanded,
&OutPositionOffsetContainer,
&OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
}
FVector FSGTracking::GetSenseGloveViveToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -128,13 +192,20 @@ FVector FSGTracking::GetSenseGloveViveToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetSenseGloveViveToAttachRotation()
FQuat FSGTracking::GetSenseGloveViveToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveViveToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetSenseGloveViveToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveViveToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetSenseGloveOculusTouchToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -142,13 +213,20 @@ FVector FSGTracking::GetSenseGloveOculusTouchToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetSenseGloveOculusTouchToAttachRotation()
FQuat FSGTracking::GetSenseGloveOculusTouchToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveOculusTouchToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetSenseGloveOculusTouchToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetSenseGloveOculusTouchToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetNovaToWristPositionOffset()
{
FSGIC_FVector OutOffsetContainer;
@@ -156,13 +234,20 @@ FVector FSGTracking::GetNovaToWristPositionOffset()
return MoveTemp(OutOffsetContainer.Vector);
}
FQuat FSGTracking::GetNovaToWristRotationOffset()
FQuat FSGTracking::GetNovaToWristRotationOffsetQ()
{
FSGIC_FQuat OutOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaToWristRotationOffset(&OutOffsetContainer);
return MoveTemp(OutOffsetContainer.Quat);
}
FRotator FSGTracking::GetNovaToWristRotationOffset()
{
FSGIC_FQuat OutOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaToWristRotationOffset(&OutOffsetContainer);
return OutOffsetContainer.Quat.Rotator();
}
void FSGTracking::GetNovaGloveWristOffset(const bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
FSGIC_FVector OutPositionOffsetContainer;
@@ -175,6 +260,19 @@ void FSGTracking::GetNovaGloveWristOffset(const bool bRightHanded, FVector& OutP
OutRotationOffset = MoveTemp(OutRotationOffsetContainer.Quat);
}
void FSGTracking::GetNovaGloveWristOffset(const bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset)
{
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaGloveWristOffset(bRightHanded,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNovaViveToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -182,13 +280,20 @@ FVector FSGTracking::GetRightNovaViveToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNovaViveToAttachRotation()
FQuat FSGTracking::GetRightNovaViveToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaViveToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNovaViveToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaViveToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNovaViveToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -196,13 +301,20 @@ FVector FSGTracking::GetLeftNovaViveToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNovaViveToAttachRotation()
FQuat FSGTracking::GetLeftNovaViveToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaViveToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNovaViveToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaViveToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNovaQuest2ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -210,13 +322,20 @@ FVector FSGTracking::GetRightNovaQuest2ToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNovaQuest2ToAttachRotation()
FQuat FSGTracking::GetRightNovaQuest2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuest2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNovaQuest2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuest2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNovaQuest2ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -224,13 +343,20 @@ FVector FSGTracking::GetLeftNovaQuest2ToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNovaQuest2ToAttachRotation()
FQuat FSGTracking::GetLeftNovaQuest2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuest2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNovaQuest2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuest2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNovaPico2ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
@@ -238,20 +364,34 @@ FVector FSGTracking::GetRightNovaPico2ToAttachPosition()
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNovaPico2ToAttachRotation()
FQuat FSGTracking::GetRightNovaPico2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaPico2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FQuat FSGTracking::GetLeftNovaPico2ToAttachRotation()
FRotator FSGTracking::GetRightNovaPico2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaPico2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FQuat FSGTracking::GetLeftNovaPico2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaPico2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNovaPico2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaPico2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
@@ -266,6 +406,20 @@ void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware
OutRotationOffset = MoveTemp(OutRotationOffsetContainer.Quat);
}
void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset)
{
FSGIC_ESGPositionalTrackingHardware HardwareContainer{Hardware};
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaGloveTrackerOffset(&HardwareContainer, bRightHanded,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
}
FString FSGTracking::ToString(const ESGPositionalTrackingHardware Hardware)
{
FSGIC_FString OutStringContainer;
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Hard-Coded Database that is used in calibration and in solving.
* Values herein are used to limit outputs within 'natural' ranges.
*/
@@ -41,33 +42,72 @@
#include "SGAnatomy.generated.h"
/**
* "Database" of anatomical values, such as joint limits.
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGAnatomy
{
GENERATED_BODY()
public:
/**
* Total sum of all finger flexion that would be considered "total flexion".
*/
static float GetTotalFingerFlexion();
/**
* Total sum of all finger flexion that would be considered "total extension".
*/
static float GetTotalFingerExtension();
/**
* Total sum of all thumb flexion that would be considered "total flexion".
*/
static float GetTotalThumbFlexion();
/**
* Total sum of all thumb flexion that would be considered "total extension".
*/
static float GetTotalThumbExtension();
/**
* Retrieve one of the limits of a finger joint's movement.
*/
static float GetFingerJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax);
/**
* Retrieve one of the limits of a thumb joint's movement.
*/
static float GetThumbJointLimit(bool bRightHanded, int32 Joint, int32 Movement, bool bMax);
static float NormalizeFingerFlex(float FlexionInRadians);
/**
* Convert a total finger flexion in radians into a 0..1 representation.
*/
static float NormalizeFingerFlexion(float FlexionInRadians);
static float NormalizeThumbFlex(float FlexionInRadians);
/**
* Convert a total thumb flexion in radians into a 0..1 representation.
*/
static float NormalizeThumbFlexion(float FlexionInRadians);
/**
* Get Hand Angles that would make a Default (Idle) Pose.
*/
static TArray<TArray<FVector>> GetDefaultHandAngles(bool bRightHanded);
/**
* Get Hand Angles that would make a flat hand.
*/
static TArray<TArray<FVector>> GetFlatHandAngles(bool bRightHanded);
/**
* Get hand angles that would make a thumbs up.
*/
static TArray<TArray<FVector>> GetThumbsUpHandAngles(bool bRightHanded);
/**
* Get Hand Angles that would make a fist.
*/
static TArray<TArray<FVector>> GetFistHandAngles(bool bRightHanded);
};
@@ -29,7 +29,9 @@
*
* @section DESCRIPTION
*
*
* A data class containing the minimum required data for a hand's forward
* kinematics.
* Used in both kinematics and calibration.
*/
@@ -46,12 +48,14 @@
#include "SGCore/SGFloatArray.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGBasicHandModel.generated.h"
class FSGBasicHandModelImpl;
/**
* Represents data of a user's hand required for forward kinematics.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGBasicHandModel final : public UObject
{
@@ -62,37 +66,89 @@ public:
UObject* Outer, const FSGBasicHandModelImpl& BasicHandModelImpl);
public:
/**
* The basic class constructor.
*/
static USGBasicHandModel* NewBasicHandModel(UObject* Outer);
/**
* Create a new BasicHandModel with no starting rotations.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<TArray<float>>& Lengths, const TArray<FVector>& StartPositions);
/**
* Create a new BasicHandModel with no starting rotations.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<FSGFloatArray>& Lengths, const TArray<FVector>& StartPositions);
/**
* Create a new BasicHandModel.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations);
/**
* Create a new BasicHandModel.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations);
/**
* Create a new BasicHandModel.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations);
/**
* Create a new BasicHandModel.
*/
static USGBasicHandModel* NewBasicHandModel(
UObject* Outer,
bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations);
public:
/**
* Retrieve a default left or right hand model.
*/
static USGBasicHandModel* Default(UObject* Outer, bool bRightHanded);
/**
* Convert a serialized HandModel back into its class representation.
*/
static USGBasicHandModel* Deserialize(UObject* Outer, const FString& SerializedString);
public:
/**
* Default finger lengths (based on right hand).
*
* @remarks Any missing fingers are replaced with their respective value.
*/
static TArray<TArray<float>> GetBaseFingerLengths();
/**
* Default joint positions (based on right hand).
*
* @remarks Any missing positions are replaced with their respective value.
*/
static TArray<FVector> GetBaseJointPositions();
static TArray<FVector> GetBaseJointRotations();
/**
* Default joint angles (based on right hand).
*
* @remarks Any missing angles are replaced with their respective value.
*/
static TArray<FVector> GetBaseJointAngles();
private:
struct FImpl;
@@ -106,20 +162,47 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic class constructor.
*/
USGBasicHandModel();
/**
* Create a new BasicHandModel with no starting rotations.
*/
USGBasicHandModel(bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions);
/**
* Create a new BasicHandModel with no starting rotations.
*/
USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions);
/**
* Create a new BasicHandModel.
*/
USGBasicHandModel(bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations);
/**
* Create a new BasicHandModel.
*/
USGBasicHandModel(bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations);
/**
* Create a new BasicHandModel.
*/
USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations);
/**
* Create a new BasicHandModel.
*/
USGBasicHandModel(bool bRightHanded, const TArray<FSGFloatArray>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations);
public:
/**
* The cast from underlying type constructor.
@@ -151,48 +234,133 @@ protected:
FSGBasicHandModelImpl& ToBasicHandModelImpl();
public:
/**
* Whether or not this BasicHandModel was created for a left- or right hand. Used for validation.
*/
bool IsRight() const;
/**
* The length of individual finger phalangers in mm, sorted per finger. Generally 5x3.
*/
TArray<TArray<float>> GetFingerLengths() const;
/**
* Retrieve the finger lengths of a specific finger in cm.
*/
TArray<float> GetFingerLengths(ESGFinger Finger) const;
/**
* Set the finger lengths of a specific finger in cm.
*/
void SetFingerLengths(ESGFinger Finger, const TArray<float>& Lengths);
/**
* Set the finger lengths of a specific finger in cm.
*/
void SetFingerLengths(uint8 Finger, const TArray<float>& Lengths);
/**
* Get the finger ratios of all fingers.
*/
TArray<TArray<float>> GetFingerRatios() const;
/**
* Get the finger ratios of a specific finger.
*/
TArray<float> GetFingerRatios(ESGFinger Finger) const;
/**
* Starting joint positions relative to the device Origin.
*/
TArray<FVector> GetStartJointPositions() const;
/**
*
*/
void SetStartJointPosition(ESGFinger Finger, const FVector& Position);
/**
*
*/
void SetStartJointPosition(uint8 Finger, const FVector& Position);
TArray<FQuat> GetStartJointRotations() const;
/**
* Starting joint rotations relative to the device Origin.
*/
TArray<FQuat> GetStartJointRotationsQ() const;
/**
* Starting joint rotations relative to the device Origin.
*/
TArray<FRotator> GetStartJointRotations() const;
/**
* Retrieve the start position of a specific finger.
*/
FVector GetJointPosition(ESGFinger Finger) const;
/**
* Set the start position of a specific finger.
*/
void SetJointPosition(const FVector& NewPosition, ESGFinger Finger);
FQuat GetJointRotation(ESGFinger Finger) const;
/**
* Retrieve the start rotation of a specific finger.
*/
FQuat GetJointRotationQ(ESGFinger Finger) const;
/**
* Retrieve the start rotation of a specific finger.
*/
FRotator GetJointRotation(ESGFinger Finger) const;
/**
* Set the start rotation of a specific finger.
*/
void SetJointRotation(const FQuat& NewRotation, ESGFinger Finger);
/**
* Set the start rotation of a specific finger.
*/
void SetJointRotation(const FRotator& NewRotation, ESGFinger Finger);
/**
* Get the total lengths of fingers, in cm.
*/
TArray<float> GetTotalLengths() const;
/**
* Get the total length of a specific finger, in mm.
*/
float GetTotalLength(ESGFinger Finger) const;
public:
/**
* Retrieve the lengths of a specific finger, as BasicHandModel representation (L, 0, 0).
*
* @remarks Used for forwards kinematics.
*/
TArray<FVector> Get3DLengths(ESGFinger Finger) const;
public:
/**
* Check if this BasicHandModel has the same values as another BasicHandModel.
*/
bool Equals(const USGBasicHandModel* BasicHandModel) const;
public:
/**
* Convert this handModel into a string notation, readable for humans. Does not include starting positions / rotations.
*/
FString ToString() const;
/**
* Convert this handModel into a string notation, readable for humans. Optionally includes starting positions / rotations.
*/
FString ToString(bool bLengthsOnly) const;
/**
* Serialize this HandModel into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,10 @@
*
* @section DESCRIPTION
*
*
* Represents a Sense Glove Device that has no specific class within the API.
* Used to test different iterations of the same product before integrating it
* into the Core API.
* Allows access to raw sensor values and commands of such a device.
*/
@@ -45,6 +48,9 @@
class FSGDeviceImpl;
class FSGBetaDeviceImpl;
/**
* A Device that adheres to the SenseGlove communications protocol, but which has no implementation in this API.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGBetaDevice final : public USGDevice
{
@@ -55,14 +61,24 @@ public:
static USGBetaDevice* NewBetaDevice(UObject* Outer, TSharedRef<FSGBetaDeviceImpl> BetaDeviceImpl);
public:
/**
* The basic class constructor.
*/
static USGBetaDevice* NewBetaDevice(UObject* Outer);
/**
* Creates a new instance of a Beta Device.
*/
static USGBetaDevice* NewBetaDevice(
UObject* Outer,
const FString& ConstantsString, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
public:
/**
* Deserialize a beta device from its basic constants string. Returns nullptr is unsuccessful.
*/
static USGBetaDevice* Parse(UObject* Outer, const FString& String);
private:
@@ -77,8 +93,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic class constructor.
*/
USGBetaDevice();
/**
* Creates a new instance of a Beta Device.
*/
USGBetaDevice(const FString& ConstantsString, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
@@ -118,26 +140,56 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration.
*/
virtual ESGDeviceType GetDeviceType() const override;
/**
* Get the unique identifier of this device.
*/
virtual FString GetDeviceId() const override;
/**
* Retrieve this device's hardware version.
*/
virtual FString GetHardwareVersion() const override;
/**
* Retrieve this device's firmware version.
*/
virtual int32 GetFirmwareVersion() const override;
/**
* Retrieve this device's sub-firmware version.
*/
virtual int32 GetSubFirmwareVersion() const override;
public:
/**
* Retrieve the constants string for additional processing.
*/
FString GetConstantsString() const;
/**
* Retrieve a raw sensor string from this Beta Device.
*/
FString GetSensorData() const;
/**
* Retrieve the last command retrieved from this Beta Device.
*/
FString GetLastCommand() const;
public:
/**
* Send a raw string command to this device.
*/
bool SendHaptics(const FString& Command) const;
public:
/**
* Create a string representation of this device for reporting purposes.
*/
virtual FString ToString() const override;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Buzz motor command specific for the Sense Glove.
*/
@@ -40,13 +40,16 @@
#include "Templates/UniquePtr.h"
#include "UObject/ObjectMacros.h"
#include "SGFingerCommand.h"
#include "SGCore/SGFingerCommand.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGBuzzCommand.generated.h"
class FSGBuzzCommandImpl;
/**
* A vibration command for the Sense Glove, with levels for each finger.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGBuzzCommand : public USGFingerCommand
{
@@ -57,15 +60,32 @@ public:
static USGBuzzCommand* NewBuzzCommand(UObject* Outer, TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl);
public:
/**
* The basic constructor.
*/
static USGBuzzCommand* NewBuzzCommand(UObject* Outer);
/**
* Create a new buzz motor command, where each finger level is contained inside an array of size 5.
*/
static USGBuzzCommand* NewBuzzCommand(UObject* Outer, const TArray<int32>& BuzzLevels);
static USGBuzzCommand* NewBuzzCommand(UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky);
/**
* Create a new Buzz Motor command, indicating the intensity for each finger.
*/
static USGBuzzCommand* NewBuzzCommand(UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring,
int32 Pinky);
/**
* Create a new Buzz Motor command, with only one finger being activated.
*/
static USGBuzzCommand* NewBuzzCommand(UObject* Outer, ESGFinger Finger, int32 BuzzLevel);
public:
/**
* A command that turns off all vibration motors of the Sense Glove.
*/
static USGBuzzCommand* Off(UObject* Outer);
private:
@@ -80,9 +100,24 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic constructor.
*/
USGBuzzCommand();
/**
* Create a new buzz motor command, where each finger level is contained inside an array of size 5.
*/
explicit USGBuzzCommand(const TArray<int32>& BuzzLevels);
/**
* Create a new Buzz Motor command, indicating the intensity for each finger.
*/
USGBuzzCommand(int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky);
/**
* Create a new Buzz Motor command, with only one finger being activated.
*/
USGBuzzCommand(ESGFinger Finger, int32 BuzzLevel);
public:
@@ -121,7 +156,13 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Copy this Buzz Command into a new object.
*/
USGBuzzCommand* Copy(UObject* Outer) const;
/**
* Merge this command with another, taking the maximum value between the two.
*/
USGBuzzCommand* Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const;
};
@@ -47,6 +47,9 @@
class FSGCalibrationDataPointImpl;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGCalibrationDataPoint final : public UObject
{
@@ -57,11 +60,17 @@ public:
UObject* Outer, const FSGCalibrationDataPointImpl& CalibrationDataPointImpl);
public:
/**
*
*/
static USGCalibrationDataPoint* NewCalibrationDataPoint(UObject* Outer);
/**
* Create a new data point.
*/
static USGCalibrationDataPoint* NewCalibrationDataPoint(
UObject* Outer,
int32 CurrentStage,const TArray<FVector>& CalibrationValues);
int32 CurrentStage, const TArray<FVector>& CalibrationValues);
private:
struct FImpl;
@@ -75,8 +84,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
*
*/
USGCalibrationDataPoint();
/**
* Create a new data point.
*/
USGCalibrationDataPoint(int32 CurrentStage, const TArray<FVector>& CalibrationValues);
public:
@@ -104,10 +119,19 @@ public:
const FSGCalibrationDataPointImpl& ToCalibrationDataPointImpl() const;
public:
/**
* Actual calibration values.
*/
TArray<FVector> GetCalibrationValues() const;
/**
* The Calibration stage this data point belongs to.
*/
int32 GetStage() const;
public:
/**
* Log Calibration values for storing on disk.
*/
FString ToLogData(const FString& Delimiter = "\t") const;
};
+70 -2
View File
@@ -29,7 +29,9 @@
*
* @section DESCRIPTION
*
*
* Represents a Device built by the Sense Glove company that is compatible with
* our Communications Protocol. All such devices derive from this abstract
* class.
*/
@@ -49,14 +51,23 @@ class FSGHapticGloveImpl;
class FSGNovaGloveImpl;
class FSGSenseGloveImpl;
/**
*
*/
UCLASS(Abstract, BlueprintType)
class SENSEGLOVECORE_API USGDevice : public UObject
{
GENERATED_BODY()
public:
/**
* Parse a main and sub firmware version from its raw (v4.12) notation
*/
static void ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion);
/**
*
*/
static FString ToString(ESGDeviceType DeviceType);
private:
@@ -71,6 +82,9 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
* The basic constructor.
*/
USGDevice();
public:
@@ -200,39 +214,93 @@ protected:
virtual void SyncUProperties();
public:
/**
* Check which DeviceType this class belongs to.
*/
virtual ESGDeviceType GetDeviceType() const;
/**
* Retrieve this device's unique identifier.
*/
virtual FString GetDeviceId() const PURE_VIRTUAL(FSGDevice::GetDeviceId, return FString(););
/**
* Retrieve this device's hardware version.
*/
virtual FString GetHardwareVersion() const PURE_VIRTUAL(FSGDevice::GetHardwareVersion, return FString(););
/**
* Retrieve this device's main firmware version. v4.12 returns 4.
*/
virtual int32 GetFirmwareVersion() const PURE_VIRTUAL(FSGDevice::FirmwareVersion, return -1;);
/**
* Retrieve this device's sub firmware version. v4.12 returns 12.
*/
virtual int32 GetSubFirmwareVersion() const;
/**
*
*/
virtual FString GetFirmwareString() const;
/**
* Retrieve this Device's Serial/Bluetooth address.
*/
FString GetAddress() const;
/**
* Check if this device is currently connected to the system.
*/
bool IsConnected() const;
/**
* Retrieve the connection type of this Sense Glove.
*/
ESGConnectionType GetConnectionType() const;
/**
* Retrieve the device's Packets per Second Variable.
*/
int32 PacketsPerSecondReceived() const;
/**
* Retrieve the device's Packets per Second Variable.
*/
int32 PacketsPerSecondSent() const;
/**
* Retrieve the index of this device within SenseCom.
*/
int32 GetDeviceIndex() const;
void SetDeviceIndex(const int32 Index);
/**
* Change this device's index within the SenseCom. Warning: Can cause errors.
*/
void SetDeviceIndex(int32 NewIndex);
/**
* Returns true if this device is connected over a connection other than usb cable.
*/
virtual bool IsWireless() const;
/**
* Returns true if this device operates on a battery.
*/
virtual bool HasBattery() const;
/**
* Returns true if this device is currently charging.
*/
virtual bool IsCharging();
/**
* Returns the device's battery level, as a value between 0 (empty) and 1 (full).
*/
virtual bool GetBatteryLevel(float& OutLevel);
/**
* Get a string representation of this SGDevice, used for debugging.
*/
virtual FString ToString() const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Interface for SenseCom, allows the retrieval of Devices and Data, but only
* as.
*/
@@ -46,41 +47,91 @@
class USGDevice;
/**
* Interface for SenseCom, allows the retrieval of Devices and Data.
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGDeviceList
{
GENERATED_BODY()
public:
/**
* Retrieve the number of devices that have been detected by the SenseCom executable.
*/
static int32 ActiveDevices();
/**
* Returns true if the SenseCom program is running.
*/
static bool SenseCommRunning();
/**
* Clear the device list, and block any further attempt to add to it until ReInitialize is called.
*
* @remarks Useful if your IDE has troubles unloading dlls (cough, Unity, Cough).
*/
static void Dispose();
/**
* When you've accidentally disposed of the list before you meant to.
*/
static void Reinitialize();
/**
* Retrieve all Sense Glove Devices connected to this system.
*/
static TArray<USGDevice*> GetDevices(UObject* Outer);
/// TODO
// THIS PROBABLY SHOULD BE REMOVED!
/**
* Retrieve a list of SGDevices of a specific class.
*/
static TArray<USGDevice*> GetDevices(UObject* Outer, const TSubclassOf<USGDevice>& DeviceType);
/**
* Retrieve a list of SGDevices of a specific type.
*/
static TArray<USGDevice*> GetDevices(UObject* Outer, ESGDeviceType DeviceType);
/**
* Retrieve the latest (raw) sensor data from a specific device in our list.
*/
static bool GetSensorDataString(int32 IpcIndex, const FString& IpcAddress, FString& OutString);
/**
* Send a (raw) command to a specific device in the list.
*/
static bool SendHaptics(int32 IpcIndex, const FString& IpcAddress, const FString& Commands);
/**
*
*/
static FString GetDeviceStringAt(int32 IpcIndex, const FString& IpcAddress, int32 Index);
/**
* Retrieve Device Address.
*/
static FString GetAddress(int32 IpcIndex, const FString& IpcAddress);
/**
* Retieve this device's connectionType.
*/
static ESGConnectionType GetConnectionType(int32 IpcIndex, const FString& IpcAddress);
/**
* Returns true if the device at this connection side is properly connected.
*/
static bool IsConnected(int32 IpcIndex, const FString& IpcAddress);
/**
* Retrieve the device's Packets per Second Variable.
*/
static int32 PacketsPerSecondReceived(int32 IpcIndex, const FString& IpcAddress);
/**
* Retrieve the device's Packets per Second sent Variable.
*/
static int32 PacketsPerSecondSent(int32 IpcIndex, const FString& IpcAddress);
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Base class for Device Models containing the minimum amount of data gathered
* through Communications Protocol. Used for shared functionality.
*/
@@ -41,12 +42,13 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGDeviceModel.generated.h"
class FSGDeviceModelImpl;
/**
* Base class containing the minimum amount of data for device models.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGDeviceModel final : public UObject
{
@@ -57,15 +59,27 @@ public:
UObject* Outer, const FSGDeviceModelImpl& DeviceModelImpl);
public:
/**
*
*/
static USGDeviceModel* NewDeviceModel(UObject* Outer);
/**
*
*/
static USGDeviceModel* NewDeviceModel(
UObject* Outer,
const FString& Id, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
public:
/**
* Parse a 32-bit integer value into a set of booleans (010010011) that indicate which (optional) functions this device has.
*/
static TArray<bool> ParseFunctions(int32 Value, int32 Size);
/**
*
*/
static void ParseFirmware(const FString& RawFirmware, int32& OutMainVersion, int32& OutSubVersion);
private:
@@ -80,8 +94,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Empty constructor to be used by child classes.
*/
USGDeviceModel();
/**
*
*/
USGDeviceModel(const FString& Id, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
public:
@@ -115,11 +135,23 @@ protected:
FSGDeviceModelImpl& ToDeviceModelImpl();
public:
/**
* Retrieve the Unique identifier of this device.
*/
FString GetDeviceId() const;
/**
* Retrieve the Hardware (sub) version of this Sense Glove Device.
*/
FString GetHardwareVersion() const;
/**
* Firmware version running on the device's MicroController. (as v4.12, this is the 4).
*/
int32 GetFirmwareVersion() const;
/**
* Sub firmware version running on the device's microcontroller (as v4.12, this is the 12).
*/
int32 GetSubFirmwareVersion() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* A command for five fingers that can be sent to a Sense Glove device.
*/
@@ -49,6 +49,9 @@ class FSGFingerCommandImpl;
class FSGForceFeedbackCommandImpl;
class FSGTimedBuzzCommandImpl;
/**
* A command that contains values (levels) for five fingers.
*/
UCLASS(Abstract, BlueprintType)
class SENSEGLOVECORE_API USGFingerCommand : public UObject
{
@@ -66,8 +69,14 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
*
*/
USGFingerCommand();
/**
*
*/
explicit USGFingerCommand(const TArray<int32>& InLevels);
public:
@@ -159,7 +168,6 @@ protected:
*/
void SetFingerCommandImpl(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl);
public:
/**
* The cast to underlying type method.
@@ -178,13 +186,29 @@ protected:
virtual void SyncUProperties();
public:
/**
*
*/
TArray<int32> GetLevels() const;
public:
/**
*
*/
int32 GetLevel(int32 Finger) const;
/**
*
*/
void SetLevel(int32 Finger, int32 Value);
/**
* Check if this command contains the same values as another.
*/
bool Equals(const USGFingerCommand* FingerCommand) const;
/**
* Create a string representation of this finger command.
*/
FString ToString() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* A command for five fingers that can be sent to a Sense Glove device.
*/
@@ -47,6 +47,9 @@
class FSGForceFeedbackCommandImpl;
/**
* A Force-Feedback command for the Sense Glove, with levels for each finger.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGForceFeedbackCommand final : public USGFingerCommand
{
@@ -59,18 +62,34 @@ public:
static USGForceFeedbackCommand* NewForceFeedbackCommand(
UObject* Outer, TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl);
public:
/**
* Empty constructor for internal initialization.
*/
static USGForceFeedbackCommand* NewForceFeedbackCommand(UObject* Outer);
/**
* Create a new Force-Feedback Command, with levels for each finger stored in an int[5] array.
*/
static USGForceFeedbackCommand* NewForceFeedbackCommand(
UObject* Outer, const TArray<int32>& ForceFeedbackLevels);
/**
* Create a new Force-Feedback Command, with levels for each finger.
*/
static USGForceFeedbackCommand* NewForceFeedbackCommand(
UObject* Outer, int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky);
/**
* Create a new Force-Feedback command, with only one finger being activated.
*/
static USGForceFeedbackCommand* NewForceFeedbackCommand(
UObject* Outer, ESGFinger Finger, int32 BuzzLevel);
public:
/**
* A command that turns off all force feedback on the Sense Glove.
*/
static USGForceFeedbackCommand* Off(UObject* Outer);
private:
@@ -85,9 +104,24 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Empty constructor for internal initialization.
*/
USGForceFeedbackCommand();
/**
* Create a new Force-Feedback Command, with levels for each finger stored in an int[5] array.
*/
explicit USGForceFeedbackCommand(const TArray<int32>& ForceFeedbackLevels);
/**
* Create a new Force-Feedback Command, with levels for each finger.
*/
USGForceFeedbackCommand(int32 Thumb, int32 Index, int32 Middle, int32 Ring, int32 Pinky);
/**
* Create a new Force-Feedback command, with only one finger being activated.
*/
USGForceFeedbackCommand(ESGFinger Finger, int32 BuzzLevel);
public:
@@ -126,7 +160,13 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Copy this ForceFeedback Command into a new object.
*/
USGForceFeedbackCommand* Copy(UObject* Outer) const;
/**
* Merge this finger command with another, taking the maximum value between the two.
*/
USGForceFeedbackCommand* Merge(UObject* Outer, const USGForceFeedbackCommand* ForceFeedbackCommand) const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Contains interpolation sets for all hand joint movements that can be
* calculated using the Sense Glove.
*/
@@ -43,15 +44,17 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGInterpolationSet.h"
#include "SGCore/SGInterpolationSetArray.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGHandInterpolator.generated.h"
class FSGHandInterpolatorImpl;
class USGHandInterpolator;
/**
* Contains interpolation sets of all joint movements that can be calculated into a HandPose.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHandInterpolator final : public UObject
{
@@ -62,36 +65,80 @@ public:
UObject* Outer, const FSGHandInterpolatorImpl& HandInterpolatorImpl);
public:
/**
* The basic constructor.
*/
static USGHandInterpolator* NewHandInterpolator(UObject* Outer);
/**
* Create a new basic HandInterpolator without a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations);
/**
* Create a new basic HandInterpolator without a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FQuat& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FRotator& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FQuat& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
static USGHandInterpolator* NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FRotator& CmcStartRotation);
public:
/**
* Create a default instance of a left- or right handed interpolator.
*/
static USGHandInterpolator* Default(UObject* Outer, const bool bRightHanded);
/**
* Convert a serialized HandInterpolator back into a class representation.
*/
static USGHandInterpolator* Deserialize(UObject* Outer, const FString& SerializedString);
public:
/**
* Calculate all angles of a specific finger based on an Interpolator and input angles.
*/
static TArray<FVector> InterpolateFingerAngles(ESGFinger Finger, const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles);
/**
* Calculate all angles of the Thumb based on an Interpolator and input angles.
*/
static TArray<FVector> InterpolateThumbAngles(const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles);
/**
* Calculate all hand angles based on an interpolator and total xyz angles.
*/
static TArray<TArray<FVector>> InterpolateHandAngles(const USGHandInterpolator* Interpolator,
const TArray<FVector>& TotalAngles);
@@ -107,18 +154,45 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic constructor.
*/
USGHandInterpolator();
/**
* Create a new basic HandInterpolator without a starting rotation.
*/
explicit USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations);
/**
* Create a new basic HandInterpolator without a starting rotation.
*/
explicit USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations);
/**
* Create a new basic HandInterpolator without a starting rotation.
*/
USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FQuat& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FRotator& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FQuat& CmcStartRotation);
/**
* Create a new basic HandInterpolator with a starting rotation.
*/
USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FRotator& CmcStartRotation);
public:
/**
* The cast from underlying type constructor.
@@ -144,30 +218,68 @@ public:
const FSGHandInterpolatorImpl& ToHandInterpolatorImpl() const;
public:
/**
* Interpolation sets for each finger. First index indicates which finger, Second index indicates the joint movement.
*/
TArray<TArray<USGInterpolationSet*>> GetJointInterpolations(UObject* Outer) const;
FQuat GetCmcStartRotation() const;
/**
* Starting rotation of the thumb cmc joint.
*/
FQuat GetCmcStartRotationQ() const;
/**
* Starting rotation of the thumb cmc joint.
*/
FRotator GetCmcStartRotation() const;
public:
/**
* Calculate any finger's movement rotation, using an input value.
*/
float CalculateAngle(ESGFinger Finger, int32 Movement, float Value) const;
/**
* Calculate a finger movement's rotation, using an input value.
*/
float CalculateAngle(ESGFinger Finger, ESGFingerMovement Movement, float Value) const;
/**
* Calculate a thumb movement's rotation, using an input value.
*/
float CalculateAngle(ESGFinger Finger, ESGThumbMovement Movement, float Value) const;
public:
/**
* Updates a particular joint movement interpolation, without changing its limits.
*/
void SetInterpolation(int32 Finger, int32 Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1);
/**
* Updates a particular joint movement interpolation, without changing its limits.
*/
void SetInterpolation(ESGFinger Finger, ESGFingerMovement Movement,
float InputAt0, float InputAt1, float AngleAt0, float AngleAt1);
/**
* Updates a particular joint movement interpolation, without changing its limits.
*/
void SetInterpolation(ESGThumbMovement Movement, float InputAt0, float InputAt1, float AngleAt0, float AngleAt1);
/**
* Returns an interpolationSet
*/
USGInterpolationSet* GetInterpolation(UObject* Outer, int32 Finger, int32 Movement) const;
public:
/**
* Check if this handInterpolator matches another.
*/
bool Equals(const USGHandInterpolator* HandInterpolator) const;
public:
/**
* Serialize this HandInterpolator into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Data class containing all variables to draw or analyze a virtual hand
* in different formats.
*/
@@ -43,15 +44,20 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGQuatArray.h"
#include "SGCore/SGRotatorArray.h"
#include "SGCore/SGVectorArray.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGHandPose.generated.h"
class USGBasicHandModel;
class FSGHandPoseImpl;
class USGHandPose;
/**
* Contains all variables required to draw or analyze a virtual hand.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHandPose final : public UObject
{
@@ -62,6 +68,9 @@ public:
UObject* Outer, const FSGHandPoseImpl& HandPoseImpl);
public:
/**
* The default constructor.
*/
static USGHandPose* NewHandPose(UObject* Outer);
static USGHandPose* NewHandPose(
@@ -69,34 +78,87 @@ public:
bool bRightHanded, const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles);
/**
* Create a new instance of HandPose.
*/
static USGHandPose* NewHandPose(
UObject* Outer,
bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles);
/**
* Create a new instance of HandPose.
*/
static USGHandPose* NewHandPose(
UObject* Outer,
bool bRightHanded, const TArray<FSGVectorArray>& JointPositions, const TArray<FSGQuatArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles);
/**
* Create a new instance of HandPose.
*/
static USGHandPose* NewHandPose(
UObject* Outer,
bool bRightHanded, const TArray<FSGVectorArray>& JointPositions, const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles);
public:
/**
* Deserialize a HandPose back into usable values.
*/
static USGHandPose* Deserialize(UObject* Outer, const FString& SerializedString);
/**
* Generate a HandPose based on articulation angles (handAngles).
*/
static USGHandPose* FromHandAngles(UObject* Outer,
const TArray<TArray<FVector>>& HandAngles, bool bRightHanded,
const USGBasicHandModel* HandDimensions);
/**
* Generate a HandPose based on articulation angles (handAngles), with a default HandModel.
*/
static USGHandPose* FromHandAngles(UObject* Outer, const TArray<TArray<FVector>>& HandAngles, bool bRightHanded);
/**
* Create a new instance of a left or right handed Pose that is "idle"; in a neutral position.
*/
static USGHandPose* DefaultIdle(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions);
/**
* Create a new instance of a left or right handed Pose that is "idle"; in a neutral position.
*/
static USGHandPose* DefaultIdle(UObject* Outer, bool bRightHanded);
/**
* Generates a HandPose representing an 'open hand', used in calibration to determine finger extension.
*/
static USGHandPose* FlatHand(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions);
/**
* Generates a HandPose representing an 'open hand', used in calibration to determine finger extension.
*/
static USGHandPose* FlatHand(UObject* Outer, bool bRightHanded);
/**
* Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction.
*/
static USGHandPose* ThumbsUp(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions);
/**
* Generates a HandPose representing a 'thumbs up', used in calibration to determine finger flexion, thumb extension and adduction.
*/
static USGHandPose* ThumbsUp(UObject* Outer, bool bRightHanded);
/**
* Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction.
*/
static USGHandPose* Fist(UObject* Outer, bool bRightHanded, const USGBasicHandModel* HandDimensions);
/**
* Generates a HandPose representing a 'fist', used in calibration to determine, thumb flexion and abduction.
*/
static USGHandPose* Fist(UObject* Outer, bool bRightHanded);
private:
@@ -111,16 +173,39 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGHandPose();
/**
* Create a new instance of HandPose.
*/
USGHandPose(bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles);
/**
* Create a new instance of HandPose.
*/
USGHandPose(bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& HandAngles);
/**
* Create a new instance of HandPose.
*/
USGHandPose(bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions, const TArray<FSGQuatArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles);
/**
*
*/
USGHandPose(bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions, const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& HandAngles);
public:
/**
* The cast from underlying type constructor.
@@ -146,23 +231,59 @@ public:
const FSGHandPoseImpl& ToHandPoseImpl() const;
public:
/**
* Whether this HandPose was created to be a right- or left hand.
*/
bool IsRight() const;
/**
* Positions of all hand joints relative to the Sense Glove origin. From thumb to pinky, proximal to distal.
*/
TArray<TArray<FVector>> GetJointPositions() const;
TArray<TArray<FQuat>> GetJointRotations() const;
/**
* Quaternion rotations of all hand joints. From thumb to pinky, proximal to distal.
*/
TArray<TArray<FQuat>> GetJointRotationsQ() const;
/**
* Rotations of all hand joints. From thumb to pinky, proximal to distal.
*/
TArray<TArray<FRotator>> GetJointRotations() const;
/**
* Euler representations of all possible hand angles. From thumb to pinky, proximal to distal.
*/
TArray<TArray<FVector>> GetHandAngles() const;
public:
/**
* Returns true of these two hand poses are roughly equal.
*/
bool Equals(const USGHandPose* HandPose) const;
/**
* Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed).
*
* @remarks Useful for animation or for detecting gestures.
*/
float GetNormalizedFlexion(ESGFinger Finger, bool bClamp01 = true) const;
/**
* Returns the total flexion of a specific finger as a value between 0 (fully extended) and 1 (fully flexed).
*
* @remarks Useful for animation or for detecting gestures.
*/
TArray<float> GetNormalizedFlexion(bool bClamp01 = true) const;
public:
/**
*
*/
FString ToString(bool bShortFormat = false) const;
/**
* Serialize this HandPose into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* A profile containing all the information required for HapticGloves.
*/
@@ -41,13 +41,15 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGHandProfile.generated.h"
class FSGHandProfileImpl;
class USGNovaGloveHandProfile;
class USGSenseGloveHandProfile;
/**
* Interpolation profiles for a user's hand, compatible with all HapticGloves.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHandProfile final : public UObject
{
@@ -58,8 +60,14 @@ public:
UObject* Outer, const FSGHandProfileImpl& HandProfileImpl);
public:
/**
* The default constructor.
*/
static USGHandProfile* NewHandProfile(UObject* Outer);
/**
* Creates a new instance of a HandProfile.
*/
static USGHandProfile* NewHandProfile(
UObject* Outer,
bool bRightHanded,
@@ -67,25 +75,55 @@ public:
const USGNovaGloveHandProfile* NovaGloveHandProfile);
public:
/**
* Generate a new handProfile for either a left or right hand.
*/
static USGHandProfile* Default(UObject* Outer, bool bRightHanded);
/**
* Convert a string notation of a NovaGloveHandProfile into a new instance.
*/
static USGHandProfile* Deserialize(UObject* Outer, const FString& SerializedString);
public:
/**
* Returns the directory where HandProfiles are being stored. Does not include a '\\' at the end.
*/
static FString GetProfileDirectory();
/**
* Filename for the left hand profile.
*/
static FString GetLeftHandFileName();
/**
* Filename for the right hand profile.
*/
static FString GetRightHandFileName();
/**
* Returns the fileName of the left or right-handed profiles.
*/
static FString GetProfileFileName(bool bRightHanded);
/**
* Retrieves the latest HandProfile from disk. If this function returns false, latestProfils is equal to SGCOre::HandProfile::Default(rightHand).
*/
static bool GetLatestProfile(UObject* Outer, bool bRightHanded, USGHandProfile*& OutLatestProfile);
/**
* Stores a HandProfile on disk for other programs to access. Call this function only if your software handles calibration functions.
*/
static bool StoreProfile(const USGHandProfile* ProfileToStore);
/**
* Resets the Calibration of a specific back to default values.
*/
static bool ResetCalibration(bool bRightHanded, bool bOnDisk = true);
/**
* Resets the Calibration of both hands back to default values.
*/
static void ResetCalibration(bool bOnDisk = true);
private:
@@ -100,8 +138,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGHandProfile();
/**
* Creates a new instance of a HandProfile.
*/
USGHandProfile(bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile);
@@ -131,17 +175,35 @@ public:
const FSGHandProfileImpl& ToHandProfileImpl() const;
public:
/**
* Whether this profile was created for a left or right hand.
*/
bool IsRight() const;
/**
* Profile for SenseGloves.
*/
USGSenseGloveHandProfile* GetSenseGloveHandProfile(UObject* Outer) const;
/**
* User profile for Nova.
*/
USGNovaGloveHandProfile* GetNovaGloveHandProfile(UObject* Outer) const;
public:
/**
*
*/
bool Equals(const USGHandProfile* HandProfile) const;
/**
* Reset this profile back to its default values.
*/
void Reset();
public:
/**
* Convert this NovaGloveHandProfile into a string notation so it can be stored on disk.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* An interface for any of our gloves that can track hand motion and/or send
* force / vibrotactile feedback.
*/
@@ -55,6 +56,9 @@ class FSGSenseGloveImpl;
class USGBuzzCommand;
class USGForceFeedbackCommand;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGlove : public USGDevice
{
@@ -69,13 +73,25 @@ protected:
static USGHapticGlove* NewHapticGlove(UObject* Outer, TSharedRef<FSGHapticGloveImpl> HapticGloveImpl);
protected:
/**
*
*/
static USGHapticGlove* NewHapticGlove(UObject* Outer);
public:
/**
* Get all Haptic Gloves detected on this system.
*/
static TArray<USGHapticGlove*> GetHapticGloves(UObject* Outer);
/**
* Get the first Haptic Glove detected on this system.
*/
static bool GetGlove(UObject* Outer, USGHapticGlove*& OutGlove);
/**
* Get the first left/right Haptic Glove detected on this system.
*/
static bool GetGlove(UObject* Outer, bool bRightHanded, USGHapticGlove*& OutGlove);
private:
@@ -90,6 +106,9 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
* The basic constructor.
*/
USGHapticGlove();
public:
@@ -158,67 +177,174 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Get the DeviceType enumerator of this device; used to check if its a SenseGlove/Nova/etc.
*/
virtual ESGDeviceType GetDeviceType() const override;
/**
* Retrieve this glove's unique identifier.
*/
virtual FString GetDeviceId() const override;
/**
* Retrieve this glove's hardware (sub) version. "DK1", "DK2", etc.
*/
virtual FString GetHardwareVersion() const override;
/**
* Retrieve this device's main firmware version. v4.12 returns 4.
*/
virtual int32 GetFirmwareVersion() const override;
/**
* Retrieve this device's sub firmware version. v4.12 returns 12.
*/
virtual int32 GetSubFirmwareVersion() const override;
/**
* Returns true if this glove is made for a right hand. If false, it's a left hand.
*/
virtual bool IsRight() const;
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
virtual bool GetImuRotation(FQuat& OutImu);
/**
* Retrieve this glove's IMU rotation, if if has any.
*/
virtual bool GetImuRotation(FRotator& OutImu);
/**
* Calculate the Hand Pose of this device, provided it has Hand Tracking available
*/
virtual bool GetHandPose(
UObject* Outer,
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile,USGHandPose*& OutHandPose);
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose);
/**
* Calculate the HandPose of this Device, taking into account user values, but not hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile, but with a specific hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose);
/**
* Retrieve a HandPose based on the latest profile and default hand Geometry.
*/
virtual bool GetHandPose(UObject* Outer, USGHandPose*& OutHandPose);
public:
/**
* Stops all Haptic effects if any are currently playing. Useful at the end of simulations or when resetting.
*/
virtual void StopHaptics();
/**
* Send Haptic Commands to this Glove.
*/
virtual void StopVibrations();
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGThumperCommand* ThumperCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand);
public:
/**
* Retrieve calibration values of this glove, as an array of size 5, containing x (roll), y (flexion), z (abduction) values.
*/
virtual bool GetCalibrationValues(TArray<FVector>& OutValues);
/**
* Reset Calibration range for this Device.
*/
virtual void ResetCalibrationRange();
/**
* Updates calibration values only.
*/
virtual void UpdateCalibrationRange();
/**
* Updates calibration values only.
*/
virtual void UpdateCalibrationRange(const TArray<FVector>& CalibrationValues);
/**
* Access the minimum- and maximum sensor values measured by this Haptic Glove, in this session.
*/
virtual void GetCalibrationRange(TArray<FVector>& OutMinValues,
TArray<FVector>& OutMaxValues);
/**
* Updates Calibration values and applies it to the Profile.
*/
virtual void UpdateCalibration(UObject* Outer, USGHandProfile*& OutProfile);
/**
* Apply this glove's calibration range to a handProfile.
*/
virtual void ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const;
public:
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*
* @remarks The simplest interface, using default offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const;
};
@@ -41,13 +41,16 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGSensorRange.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGHapticGloveCalibrationCheck.generated.h"
class FSGHapticGloveCalibrationCheckImpl;
class USGSensorRange;
/**
* An algorithm that checks whether or not our current user is running in the same calibration range as last time.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCalibrationCheck final : public UObject
{
@@ -58,32 +61,68 @@ public:
UObject* Outer, const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl);
public:
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
static USGHapticGloveCalibrationCheck* NewHapticGloveCalibrationCheck(UObject* Outer);
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
static USGHapticGloveCalibrationCheck* NewHapticGloveCalibrationCheck(
UObject* Outer, const USGSensorRange* LastCalibrationRange);
public:
/**
* SenseGlove: How far from the threshold one can be where we would still call it 'the same as before'.
*/
static float GetSenseGloveThreshold();
/**
* Nova: How far from the threshold one can be where we would still call it 'the same as before'.
*/
static float GetNovaGloveThreshold();
/**
* SenseGlove: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
static float GetSenseGloveMinFlexion();
/**
* Nova: The minimum amount of sensor flexion movement before we start testing for a smaller hand.
*/
static float GetNovaGloveMinFlexion();
/**
* SenseGlove: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
static float GetSenseGloveMinAbduction();
/**
* Nova: The minimum amount of sensor movement on the thumb abduction before we start testing for a smaller hand.
*/
static float GetNovaGloveMinAbduction();
public:
/**
* Returns true if this DeviceType requires a calibration check.
*/
static bool NeedsCheck(ESGDeviceType DeviceType);
/**
* Checks if current values are operating out of the previous range. Returns -1 if all is fine. 0...4 to indicate which finger is out of bounds.
*/
static int32 OutOfBounds(const USGSensorRange* PreviousRange, const TArray<FVector>& CurrentValues,
ESGDeviceType DeviceType);
/**
* Returns true if the user has moved enough in both flexion and thumb abduction movement to be considered 'active'
*/
static bool MovedMinimum(const TArray<FVector>& CurrentRange, ESGDeviceType DeviceType);
/**
* Returns true if the current sensor values have moved roughly as much as last time.
*/
static bool MatchesLast(const TArray<FVector>& CurrentRange, const TArray<FVector>& LastRange,
ESGDeviceType DeviceType);
@@ -99,8 +138,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
USGHapticGloveCalibrationCheck();
/**
* The last calibration range can be null, at which point you definitely need calibration.
*/
explicit USGHapticGloveCalibrationCheck(const USGSensorRange* LastCalibrationRange);
public:
@@ -128,15 +173,30 @@ public:
const FSGHapticGloveCalibrationCheckImpl& ToHapticGloveCalibrationCheckImpl() const;
public:
/**
*
*/
USGSensorRange* GetLastSensorRange(UObject* Outer) const;
public:
/**
*
*/
ESGCalibrationStage GetCalibrationStage() const;
/**
* Whether this algorithm has determined if calibration is required, or not.
*/
bool ReachedConclusion() const;
public:
/**
* Reset the calibration check. so it may be used again. This does not reset the last range.
*/
void Reset();
/**
* Using the currently received Sensor Values, check if calibration is required. This function will have to be called until a conclusion can be reached.
*/
void CheckRange(const TArray<FVector>& CurrentValues, float DeltaSeconds, ESGDeviceType DeviceType);
};
@@ -29,7 +29,6 @@
*
* @section DESCRIPTION
*
*
*/
@@ -41,18 +40,21 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGCalibrationDataPoint.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGSensorRange.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGHapticGloveCalibrationSequence.generated.h"
class FSGHapticGloveCalibrationSequenceImpl;
class FSGHapticGloveQuickCalibrationImpl;
class USGCalibrationDataPoint;
class USGHandPose;
class USGHandProfile;
class USGHapticGlove;
class USGSensorRange;
/**
* A sequence which collects data points until specific criteria have been met. It must be 'fed' an Update command from your program in order to work.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCalibrationSequence : public UObject
{
@@ -66,16 +68,28 @@ public:
UObject* Outer, TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequence);
protected:
/**
*
*/
static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(UObject* Outer);
public:
/**
* Create a new instance of a base HapitcGlove Calibration Sequence.
*/
static USGHapticGloveCalibrationSequence* NewHapticGloveCalibrationSequence(
UObject* Outer, const USGHapticGlove* LinkedGlove);
public:
/**
* The maximum buffer size for calibration points. Once calibrationPoints exceeds this value, the
*/
static int32 GetMaxDataPoints();
public:
/**
* Converts a calibration range taken from a Calibration sequence, and converts it into a profile. Use this if you're not actually using the sequence.
*/
static bool CompileProfile(UObject* Outer,
const USGSensorRange* SensorRange, ESGDeviceType ForDevice, bool bRightHanded,
USGHandProfile*& OutProfile);
@@ -92,9 +106,15 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
*
*/
USGHapticGloveCalibrationSequence();
public:
/**
* Create a new instance of a base HapitcGlove Calibration Sequence.
*/
explicit USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove);
public:
@@ -172,41 +192,96 @@ protected:
virtual void SyncUProperties();
public:
/**
* Glove linked to this calibration sequence. Will attempt to grab data from this glove evey time Update() is called.
*/
USGHapticGlove* GetLinkedGlove(UObject* Outer) const;
/**
*
*/
void SetLinkedGlove(const USGHapticGlove* LinkedGlove);
/**
* Calibration points collected during this calibration process. One is added every time the "Update()" function is called.
* Used to create a profile after the calibration finishes.
*/
TArray<USGCalibrationDataPoint*> GetCalibrationPoints(UObject* Outer) const;
/**
* How much time has elapsed during this calibration sequence. Useful for logging or for automated functions.
*/
float GetElapsedTime() const;
/**
* Used to determine if the user has manually ended the sequence, to prevent us from adding any more calibration points.
*/
bool IsManuallyCompleted() const;
/**
* If a sequence consists of multiple stages, this integer will show you which one is currently active.
*/
int32 GetCurrentStage() const;
/**
* Returns the amount of calibration points collected so far.
*/
SIZE_T GetCalibrationPointsCount() const;
/**
* Whether or not this sequence was completed as per its own rules.
*/
bool AutoCompleted() const;
/**
* Returns true if this sequence is marked as 'complete' and can begin compiling a profile.
*/
bool Completed() const;
public:
/**
* Resets this calibration sequence's data, but not it's LinkedGlove.
*/
void Reset();
/**
*
*/
void AddDataPoint(const TArray<FVector>& CalibrationPoints);
/**
* Update this calibration sequence with new data. We use deltaSeconds to check for things like stability.
*/
void Update(float DeltaSeconds);
/**
* Manual confirmation of whatever step we're supposed to making at the moment.
*/
void ConfirmCurrentStep();
public:
/**
* Compile a min/max range from the data points collected by this sequence. Returns true if it's actually possible.
*/
bool CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const;
/**
* Compile a profile from the data points collected by this sequence. Returns true if it's actually possible.
*/
bool CompileProfile(UObject* Outer, ESGDeviceType ForDevice, bool bRightHanded, USGHandProfile*& OutProfile) const;
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
bool GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const;
/**
* Returns the current HandPose; either the one we should be making, or what it would look like at the moment.
*/
bool GetHandPose(UObject* Outer, bool bRightHanded, USGHandPose*& OutCurrentHandPose) const;
/**
* Retrieve instructions on what to do during the current step.
*/
FString GetCurrentInstruction(const FString& NextStepKey = FString{""}) const;
};
@@ -50,6 +50,9 @@ class USGBuzzCommand;
class USGForceFeedbackCommand;
class USGTimedBuzzCommand;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveCommandBuffer final : public UObject
{
@@ -60,13 +63,25 @@ public:
UObject* Outer, const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl);
public:
/**
* Create a new HapticsStream for a Haptic Glove.
*/
static USGHapticGloveCommandBuffer* NewHapticGloveCommandBuffer(UObject* Outer);
public:
/**
* The base maximum amount of Force-Feedback Commands that can be in a queue.
*/
static int32 GetMaxForceFeedbackCommands();
/**
* The base maximum amount of Vibrotactile Commands that can be in a queue.
*/
static int32 GetMaxBuzzCommands();
/**
* The base maximum amount of Thumper Commands that can be in a queue.
*/
static int32 GetMaxThumpCommands();
private:
@@ -81,6 +96,9 @@ private:
FImplDeleter PimplDeleter;
public:
/**
*
*/
USGHapticGloveCommandBuffer();
public:
@@ -108,38 +126,83 @@ public:
const FSGHapticGloveCommandBufferImpl& ToHapticGloveCommandBufferImpl() const;
public:
/**
* All Force Feedback Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGForceFeedbackCommand*> GetForceFeedbackCommandsQueue(UObject* Outer) const;
/**
* All Timed Buzz Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGTimedBuzzCommand*> GetBuzzCommandsQueue(UObject* Outer) const;
/**
* All Timed Thump Commands that have been received this 'frame'. Will be flattened into a single command during FlushHapitcs.
*/
TArray<USGTimedThumpCommand*> GetThumperCommandsQueue(UObject* Outer) const;
public:
/**
* Clears only the Force-Feedback Queue.
*/
void ClearForceFeedbackCommandsQueue();
/**
* Clears all vibrations in the queue(s).
*/
void ClearVibrations();
/**
* Clear all ongoing effects to this stream.
*/
void Clear();
/**
* Add a new Force-Feedback command to the queue. Does not actually send it.
*/
void AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Add a new vibrotactile command to the queue. Does not actually send it.
*/
void AddCommand(const USGTimedBuzzCommand* BuzzCommand);
/**
* Add a new Thumper command to the queue. Does not actually send it. Does not work with SenseGlove, only for Nova's
*/
void AddCommand(const USGTimedThumpCommand* ThumpCommand);
/**
* Update the active commands, using a deltaSeconds since last update, in seconds. Any timedCommands that are elapsed will be removed from the list.
*/
void UpdateTimedCommands(float DeltaSeconds);
public:
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue. Returns lastForceFeedbackCommand if no ForceFeedback commands are given.
*/
USGForceFeedbackCommand* GetTotalForceFeedbackLevels(
UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const;
/**
* Compiles all ForceFeedback Levels in the queue into a single one. Does not clear the queue.
*/
USGForceFeedbackCommand* GetTotalForceFeedbackLevels(UObject* Outer) const;
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
USGBuzzCommand* GetTotalBuzzLevels(UObject* Outer) const;
/**
* Compiles all active vibrotactile in the queue into a single list of levels. Does not clear the queue.
*/
USGThumperCommand* GetTotalThumperLevels(UObject* Outer) const;
public:
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Only clears the ForceFeedback queue, and only if you want it to.
*/
void FlushHaptics(UObject* Outer,
const USGForceFeedbackCommand* LastBrakeLevel,
USGForceFeedbackCommand*& OutForceFeedbackCommand,
@@ -147,6 +210,9 @@ public:
USGThumperCommand*& OutThumperCommand,
bool bClearForceFeedbackQueue = true);
/**
* Compile all commands in the queue(s) into a single set of commands that can be sent to the glove. Also updates & clears all queues.
*/
void FlushHaptics(UObject* Outer,
float DeltaSeconds,
const USGForceFeedbackCommand* LastBrakeLevel,
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* An interface to get calibration to / from disk.
*/
@@ -37,44 +37,89 @@
#include "Containers/UnrealString.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGSensorRange.h"
#include "SGHapticGloveHandProfiles.generated.h"
class USGHandProfile;
class USGHapticGlove;
class USGSensorRange;
/**
* A glove developed by SenseGlove, that has hand tracking and/or haptic feedback functionality.
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGHapticGloveHandProfiles
{
GENERATED_BODY()
public:
/**
* Returns the directory where our HandProfiles are stored.
*/
static FString GetProfileDirectory();
/**
* Set the directory where our HandProfiles are stored.
*/
static void SetProfileDirectory(const FString& Directory);
/**
* Access the latest Left Hand Profile from disk.
*/
static void GetLeftHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Left Hand Profile - also stores it on disk.
*/
static void SetLeftHandProfile(const USGHandProfile* HandProfile);
/**
* Access the latest Right Hand Profile from disk.
*/
static void GetRightHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile);
/**
* Sets the newest Right Hand Profile - also stores it on disk.
*/
static void SetRightHandProfile(const USGHandProfile* HandProfile);
/**
* Retrieve a left- or right handed profile.
*/
static void GetProfile(UObject* Outer, bool bRightHanded, USGHandProfile*& OutHandProfile);
/**
* Store a profile in the global variables and on disk. The profile determines if this is a left or right hand.
*/
static void SetProfile(const USGHandProfile* HandProfile);
/**
* Store a profile in the global variables and on disk. You determine if this is a left or right hand.
*/
static void SetProfile(const USGHandProfile* HandProfile, bool bRightHanded);
/**
* Restore both profiles back to their default values.
*/
static void RestoreDefaults();
/**
* Restore the left- or right hand profiles back to their default values.
*/
static void RestoreDefaults(bool bRightHanded);
/**
* Load the latest profiles from disk. Automatically called when you first try to access a profile.
* Exposed so you can force-reload profiles.
*/
static void TryLoadingFromDisk();
/**
* Stores the last sensor range of a glove.
*/
static bool SaveLastRange(const USGSensorRange* CurrentRange, const USGHapticGlove* ForGlove);
/**
* Loads the last sensor range of a glove.
*/
static bool LoadLastRange(UObject* Outer, const USGHapticGlove* ForGlove, USGSensorRange*& OutLastRange);
};
@@ -45,6 +45,9 @@
class FSGHapticGloveQuickCalibrationImpl;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGHapticGloveQuickCalibration final : public USGHapticGloveCalibrationSequence
{
@@ -57,14 +60,24 @@ public:
static USGHapticGloveQuickCalibration* NewHapticGloveQuickCalibration(
UObject* Outer, TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibration);
public:
/**
*
*/
static USGHapticGloveQuickCalibration* NewHapticGloveQuickCalibration(UObject* Outer);
/**
* Create a new instance of a QuickCalibration for Haptic Gloves.
*/
static USGHapticGloveQuickCalibration* NewHapticGloveQuickCalibration(
UObject* Outer,
const USGHapticGlove* GloveToCalibrate,
float AutoEndTimeout = GetDefaultAutoEndTimeout());
public:
/**
* Default time in seconds, to end this sequence. 15 seconds is very quick for some people.
*/
static float GetDefaultAutoEndTimeout();
private:
@@ -79,8 +92,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
*
*/
USGHapticGloveQuickCalibration();
/**
* Create a new instance of a QuickCalibration for Haptic Gloves.
*/
explicit USGHapticGloveQuickCalibration(const USGHapticGlove* GloveToCalibrate,
float AutoEndTimeout = GetDefaultAutoEndTimeout());
@@ -121,31 +140,70 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Time, in seconds, after which this sequence stops gathering data. Based on the deltaSeconds variable passed in the Update() function.
*/
float GetAutoEndTimeout() const;
/**
* When compiling the final profile, we use a Weighted Moving Average filter with this period to filer out some outliers.
*/
int32 GetSmoothingSamples() const;
/**
* The min/max values recorded during this calibration sequence.
*/
USGSensorRange* GetSensorRange(UObject* Outer) const;
/**
* A temporary profile to apply the sensorRange to. Used to generate a 'preview' HandPose.
*/
USGHandProfile* GetTemporaryProfile(UObject* Outer) const;
/**
* Determines if the user has moved enough so that we can animate.
*/
bool CanAnimate() const;
public:
/**
* This sequence autocompletes after its autoEndTime has elapsed.
*/
bool AutoCompleted() const;
public:
/**
* Resets data points, min/max ranges and profile.
*/
void Reset();
/**
* Update this calibration sequence with new data. We use deltaSeconds to check for things like stability.
*/
void Update(float DeltaSeconds);
/**
* Add a new datapoint to this sequence's collection. Updates the range and profile used to generate a preview.
*/
void AddDataPoint(const TArray<FVector>& CalibrationData);
/**
* After we confirm the current step, we're basically done.
*/
void ConfirmCurrentStep();
/**
* Compile a sensor range from the data points collected while the sequence was running. Smoothed by a Moving Average Filter.
*/
bool CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const;
/**
* Returns a 'preview' of what a HandPose with this sequence's current settings would look like.
*/
bool GetHandPose(UObject* Outer, bool bRightHanded, USGHandPose*& OutCurrentHandPose) const;
/**
* Retrieve instructions on what to do during the current step.
*/
FString GetCurrentInstruction(const FString& NextStepKey = FString{""}) const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Data class containing all variables to map an input value from one range to
* another.
*/
@@ -47,6 +48,9 @@
class FSGInterpolationSetImpl;
/**
* Set of variables to map a value from one range to the next.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGInterpolationSet final : public UObject
{
@@ -57,14 +61,26 @@ public:
UObject* Outer, const FSGInterpolationSetImpl& InterpolationSetImpl);
public:
/**
* Creates a basic interpolation set, without limits.
*/
static USGInterpolationSet* NewInterpolationSet(UObject* Outer);
/**
* Create a new interpolation set without limits.
*/
static USGInterpolationSet* NewInterpolationSet(UObject* Outer, float From1, float From2, float To1, float To2);
/**
* Create a new interpolation set with limits.
*/
static USGInterpolationSet* NewInterpolationSet(
UObject* Outer, float From1, float From2, float To1, float To2, float Min, float Max);
public:
/**
* Convert a string notation of an InterpolationSet into a new class instance.
*/
static USGInterpolationSet* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -79,10 +95,19 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Creates a basic interpolation set, without limits.
*/
USGInterpolationSet();
/**
* Create a new interpolation set without limits.
*/
USGInterpolationSet(float From1, float From2, float To1, float To2);
/**
* Create a new interpolation set with limits.
*/
USGInterpolationSet(float From1, float From2, float To1, float To2, float Min, float Max);
public:
@@ -110,40 +135,91 @@ public:
const FSGInterpolationSetImpl& ToInterpolationSetImpl() const;
public:
/**
* First value of input range.
*/
float GetX0() const;
/**
*
*/
void SetX0(float X0);
/**
* Second value of input range.
*/
float GetX1() const;
/**
*
*/
void SetX1(float X1);
/**
* First value of output range.
*/
float GetY0() const;
/**
*
*/
void SetY0(float Y0);
/**
* Second value of output range.
*/
float GetY1() const;
/**
*
*/
void SetY1(float Y1);
/**
* Minimum range of the output value.
*/
float GetMin() const;
/**
*
*/
void SetMin(float Min);
/**
* Maximum range of the output value.
*/
float GetMax() const;
/**
*
*/
void SetMax(float Max);
public:
/**
* Calculate an output value in range [x0...x1] to [y0..y1]
*/
float Get(float Value, bool bLimit, bool bNormalizeAngle = false) const;
public:
/**
* Returns true if this InterpolationSet has the same values as another set.
*/
bool Equals(const USGInterpolationSet* InterpolationSet) const;
public:
/**
*
*/
FString ToString() const;
/**
*
*/
FString ToString(bool bLimits) const;
/**
* Convert this InterpolationSet into a string notation so it can be stored on disk.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Contains kinematic formulae and wrappers for Sense Glove mathematics.
*/
@@ -39,23 +39,50 @@
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGJointKinematics.generated.h"
class USGBasicHandModel;
/**
*
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGJointKinematics
{
GENERATED_BODY()
public:
/**
* Perform forward Kinematics on a set of joints, defined by a start position- and rotation,
* joint angles and the lengths in between. Outputs the calculated positions and rotations.
*/
static bool ForwardKinematics(
const FVector& StartPosition, const FQuat& StartRotation,
const TArray<FVector>& JointLengths, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FQuat>& OutNewRotations);
/**
* Perform forward Kinematics on a set of joints, defined by a start position- and rotation,
* joint angles and the lengths in between. Outputs the calculated positions and rotations.
*/
static bool ForwardKinematics(
const FVector& StartPosition, const FRotator& StartRotation,
const TArray<FVector>& JointLengths, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FRotator>& OutNewRotations);
/**
* Calculate positions and rotations of a finger based on input angles and profile.
*/
static bool ForwardKinematics(
const USGBasicHandModel* Profile, ESGFinger Finger, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FQuat>& OutNewRotations);
/**
* Calculate positions and rotations of a finger based on input angles and profile.
*/
static bool ForwardKinematics(
const USGBasicHandModel* Profile, ESGFinger Finger, const TArray<FVector>& JointAngles,
TArray<FVector>& OutNewPositions, TArray<FRotator>& OutNewRotations);
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Information about the SGCore C++ Library.
*/
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* An interface for the "Nova" - a soft glove.
* Contains methods for Kinematics, Haptics and Serialization.
*/
@@ -41,11 +42,7 @@
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGNovaGloveSensorData.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGNovaGlove.generated.h"
@@ -53,8 +50,13 @@
class FSGNovaGloveImpl;
class USGBuzzCommand;
class USGForceFeedbackCommand;
class USGNovaGloveInfo;
class USGNovaGloveSensorData;
class USGThumperCommand;
/**
* A soft glove with Force- and Vibrotactile Feedback and limited tracking.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGNovaGlove final : public USGHapticGlove
{
@@ -66,51 +68,113 @@ public:
static USGNovaGlove* NewNovaGlove(UObject* Outer, TSharedRef<FSGNovaGloveImpl> NovaGloveImpl);
public:
/**
*
*/
static USGNovaGlove* NewNovaGlove(UObject* Outer);
/**
*
*/
static USGNovaGlove* NewNovaGlove(UObject* Outer, const USGNovaGloveInfo& DeviceInfo);
public:
/**
* Byte indicating a new Nova haptic command.
*/
static ANSICHAR GetHapticsByte();
/**
* Minimum calibration value distance until we apply the range.
*/
static FVector GetMinCalibrationRange();
public:
/**
* Calculate a Hand Pose based on a HandMode; sensor data from a Nova, and a UserProfile.
*/
static USGHandPose* CalculateHandPose(UObject* Outer,
const USGBasicHandModel* HandModel,
const USGNovaGloveSensorData* NovaData,
const USGNovaGloveHandProfile* Profile);
public:
/**
* Deserializes a Nova from its ConstantsString. Returns a nullptr if unsuccessful.
*/
static USGDevice* Parse(UObject* Outer, const FString& ConstantsString);
/**
* Retrieve all Nova's.
*/
static TArray<USGNovaGlove*> GetNovaGloves(UObject* Outer);
/**
* Retrieve the first connected Nova there is.
*/
static bool GetNovaGlove(UObject* Outer, USGNovaGlove*& OutGlove);
/**
* Retrieve the first (connected) right or left handed Nova.
*/
static bool GetNovaGlove(UObject* Outer, bool bRightHanded, USGNovaGlove*& OutGlove);
public:
/**
* Convert a SenseGlove GlovePose into calibrationValues.
*/
static TArray<FVector> GetCalibrationValues(const USGNovaGloveSensorData* SensorData);
/**
*
*/
static void CalibrateInterpolation(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues,
USGNovaGloveHandProfile*& OutProfile);
public:
/**
* Retrieve the location of the glove origin, based on a reference location without requiring an object reference.
*/
static void CalculateGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, bool bRightHanded,
FVector& OutGlovePosition, FQuat& OutGloveRotation);
/**
* Retrieve the location of the glove origin, based on a reference location without requiring an object reference.
*/
static void CalculateGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, bool bRightHanded,
FVector& OutGlovePosition, FRotator& OutGloveRotation);
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets, without needing an object reference.
*/
static void CalculateWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, bool bRightHanded,
FVector& OutWristPosition, FQuat& OutWristRotation);
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets, without needing an object reference.
*/
static void CalculateWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, bool bRightHanded,
FVector& OutWristPosition, FRotator& OutWristRotation);
public:
/**
* Converts a thumper command into bytes that the Nova can understand.
*/
static FString ToBytes(const USGThumperCommand* ThumperCommand);
/**
* Converts a force-feedback command into bytes that the Nova can understand.
*/
static FString ToBytes(const USGForceFeedbackCommand* ForceFeedbackCommand);
/**
* Converts a buzz-motor command into bytes that the Nova can understand.
*/
static FString ToBytes(const USGBuzzCommand* BuzzCommand);
private:
@@ -185,68 +249,156 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Return the DeviceType of this Nova.
*/
virtual ESGDeviceType GetDeviceType() const override;
/**
* Returns this device's unique identifier.
*/
virtual FString GetDeviceId() const override;
/**
* Access this device's hardware designation.
*/
virtual FString GetHardwareVersion() const override;
/**
* Access this device's main firmware version. (ex: v3.2 -> 3).
*/
virtual int32 GetFirmwareVersion() const override;
/**
* Access this device's sub-firmware version. (ex: v3.2 -> 2).
*/
virtual int32 GetSubFirmwareVersion() const override;
public:
/**
* Returns true if this device operates on a battery.
*/
virtual bool HasBattery() const override;
/**
* Returns true if this device is currently charging.
*/
virtual bool IsCharging() override;
/**
* Returns the device's battery level, as a value between 0 (empty) and 1 (full).
*/
virtual bool GetBatteryLevel(float& OutBatteryLevel) override;
public:
/**
* Get the latest Sensor Data from this Sense Glove.
*/
bool GetSensorData(UObject* Outer, USGNovaGloveSensorData*& OutSensorData);
/**
* Retrieve Nova rotation.
*/
virtual bool GetImuRotation(FQuat& OutImu) override;
/**
* Retrieve Nova rotation.
*/
virtual bool GetImuRotation(FRotator& OutImu) override;
/// HACK
/// 'FSGNovaGlove::GetHandPose' hides overloaded virtual functions [-Werror,-Woverloaded-virtual]
/// tell the compiler we want both the GetHandPose from FSGHapticGlove and FSGNovaGlove
/// tell the compiler we want both the GetHandPose from USGHapticGlove and USGNovaGlove
using USGHapticGlove::GetHandPose;
/**
* Retrieve a new hand pose using this glove, based on (calibrated) user data.
*/
bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandModel, const USGNovaGloveHandProfile* Profile,
USGHandPose*& OutHandPose);
/**
* Retrieve a new hand pose using this glove, based on (calibrated) user data.
*/
virtual bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose) override;
/**
* Calculate the HandPose of this Device, taking into account user values, but not hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose) override;
public:
/**
* Send all available haptics to a Nova.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand) override;
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand) override;
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGBuzzCommand* BuzzCommand) override;
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGThumperCommand* ThumperCommand) override;
public:
/**
* Retrieve calibration values of this glove, as an array of size 5, containing x (roll), y (flexion), z (abduction) values.
*/
virtual bool GetCalibrationValues(TArray<FVector>& OutValues) override;
/**
* Applies the calibration range of this Nova a HandProfile.
*/
virtual void ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const override;
/**
* Applies the calibration range of this SenseGlove to a NovaGloveHandProfile.
*/
void ApplyCalibration(UObject* Outer, USGNovaGloveHandProfile*& OutProfile) const;
public:
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const override;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const override;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const override;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const override;
public:
/**
* Create a string representation of this device for reporting purposes.
*/
virtual FString ToString() const override;
};
@@ -38,21 +38,30 @@
#include "Containers/Array.h"
#include "Math/Vector.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGNovaGloveCalibration.generated.h"
class USGNovaGloveHandProfile;
/**
*
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGNovaGloveCalibration
{
GENERATED_BODY()
public:
/**
* Apply a glove's default interpolation values to a profile, using the 'default' hand angles from calibration.
*/
static void ApplyDefaultCalibrationInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const USGNovaGloveHandProfile* Profile);
/**
* Apply a set of sensor-to-joint-angle interpolations to a nova profile.
*/
static void ApplyInterpolationValues(
const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Input for Nova kinematics to calculate a HandPose.
* Output of calibration algorithms.
*/
@@ -41,13 +42,14 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGNovaGloveHandProfile.generated.h"
class FSGNovaGloveHandProfileImpl;
class USGHandInterpolator;
/**
* Contains user-specific data for the Nova to convert sensor data into a hand pose.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGNovaGloveHandProfile final : public UObject
{
@@ -58,11 +60,28 @@ public:
UObject* Outer, const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl);
public:
/**
* The default constructor.
*/
static USGNovaGloveHandProfile* NewNovaGloveHandProfile(UObject* Outer);
/**
* Create a new instance of a Nova-Profile.
*/
static USGNovaGloveHandProfile* NewNovaGloveHandProfile(
UObject* Outer, bool bRightHanded, const USGHandInterpolator* Interpolator);
public:
/**
* Creates a default Nova Profile for a left or right hand.
*/
static USGNovaGloveHandProfile* Default(UObject* Outer, bool bRightHanded);
/**
* Convert a string notation of a NovaGloveHandProfile into a new instance.
*/
static USGNovaGloveHandProfile* Deserialize(UObject* Outer, const FString& SerializedString);
private:
struct FImpl;
@@ -75,8 +94,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGNovaGloveHandProfile();
/**
* Create a new instance of a Nova-Profile.
*/
USGNovaGloveHandProfile(bool bRightHanded, const USGHandInterpolator* Interpolator);
public:
@@ -104,15 +129,30 @@ public:
const FSGNovaGloveHandProfileImpl& ToNovaGloveHandProfileImpl() const;
public:
/**
* Whether this profile was created for a right- or left hand.
*/
bool IsRight() const;
/**
* Interpolation sets to convert sensor data into a hand pose.
*/
USGHandInterpolator* GetInterpolationSet(UObject* Outer) const;
public:
/**
*
*/
bool Equals(const USGNovaGloveHandProfile* NovaGloveHandProfile) const;
/**
*
*/
void Reset();
public:
/**
* Convert this NovaGloveHandProfile into a string notation so it can be stored on disk.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Contains information on Nova's hardware, extracted from the device.
*/
@@ -42,13 +42,13 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGNovaGloveInfo.generated.h"
class FSGNovaGloveInfoImpl;
/**
* Device information extracted from a Nova Glove.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGNovaGloveInfo final : public UObject
{
@@ -59,16 +59,28 @@ public:
UObject* Outer, const FSGNovaGloveInfoImpl& NovaGloveInfoImpl);
public:
/**
* The default constructor.
*/
static USGNovaGloveInfo* NewNovaGloveInfo(UObject* Outer);
/**
* Create a new instance of a NovaGloveInfo.
*/
static USGNovaGloveInfo* NewNovaGloveInfo(
UObject* Outer,
const FString& DeviceId, const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, const FQuat& ImuCorrection, int32 NumberOfSensors);
public:
/**
* Parse an constants string into a NovaGloveInfo class.
*/
static bool Parse(UObject* Outer, const FString& ConstantsString, USGNovaGloveInfo*& OutGloveInfo);
/**
* Convert a string representation back into a NovaGloveInfo class.
*/
static USGNovaGloveInfo* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -83,8 +95,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGNovaGloveInfo();
/**
* Create a new instance of a NovaGloveInfo.
*/
USGNovaGloveInfo(const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, const FQuat& ImuCorrection, int32 NumberOfSensors);
@@ -120,25 +138,60 @@ protected:
FSGNovaGloveInfoImpl& ToNovaGloveInfoImpl();
public:
/**
* Unique identifier of this device.
*/
FString GetDeviceId() const;
/**
* Hardware (sub) version of this Sense Glove Device.
*/
FString GetHardwareVersion() const;
/**
* Firmware version running on the device's MicroController. (as v4.12, this is the 4).
*/
int32 GetFirmwareVersion() const;
/**
* Sub firmware version running on the device's microcontroller (as v4.12, this is the .12).
*/
int32 GetSubFirmwareVersion() const;
/**
* Determines if this is a right-handed Nova.
*/
bool IsRight() const;
FQuat GetImuCorrection() const;
/**
* The IMU correction of this Nova.
*/
FQuat GetImuCorrectionQ() const;
/**
* The IMU correction of this Nova.
*/
FRotator GetImuCorrection() const;
/**
* The number of sensors in this device.
*/
int32 GetNumberOfSensors() const;
public:
/**
* Returns true if this GloveInfo contains the same information as another.
*/
bool Equals(const USGNovaGloveInfo* NovaGloveInfo) const;
public:
/**
* Create a string representation of this Glove Info.
*/
FString ToString() const;
/**
* Convert this class into a string representation so it can be unpacked later.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Nova SensorData, parsed from rae string representations.
*/
@@ -43,12 +43,14 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGNovaGloveInfo.h"
#include "SGNovaGloveSensorData.generated.h"
class FSGNovaGloveSensorDataImpl;
class USGNovaGloveInfo;
/**
* Sensor Data coming from a Nova, converted into useful values.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGNovaGloveSensorData final : public UObject
{
@@ -59,17 +61,39 @@ public:
UObject* Outer, const FSGNovaGloveSensorDataImpl& NovaGloveSensorDataImpl);
public:
/**
* Default constructor for NovaGloveSensorData.
*/
static USGNovaGloveSensorData* NewNovaGloveSensorData(UObject* Outer);
/**
* Create a new instance of a NovaGloveSensorData.
*/
static USGNovaGloveSensorData* NewNovaGloveSensorData(
UObject* Outer, const TArray<FVector>& Values, int32 ParsedValues,
const FQuat& ImuRotation, bool bImuParsed, float BatteryLevel, bool bCharging);
/**
* Create a new instance of a NovaGloveSensorData.
*/
static USGNovaGloveSensorData* NewNovaGloveSensorData(
UObject* Outer, const TArray<FVector>& Values, int32 ParsedValues,
const FRotator& ImuRotation, bool bImuParsed, float BatteryLevel, bool bCharging);
public:
/**
* Returns a NovaGloveSensorData without any values.
*/
static USGNovaGloveSensorData* Empty(UObject* Outer);
/**
* Parse the bytes as they come in from the device into useable values.
*/
static USGNovaGloveSensorData* Parse(UObject* Outer, const FString& RawData, const USGNovaGloveInfo* GloveInfo);
/**
* Convert this sensor data into ta string representation.
*/
static USGNovaGloveSensorData* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -84,11 +108,23 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Default constructor for NovaGloveSensorData.
*/
USGNovaGloveSensorData();
/**
* Create a new instance of a NovaGloveSensorData.
*/
USGNovaGloveSensorData(const TArray<FVector>& Values, int32 ParsedValues,
const FQuat& ImuRotation, bool bImuParsed, float BatteryLevel, bool bCharging);
/**
* Create a new instance of a NovaGloveSensorData.
*/
USGNovaGloveSensorData(const TArray<FVector>& Values, int32 ParsedValues,
const FRotator& ImuRotation, bool bImuParsed, float BatteryLevel, bool bCharging);
public:
/**
* The cast from underlying type constructor.
@@ -114,23 +150,55 @@ public:
const FSGNovaGloveSensorDataImpl& ToNovaGloveSensorDataImpl() const;
public:
/**
* Pronation/Supination, Flexion/Extension and Abduction/Adduction values for each finger.
*/
TArray<FVector> GetSensorValues() const;
FQuat GetImuRotation() const;
/**
* Quaternion rotation relative to magnetic north.
*/
FQuat GetImuRotationQ() const;
/**
* Rotation relative to magnetic north.
*/
FRotator GetImuRotation() const;
/**
* The number of values that were parsed from the sensor string.
*/
int32 GetParsedValues() const;
/**
* Whether the IMU values were all successfully parsed, or not.
*/
bool IsImuParsed() const;
/**
* A value between 0..1 that represents the battery level of this Nova Glove (0 .. 100%). Returns -1 if the value wasn't received.
*/
float GetBatteryLevel() const;
/**
* Returns true if this NovaGlove is connected to a power source
*/
bool IsCharging() const;
public:
/**
* Returns true if this sensor data contains the same values as another.
*/
bool Equals(const USGNovaGloveSensorData* NovaGloveSensorData) const;
public:
/**
* Create a readable string representation of this Sensor Data
*/
FString ToString() const;
/**
* Convert this sensor data into a string so it can be stored on disk.
*/
FString SGSerialize() const;
};
@@ -0,0 +1,50 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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 "Math/Rotator.h"
#include "SGRotatorArray.generated.h"
USTRUCT(BlueprintType)
struct SENSEGLOVECORE_API FSGRotatorArray
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category="SenseGlove | Core | Nested Arrays", BlueprintReadWrite)
TArray<FRotator> RotatorArray;
};
@@ -40,21 +40,42 @@
#include "SGSenseCom.generated.h"
/**
*
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGSenseCom
{
GENERATED_BODY()
public:
/**
* Registers current process as the latest SenseCom build.
*/
static bool RegisterExe();
/**
* Register a particular path as the SenseGlove executable location.
*/
static bool RegisterExe(const FString& ExePath);
/**
* Retrieve the location of SenseGlove executable.
*/
static bool GetExePath(FString& OutExePath);
/**
* Returns true if SenseCom scanning is active.
*/
static bool ScanningActive();
/**
* Returns the directory of the current process.
*/
static bool GetCurrentExeDirectory(FString& OutDirectory);
/**
* Force-starts the SenseCom application if it is active on the system.
*/
static bool StartupSenseCom();
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* An interface for the Sense Glove exoskeleton glove.
* Contains methods for Kinematics, Haptics and Serialization.
*/
@@ -56,6 +57,9 @@ class FSGSenseGloveImpl;
class USGBuzzCommand;
class USGForceFeedbackCommand;
/**
* Interface for the Sense Glove; and exoskeleton Force-Feedback glove.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSenseGlove final : public USGHapticGlove
{
@@ -67,51 +71,108 @@ public:
static USGSenseGlove* NewSenseGlove(UObject* Outer, TSharedRef<FSGSenseGloveImpl> SenseGloveImpl);
public:
/**
*
*/
static USGSenseGlove* NewSenseGlove(UObject* Outer);
/**
* Create a new instance of a Sense Glove.
*/
static USGSenseGlove* NewSenseGlove(UObject* Outer, const USGSenseGloveInfo& Model);
public:
/**
* Byte indicating a new Sense Glove haptic command.
*/
static ANSICHAR GetHapticsByte();
/**
* Byte indicating a new Thumper command.
*/
static ANSICHAR GetThumperByte();
public:
/**
* Calculates a GlovePose based on sensor angles and a glove model.
*
* @remarks Use this when you already have gloveAngles collected.
*/
static USGSenseGlovePose* CalculateGlovePose(UObject* Outer,
const USGSenseGloveSensorData* SensorData,
const USGSenseGloveInfo* GloveModel);
/**
* Calculates a GlovePose based on gloveAngles and a glove model.
*
* @remarks Use this when you already have gloveAngles collected.
*/
static USGSenseGlovePose* CalculateGlovePose(UObject* Outer,
const TArray<TArray<FVector>>& GloveAngles,
const USGSenseGloveInfo* GloveModel);
/**
* @remarks Use this when you already have a GlovePose.
*/
static USGHandPose* CalculateHandPose(UObject* Outer,
const USGSenseGlovePose* GlovePose,
const USGBasicHandModel* HandModel,
const USGSenseGloveHandProfile* Profile);
public:
/**
* Deserializes a Sense Glove from its ConstantsString. Returns a nullptr if unsuccessful.
*/
static USGDevice* Parse(UObject* Outer, const FString& ConstantsString);
/**
* Retrieve all Sense Gloves connected to this system.
*/
static TArray<USGSenseGlove*> GetSenseGloves(UObject* Outer);
/**
* Retrieve the first connected Sense Glove there is.
*/
static bool GetSenseGlove(UObject* Outer, USGSenseGlove*& OutGlove);
/**
* Retrieve the first (connected) right or left handed sense glove.
*/
static bool GetSenseGlove(UObject* Outer, bool bRightHanded, USGSenseGlove*& OutGlove);
public:
/**
* Convert a SenseGlove GlovePose into calibrationValues.
*/
static TArray<FVector> GetCalibrationValues(const USGSenseGlovePose* GlovePose);
/**
* Apply interpolation values to the correct fields in the SenseGlove Profile, based on min/max sensor values.
*/
static void CalibrateInterpolation(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues,
bool bRightHanded, USGSenseGloveHandProfile*& OutProfile);
public:
/**
* Retrieve the location of the glove origin, based on a reference location without requiring an object reference.
*/
static void CalculateGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
bool bRightHanded, ESGFinger MountedOn,
FVector& OutGlovePosition, FQuat& OutGloveRotation);
/**
* Retrieve the location of the glove origin, based on a reference location without requiring an object reference.
*/
static void CalculateGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
bool bRightHanded, ESGFinger MountedOn,
FVector& OutGlovePosition, FRotator& OutGloveRotation);
/**
* Calculates the full wrist location.
*/
static void CalculateWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
bool bRightHanded, ESGFinger MountedOn,
@@ -119,6 +180,16 @@ public:
const FQuat& GloveWristRotationOffset,
FVector& OutWristPosition, FQuat& OutWristRotation);
/**
* Calculates the full wrist location.
*/
static void CalculateWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
bool bRightHanded, ESGFinger MountedOn,
const FVector& GloveWristPositionOffset,
const FRotator& GloveWristRotationOffset,
FVector& OutWristPosition, FRotator& OutWristRotation);
private:
struct FImpl;
@@ -131,8 +202,14 @@ private:
FImplDeleter PimplDeleter;
protected:
/**
*
*/
USGSenseGlove();
/**
* Create a new instance of a Sense Glove.
*/
explicit USGSenseGlove(const USGSenseGloveInfo& Model);
public:
@@ -191,80 +268,212 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Retrieve this glove's hardware model, which contains its hardware data.
*/
USGSenseGloveInfo* GetGloveModel(UObject* Outer) const;
/**
* Check if this Sense Glove is right handed.
*
* @remarks While the variable is stored in SG_GloveModel, added direct access here since its frequently used.
*/
virtual bool IsRight() const override;
public:
/**
* Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration.
*/
virtual ESGDeviceType GetDeviceType() const override;
/**
* Retrieve this Sense Glove's unique identifier.
*/
virtual FString GetDeviceId() const override;
/**
* Retrieve this glove's hardware (sub) version.
*/
virtual FString GetHardwareVersion() const override;
/**
* Retrieve this device's firmware version.
*/
virtual int32 GetFirmwareVersion() const override;
/**
* Retrieve this device's sub-firmware version.
*/
virtual int32 GetSubFirmwareVersion() const override;
public:
/**
* Get the latest Sensor Data from this Sense Glove.
*/
bool GetSensorData(UObject* Outer, USGSenseGloveSensorData*& OutSensorData) const;
/**
*
*/
virtual bool GetImuRotation(FQuat& OutImu) override;
/**
*
*/
virtual bool GetImuRotation(FRotator& OutImu) override;
/**
* Get the pose of this Sense Glove's hardware, based on its latest Sensor Data.
*/
bool GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePose);
/**
* Get the pose of this Sense Glove's hardware based on a set of Sensor Data.
*/
bool GetGlovePose(UObject* Outer, const USGSenseGloveSensorData* SensorData, USGSenseGlovePose*& OutGlovePose);
/// HACK
/// 'FSGSenseGloveImpl::GetHandPose' hides overloaded virtual functions [-Werror,-Woverloaded-virtual]
/// tell the compiler we want both the GetHandPose from FSGHapticGloveImpl and FSGSenseGloveImpl
/// tell the compiler we want both the GetHandPose from USGHapticGlove and USGSenseGlove
using USGHapticGlove::GetHandPose;
/**
* Retrieve a new hand pose using this glove's data, based on (calibrated) user data.
*/
bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandModel, const USGSenseGloveHandProfile* Profile,
USGHandPose*& OutHandPose);
/**
* Calculate the Hand Pose of this device, provided it has Hand Tracking available.
*/
virtual bool GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose) override;
/**
* Calculate the HandPose of this Device, taking into account user values, but not hand geometry.
*/
virtual bool GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose) override;
public:
/// HACK
/// 'USGSenseGlove::SendHaptics' hides overloaded virtual functions [-Werror,-Woverloaded-virtual]
/// tell the compiler we want both the SendHaptics from USGHapticGlove and USGSenseGlove
using USGHapticGlove::SendHaptics;
/**
* Set the level(s) of Force and Vibrotactile feedback, with an optional thumper command.
*/
bool SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
ESGSenseGloveThumperCommand ThumperCommand = ESGSenseGloveThumperCommand::None);
/**
* Send a thumper command.
*/
bool SendHaptics(ESGSenseGloveThumperCommand ThumperCommand);
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand) override;
/**
* Send Haptic Commands to this Glove.
*/
virtual void SendHaptics(const USGBuzzCommand* BuzzCommand) override;
/**
* Retrieve this device's firmware version.
*/
virtual void SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand) override;
public:
/**
* Retrieve calibration values of this glove, as an array of size 5, containing x (roll), y (flexion), z (abduction) values.
*/
virtual bool GetCalibrationValues(TArray<FVector>& OutValues) override;
/**
* Reset the glove's calibration range.
*/
virtual void ResetCalibrationRange() override;
/**
* Apply this glove's calibration range to a handProfile.
*/
virtual void ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const override;
/**
* Apply this glove's calibration range to a SenseGloveHandProfile.
*/
void ApplyCalibration(UObject* Outer, USGSenseGloveHandProfile*& OutProfile) const;
public:
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const override;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
virtual void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const override;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
void GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, ESGFinger MountedOn,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const;
/**
* Retrieve the location of the glove origin, based on a reference location.
*/
void GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware, ESGFinger MountedOn,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const override;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
virtual void GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const override;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
void GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
const FVector& GloveWristPositionOffset,
const FQuat& GloveWristRotationOffset,
FVector& OutWristPosition, FQuat& OutWristRotation) const;
/**
* Retrieve the location of the wrist, based on a reference location and default glove-hand offsets.
*/
void GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
const FVector& GloveWristPositionOffset,
const FRotator& GloveWristRotationOffset,
FVector& OutWristPosition, FRotator& OutWristRotation) const;
public:
/**
* Create a string representation of this device for reporting purposes.
*/
virtual FString ToString() const override;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Input for Sense Glove kinematics to calculate a HandPose.
* Output of calibration algorithms.
*/
@@ -42,13 +43,16 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGSenseGloveHandProfile.generated.h"
class FSGSenseGloveHandProfileImpl;
class USGHandInterpolator;
/**
* Contains everything a Sense Glove needs to calculate a HandPose.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSenseGloveHandProfile final : public UObject
{
@@ -59,18 +63,33 @@ public:
UObject* Outer, const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl);
public:
/**
* The basic constructor.
*/
static USGSenseGloveHandProfile* NewSenseGloveHandProfile(UObject* Outer);
/**
* Create a new Hand Profile for the Sense Glove.
*/
static USGSenseGloveHandProfile* NewSenseGloveHandProfile(
UObject* Outer, bool bRightHanded, const USGHandInterpolator* Interpolator,
ESGThumbSolver ThumbSolver, ESGFingerSolver FingerSolver, const TArray<FVector>& FingerThimbleOffset);
public:
/**
* Retrieve a 'new' profile, for either a left or right hand.
*/
static USGSenseGloveHandProfile* Default(UObject* Outer, bool bRightHanded);
/**
* Deserialize a HandProfile back into usable values.
*/
static USGSenseGloveHandProfile* Deserialize(UObject* Outer, const FString& SerializedString);
public:
/**
* Default offset from thimble to fingertip.
*/
static FVector GetDefaultThimbleOffset();
private:
@@ -85,8 +104,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic constructor.
*/
USGSenseGloveHandProfile();
/**
* Create a new Hand Profile for the Sense Glove.
*/
USGSenseGloveHandProfile(bool bRightHanded, const USGHandInterpolator* Interpolator,
ESGThumbSolver ThumbSolver, ESGFingerSolver FingerSolver,
const TArray<FVector>& FingerThimbleOffset);
@@ -116,21 +141,45 @@ public:
const FSGSenseGloveHandProfileImpl& ToSenseGloveHandProfileImpl() const;
public:
/**
* Check whether this profile has been created for a right hand (true) or left hand (false).
*/
bool IsRight() const;
/**
* Interpolation set to estimate joint angles.
*/
USGHandInterpolator* GetInterpolationSet(UObject* Outer) const;
/**
* Solver property that determines _how_ HandPoses are calculated.
*/
ESGThumbSolver GetThumbSolver() const;
/**
* Solver property that determines _how_ finger poses are calculated.
*/
ESGFingerSolver GetFingerSolver() const;
/**
* Offset from thimble to fingertip, used for Inverse Kinematics.
*/
TArray<FVector> GetFingerThimbleOffset() const;
public:
/**
*
*/
bool Equals(const USGSenseGloveHandProfile* SenseGloveHandProfile) const;
/**
* Reset calibration on this profile.
*/
void Reset();
public:
/**
* Serialize this HandProfile into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Glove information taken from the Sense Glove.
*/
@@ -42,13 +42,15 @@
#include "UObject/ObjectMacros.h"
#include "SGCore/SGVectorArray.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGSenseGloveInfo.generated.h"
class FSGSenseGloveInfoImpl;
/**
* Glove Information taken from a SenseGlove. Contains everything from unique ID, firmware version, etc.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSenseGloveInfo final : public UObject
{
@@ -59,8 +61,14 @@ public:
UObject* Outer, const FSGSenseGloveInfoImpl& SenseGloveInfoImpl);
public:
/**
* The default constructor.
*/
static USGSenseGloveInfo* NewSenseGloveInfo(UObject* Outer);
/**
* Create a new Sense Glove device model.
*/
static USGSenseGloveInfo* NewSenseGloveInfo(
UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
@@ -68,6 +76,19 @@ public:
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
static USGSenseGloveInfo* NewSenseGloveInfo(
UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
static USGSenseGloveInfo* NewSenseGloveInfo(
UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
@@ -75,10 +96,26 @@ public:
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
static USGSenseGloveInfo* NewSenseGloveInfo(
UObject* Outer, const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths, const TArray<bool>& Functions);
public:
/**
* Create an instance of the SGModel from its string representation.
*/
static bool Parse(UObject* Outer, const FString& ConstantsString, USGSenseGloveInfo*& OutGloveInfo,
bool bUpdateOldModels = true);
/**
* Deserialize a HandProfile back into usable values.
*/
static USGSenseGloveInfo* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -93,20 +130,47 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The default constructor.
*/
USGSenseGloveInfo();
/**
* Create a new Sense Glove device model.
*/
USGSenseGloveInfo(const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FQuat& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
USGSenseGloveInfo(const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<TArray<FVector>>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
USGSenseGloveInfo(const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FQuat& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths, const TArray<bool>& Functions);
/**
* Create a new Sense Glove device model.
*/
USGSenseGloveInfo(const FString& DeviceId,
const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion,
bool bRightHanded, int32 NumberOfSensors, const FRotator& ImuCorrection,
const TArray<FVector>& StartPositions, const TArray<FRotator>& StartRotations,
const TArray<FSGVectorArray>& GloveLengths, const TArray<bool>& Functions);
public:
/**
* The cast from underlying type constructor.
@@ -138,44 +202,116 @@ protected:
FSGSenseGloveInfoImpl& ToSenseGloveInfoImpl();
public:
/**
* Unique identifier of this device.
*/
FString GetDeviceId() const;
/**
* Hardware (sub) version of this Sense Glove Device.
*/
FString GetHardwareVersion() const;
/**
* Firmware version running on the device's MicroController.
*/
int32 GetFirmwareVersion() const;
/**
* Sub-Firmware version running on the device's MicroController.
*/
int32 GetSubFirmwareVersion() const;
/**
* Check if this Sense Glove belongs to a left or right hand.
*/
bool IsRight() const;
/**
* The number of Sensors in this SenseGlove.
*/
int32 GetNumberOfSensors() const;
FQuat GetImuCorrection() const;
/**
* The IMU correction of this Sense Glove.
*/
FQuat GetImuCorrectionQ() const;
/**
* The IMU correction of this Sense Glove.
*/
FRotator GetImuCorrection() const;
/**
* The starting positions of each Sense Glove finger, relative to the glove origin.
*/
TArray<FVector> GetStartPositions() const;
TArray<FQuat> GetStartRotations() const;
/**
* The starting rotations of each Sense Glove finger, relative to the glove origin.
*/
TArray<FQuat> GetStartRotationsQ() const;
/**
* The starting rotations of each Sense Glove finger, relative to the glove origin.
*/
TArray<FRotator> GetStartRotations() const;
/**
* The lengths of each Sense Glove finger section, in cm.
*/
TArray<TArray<FVector>> GetGloveLengths() const;
/**
* Whether this device has a specific function (T/F).
*/
TArray<bool> GetFunctions() const;
public:
/**
* The starting position of one Sense Glove finger, relative to the glove origin.
*/
FVector GetStartPosition(ESGFinger Finger) const;
FQuat GetStartRotation(ESGFinger Finger) const;
/**
* The starting rotation of one Sense Glove finger, relative to the glove origin.
*/
FQuat GetStartRotationQ(ESGFinger Finger) const;
/**
* The starting rotation of one Sense Glove finger, relative to the glove origin.
*/
FRotator GetStartRotation(ESGFinger Finger) const;
/**
* The lengths of one Sense Glove finger's sections, in cm.
*/
TArray<FVector> GetGloveLengths(ESGFinger Finger) const;
public:
/**
* Place incoming sensor data into the right format, according to this glove's model.
*/
TArray<TArray<FVector>> ToGloveAngles(const TArray<TArray<float>>& SensorAngles) const;
/**
* Returns true if this SG_Model has the same values as another.
*/
bool Equals(const USGSenseGloveInfo* SenseGloveInfo) const;
public:
/**
* Create a string representation for logging. If shortNotation is false, all values are reported.
*/
FString ToString() const;
/**
* Create a string representation for fast logging.
*/
FString ToString(bool bShortNotation) const;
/**
* Serialize this HandProfile into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,8 @@
*
* @section DESCRIPTION
*
*
* Contains position and rotation data of a SenseGlove's exoskeleton, along
* with accessors for relevant variables.
*/
@@ -43,17 +44,19 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGSenseGloveInfo.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCore/SGQuatArray.h"
#include "SGCore/SGRotatorArray.h"
#include "SGCore/SGVectorArray.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGSenseGlovePose.generated.h"
class FSGSenseGlovePoseImpl;
class USGSenseGloveHandProfile;
class USGSenseGloveInfo;
/**
* Represents a pose of a Sense Glove exoskeleton.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSenseGlovePose final : public UObject
{
@@ -64,21 +67,52 @@ public:
UObject* Outer, const FSGSenseGlovePoseImpl& SenseGlovePoseImpl);
public:
/**
* The basic constructor.
*/
static USGSenseGlovePose* NewSenseGlovePose(UObject* Outer);
/**
* Creates a new instance of a SenseGlovePose.
*/
static USGSenseGlovePose* NewSenseGlovePose(UObject* Outer, bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
static USGSenseGlovePose* NewSenseGlovePose(UObject* Outer, bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
static USGSenseGlovePose* NewSenseGlovePose(UObject* Outer, bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGQuatArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
static USGSenseGlovePose* NewSenseGlovePose(UObject* Outer, bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles);
public:
/**
* Returns an idle pose for the Sense Glove if no data can be found.
*/
static USGSenseGlovePose* IdlePose(UObject* Outer, const USGSenseGloveInfo* GloveInfo);
/**
* Deserialize a GlovePose back into usable values.
*/
static USGSenseGlovePose* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -93,18 +127,43 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic constructor.
*/
USGSenseGlovePose();
/**
* Creates a new instance of a SenseGlovePose.
*/
USGSenseGlovePose(bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FQuat>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
USGSenseGlovePose(bool bRightHanded,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FRotator>>& JointRotations,
const TArray<TArray<FVector>>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
USGSenseGlovePose(bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGQuatArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles);
/**
* Creates a new instance of a SenseGlovePose.
*/
USGSenseGlovePose(bool bRightHanded,
const TArray<FSGVectorArray>& JointPositions,
const TArray<FSGRotatorArray>& JointRotations,
const TArray<FSGVectorArray>& GloveAngles);
public:
/**
* The cast from underlying type constructor.
@@ -130,29 +189,77 @@ public:
const FSGSenseGlovePoseImpl& ToSenseGlovePoseImpl() const;
public:
/**
* Whether this Glove Pose was created for be a right- or left hand, or not.
*/
bool IsRight() const;
/**
* Positions of each glove joint, relative to the Glove's Origin.
*/
TArray<TArray<FVector>> GetJointPositions() const;
TArray<TArray<FQuat>> GetJointRotations() const;
/**
* Quaternion rotation of each glove joint, relative to the Glove Origin.
*/
TArray<TArray<FQuat>> GetJointRotationsQ() const;
/**
* Rotation of each glove joint, relative to the Glove Origin.
*/
TArray<TArray<FRotator>> GetJointRotations() const;
/**
* Glove joint angles in euler notation, relative to the last segment.
*
* @remarks Essentially sensor angles, though placed in their proper xyz notation.
*/
TArray<TArray<FVector>> GetGloveAngles() const;
public:
/**
* The position of the tip of the 'thimbles', the furthest link on each glove link.
*/
TArray<FVector> GetThimblePositions() const;
TArray<FQuat> GetThimbleRotations() const;
/**
* The (quaternion) rotation of the 'thimbles', the furthest link on each link.
*/
TArray<FQuat> GetThimbleRotationsQ() const;
/**
* The rotation of the 'thimbles', the furthest link on each link.
*/
TArray<FRotator> GetThimbleRotations() const;
/**
* Sum of the Sensor angles in each (xyz) direction. "Total Pronation / Flexion / Abduction".
*/
TArray<FVector> GetTotalGloveAngles() const;
/**
* Calculate fingertip positions based on a user profile.
*/
TArray<FVector> CalculateFingerTips(const USGSenseGloveHandProfile* SenseGloveHandProfile) const;
/**
* Calculate fingertip positions, knowing the offset between thimble and fingertips.
*/
TArray<FVector> CalculateFingerTips(const TArray<FVector>& FingerOffsets) const;
/**
* Returns true if this glove pose equals another.
*/
bool Equals(const USGSenseGlovePose* SenseGlovePose) const;
public:
/**
* Returns a user-friendly string representation of this GlovePose for reporting.
*/
FString ToString(bool bShortFormat = false) const;
/**
* Serialize this GlovePose into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Parsed sensor data coming form a Sense Glove.
*/
@@ -44,12 +44,14 @@
#include "SGCore/SGFloatArray.h"
#include "SGCore/SGSenseGloveInfo.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGSenseGloveSensorData.generated.h"
class FSGSenseGloveSensorDataImpl;
/**
* Sense Glove Sensor Data, parsed from a sensor string.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSenseGloveSensorData final : public UObject
{
@@ -60,21 +62,53 @@ public:
UObject* Outer, const FSGSenseGloveSensorDataImpl& SenseGloveSensorDataImpl);
public:
/**
* The basic constructor.
*/
static USGSenseGloveSensorData* NewSenseGloveSensorData(UObject* Outer);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
static USGSenseGloveSensorData* NewSenseGloveSensorData(
UObject* Outer, const TArray<TArray<float>>& SensorAngles,
const FQuat& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
static USGSenseGloveSensorData* NewSenseGloveSensorData(
UObject* Outer, const TArray<TArray<float>>& SensorAngles,
const FRotator& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
static USGSenseGloveSensorData* NewSenseGloveSensorData(
UObject* Outer, const TArray<FSGFloatArray>& SensorAngles,
const FQuat& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
static USGSenseGloveSensorData* NewSenseGloveSensorData(
UObject* Outer, const TArray<FSGFloatArray>& SensorAngles,
const FRotator& ImuRotation, int32 ParsedValues, bool bImuParsed);
public:
/**
* Returns sensor data with no values.
*/
static USGSenseGloveSensorData* Empty(UObject* Outer);
/**
* Deserialize Sense Glove sensor data from a raw char[] received through IPC.
*/
static USGSenseGloveSensorData* Parse(UObject* Outer, const FString& RawData, const USGSenseGloveInfo* GloveInfo);
/**
* Deserialize a HandProfile back into useable values.
*/
static USGSenseGloveSensorData* Deserialize(UObject* Outer, const FString& SerializedString);
private:
@@ -89,14 +123,35 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* The basic constructor.
*/
USGSenseGloveSensorData();
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles,
const FQuat& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
USGSenseGloveSensorData(const TArray<TArray<float>>& SensorAngles,
const FRotator& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles,
const FQuat& ImuRotation, int32 ParsedValues, bool bImuParsed);
/**
* Create a new instance of a Sense Glove Sensor Data class.
*/
USGSenseGloveSensorData(const TArray<FSGFloatArray>& SensorAngles,
const FRotator& ImuRotation, int32 ParsedValues, bool bImuParsed);
public:
/**
* The cast from underlying type constructor.
@@ -122,24 +177,56 @@ public:
const FSGSenseGloveSensorDataImpl& ToSenseGloveSensorDataImpl() const;
public:
/**
* Glove angles in radians, sorted by finger, from proximal to distal.
*/
TArray<TArray<float>> GetSensorAngles() const;
FQuat GetImuRotation() const;
/**
*
*/
FQuat GetImuRotationQ() const;
/**
*
*/
FRotator GetImuRotation() const;
/**
* Check how many values have been parsed from the Sensor String.
*/
int32 GetParsedValues() const;
/**
* Check if the IMU was properly parsed.
*/
bool IsImuParsed() const;
public:
/**
* Get the glove angles of a specific finger segment.
*/
TArray<float> GetSensorAngles(ESGFinger Finger) const;
/**
* Returns all glove angles in a sequence, without splitting them per finger.
*/
TArray<float> GetAngleSequence() const;
public:
/**
* Returns true if the values of both data are equal.
*/
bool Equals(const USGSenseGloveSensorData* SenseGloveSensorData) const;
public:
/**
* Retrieve a simple representation of this sensor data for debugging purposes.
*/
FString ToString() const;
/**
* Serialize this HandProfile into a string representation.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Contains enumerators and classes to aid in Sense Glove Deserialization.
*/
@@ -41,35 +41,80 @@
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "SGCore/SGSenseGloveInfo.h"
#include "SGSenseGloveVars.generated.h"
class USGSenseGloveInfo;
/**
* "Database" class containing Sense Glove internal variables.
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGSenseGloveVars
{
GENERATED_BODY()
public:
/**
* Retrieve a basic ConstantsString for a Sense Glove of a specific Hardware Version. Used for debugging / unit tests.
*
* @returns Returns an empty string when an invalid glove version is requested.
*/
static FString GetStandardConstantsString(const FString& HardwareVersion, float FirmwareVersion, bool bRightHanded);
/**
* Retrieve an example sensor string of a Sense Glove with a particular hardware- and firmware version.
*/
static FString GetSensorString(const FString& HardwareVersion, float FirmwareVersion);
/**
* Retrieve the starting positions of a particular Sense Glove.
*/
static TArray<FVector> GetStartPositions(const FString& HardwareVersion, bool bRightHanded);
static TArray<FQuat> GetStartRotations(const FString& HardwareVersion, bool bRightHanded);
/**
* Retrieve the starting rotations of a particular Sense Glove.
*/
static TArray<FQuat> GetStartRotationsQ(const FString& HardwareVersion, bool bRightHanded);
/**
* Retrieve the starting rotations of a particular Sense Glove.
*/
static TArray<FRotator> GetStartRotations(const FString& HardwareVersion, bool bRightHanded);
/**
* Retrieve the glove finger lengths of a particular Sense Glove.
*/
static TArray<TArray<FVector>> GetGloveLengths(const FString& HardwareVersion);
/**
* Get the number of sensors of a SenseGlove.
*/
static int32 GetSensors(const FString& HardwareVersion);
static FQuat GetImuCorrection(const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
/**
* Get the default IMUCorrection for the SenseGlove.
*/
static FQuat GetImuCorrectionQ(const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
/**
* Get the default IMUCorrection for the SenseGlove.
*/
static FRotator GetImuCorrection(const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
/**
* Check all functionality of a SenseGlove.
*/
static TArray<bool> GetFunctions(const FString& HardwareVersion, int32 FirmwareVersion, int32 SubFirmwareVersion);
/**
* Generate a custom glove info.
*/
static USGSenseGloveInfo* GenerateGloveModel(UObject* Outer, const FString& HardwareVersion, int32 FirmwareVersion,
int32 SubFirmwareVersion, bool bRightHanded);
/**
* Generate a custom glove info.
*/
static USGSenseGloveInfo* GenerateGloveModel(UObject* Outer, const FString& HardwareVersion, int32 FirmwareVersion,
int32 SubFirmwareVersion, bool bRightHanded, const FString& CustomId);
};
@@ -46,6 +46,9 @@
class FSGSensorRangeImpl;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGSensorRange final : public UObject
{
@@ -56,18 +59,36 @@ public:
UObject* Outer, const FSGSensorRangeImpl& SensorRangeImpl);
public:
/**
* Create a new instance of a SensorRange with values at 0, 0.
*/
static USGSensorRange* NewSensorRange(UObject* Outer);
/**
* Create a new SensorRange with predefined Min/Max values.
*/
static USGSensorRange* NewSensorRange(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues);
public:
/**
* Generates a Sensor Range where minimum values are float.MaxValue and maximum values are float.MinValue.
*/
static USGSensorRange* ForCalibration(UObject* Outer);
/**
* Convert a serialized SensorRange back into the appropriate class.
*/
static USGSensorRange* Deserialize(UObject* Outer, const FString& SerializedString);
/**
* Evaluate maxValues so that it contains the highest x, y, and z values between currentValues and maxValues.
*/
static void CheckMax(const FVector CurrentValues, FVector& OutMaxValues);
/**
* Evaluate minValues so that it contains the lowest x, y, and z values between currentValues and minValues.
*/
static void CheckMin(const FVector& CurrentValues, FVector& OutMinValues);
private:
@@ -82,8 +103,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Create a new instance of a SensorRange with values at 0, 0.
*/
USGSensorRange();
/**
* Create a new SensorRange with predefined Min/Max values.
*/
USGSensorRange(const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues);
public:
@@ -111,25 +138,55 @@ public:
const FSGSensorRangeImpl& ToSensorRangeImpl() const;
public:
/**
* Access the lowest values values of this range.
*/
TArray<FVector> GetMinValues() const;
/**
* Set the lowest values values of this range.
*/
void SetMinValues(const TArray<FVector>& Values);
/**
* Access the highest values values of this range.
*/
TArray<FVector> GetMaxValues() const;
/**
* Set the highest values values of this range.
*/
void SetMaxValues(const TArray<FVector>& Values);
/**
* Access the difference between min and max values.
*/
TArray<FVector> GetRange() const;
public:
/**
* Update the Range based on the current MinValues and MaxValues.
*/
void UpdateRange();
/**
* In otherValues are greater/smaller than this current range, update them.
*/
void CheckForExtremes(const TArray<FVector>& OtherValues);
public:
/**
* Report the Range value of this SensorRange, separated by a comma.
*/
FString RangeString(bool bYOnly = true) const;
/**
* Convert this SensorRange into a string rotation [min ... max].
*/
FString ToString(bool bYOnly = true) const;
/**
* Serialize this SensorRange into a string representation, that can be deserialized later.
*/
FString SGSerialize() const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Thumper command.
*/
@@ -44,6 +44,9 @@
class FSGThumperCommandImpl;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGThumperCommand : public UObject
{
@@ -53,11 +56,20 @@ public:
static USGThumperCommand* NewThumperCommand(UObject* Outer, const FSGThumperCommandImpl& ThumperCommandImpl);
public:
/**
* Empty constructor for inheritance.
*/
static USGThumperCommand* NewThumperCommand(UObject* Outer);
/**
* Create a new Thumper Command.
*/
static USGThumperCommand* NewThumperCommand(UObject* Outer, int32 Magnitude);
public:
/**
* A command that turns off all force feedback on the Sense Glove.
*/
static USGThumperCommand* Off(UObject* Outer);
private:
@@ -72,7 +84,14 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Empty constructor for inheritance.
*/
USGThumperCommand();
/**
* Create a new Thumper Command.
*/
explicit USGThumperCommand(int32 Magnitude);
public:
@@ -100,14 +119,29 @@ public:
const FSGThumperCommandImpl& ToThumperCommandImpl() const;
public:
/**
* Thumper intensity, a level between 0 and 100.
*/
int32 GetMagnitude() const;
/**
*
*/
void SetMagnitude(int32 Magnitude);
public:
/**
* Duplicate the Thumper command.
*/
USGThumperCommand* Copy(UObject* Outer) const;
/**
* Merge two ThumperCommands into one.
*/
USGThumperCommand* Merge(UObject* Outer, const USGThumperCommand* ThumperCommand) const;
/**
*
*/
bool Equals(const USGThumperCommand* ThumperCommand) const;
};
@@ -29,7 +29,7 @@
*
* @section DESCRIPTION
*
*
* Buzz Motor with timing parameters.
*/
@@ -40,12 +40,16 @@
#include "Templates/UniquePtr.h"
#include "UObject/ObjectMacros.h"
#include "SGBuzzCommand.h"
#include "SGTimedBuzzCommand.generated.h"
class FSGTimedBuzzCommandImpl;
class USGBuzzCommand;
/**
* Buzz motor commands that is meant to stop after a few milliseconds.
*
* @remarks Intended use; this.levels indicates the actual command.
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGTimedBuzzCommand : public USGBuzzCommand
{
@@ -59,12 +63,21 @@ public:
UObject* Outer, TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl);
public:
/**
* Empty constructor for inheritance.
*/
static USGTimedBuzzCommand* NewTimedBuzzCommand(UObject* Outer);
/**
* Create a new TimeBuzzCommand for a single finger.
*/
static USGTimedBuzzCommand* NewTimedBuzzCommand(
UObject* Outer,
ESGFinger Finger, int32 Magnitude, float DurationSeconds, float StartTimeSeconds = 0.0f);
/**
* Create a new buzz motor command that expires after timing_ms.
*/
static USGTimedBuzzCommand* NewTimedBuzzCommand(
UObject* Outer,
const USGBuzzCommand* BaseCommand, float DurationSeconds, float StartTimeSeconds = 0.0f);
@@ -81,8 +94,19 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Empty constructor for inheritance.
*/
USGTimedBuzzCommand();
/**
* Create a new TimeBuzzCommand for a single finger.
*/
USGTimedBuzzCommand(ESGFinger Finger, int32 Magnitude, float DurationSeconds, float StartTimeSeconds = 0.0f);
/**
* Create a new buzz motor command that expires after timing_ms.
*/
USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand, float DurationSeconds, float StartTimeSeconds = 0.0f);
public:
@@ -121,25 +145,61 @@ protected:
virtual void SyncUProperties() override;
public:
/**
* Copy this Buzz Command's values into a new object.
*/
USGBuzzCommand* Copy(UObject* Outer) const;
/**
* Merges this base command with another command.
*/
USGBuzzCommand* Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const;
public:
/**
* Access the base command, which indicates the buzz levels to keep untill time elapses.
*/
USGBuzzCommand* GetBaseCommand(UObject* Outer) const;
/**
*
*/
int32 GetMagnitude() const;
/**
* The total time [milliseconds] each buzz motor should be vibrating for.
*/
float GetDuration() const;
/**
* The time elapsed since the command was sent [milliseconds].
*/
float GetElapsedTime() const;
/**
* Check if this timed command's timing has elapsed.
*/
bool HasTimeElapsed() const;
/**
* Represents how far this effect is in its playtime; [0...1], where 0 means at the start, and 1 means at the end.
*
* @param bClamp01 Optional parameter; ensures this value is always between 0 and 1.
*/
float NormalizedTime(bool bClamp01 = true) const;
/**
* Reset the timings of this BuzzCommand, allowing us to re-use it.
*/
void ResetTiming();
/**
* Update the elapsed time to check if the buzz motors should stop.
*/
void UpdateTiming(float DeltaSeconds);
/**
*
*/
FString ToString() const;
};
@@ -40,12 +40,14 @@
#include "UObject/Object.h"
#include "UObject/ObjectMacros.h"
#include "SGCore/SGThumperCommand.h"
#include "SGTimedThumpCommand.generated.h"
class FSGTimedThumpCommandImpl;
class USGThumperCommand;
/**
*
*/
UCLASS(BlueprintType)
class SENSEGLOVECORE_API USGTimedThumpCommand final : public UObject
{
@@ -56,11 +58,20 @@ public:
UObject* Outer, const FSGTimedThumpCommandImpl& TimedThumpCommandImpl);
public:
/**
* Internal, empty, for extended classes.
*/
static USGTimedThumpCommand* NewTimedThumpCommand(UObject* Outer);
/**
* Create a new Timed Thumper Command.
*/
static USGTimedThumpCommand* NewTimedThumpCommand(
UObject* Outer, int32 Magnitude, float DurationSeconds, float StartTimeSeconds = 0.0f);
/**
* Create a new Timed Thumper Command.
*/
static USGTimedThumpCommand* NewTimedThumpCommand(
UObject* Outer, const USGThumperCommand* BaseCommand, float DurationSeconds, float StartTimeSeconds = 0.0f);
@@ -76,8 +87,19 @@ private:
FImplDeleter PimplDeleter;
public:
/**
* Internal, empty, for extended classes.
*/
USGTimedThumpCommand();
/**
* Create a new Timed Thumper Command.
*/
USGTimedThumpCommand(int32 Magnitude, float DurationSeconds, float StartTimeSeconds = 0.0f);
/**
* Create a new Timed Thumper Command.
*/
USGTimedThumpCommand(const USGThumperCommand* BaseCommand, float DurationSeconds, float StartTimeSeconds = 0.0f);
public:
@@ -105,28 +127,61 @@ public:
const FSGTimedThumpCommandImpl& ToTimedThumpCommandImpl() const;
public:
/**
* Magnitude in %.
*/
int32 GetMagnitude() const;
/**
*
*/
void SetMagnitude(int32 Magnitude);
/**
* Duration in seconds.
*/
float GetDuration() const;
/**
*
*/
void SetDuration(float Duration);
/**
* The elapsed time so far.
*/
float GetElapsedTime() const;
/**
*
*/
void SetElapsedTime(float ElapsedTime);
public:
/**
* Returns true if the timed command has elapsed.
*/
bool HasTimeElapsed() const;
public:
/**
* Copy the parameters of this ThumperCommand into another instance.
*/
USGTimedThumpCommand* Copy(UObject* Outer, bool bCopyElapsed = true) const;
/**
* Update the timing on this Thumper Command.
*/
void Update(float DeltaSeconds);
/**
*
*/
bool Equals(const USGTimedThumpCommand* TimedThumpCommand) const;
public:
/**
*
*/
FString ToString() const;
};
+183 -11
View File
@@ -44,69 +44,241 @@
#include "SGTracking.generated.h"
/**
*
*/
USTRUCT()
struct SENSEGLOVECORE_API FSGTracking
{
GENERATED_BODY()
public:
/**
* Knowing a position & rotation in 3D space, calculate a relative location based on offsets.
*/
static void CalculateLocation(
const FVector& TrackedPosition, const FQuat& TrackedRotation,
const FVector& PositionOffset, const FQuat& RotationOffset,
FVector& OutNewPosition, FQuat& OutNewRotation);
/**
* Knowing a position & rotation in 3D space, calculate a relative location based on offsets.
*/
static void CalculateLocation(
const FVector& TrackedPosition, const FRotator& TrackedRotation,
const FVector& PositionOffset, const FRotator& RotationOffset,
FVector& OutNewPosition, FRotator& OutNewRotation);
/**
* Positional offset from each finger to the glove origin.
*/
static TArray<FVector> GetSenseGloveFingerToGlovePositionOrigin();
static TArray<FQuat> GetSenseGloveFingerToGloveRotationOrigin();
/**
*
*/
static TArray<FQuat> GetSenseGloveFingerToGloveRotationOriginQ();
/**
*
*/
static TArray<FRotator> GetSenseGloveFingerToGloveRotationOrigin();
/**
* Default position offset from glove origin to wrist location, in cm.
*/
static FVector GetSenseGloveWristPositionOffset();
static FQuat GetSenseGloveWristRotationOffset();
/**
* Default rotation offset from glove origin to wrist location.
*/
static FQuat GetSenseGloveWristRotationOffsetQ();
/**
* Default rotation offset from glove origin to wrist location.
*/
static FRotator GetSenseGloveWristRotationOffset();
/**
* Get the position and rotation offsets to go from the glove origin to the mounted position.
* @remarks Based on CAD. needs to be inverted when going from tracker to glove origin.
*/
static void GetSenseGloveMountOffset(bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FQuat& OutIRotation);
/**
* Get the position and rotation offsets to go from the glove origin to the mounted position.
* @remarks Based on CAD. needs to be inverted when going from tracker to glove origin.
*/
static void GetSenseGloveMountOffset(bool bRightHanded, ESGFinger ToFinger,
FVector& OutIPosition, FRotator& OutIRotation);
/**
* Get the offset to get from the TrackedHardware to a SenseGlove mounting location. Combined with Glove-Mount offset to get the glove location.
*/
static void GetSenseGloveTrackerMountOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
/**
* Get the offset to get from the TrackedHardware to a SenseGlove mounting location. Combined with Glove-Mount offset to get the glove location.
*/
static void GetSenseGloveTrackerMountOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
/**
* Vive Tracker origin to Finger rotational offset.
*/
static FVector GetSenseGloveViveToAttachPosition();
static FQuat GetSenseGloveViveToAttachRotation();
/**
* Vive Tracker origin to Finger rotational offset.
*/
static FQuat GetSenseGloveViveToAttachRotationQ();
/**
* Vive Tracker origin to Finger rotational offset.
*/
static FRotator GetSenseGloveViveToAttachRotation();
/**
* Oculus Touch origin to Finger rotational offset.
*/
static FVector GetSenseGloveOculusTouchToAttachPosition();
static FQuat GetSenseGloveOculusTouchToAttachRotation();
/**
* Oculus Touch origin to Finger rotational offset.
*/
static FQuat GetSenseGloveOculusTouchToAttachRotationQ();
/**
* Oculus Touch origin to Finger rotational offset.
*/
static FRotator GetSenseGloveOculusTouchToAttachRotation();
/**
* Positional offset between Nova Glove Origin and Wrist.
*/
static FVector GetNovaToWristPositionOffset();
static FQuat GetNovaToWristRotationOffset();
/**
* Rotational offset between Nova Glove Origin and Wrist.
*/
static FQuat GetNovaToWristRotationOffsetQ();
/**
* Rotational offset between Nova Glove Origin and Wrist.
*/
static FRotator GetNovaToWristRotationOffset();
/**
* Returns the Offsets that will bring us from the Nova origin to the wrist position.
*/
static void GetNovaGloveWristOffset(bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset);
/**
* Returns the Offsets that will bring us from the Nova origin to the wrist position.
*/
static void GetNovaGloveWristOffset(bool bRightHanded, FVector& OutPositionOffset, FRotator& OutRotationOffset);
/**
*
*/
static FVector GetRightNovaViveToAttachPosition();
static FQuat GetRightNovaViveToAttachRotation();
/**
*
*/
static FQuat GetRightNovaViveToAttachRotationQ();
/**
*
*/
static FRotator GetRightNovaViveToAttachRotation();
/**
*
*/
static FVector GetLeftNovaViveToAttachPosition();
static FQuat GetLeftNovaViveToAttachRotation();
/**
*
*/
static FQuat GetLeftNovaViveToAttachRotationQ();
/**
*
*/
static FRotator GetLeftNovaViveToAttachRotation();
/**
*
*/
static FVector GetRightNovaQuest2ToAttachPosition();
static FQuat GetRightNovaQuest2ToAttachRotation();
/**
*
*/
static FQuat GetRightNovaQuest2ToAttachRotationQ();
/**
*
*/
static FRotator GetRightNovaQuest2ToAttachRotation();
/**
*
*/
static FVector GetLeftNovaQuest2ToAttachPosition();
static FQuat GetLeftNovaQuest2ToAttachRotation();
/**
*
*/
static FQuat GetLeftNovaQuest2ToAttachRotationQ();
/**
*
*/
static FRotator GetLeftNovaQuest2ToAttachRotation();
/**
* @remarks Left is a mirror, so we only need R pos.
*/
static FVector GetRightNovaPico2ToAttachPosition();
static FQuat GetRightNovaPico2ToAttachRotation();
/**
*
*/
static FQuat GetRightNovaPico2ToAttachRotationQ();
static FQuat GetLeftNovaPico2ToAttachRotation();
/**
*
*/
static FRotator GetRightNovaPico2ToAttachRotation();
/**
*
*/
static FQuat GetLeftNovaPico2ToAttachRotationQ();
/**
*
*/
static FRotator GetLeftNovaPico2ToAttachRotation();
/**
* Retrieves Offsets for a particular device.
*/
static void GetNovaGloveTrackerOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset);
/**
* Retrieves Offsets for a particular device.
*/
static void GetNovaGloveTrackerOffset(ESGPositionalTrackingHardware Hardware, bool bRightHanded,
FVector& OutPositionOffset, FRotator& OutRotationOffset);
/**
*
*/
static FString ToString(ESGPositionalTrackingHardware Hardware);
};
@@ -47,6 +47,7 @@ public class SenseGloveCore : ModuleRules
{
"Core",
"Engine",
"SenseGloveTypes",
}
);
@@ -57,7 +58,6 @@ public class SenseGloveCore : ModuleRules
"SenseGloveCoreImpl",
"SenseGloveInterop",
"SenseGloveLog",
"SenseGloveTypes",
"SenseGloveUtils",
}
);
@@ -39,6 +39,7 @@
#include "SGBuildHacks/SGInclude_Core_Vect3D.h"
#include "SGCoreImpl/SGVect3DImpl.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGUtils/SGCoordinates.h"
float FSGAnatomyImpl::GetTotalFingerFlexion()
{
@@ -63,57 +64,59 @@ float FSGAnatomyImpl::GetTotalThumbExtension()
float FSGAnatomyImpl::GetFingerJointLimit(
const bool bRightHanded, const int32 Joint, const int32 Movement, const bool bMax)
{
return FAnatomyType::GetFingerJointLimit(bRightHanded, Joint, Movement, bMax);
return FSGCoordinates::TransformToUnreal(
Movement, FAnatomyType::GetFingerJointLimit(bRightHanded, Joint, Movement, bMax));
}
float FSGAnatomyImpl::GetThumbJointLimit(
const bool bRightHanded, const int32 Joint, const int32 Movement, const bool bMax)
{
return FAnatomyType::GetThumbJointLimit(bRightHanded, Joint, Movement, bMax);
return FSGCoordinates::TransformToUnreal(
Movement, FAnatomyType::GetThumbJointLimit(bRightHanded, Joint, Movement, bMax));
}
float FSGAnatomyImpl::NormalizeFingerFlex(const float FlexionInRadians)
float FSGAnatomyImpl::NormalizeFingerFlexion(const float FlexionInRadians)
{
return FAnatomyType::NormalizeFingerFlex(FlexionInRadians);
return FAnatomyType::NormalizeFingerFlexion(FlexionInRadians);
}
float FSGAnatomyImpl::NormalizeThumbFlex(const float FlexionInRadians)
float FSGAnatomyImpl::NormalizeThumbFlexion(const float FlexionInRadians)
{
return FAnatomyType::NormalizeThumbFlex(FlexionInRadians);
return FAnatomyType::NormalizeThumbFlexion(FlexionInRadians);
}
TArray<TArray<FVector>> FSGAnatomyImpl::GetDefaultHandAngles(const bool bRightHanded)
{
TArray<TArray<FVector>> DefaultHandAngles{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromSenseGloveAngles<FSGVect3DImpl::FVect3DType>(
FAnatomyType::GetDefaultHandAngles(bRightHanded))
};
return DefaultHandAngles;
return MoveTemp(DefaultHandAngles);
}
TArray<TArray<FVector>> FSGAnatomyImpl::GetFlatHandAngles(const bool bRightHanded)
{
TArray<TArray<FVector>> FlatHandAngles{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromSenseGloveAngles<FSGVect3DImpl::FVect3DType>(
FAnatomyType::GetFlatHandAngles(bRightHanded))
};
return FlatHandAngles;
return MoveTemp(FlatHandAngles);
}
TArray<TArray<FVector>> FSGAnatomyImpl::GetThumbsUpHandAngles(const bool bRightHanded)
{
TArray<TArray<FVector>> ThumbsUpHandAngles{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromSenseGloveAngles<FSGVect3DImpl::FVect3DType>(
FAnatomyType::GetThumbsUpHandAngles(bRightHanded))
};
return ThumbsUpHandAngles;
return MoveTemp(ThumbsUpHandAngles);
}
TArray<TArray<FVector>> FSGAnatomyImpl::GetFistHandAngles(const bool bRightHanded)
{
TArray<TArray<FVector>> FistHandAngles{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromSenseGloveAngles<FSGVect3DImpl::FVect3DType>(
FAnatomyType::GetFistHandAngles(bRightHanded))
};
return FistHandAngles;
return MoveTemp(FistHandAngles);
}
@@ -47,6 +47,7 @@
#include "SGCoreImpl/SGQuatImpl.h"
#include "SGCoreImpl/SGVect3DImpl.h"
#include "SGUtils/SGArrayUtils.h"
#include "SGUtils/SGUnits.h"
struct FSGBasicHandModelImpl::FImpl
{
@@ -77,7 +78,7 @@ struct FSGBasicHandModelImpl::FImpl
FImpl& operator=(const FImpl& Rhs) = default;
};
FSGBasicHandModelImpl FSGBasicHandModelImpl::Default(bool bRightHanded)
FSGBasicHandModelImpl FSGBasicHandModelImpl::Default(const bool bRightHanded)
{
return FSGBasicHandModelImpl(FSGBasicHandModelImpl::FBasicHandModelType::Default(bRightHanded));
}
@@ -92,7 +93,7 @@ FSGBasicHandModelImpl FSGBasicHandModelImpl::Deserialize(const FString& Serializ
const TArray<TArray<float>>& FSGBasicHandModelImpl::GetBaseFingerLengths()
{
static const TArray<TArray<float>> BaseFingerLengths{
FSGArrayUtils::FromStdVector<float>(
FSGArrayUtils::FromMillimeters(
FSGBasicHandModelImpl::FBasicHandModelType::GetBaseFingerLengths())
};
return BaseFingerLengths;
@@ -101,69 +102,72 @@ const TArray<TArray<float>>& FSGBasicHandModelImpl::GetBaseFingerLengths()
const TArray<FVector>& FSGBasicHandModelImpl::GetBaseJointPositions()
{
static const TArray<FVector> BaseJointPositions{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(
FBasicHandModelType::GetBaseJointPositions())
};
return BaseJointPositions;
}
const TArray<FVector>& FSGBasicHandModelImpl::GetBaseJointRotations()
const TArray<FVector>& FSGBasicHandModelImpl::GetBaseJointAngles()
{
static const TArray<FVector> BaseJointRotations{
static const TArray<FVector> BaseJointAngles{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FBasicHandModelType::GetBaseJointRotations())
FBasicHandModelType::GetBaseJointAngles())
};
return BaseJointRotations;
return BaseJointAngles;
}
FSGBasicHandModelImpl::FSGBasicHandModelImpl()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBasicHandModelImpl::FSGBasicHandModelImpl(bool bRightHanded, const TArray<TArray<float>>& Lengths,
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
std::vector<std::vector<float>> LengthsVector{
FSGArrayUtils::ToStdVector<float>(Lengths)
FSGArrayUtils::ToMillimeters(Lengths)
};
std::vector<FSGVect3DImpl::FVect3DType> StartPositionsVector{FSGArrayUtils::ToStdVector<
FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(StartPositions)};
std::vector<FSGVect3DImpl::FVect3DType> StartPositionsVector{
FSGArrayUtils::ToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(StartPositions)
};
Pimpl->BasicHandModel = FSGBasicHandModelImpl::FBasicHandModelType(bRightHanded, MoveTemp(LengthsVector),
MoveTemp(StartPositionsVector));
}
FSGBasicHandModelImpl::FSGBasicHandModelImpl(bool bRightHanded, const TArray<TArray<float>>& Lengths,
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const bool bRightHanded, const TArray<TArray<float>>& Lengths,
const TArray<FVector>& StartPositions, const TArray<FQuat>& StartRotations)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
std::vector<std::vector<float>> LengthsVector{
FSGArrayUtils::ToStdVector<float>(Lengths)
FSGArrayUtils::ToMillimeters(Lengths)
};
std::vector<FSGVect3DImpl::FVect3DType> StartPositionsVector{FSGArrayUtils::ToStdVector<
FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(StartPositions)};
std::vector<FSGVect3DImpl::FVect3DType> StartPositionsVector{
FSGArrayUtils::ToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(StartPositions)
};
std::vector<FSGQuatImpl::FQuatType> StartRotationsVector{FSGArrayUtils::ToStdVector<
FQuat, FSGQuatImpl::FQuatType, FSGQuatImpl, &FSGQuatImpl::ToQuat>(StartRotations)};
std::vector<FSGQuatImpl::FQuatType> StartRotationsVector{
FSGArrayUtils::ToStdVector<FQuat, FSGQuatImpl::FQuatType, FSGQuatImpl, &FSGQuatImpl::ToQuat>(StartRotations)
};
Pimpl->BasicHandModel = FSGBasicHandModelImpl::FBasicHandModelType(bRightHanded, MoveTemp(LengthsVector),
MoveTemp(StartPositionsVector),
@@ -172,27 +176,31 @@ FSGBasicHandModelImpl::FSGBasicHandModelImpl(bool bRightHanded, const TArray<TAr
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const FBasicHandModelType& BasicHandModel)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->BasicHandModel = BasicHandModel;
}
FSGBasicHandModelImpl::FSGBasicHandModelImpl(const FSGBasicHandModelImpl& Rhs)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->Owner = this;
}
FSGBasicHandModelImpl::FSGBasicHandModelImpl(FSGBasicHandModelImpl&& Rhs) noexcept = default;
FSGBasicHandModelImpl::FSGBasicHandModelImpl(FSGBasicHandModelImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGBasicHandModelImpl::~FSGBasicHandModelImpl() = default;
@@ -203,7 +211,11 @@ FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(const FSGBasicHandModelI
return *this;
}
FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(FSGBasicHandModelImpl&& Rhs) noexcept = default;
FSGBasicHandModelImpl& FSGBasicHandModelImpl::operator=(FSGBasicHandModelImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
const FSGBasicHandModelImpl::FBasicHandModelType& FSGBasicHandModelImpl::ToBasicHandModel() const
{
@@ -223,7 +235,7 @@ void FSGBasicHandModelImpl::SetIsRight(const bool bRightHanded)
TArray<TArray<float>> FSGBasicHandModelImpl::GetFingerLengths() const
{
TArray<TArray<float>> FingerLengths{
FSGArrayUtils::FromStdVector<float>(Pimpl->BasicHandModel.GetFingerLengths())
FSGArrayUtils::FromMillimeters(Pimpl->BasicHandModel.GetFingerLengths())
};
return MoveTemp(FingerLengths);
}
@@ -231,28 +243,32 @@ TArray<TArray<float>> FSGBasicHandModelImpl::GetFingerLengths() const
void FSGBasicHandModelImpl::SetFingerLengths(const TArray<TArray<float>>& FingerLengths)
{
std::vector<std::vector<float>> FingerLengthsVector{
FSGArrayUtils::ToStdVector<float>(FingerLengths)
FSGArrayUtils::ToMillimeters(FingerLengths)
};
Pimpl->BasicHandModel.SetFingerLengths(MoveTemp(FingerLengthsVector));
}
TArray<float> FSGBasicHandModelImpl::GetFingerLengths(ESGFinger Finger) const
TArray<float> FSGBasicHandModelImpl::GetFingerLengths(const ESGFinger Finger) const
{
TArray<float> FingerLengths{FSGArrayUtils::FromStdVector<float>(
Pimpl->BasicHandModel.GetFingerLengths(FSGCoreEnumCast::ToEFinger(Finger)))
TArray<float> FingerLengths{
FSGArrayUtils::FromMillimeters(Pimpl->BasicHandModel.GetFingerLengths(FSGCoreEnumCast::ToEFinger(Finger)))
};
return MoveTemp(FingerLengths);
}
void FSGBasicHandModelImpl::SetFingerLengths(ESGFinger Finger, const TArray<float>& Lengths)
void FSGBasicHandModelImpl::SetFingerLengths(const ESGFinger Finger, const TArray<float>& Lengths)
{
std::vector<float> LengthsVector{FSGArrayUtils::ToStdVector<float>(Lengths)};
std::vector<float> LengthsVector{
FSGArrayUtils::ToMillimeters(Lengths)
};
Pimpl->BasicHandModel.SetFingerLengths(FSGCoreEnumCast::ToEFinger(Finger), MoveTemp(LengthsVector));
}
void FSGBasicHandModelImpl::SetFingerLengths(uint8 Finger, const TArray<float>& Lengths)
void FSGBasicHandModelImpl::SetFingerLengths(const uint8 Finger, const TArray<float>& Lengths)
{
std::vector<float> LengthsVector{FSGArrayUtils::ToStdVector<float>(Lengths)};
std::vector<float> LengthsVector{
FSGArrayUtils::ToMillimeters(Lengths)
};
Pimpl->BasicHandModel.SetFingerLengths(Finger, MoveTemp(LengthsVector));
}
@@ -264,7 +280,7 @@ TArray<TArray<float>> FSGBasicHandModelImpl::GetFingerRatios() const
return MoveTemp(FingerRatios);
}
TArray<float> FSGBasicHandModelImpl::GetFingerRatios(ESGFinger Finger) const
TArray<float> FSGBasicHandModelImpl::GetFingerRatios(const ESGFinger Finger) const
{
TArray<float> FingerRatios{
FSGArrayUtils::FromStdVector<float>(Pimpl->BasicHandModel.GetFingerRatios(FSGCoreEnumCast::ToEFinger(Finger)))
@@ -275,7 +291,7 @@ TArray<float> FSGBasicHandModelImpl::GetFingerRatios(ESGFinger Finger) const
TArray<FVector> FSGBasicHandModelImpl::GetStartJointPositions() const
{
TArray<FVector> StartJointPositions{
FSGArrayUtils::FromStdVector<FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
FSGArrayUtils::FromMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(
Pimpl->BasicHandModel.GetStartJointPositions())
};
return MoveTemp(StartJointPositions);
@@ -284,21 +300,23 @@ TArray<FVector> FSGBasicHandModelImpl::GetStartJointPositions() const
void FSGBasicHandModelImpl::SetStartJointPositions(const TArray<FVector>& StartJointPositions)
{
std::vector<FSGVect3DImpl::FVect3DType> StartJointPositionsVector{
FSGArrayUtils::ToStdVector<
FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(StartJointPositions)
FSGArrayUtils::ToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(StartJointPositions)
};
Pimpl->BasicHandModel.SetStartJointPositions(MoveTemp(StartJointPositionsVector));
}
void FSGBasicHandModelImpl::SetStartJointPosition(ESGFinger Finger, const FVector& Position)
void FSGBasicHandModelImpl::SetStartJointPosition(const ESGFinger Finger, const FVector& Position)
{
Pimpl->BasicHandModel.SetStartJointPosition(FSGCoreEnumCast::ToEFinger(Finger),
FSGVect3DImpl(Position).ToVect3D());
Pimpl->BasicHandModel.SetStartJointPosition(
FSGCoreEnumCast::ToEFinger(Finger),
FSGUnits::CentimetersToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(Position));
}
void FSGBasicHandModelImpl::SetStartJointPosition(const uint8 Finger, const FVector& Position)
{
Pimpl->BasicHandModel.SetStartJointPosition(Finger, FSGVect3DImpl(Position).ToVect3D());
Pimpl->BasicHandModel.SetStartJointPosition(
Finger,
FSGUnits::CentimetersToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(Position));
}
TArray<FQuat> FSGBasicHandModelImpl::GetStartJointRotations() const
@@ -322,13 +340,15 @@ void FSGBasicHandModelImpl::SetStartJointRotations(const TArray<FQuat>& StartJoi
FVector FSGBasicHandModelImpl::GetJointPosition(const ESGFinger Finger) const
{
const FSGVect3DImpl Position(Pimpl->BasicHandModel.GetJointPosition(FSGCoreEnumCast::ToEFinger(Finger)));
return Position.ToFVector();
return FSGUnits::MillimetersToCentimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(
Pimpl->BasicHandModel.GetJointPosition(FSGCoreEnumCast::ToEFinger(Finger)));
}
void FSGBasicHandModelImpl::SetJointPosition(const FVector& NewPosition, const ESGFinger Finger)
{
Pimpl->BasicHandModel.SetJointPosition(FSGVect3DImpl(NewPosition).ToVect3D(), FSGCoreEnumCast::ToEFinger(Finger));
Pimpl->BasicHandModel.SetJointPosition(
FSGUnits::CentimetersToMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(NewPosition),
FSGCoreEnumCast::ToEFinger(Finger));
}
FQuat FSGBasicHandModelImpl::GetJointRotation(const ESGFinger Finger) const
@@ -345,21 +365,23 @@ void FSGBasicHandModelImpl::SetJointRotation(const FQuat& NewRotation, const ESG
TArray<float> FSGBasicHandModelImpl::GetTotalLengths() const
{
const TArray<float> TotalLengths{
FSGArrayUtils::FromStdVector<float>(Pimpl->BasicHandModel.GetTotalLengths())
FSGArrayUtils::FromMillimeters(Pimpl->BasicHandModel.GetTotalLengths())
};
return TotalLengths;
}
float FSGBasicHandModelImpl::GetTotalLength(const ESGFinger Finger) const
{
return Pimpl->BasicHandModel.GetTotalLength(FSGCoreEnumCast::ToEFinger(Finger));
return FSGUnits::MillimetersToCentimeters(
Pimpl->BasicHandModel.GetTotalLength(FSGCoreEnumCast::ToEFinger(Finger)));
}
TArray<FVector> FSGBasicHandModelImpl::Get3DLengths(const ESGFinger Finger) const
{
const TArray<FVector> Lengths(FSGArrayUtils::FromStdVector<
FSGVect3DImpl::FVect3DType, FVector, FSGVect3DImpl, &FSGVect3DImpl::ToFVector>(
Pimpl->BasicHandModel.Get3DLengths(FSGCoreEnumCast::ToEFinger(Finger))));
const TArray<FVector> Lengths{
FSGArrayUtils::FromMillimeters<FSGVect3DImpl::FVect3DType, FSGVect3DImpl>(
Pimpl->BasicHandModel.Get3DLengths(FSGCoreEnumCast::ToEFinger(Finger)))
};
return Lengths;
}
@@ -77,11 +77,11 @@ TSharedRef<FSGBetaDeviceImpl> FSGBetaDeviceImpl::Parse(const FString& String)
FSGBetaDeviceImpl::FSGBetaDeviceImpl()
: FSGDeviceImpl(),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
@@ -93,46 +93,50 @@ FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FString& ConstantsString, const FStri
TCHAR_TO_UTF8(*HardwareVersion),
FirmwareVersion,
SubFirmwareVersion)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FBetaDeviceType BetaDevice)
: FSGDeviceImpl(std::make_shared<FBetaDeviceType>(BetaDevice)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FBetaDevicePtrType BetaDevice)
: FSGDeviceImpl(BetaDevice),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBetaDeviceImpl::FSGBetaDeviceImpl(const FSGBetaDeviceImpl& Rhs)
: FSGDeviceImpl(Rhs),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->Owner = this;
}
FSGBetaDeviceImpl::FSGBetaDeviceImpl(FSGBetaDeviceImpl&& Rhs) noexcept = default;
FSGBetaDeviceImpl::FSGBetaDeviceImpl(FSGBetaDeviceImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGBetaDeviceImpl::~FSGBetaDeviceImpl() = default;
@@ -144,7 +148,11 @@ FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(const FSGBetaDeviceImpl& Rhs)
return *this;
}
FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(FSGBetaDeviceImpl&& Rhs) noexcept = default;
FSGBetaDeviceImpl& FSGBetaDeviceImpl::operator=(FSGBetaDeviceImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGBetaDeviceImpl::FBetaDeviceType FSGBetaDeviceImpl::ToBetaDevice() const
{
@@ -75,77 +75,81 @@ const FSGBuzzCommandImpl& FSGBuzzCommandImpl::Off()
FSGBuzzCommandImpl::FSGBuzzCommandImpl()
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>()),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const TArray<int32>& BuzzLevels)
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(FSGArrayUtils::ToStdVector<int32>(BuzzLevels))),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring,
const int32 Pinky)
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(Thumb, Index, Middle, Ring, Pinky)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const ESGFinger Finger, const int32 BuzzLevel)
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(FSGCoreEnumCast::ToEFinger(Finger), BuzzLevel)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const FBuzzCommandType& BuzzCommand)
: FSGFingerCommandImpl(MakeShared<FBuzzCommandType>(BuzzCommand)),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const TSharedRef<FBuzzCommandType> BuzzCommand)
: FSGFingerCommandImpl(BuzzCommand),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(const FSGBuzzCommandImpl& Rhs)
: FSGFingerCommandImpl(Rhs),
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->Owner = this;
}
FSGBuzzCommandImpl::FSGBuzzCommandImpl(FSGBuzzCommandImpl&& Rhs) noexcept = default;
FSGBuzzCommandImpl::FSGBuzzCommandImpl(FSGBuzzCommandImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGBuzzCommandImpl::~FSGBuzzCommandImpl() = default;
@@ -157,7 +161,11 @@ FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(const FSGBuzzCommandImpl& Rhs)
return *this;
}
FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(FSGBuzzCommandImpl&& Rhs) noexcept = default;
FSGBuzzCommandImpl& FSGBuzzCommandImpl::operator=(FSGBuzzCommandImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
const FSGBuzzCommandImpl::FBuzzCommandType& FSGBuzzCommandImpl::ToBuzzCommand() const
{
@@ -77,22 +77,22 @@ struct FSGCalibrationDataPointImpl::FImpl
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const int32 CurrentStage,
const TArray<FVector>& CalibrationValues)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
std::vector<FSGVect3DImpl::FVect3DType> Values(
FSGArrayUtils::ToStdVector<FVector, FSGVect3DImpl::FVect3DType, FSGVect3DImpl, &FSGVect3DImpl::ToVect3D>(
@@ -102,27 +102,31 @@ FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const int32 CurrentStag
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const FCalibrationDataPointType& CalibrationDataPoint)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->CalibrationDataPoint = CalibrationDataPoint;
}
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(const FSGCalibrationDataPointImpl& Rhs)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->Owner = this;
}
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(FSGCalibrationDataPointImpl&& Rhs) noexcept = default;
FSGCalibrationDataPointImpl::FSGCalibrationDataPointImpl(FSGCalibrationDataPointImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGCalibrationDataPointImpl::~FSGCalibrationDataPointImpl() = default;
@@ -133,7 +137,10 @@ FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(const FSGCal
return *this;
}
FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(FSGCalibrationDataPointImpl&& Rhs) noexcept
FSGCalibrationDataPointImpl& FSGCalibrationDataPointImpl::operator=(FSGCalibrationDataPointImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
const FSGCalibrationDataPointImpl::FCalibrationDataPointType&
@@ -354,6 +354,70 @@ ESGPositionalTrackingHardware FSGCoreEnumCast::ToESGPositionalTrackingHardware(c
return ESGPositionalTrackingHardware::None;
}
FSGCoreEnumCast::FESenseGloveThumperCommandType FSGCoreEnumCast::ToESenseGloveThumperCommand(
const ESGSenseGloveThumperCommand Enum)
{
switch (Enum)
{
case ESGSenseGloveThumperCommand::None:
return FESenseGloveThumperCommandType::None;
case ESGSenseGloveThumperCommand::TurnOff:
return FESenseGloveThumperCommandType::TurnOff;
case ESGSenseGloveThumperCommand::CueGameOver:
return FESenseGloveThumperCommandType::CueGameOver;
case ESGSenseGloveThumperCommand::ButtonDouble100:
return FESenseGloveThumperCommandType::ButtonDouble100;
case ESGSenseGloveThumperCommand::ButtonDouble60:
return FESenseGloveThumperCommandType::ButtonDouble60;
case ESGSenseGloveThumperCommand::ImpactThump30:
return FESenseGloveThumperCommandType::ImpactThump30;
case ESGSenseGloveThumperCommand::ImpactThump10:
return FESenseGloveThumperCommandType::ImpactThump10;
case ESGSenseGloveThumperCommand::ImpactThump100:
return FESenseGloveThumperCommandType::ImpactThump100;
case ESGSenseGloveThumperCommand::ObjectGrasp100:
return FESenseGloveThumperCommandType::ObjectGrasp100;
case ESGSenseGloveThumperCommand::ObjectGrasp60:
return FESenseGloveThumperCommandType::ObjectGrasp60;
case ESGSenseGloveThumperCommand::ObjectGrasp30:
return FESenseGloveThumperCommandType::ObjectGrasp30;
}
// Keep the compiler satisfied!
return FESenseGloveThumperCommandType::None;
}
ESGSenseGloveThumperCommand FSGCoreEnumCast::ToESGSenseGloveThumperCommand(const FESenseGloveThumperCommandType Enum)
{
switch (Enum)
{
case FESenseGloveThumperCommandType::None:
return ESGSenseGloveThumperCommand::None;
case FESenseGloveThumperCommandType::TurnOff:
return ESGSenseGloveThumperCommand::TurnOff;
case FESenseGloveThumperCommandType::CueGameOver:
return ESGSenseGloveThumperCommand::CueGameOver;
case FESenseGloveThumperCommandType::ButtonDouble100:
return ESGSenseGloveThumperCommand::ButtonDouble100;
case FESenseGloveThumperCommandType::ButtonDouble60:
return ESGSenseGloveThumperCommand::ButtonDouble60;
case FESenseGloveThumperCommandType::ImpactThump30:
return ESGSenseGloveThumperCommand::ImpactThump30;
case FESenseGloveThumperCommandType::ImpactThump10:
return ESGSenseGloveThumperCommand::ImpactThump10;
case FESenseGloveThumperCommandType::ImpactThump100:
return ESGSenseGloveThumperCommand::ImpactThump100;
case FESenseGloveThumperCommandType::ObjectGrasp100:
return ESGSenseGloveThumperCommand::ObjectGrasp100;
case FESenseGloveThumperCommandType::ObjectGrasp60:
return ESGSenseGloveThumperCommand::ObjectGrasp60;
case FESenseGloveThumperCommandType::ObjectGrasp30:
return ESGSenseGloveThumperCommand::ObjectGrasp30;
}
return ESGSenseGloveThumperCommand::None;
}
FSGCoreEnumCast::FEThumbMovementType FSGCoreEnumCast::ToEThumbMovement(const ESGThumbMovement Enum)
{
switch (Enum)
@@ -36,6 +36,7 @@
#pragma once
#include <SenseGlove/Core/Fingers.hpp>
#include <SenseGlove/Core/SenseGloveThumperCommand.hpp>
#include "SGBuildHacks/SGInclude_Core_Fingers.h"
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationCheck.h"
@@ -43,6 +44,7 @@
#include "SGBuildHacks/SGInclude_Core_SenseGloveHandProfile.h"
#include "SGBuildHacks/SGInclude_Core_SGDevice.h"
#include "SGBuildHacks/SGInclude_Core_Tracking.h"
#include "SGCoreImpl/SGHapticGloveCommandBufferImpl.h"
#include "SGTypes/SGCoreTypes.h"
class SENSEGLOVECOREIMPL_API FSGCoreEnumCast
@@ -56,37 +58,41 @@ public:
typedef SGCore::Kinematics::EFingerMovement FEFingerMovementType;
typedef SGCore::SG::EFingerSolver FEFingerSolverType;
typedef SGCore::EPositionalTrackingHardware FEPositionalTrackingHardware;
typedef SGCore::Haptics::ESenseGloveThumperCommand FESenseGloveThumperCommandType;
typedef SGCore::Kinematics::EThumbMovement FEThumbMovementType;
typedef SGCore::SG::EThumbSolver FEThumbSolverType;
public:
static FEBackendType ToEBackendType(const ESGBackendType Enum);
static ESGBackendType ToESGBackendType(const FEBackendType Enum);
static FEBackendType ToEBackendType(ESGBackendType Enum);
static ESGBackendType ToESGBackendType(FEBackendType Enum);
static FECalibrationStageType ToECalibrationStage(const ESGCalibrationStage Enum);
static ESGCalibrationStage ToESGCalibrationStage(const FECalibrationStageType Enum);
static FECalibrationStageType ToECalibrationStage(ESGCalibrationStage Enum);
static ESGCalibrationStage ToESGCalibrationStage(FECalibrationStageType Enum);
static FEConnectionType ToEConnectionType(const ESGConnectionType Enum);
static ESGConnectionType ToESGConnectionType(const FEConnectionType Enum);
static FEConnectionType ToEConnectionType(ESGConnectionType Enum);
static ESGConnectionType ToESGConnectionType(FEConnectionType Enum);
static FEDeviceType ToEDeviceType(const ESGDeviceType Enum);
static ESGDeviceType ToESGDeviceType(const FEDeviceType Enum);
static FEDeviceType ToEDeviceType(ESGDeviceType Enum);
static ESGDeviceType ToESGDeviceType(FEDeviceType Enum);
static FEFingerType ToEFinger(const ESGFinger Enum);
static ESGFinger ToESGFinger(const FEFingerType Enum);
static FEFingerType ToEFinger(ESGFinger Enum);
static ESGFinger ToESGFinger(FEFingerType Enum);
static FEFingerMovementType ToEFingerMovement(const ESGFingerMovement Enum);
static ESGFingerMovement ToESGFingerMovement(const FEFingerMovementType Enum);
static FEFingerMovementType ToEFingerMovement(ESGFingerMovement Enum);
static ESGFingerMovement ToESGFingerMovement(FEFingerMovementType Enum);
static FEFingerSolverType ToEFingerSolver(const ESGFingerSolver Enum);
static ESGFingerSolver ToESGFingerSolver(const FEFingerSolverType Enum);
static FEFingerSolverType ToEFingerSolver(ESGFingerSolver Enum);
static ESGFingerSolver ToESGFingerSolver(FEFingerSolverType Enum);
static FEPositionalTrackingHardware ToEPositionalTrackingHardware(const ESGPositionalTrackingHardware Enum);
static ESGPositionalTrackingHardware ToESGPositionalTrackingHardware(const FEPositionalTrackingHardware Enum);
static FEPositionalTrackingHardware ToEPositionalTrackingHardware(ESGPositionalTrackingHardware Enum);
static ESGPositionalTrackingHardware ToESGPositionalTrackingHardware(FEPositionalTrackingHardware Enum);
static FEThumbMovementType ToEThumbMovement(const ESGThumbMovement Enum);
static ESGThumbMovement ToESGThumbMovement(const FEThumbMovementType Enum);
static FESenseGloveThumperCommandType ToESenseGloveThumperCommand(ESGSenseGloveThumperCommand Enum);
static ESGSenseGloveThumperCommand ToESGSenseGloveThumperCommand(FESenseGloveThumperCommandType Enum);
static FEThumbSolverType ToEThumbSolver(const ESGThumbSolver Enum);
static ESGThumbSolver ToESGThumbSolver(const FEThumbSolverType Enum);
static FEThumbMovementType ToEThumbMovement(ESGThumbMovement Enum);
static ESGThumbMovement ToESGThumbMovement(FEThumbMovementType Enum);
static FEThumbSolverType ToEThumbSolver(ESGThumbSolver Enum);
static ESGThumbSolver ToESGThumbSolver(FEThumbSolverType Enum);
};
@@ -90,21 +90,21 @@ FString FSGDeviceImpl::ToString(ESGDeviceType DeviceType)
FSGDeviceImpl::FSGDeviceImpl()
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
}
FSGDeviceImpl::FSGDeviceImpl(const FSGDevicePtrType SGDevice)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
ensureAlwaysMsgf(SGDevice.get(), TEXT("Invalid SGDevice!"));
Pimpl->SGDevice = SGDevice;
@@ -112,16 +112,20 @@ FSGDeviceImpl::FSGDeviceImpl(const FSGDevicePtrType SGDevice)
FSGDeviceImpl::FSGDeviceImpl(const FSGDeviceImpl& Rhs)
:
#if ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 )
#if SG_CPP17
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}, PimplDeleter))
#else
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{*Rhs.Pimpl}))
#endif /* ENGINE_MAJOR_VERSION == 5 || ( ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 22 ) */
#endif /* SG_CPP17 */
{
Pimpl->Owner = this;
}
FSGDeviceImpl::FSGDeviceImpl(FSGDeviceImpl&& Rhs) noexcept = default;
FSGDeviceImpl::FSGDeviceImpl(FSGDeviceImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGDeviceImpl::~FSGDeviceImpl() = default;
@@ -132,7 +136,11 @@ FSGDeviceImpl& FSGDeviceImpl::operator=(const FSGDeviceImpl& Rhs)
return *this;
}
FSGDeviceImpl& FSGDeviceImpl::operator=(FSGDeviceImpl&& Rhs) noexcept = default;
FSGDeviceImpl& FSGDeviceImpl::operator=(FSGDeviceImpl&& Rhs)
#if SG_CPP17
noexcept
#endif /* SG_CPP17 */
= default;
FSGDeviceImpl::FSGDevicePtrType FSGDeviceImpl::ToSGDevicePtr() const
{
@@ -242,9 +250,9 @@ int32 FSGDeviceImpl::GetDeviceIndex() const
return ToSGDevicePtrChecked()->GetDeviceIndex();
}
void FSGDeviceImpl::SetDeviceIndex(const int32 Index)
void FSGDeviceImpl::SetDeviceIndex(const int32 NewIndex)
{
ToSGDevicePtrChecked()->SetDeviceIndex(Index);
ToSGDevicePtrChecked()->SetDeviceIndex(NewIndex);
}
bool FSGDeviceImpl::IsWireless() const

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