implement the nova2 api updates and bump the senseglove libraries to v2.101.0-3e1693fb

This commit is contained in:
Mamadou Babaei
2024-03-22 21:00:17 +01:00
parent a470fadc32
commit 72bb3f9af6
574 changed files with 22013 additions and 27569 deletions
+22 -8
View File
@@ -5,21 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.9.8] - 2024-03-12 ## [Unreleased]
This is a bugfix release with containing bugfixes backported from the next major release of the plugin as documented below. This is the second major release of the SenseGlove Unreal Engine Plugin adding support for Nova 2 with enormous breaking changes to the current C++ and Blueprint APIs.
### Added
- Added support for the SenseGlove Nova 2 devices.
- Various classes have been added to the API in order to implement the new functionalities and features from the latest upstream SenseGlove libraries.
- Added initial support for the upcoming Unreal Engine 5.4 release.
### Fixed ### Fixed
- Fix a bug where the right hand mesh is always hidden inside the game no matter whether the right glove is connected or not. - A few critical bug fixes that have already been backported to the v1.x.x series through v1.9.3 to v1.9.7 releases.
- Fix a crash inside the USGHandPose::FromHandAngles method. - Fix the modules order indside the .uplugin file.
- Some performance optimizations by utilizing MoveTemp in return statements. - Fix changelog formatting.
- Some improvements applied to the source code.
- Some other minor fixes.
### Changed ### Changed
- The BonesRotations TMap is no longer a public field of FSGVirtualHandAnimInstanceProxy and instead could be retrieved by calling the GetBonesRotations() method. - SenseGlove libraries have been updated to v2.101.0-3e1693fb.
- Various classes and parts of the API have been changed in order to reflect and adhere to upstream SenseGlove libraries.
- Reverse the Platform Support Matrix order from newer Unreal Engine versions to the older ones.
- Clarify the engine support policy in the main readme file by adding the corresponding references from the Epic Marketplace Guidelines and a URL to their guidelines page.
- The SGTouchComponent uproperties BuzzDuration and BuzzLevel now utilize different different names in order to correspond to the underlying API changes. They have been renamed to VibrotactileDuration and VibrotacktileLevel.
- The SGTouchComponent uproperties ForceFeedbackLevel and BuzzLevel (now VibrotacktileLevel) parameters type have changed from int32 to float with the value range varying between 0.0f to 1.0f instead of 1 to 100 in order to correspond to the underlying API changes.
### Removed
- Various classes and parts of the API have been removed in order to reflect and adhere to upstream SenseGlove libraries.
- Removed the redundant SGIC_int32_Ref interop type.
## [1.9.7] - 2024-02-18 ## [1.9.7] - 2024-02-18
+13 -38
View File
@@ -8,16 +8,17 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
| | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Android (NDK)** | **UE Marketplace Version** | **Azure DevOps Version** | | | **Windows (MSVC 2017)** | **Windows (MSVC 2019)** | **Windows (MSVC 2022)** | **Linux x86-64 (Native Toolchain)** | **Linux AArch64 (Native Toolchain)** | **Android (NDK)** | **UE Marketplace Version** | **Azure DevOps Version** |
|----------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:-----------------:|:--------------------------:|:------------------------:| |----------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------------------:|:------------------------------------:|:-----------------:|:--------------------------:|:------------------------:|
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | ❌ | ⚠️ v1.0.4 | | **5.4** | | | ✅ v1.9.x | v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ❌ | |
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | | ⚠️ v1.0.4 | | **5.3** | | v1.9.x | ✅ v1.9.x | v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.7 | v1.9.7 |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | | ⚠️ v1.0.x | | | | ⚠️ v1.0.4 | | **5.2** | | v1.9.x | ✅ v1.9.x | v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.7 | v1.9.7 |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
| **5.0** | ❌ | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x (r21e) | ⚠️ v1.6.1 | ⚠️ v1.6.1 |
| **5.1** | ❌ | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.7 | ✅ v1.9.7 | | **5.1** | ❌ | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x | ✅ v1.9.x (r25b) | ✅ v1.9.7 | ✅ v1.9.7 |
| **5.2** | ❌ | v1.9.x | v1.9.x | v1.9.x | v1.9.x | v1.9.x (r25b) | v1.9.7 | v1.9.8 | | **5.0** | ❌ | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x | ⚠️ v1.6.x (r21e) | ⚠️ v1.6.1 | ⚠️ v1.6.1 |
| **5.3** | | v1.9.x | v1.9.x | v1.9.x | v1.9.x | v1.9.x (r25b) | v1.9.8 | v1.9.8 | | **4.27** | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x | ⚠️ v1.4.x (r21e) | ⚠️ v1.3.1 | ⚠️ v1.4.3 |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.23** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
| **4.22** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ | ❌ | ⚠️ v1.0.4 |
* <code>✅</code> Supported * <code>✅</code> Supported
* <code>⚠️</code> Not supported by the latest release and might be lacking features * <code>⚠️</code> Not supported by the latest release and might be lacking features
@@ -25,7 +26,7 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
* <code>❓</code> Unknown or untested * <code>❓</code> Unknown or untested
Remarks: Remarks:
* Per Epic's Marketplace policy regarding Code Plugins, we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps. * Per [Epic's Marketplace Guidelines](https://www.unrealengine.com/en-US/marketplace-guidelines) in regards to Code Plugins (sections 2.6.3.d and 3.1.b), we are only able to distribute or update the SenseGlove plugin for the last 3 stable versions of Unreal Engine. As a result, we won't be able to publish updates or bug fixes for the older versions of the Engine except on rare occasions and only through our official repository on Microsoft Azure DevOps.
* Microsoft Visual Studio 2022 is not supported by Unreal Engine 4.22 through 4.26. * Microsoft Visual Studio 2022 is not supported by Unreal Engine 4.22 through 4.26.
* All third-party libraries on Windows built against Windows SDK 10.0. * All third-party libraries on Windows built against Windows SDK 10.0.
* Oculus support is only provided through the recommended Android NDK versions by Epic Games. * Oculus support is only provided through the recommended Android NDK versions by Epic Games.
@@ -55,7 +56,7 @@ Please note that modules postfixed with **Impl** are intended for interal use an
## Planned Features Completion Status ## Planned Features Completion Status
### Implemented as of v1.9.8 ### Implemented as of v1.9.7
- [X] Full SenseGlove low-level core API access through Unreal C++. - [X] Full SenseGlove low-level core API access through Unreal C++.
- [X] Full SenseGlove low-level core API access through Blueprint. - [X] Full SenseGlove low-level core API access through Blueprint.
@@ -166,32 +167,6 @@ Please note that modules postfixed with **Impl** are intended for interal use an
├── android ├── android
│ │ │ │
│ ├── r21e (Android NDK r21e dependencies for UE 4.27 and 5.0)
│ │ │
│ │ ├── arm64 (64-bit ARM variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── armv7 (32-bit ARM variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ ├── x64 (64-bit x86-64 variant of Android)
│ │ │ │
│ │ │ ├── debug
│ │ │ │
│ │ │ └── release
│ │ │
│ │ └── x86 (32-bit x86 variant of Android)
│ │ │
│ │ ├── debug
│ │ │
│ │ └── release
│ │
│ └── r25b (Android NDK r21b dependencies for UE 5.1) │ └── r25b (Android NDK r21b dependencies for UE 5.1)
│ │ │ │
│ ├── arm64 (64-bit ARM variant of Android) │ ├── arm64 (64-bit ARM variant of Android)
@@ -285,4 +260,4 @@ The SenseGlove plug-in for Unreal Engine is licensed under the terms of the [MIT
### Third-Party Licenses ### Third-Party Licenses
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. 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.
+11 -11
View File
@@ -43,17 +43,6 @@
"Win64" "Win64"
] ]
}, },
{
"Name": "SenseGloveBuildHacks",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{ {
"Name": "SenseGloveBackend", "Name": "SenseGloveBackend",
"Type": "Runtime", "Type": "Runtime",
@@ -76,6 +65,17 @@
"Win64" "Win64"
] ]
}, },
{
"Name": "SenseGloveBuildHacks",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"LinuxArm64",
"Win64"
]
},
{ {
"Name": "SenseGloveConnect", "Name": "SenseGloveConnect",
"Type": "Runtime", "Type": "Runtime",
@@ -99,10 +99,10 @@ USGTouchComponent::USGTouchComponent(const FObjectInitializer& ObjectInitializer
: Super(ObjectInitializer), : Super(ObjectInitializer),
Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter)) Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{ {
BuzzLevel = 0; ForceFeedbackLevel = 1.0f;
BuzzDuration = 0.25f;
ForceFeedbackLevel = 100; VibrotactileDuration = 0.25f;
VibrotactileLevel = 0.0f;
} }
USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner) USGTouchComponent::FImpl::FImpl(USGTouchComponent* InOwner)
@@ -41,6 +41,7 @@
#include "Engine/SkeletalMesh.h" #include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h" #include "Runtime/Launch/Resources/Version.h"
#include "Templates/UnrealTypeTraits.h"
#include "UObject/ConstructorHelpers.h" #include "UObject/ConstructorHelpers.h"
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h" #include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
@@ -259,7 +260,7 @@ void USGVirtualHandComponent::SetRight(const bool bInRight)
void USGVirtualHandComponent::SetAnimClass(UClass* NewClass) void USGVirtualHandComponent::SetAnimClass(UClass* NewClass)
{ {
ensureAlwaysMsgf(Cast<USGVirtualHandAnimInstance>(NewClass), ensureAlwaysMsgf((TIsDerivedFrom<decltype(NewClass), USGVirtualHandAnimInstance>::IsDerived),
TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!")); TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!"));
Super::SetAnimClass(NewClass); Super::SetAnimClass(NewClass);
@@ -389,13 +390,7 @@ USGHandPose* USGVirtualHandComponent::GetHandPose()
if (IsValid(Glove)) if (IsValid(Glove))
{ {
#if ! PLATFORM_ANDROID
Glove->GetHandPose(this, HandPose); Glove->GetHandPose(this, HandPose);
#else /* ! PLATFORM_ANDROID */
const UWorld* World{GetWorld()};
const float DeltaTime = UGameplayStatics::GetWorldDeltaSeconds(World);
Glove->GetHandPose(this, DeltaTime, HandPose);
#endif /* ! PLATFORM_ANDROID */
} }
return HandPose; return HandPose;
@@ -51,9 +51,9 @@
#include "SenseGlove/Haptics/SGGrabState.h" #include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h" #include "SenseGlove/Haptics/SGTouchState.h"
#include "SGBuildHacks/SGPlatform.h" #include "SGBuildHacks/SGPlatform.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGHapticGlove.h" #include "SGCore/SGHapticGlove.h"
#include "SGCore/SGNova2Glove.h"
#include "SGCore/SGNovaGlove.h"
struct ASGPlayerController::FImpl struct ASGPlayerController::FImpl
{ {
@@ -61,18 +61,32 @@ struct ASGPlayerController::FImpl
* Static methods * Static methods
************************/ ************************/
static int32 GetBuzzLevel(const AActor* Actor); static float GetForceFeedbackLevel(const AActor* Actor);
static float GetBuzzDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static int32 GetForceFeedbackLevel(const AActor* Actor); static float GetVibrotactileDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static float GetVibrotactileLevel(const AActor* Actor);
static TArray<float> GetForceFeedbackLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
static TArray<float> GetVibrotactileLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching);
/************************ /************************
* Member variables * Member variables
************************/ ************************/
FTimerHandle TouchBuzzStopTimer; FTimerHandle TouchVibrotactileStopTimer;
/************************ /************************
* Owner object * Owner object
@@ -98,96 +112,137 @@ struct ASGPlayerController::FImpl
* Methods * Methods
************************/ ************************/
USGBuzzCommand* GetBuzzCommand(
const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const;
USGForceFeedbackCommand* GetForceFeedbackCommand(
const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const;
void UpdateHapticsFeedback(const FSGTouchState& TouchState); void UpdateHapticsFeedback(const FSGTouchState& TouchState);
}; };
int32 ASGPlayerController::FImpl::GetBuzzLevel(const AActor* Actor) float ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
{ {
if (IsValid(Actor)) if (IsValid(Actor))
{ {
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor); const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
if (TouchComponent) if (IsValid(TouchComponent))
{ {
return TouchComponent->GetBuzzLevel(); return TouchComponent->GetForceFeedbackLevel();
}
}
return 0;
}
float ASGPlayerController::FImpl::GetBuzzDuration(const AActor* ActorThumbTouching, const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching, const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
if (IsValid(ActorThumbTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorThumbTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorIndexTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorIndexTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorMiddleTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorMiddleTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorRingTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorRingTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
}
}
if (IsValid(ActorPinkyTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorPinkyTouching);
if (TouchComponent)
{
return TouchComponent->GetBuzzDuration();
} }
} }
return 0.0f; return 0.0f;
} }
int32 ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor) float ASGPlayerController::FImpl::GetVibrotactileDuration(const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
if (IsValid(ActorThumbTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorThumbTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorIndexTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorIndexTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorMiddleTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorMiddleTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorRingTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorRingTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
if (IsValid(ActorPinkyTouching))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(ActorPinkyTouching);
if (IsValid(TouchComponent))
{
return TouchComponent->GetVibrotactileDuration();
}
}
return 0.0f;
}
float ASGPlayerController::FImpl::GetVibrotactileLevel(const AActor* Actor)
{ {
if (IsValid(Actor)) if (IsValid(Actor))
{ {
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor); const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
if (TouchComponent) if (IsValid(TouchComponent))
{ {
return TouchComponent->GetForceFeedbackLevel(); return TouchComponent->GetVibrotactileLevel();
} }
} }
return 0; return 0.0f;
}
TArray<float> ASGPlayerController::FImpl::GetForceFeedbackLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
const float ThumbForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
const float IndexForceFeedbackLevel = GetForceFeedbackLevel(ActorIndexTouching);
const float MiddleForceFeedbackLevel = GetForceFeedbackLevel(ActorMiddleTouching);
const float RingForceFeedbackLevel = GetForceFeedbackLevel(ActorRingTouching);
const float PinkyForceFeedbackLevel = GetForceFeedbackLevel(ActorPinkyTouching);
TArray<float> ForceFeedbackLevels{
ThumbForceFeedbackLevel,
IndexForceFeedbackLevel,
MiddleForceFeedbackLevel,
RingForceFeedbackLevel,
PinkyForceFeedbackLevel,
};
return MoveTemp(ForceFeedbackLevels);
}
TArray<float> ASGPlayerController::FImpl::GetVibrotactileLevels(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching)
{
const float ThumbVibrotactileLevel = GetVibrotactileLevel(ActorThumbTouching);
const float IndexVibrotactileLevel = GetVibrotactileLevel(ActorIndexTouching);
const float MiddleVibrotactileLevel = GetVibrotactileLevel(ActorMiddleTouching);
const float RingVibrotactileLevel = GetVibrotactileLevel(ActorRingTouching);
const float PinkyVibrotactileLevel = GetVibrotactileLevel(ActorPinkyTouching);
TArray<float> ForceFeedbackLevels{
ThumbVibrotactileLevel,
IndexVibrotactileLevel,
MiddleVibrotactileLevel,
RingVibrotactileLevel,
PinkyVibrotactileLevel,
};
return MoveTemp(ForceFeedbackLevels);
} }
ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer) ASGPlayerController::ASGPlayerController(const FObjectInitializer& ObjectInitializer)
@@ -251,69 +306,10 @@ ASGPlayerController::FImpl::FImpl(ASGPlayerController* InOwner)
ASGPlayerController::FImpl::~FImpl() = default; ASGPlayerController::FImpl::~FImpl() = default;
USGBuzzCommand* ASGPlayerController::FImpl::GetBuzzCommand(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const
{
const int32 ThumbBuzzLevel = GetBuzzLevel(ActorThumbTouching);
const int32 IndexBuzzLevel = GetBuzzLevel(ActorIndexTouching);
const int32 MiddleBuzzLevel = GetBuzzLevel(ActorMiddleTouching);
const int32 RingBuzzLevel = GetBuzzLevel(ActorRingTouching);
const int32 PinkyBuzzLevel = GetBuzzLevel(ActorPinkyTouching);
if (ThumbBuzzLevel <= 0 && IndexBuzzLevel <= 0 && MiddleBuzzLevel <= 0 && RingBuzzLevel <= 0 && PinkyBuzzLevel <= 0)
{
return nullptr;
}
USGBuzzCommand* BuzzCommand = USGBuzzCommand::NewBuzzCommand(
Owner,
GetBuzzLevel(ActorThumbTouching),
GetBuzzLevel(ActorIndexTouching),
GetBuzzLevel(ActorMiddleTouching),
GetBuzzLevel(ActorRingTouching),
GetBuzzLevel(ActorPinkyTouching)
);
return BuzzCommand;
}
USGForceFeedbackCommand* ASGPlayerController::FImpl::GetForceFeedbackCommand(
const AActor* ActorThumbTouching,
const AActor* ActorIndexTouching,
const AActor* ActorMiddleTouching,
const AActor* ActorRingTouching,
const AActor* ActorPinkyTouching) const
{
const int32 ThumbForceFeedbackLevel = GetForceFeedbackLevel(ActorThumbTouching);
const int32 IndexForceFeedbackLevel = GetForceFeedbackLevel(ActorIndexTouching);
const int32 MiddleForceFeedbackLevel = GetForceFeedbackLevel(ActorMiddleTouching);
const int32 RingForceFeedbackLevel = GetForceFeedbackLevel(ActorRingTouching);
const int32 PinkyForceFeedbackLevel = GetForceFeedbackLevel(ActorPinkyTouching);
if (ThumbForceFeedbackLevel <= 0 && IndexForceFeedbackLevel <= 0 && MiddleForceFeedbackLevel <= 0
&& RingForceFeedbackLevel <= 0 && PinkyForceFeedbackLevel <= 0)
{
return nullptr;
}
USGForceFeedbackCommand* ForceFeedbackCommand = USGForceFeedbackCommand::NewForceFeedbackCommand(
Owner,
GetForceFeedbackLevel(ActorThumbTouching),
GetForceFeedbackLevel(ActorIndexTouching),
GetForceFeedbackLevel(ActorMiddleTouching),
GetForceFeedbackLevel(ActorRingTouching),
GetForceFeedbackLevel(ActorPinkyTouching)
);
return ForceFeedbackCommand;
}
void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState) void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& TouchState)
{ {
static const TArray<float> VibrotactileOffCommand{0.0f, 0.0f, 0.0, 0.0, 0.0f};
if (!IsValid(TouchState.Hand)) if (!IsValid(TouchState.Hand))
{ {
return; return;
@@ -325,47 +321,69 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
return; return;
} }
const USGBuzzCommand* BuzzCommand{ // Queue the Force-Feedback command...
GetBuzzCommand( TArray<float> ForceFeedbackLevels{
GetForceFeedbackLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching, TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching,TouchState.ActorPinkyTouching) TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
}; };
if (IsValid(BuzzCommand)) Glove->QueueForceFeedbackLevels(MoveTemp(ForceFeedbackLevels));
USGNovaGlove* NovaGlove = Cast<USGNovaGlove>(Glove);
USGNova2Glove* Nova2Glove = Cast<USGNova2Glove>(Glove);
// Queue the Vibrotactile command if a Nova or Nova 2 glove...
if (IsValid(NovaGlove) || IsValid(Nova2Glove))
{ {
Glove->SendHaptics(BuzzCommand); TArray<float> VibrotactileLevels{
GetVibrotactileLevels(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching)
};
const float Duration = FImpl::GetBuzzDuration( if (IsValid(NovaGlove))
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState. ActorRingTouching, TouchState.ActorPinkyTouching);
Owner->GetWorldTimerManager().ClearTimer(TouchBuzzStopTimer);
FTimerDelegate TouchBuzzStopHandler;
TouchBuzzStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
{ {
Glove->SendHaptics(USGBuzzCommand::Off(Owner)); NovaGlove->QueueVibroLevels(MoveTemp(VibrotactileLevels));
}
// Queue the Vibrotactile command if a Nova 2 glove...
if (IsValid(Nova2Glove))
{
/// TODO
}
}
// Send the haptics commands!
Glove->SendHaptics();
// Stop the Vibrotactile command after the timeout if a Nova or Nova 2 glove.
if (IsValid(NovaGlove) || IsValid(Nova2Glove))
{
const float VibrotactileDuration = FImpl::GetVibrotactileDuration(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState.ActorRingTouching, TouchState.ActorPinkyTouching);
Owner->GetWorldTimerManager().ClearTimer(TouchVibrotactileStopTimer);
FTimerDelegate TouchVibrotactileStopHandler;
TouchVibrotactileStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
{
// Stop the Vibrotactile command after the timeout if a Nova Glove.
if (IsValid(NovaGlove))
{
NovaGlove->QueueVibroLevels(VibrotactileOffCommand);
NovaGlove->SendHaptics();
}
// Stop the Vibrotactile command after the timeout if a Nova 2 Glove.
if (IsValid(Nova2Glove))
{
// TODO
}
}); });
Owner->GetWorldTimerManager().SetTimer( Owner->GetWorldTimerManager().SetTimer(
TouchBuzzStopTimer, TouchBuzzStopHandler, Duration, false, -1.0f); TouchVibrotactileStopTimer, TouchVibrotactileStopHandler, VibrotactileDuration, false, -1.0f);
}
else
{
Glove->SendHaptics(USGBuzzCommand::Off(Owner));
}
const USGForceFeedbackCommand* ForceFeedbackCommand{
GetForceFeedbackCommand(
TouchState.ActorThumbTouching, TouchState.ActorIndexTouching, TouchState.ActorMiddleTouching,
TouchState. ActorRingTouching, TouchState.ActorPinkyTouching)
};
if (IsValid(ForceFeedbackCommand))
{
Glove->SendHaptics(ForceFeedbackCommand);
}
else
{
Glove->SendHaptics(USGForceFeedbackCommand::Off(Owner));
} }
} }
@@ -54,15 +54,15 @@ public:
private: private:
UPROPERTY(EditAnywhere, Category="SenseGlove", UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100")) meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
int32 BuzzLevel; float ForceFeedbackLevel;
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false", ClampMin = "0.0", UIMin = "0.0")) UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false", ClampMin = "0.0", UIMin = "0.0"))
float BuzzDuration; float VibrotactileDuration;
UPROPERTY(EditAnywhere, Category="SenseGlove", UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", ClampMin = "0", ClampMax = "100", UIMin = "0", UIMax = "100")) meta=(AllowPrivateAccess="false", ClampMin = "0.0", ClampMax = "100.0", UIMin = "0.0", UIMax = "100.0"))
int32 ForceFeedbackLevel; float VibrotactileLevel;
private: private:
struct FImpl; struct FImpl;
@@ -76,33 +76,32 @@ private:
FImplDeleter PimplDeleter; FImplDeleter PimplDeleter;
public: public:
FORCEINLINE int32 GetBuzzLevel() const FORCEINLINE float GetForceFeedbackLevel() const
{
return BuzzLevel;
}
FORCEINLINE void SetBuzzLevel(const int32 Level)
{
BuzzLevel = Level;
}
FORCEINLINE float GetBuzzDuration() const
{
return BuzzDuration;
}
FORCEINLINE void SetBuzzDuration(const float Duration)
{
BuzzDuration = Duration;
}
FORCEINLINE int32 GetForceFeedbackLevel() const
{ {
return ForceFeedbackLevel; return ForceFeedbackLevel;
} }
FORCEINLINE void SetForceFeedbackLevel(const int32 Level) FORCEINLINE void SetForceFeedbackLevel(const float Level)
{ {
ForceFeedbackLevel = Level; ForceFeedbackLevel = Level;
} }
FORCEINLINE float GetVibrotactileDuration() const
{
return VibrotactileDuration;
}
FORCEINLINE void SetVibrotactileDuration(const float Duration)
{
VibrotactileDuration = Duration;
}
FORCEINLINE float GetVibrotactileLevel() const
{
return VibrotactileLevel;
}
FORCEINLINE void SetVibrotactileLevel(const float Level)
{
VibrotactileLevel = Level;
}
}; };
@@ -42,7 +42,6 @@
#endif /* PLATFORM_ANDROID */ #endif /* PLATFORM_ANDROID */
#include "SGCore/SGDeviceList.h" #include "SGCore/SGDeviceList.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGLog/SGLog.h" #include "SGLog/SGLog.h"
struct USGBackend::FImpl struct USGBackend::FImpl
@@ -118,9 +117,6 @@ bool USGBackend::InitializeBackend()
FSGDeviceList::Dispose(); FSGDeviceList::Dispose();
FSGDeviceList::Reinitialize(); FSGDeviceList::Reinitialize();
// Load the latest hand profiles.
FSGHapticGloveHandProfiles::TryLoadingFromDisk();
bBackendInitialized = true; bBackendInitialized = true;
return true; return true;
@@ -33,4 +33,4 @@
*/ */
#include "SGBuildHacks/SGInclude_Core_SensorRange.h" #include "SGBuildHacks/SGInclude_Core_CustomWaveform.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HandLayer.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticChannelInfo.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationCheck.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCalibrationSequence.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveCommandBuffer.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveHandProfiles.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_HapticGloveQuickCalibration.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NormalizationState.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_Nova2Glove.h"
@@ -33,4 +33,4 @@
*/ */
#include "SGBuildHacks/SGInclude_Core_CalibrationDataPoint.h" #include "SGBuildHacks/SGInclude_Core_Nova2GloveSensorData.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NovaGloveCalibration.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_NovaGloveHandProfile.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SenseGloveHandProfile.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SenseGloveSensorNormalizer.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_SensorNormalization.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_ThresholdCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_ThumperCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_TimedBuzzCommand.h"
@@ -1,36 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGBuildHacks/SGInclude_Core_TimedThumpCommand.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/FingerCommand.hpp" #include "SenseGlove/Core/CustomWaveform.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/BuzzCommand.hpp" #include "SenseGlove/Core/HandLayer.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticChannelInfo.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCalibrationCheck.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCalibrationSequence.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveCommandBuffer.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveHandProfiles.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HapticGloveQuickCalibration.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NormalizationState.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/HandProfile.hpp" #include "SenseGlove/Core/Nova2Glove.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/CalibrationDataPoint.hpp" #include "SenseGlove/Core/Nova2GloveSensorData.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NovaGloveCalibration.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/NovaGloveHandProfile.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SenseGloveHandProfile.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/ForceFeedbackCommand.hpp" #include "SenseGlove/Core/SenseGloveSensorNormalizer.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SensorNormalization.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -38,7 +38,7 @@
#include "SGBuildHacks/SGUndef_TEXT.h" #include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/SensorRange.hpp" #include "SenseGlove/Core/ThresholdCommand.hpp"
THIRD_PARTY_INCLUDES_END THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h" #include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/ThumperCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/TimedBuzzCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -1,44 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/TimedThumpCommand.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -36,11 +36,9 @@
#pragma once #pragma once
/* Defines a C++ like static_assert. */ /* Defines a C++ like static_assert. */
#if __cplusplus #if ! __cplusplus
#include <cassert>
#else
#include <assert.h> #include <assert.h>
#endif /* __cplusplus */ #endif /* ! __cplusplus */
/* Contains __bool_true_false_are_defined macro that can be used in order to /* Contains __bool_true_false_are_defined macro that can be used in order to
check whether boolean type is supported by the compiler or not. */ check whether boolean type is supported by the compiler or not. */
@@ -58,7 +56,7 @@ static_assert(__bool_true_false_are_defined, "Error: bool, true, and false are n
#define SENSEGLOVECONNECTIMPL_PUBLIC_API DLLIMPORT #define SENSEGLOVECONNECTIMPL_PUBLIC_API DLLIMPORT
#endif /* defined ( SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE ) */ #endif /* defined ( SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE ) */
/* If C++ is used, switch to C mode in order to prevent C++'s name mangling of /* If C++ is used, switch to C mode in order to prevent the C++ name mangling of
method names. */ method names. */
#if __cplusplus #if __cplusplus
extern "C" { extern "C" {
@@ -189,6 +189,8 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2022: case WindowsCompiler.VisualStudio2022:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143")); LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
break; break;
#endif
#if ! UE_5_4_OR_LATER && UE_5_0_OR_LATER
case WindowsCompiler.VisualStudio2019: case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142")); LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break; break;
@@ -338,6 +340,8 @@ public class SenseGloveConnectImpl : ModuleRules
case WindowsCompiler.VisualStudio2022: case WindowsCompiler.VisualStudio2022:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143")); LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
break; break;
#endif
#if ! UE_5_4_OR_LATER && UE_5_0_OR_LATER
case WindowsCompiler.VisualStudio2019: case WindowsCompiler.VisualStudio2019:
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142")); LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
break; break;
@@ -68,6 +68,12 @@ float FSGAnatomy::GetThumbJointLimit(const bool bRightHanded, const int32 Joint,
return SGCoreImpl_FSGAnatomyImpl_GetThumbJointLimit(bRightHanded, Joint, Movement, bMax); return SGCoreImpl_FSGAnatomyImpl_GetThumbJointLimit(bRightHanded, Joint, Movement, bMax);
} }
float FSGAnatomy::ClampJointAngle(
const float Value, const int32 Finger, const bool bRightHand, const int32 Joint, const int32 Movement)
{
return SGCoreImpl_FSGAnatomyImpl_ClampJointAngle(Value, Finger, bRightHand, Joint, Movement);
}
float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInDegrees) float FSGAnatomy::NormalizeFingerFlexion(const float FlexionInDegrees)
{ {
return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInDegrees); return SGCoreImpl_FSGAnatomyImpl_NormalizeFingerFlexion(FlexionInDegrees);
@@ -1,180 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGBuzzCommand.h"
#include "SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const FSGBuzzCommandImpl& BuzzCommandImpl)
{
USGBuzzCommand* Instance = NewObject<USGBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(BuzzCommandImpl);
return Instance;
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
{
USGBuzzCommand* Instance = NewObject<USGBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(MoveTemp(BuzzCommandImpl));
return Instance;
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const TArray<int32>& BuzzLevels)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
SGCoreImpl_FSGBuzzCommandImpl_ctor_BuzzLevels_MakeShared(
&OutSharedPtrContainer, &BuzzLevelsContainer);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const int32 Thumb, const int32 Index, const int32 Middle,
const int32 Ring, const int32 Pinky)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::NewBuzzCommand(UObject* Outer, const ESGFinger Finger, const int32 BuzzLevel)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBuzzCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
return NewBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand* USGBuzzCommand::Off(UObject* Outer)
{
FSGIC_FSGBuzzCommandImpl OutContainer;
SGCoreImpl_FSGBuzzCommandImpl_Off(&OutContainer);
return NewBuzzCommand(Outer, OutContainer.BuzzCommandImpl);
}
USGBuzzCommand::USGBuzzCommand()
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const TArray<int32>& BuzzLevels)
: USGFingerCommand(BuzzLevels)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 BuzzLevelsContainer{BuzzLevels};
SGCoreImpl_FSGBuzzCommandImpl_ctor_BuzzLevels_MakeShared(
&OutSharedPtrContainer, &BuzzLevelsContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGBuzzCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGBuzzCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGBuzzCommand::USGBuzzCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
: USGFingerCommand(BuzzCommandImpl)
{
}
USGBuzzCommand::USGBuzzCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
: USGFingerCommand(MoveTemp(BuzzCommandImpl))
{
}
USGBuzzCommand::~USGBuzzCommand() = default;
TSharedRef<FSGBuzzCommandImpl> USGBuzzCommand::ToBuzzCommandImpl() const
{
return FSGFingerCommandImplCast::ToBuzzCommandImpl(ToFingerCommandImpl());
}
USGBuzzCommand* USGBuzzCommand::Copy(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl InstanceContainer{ToBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGBuzzCommandImpl_Copy(&InstanceContainer, &OutBuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
USGBuzzCommand* USGBuzzCommand::Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl InstanceContainer{ToBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandImplContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGBuzzCommandImpl_Merge(&InstanceContainer, &OutBuzzCommandImplContainer, &BuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
@@ -1,175 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGCalibrationDataPoint.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGCalibrationDataPointImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_FVector.h"
struct USGCalibrationDataPoint::FImpl
{
/************************
* Member variables
************************/
FSGCalibrationDataPointImpl CalibrationDataPointImpl;
/************************
* Owner object
************************/
USGCalibrationDataPoint* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGCalibrationDataPoint* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
UObject* Outer, const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
{
USGCalibrationDataPoint* Instance = NewObject<USGCalibrationDataPoint>(Outer);
Instance->SetCalibrationDataPointImpl(CalibrationDataPointImpl);
return Instance;
}
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(UObject* Outer)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
return NewCalibrationDataPoint(Outer, MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl));
}
USGCalibrationDataPoint* USGCalibrationDataPoint::NewCalibrationDataPoint(
UObject* Outer, const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_CurrentStage_CalibrationValues(
&OutCalibrationDataPointImplContainer, CurrentStage, &CalibrationValuesContainer);
return NewCalibrationDataPoint(Outer, MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl));
}
USGCalibrationDataPoint::USGCalibrationDataPoint()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ctor(&OutCalibrationDataPointImplContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
}
USGCalibrationDataPoint::USGCalibrationDataPoint(const int32 CurrentStage, const TArray<FVector>& CalibrationValues)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointImplContainer;
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_CurrentStage_CalibrationValues(
&OutCalibrationDataPointImplContainer, CurrentStage, &CalibrationValuesContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointImplContainer.CalibrationDataPointImpl);
}
USGCalibrationDataPoint::USGCalibrationDataPoint(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetCalibrationDataPointImpl(CalibrationDataPointImpl);
}
USGCalibrationDataPoint::~USGCalibrationDataPoint() = default;
void USGCalibrationDataPoint::SetCalibrationDataPointImpl(const FSGCalibrationDataPointImpl& CalibrationDataPointImpl)
{
FSGIC_FSGCalibrationDataPointImpl OutCalibrationDataPointContainer;
FSGIC_FSGCalibrationDataPointImpl RhsContainer{CalibrationDataPointImpl};
SGCoreImpl_FSGCalibrationDataPointImpl_ctor_copy(&OutCalibrationDataPointContainer, &RhsContainer);
Pimpl->CalibrationDataPointImpl = MoveTemp(OutCalibrationDataPointContainer.CalibrationDataPointImpl);
}
const FSGCalibrationDataPointImpl& USGCalibrationDataPoint::ToCalibrationDataPointImpl() const
{
return Pimpl->CalibrationDataPointImpl;
}
TArray<FVector> USGCalibrationDataPoint::GetCalibrationValues() const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{ToCalibrationDataPointImpl()};
FSGIC_TArray_FVector OutValuesContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_GetCalibrationValues(&InstanceContainer, &OutValuesContainer);
return MoveTemp(OutValuesContainer.Array);
}
int32 USGCalibrationDataPoint::GetStage() const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{ToCalibrationDataPointImpl()};
return SGCoreImpl_FSGCalibrationDataPointImpl_GetStage(&InstanceContainer);
}
FString USGCalibrationDataPoint::ToLogData(const FString& Delimiter) const
{
FSGIC_FSGCalibrationDataPointImpl InstanceContainer{Pimpl->CalibrationDataPointImpl};
FSGIC_FString DelimiterContainer{Delimiter};
FSGIC_FString OutDataContainer;
SGCoreImpl_FSGCalibrationDataPointImpl_ToLogData(&InstanceContainer, &OutDataContainer, &DelimiterContainer);
return MoveTemp(OutDataContainer.String);
}
USGCalibrationDataPoint::FImpl::FImpl(USGCalibrationDataPoint* InOwner)
: Owner(InOwner)
{
}
USGCalibrationDataPoint::FImpl::~FImpl() = default;
void USGCalibrationDataPoint::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,340 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGCustomWaveform.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGWaveformType.h"
#include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGCustomWaveform::FImpl
{
/************************
* Member variables
************************/
FSGCustomWaveformImpl CustomWaveformImpl;
/************************
* Owner object
************************/
USGCustomWaveform* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGCustomWaveform* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer, const FSGCustomWaveformImpl& CustomWaveformImpl)
{
USGCustomWaveform* Instance = NewObject<USGCustomWaveform>(Outer);
Instance->SetCustomWaveformImpl(CustomWaveformImpl);
return Instance;
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor(&OutCustomWaveformImplContainer);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(UObject* Outer, const float Amplitude, const float Duration)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration(
&OutCustomWaveformImplContainer, Amplitude, Duration);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
USGCustomWaveform* USGCustomWaveform::NewCustomWaveform(
UObject* Outer, const float Amplitude, const float Duration, const float Frequency)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration_Frequency(
&OutCustomWaveformImplContainer, Amplitude, Duration, Frequency);
return NewCustomWaveform(Outer, MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl));
}
FString USGCustomWaveform::ToString(const ESGWaveformType Type)
{
FSGIC_ESGWaveformType TypeContainer{Type};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGCustomWaveformImpl_ToString_Type(&OutStringContainer, &TypeContainer);
return MoveTemp(OutStringContainer.String);
}
USGCustomWaveform::USGCustomWaveform()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor(&OutCustomWaveformImplContainer);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const float Amplitude, const float Duration)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration(
&OutCustomWaveformImplContainer, Amplitude, Duration);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const float Amplitude, const float Duration, const float Frequency)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformImplContainer;
SGCoreImpl_FSGCustomWaveformImpl_ctor_Amplitude_Duration_Frequency(
&OutCustomWaveformImplContainer, Amplitude, Duration, Frequency);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformImplContainer.CustomWaveformImpl);
}
USGCustomWaveform::USGCustomWaveform(const FSGCustomWaveformImpl& CustomWaveformImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetCustomWaveformImpl(CustomWaveformImpl);
}
USGCustomWaveform::~USGCustomWaveform() = default;
void USGCustomWaveform::SetCustomWaveformImpl(const FSGCustomWaveformImpl& CustomWaveformImpl)
{
FSGIC_FSGCustomWaveformImpl OutCustomWaveformContainer;
FSGIC_FSGCustomWaveformImpl RhsContainer{CustomWaveformImpl};
SGCoreImpl_FSGCustomWaveformImpl_ctor_copy(&OutCustomWaveformContainer, &RhsContainer);
Pimpl->CustomWaveformImpl = MoveTemp(OutCustomWaveformContainer.CustomWaveformImpl);
}
const FSGCustomWaveformImpl& USGCustomWaveform::ToCustomWaveformImpl() const
{
return Pimpl->CustomWaveformImpl;
}
float USGCustomWaveform::GetAmplitude() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetAmplitude(&InstanceContainer);
}
void USGCustomWaveform::SetAmplitude(const float Amplitude)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetAmplitude(&InstanceContainer, Amplitude);
}
ESGWaveformType USGCustomWaveform::GetWaveType() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_ESGWaveformType OutTypeContainer;
SGCoreImpl_FSGCustomWaveformImpl_GetWaveType(&InstanceContainer, &OutTypeContainer);
return MoveTemp(OutTypeContainer.Type);
}
void USGCustomWaveform::SetWaveType(const ESGWaveformType Type)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_ESGWaveformType TypeContainer{Type};
SGCoreImpl_FSGCustomWaveformImpl_SetWaveType(&InstanceContainer, &TypeContainer);
}
bool USGCustomWaveform::IsInfinite() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_IsInfinite(&InstanceContainer);
}
void USGCustomWaveform::SetInfinite(const bool bInfinite)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetInfinite(&InstanceContainer, bInfinite);
}
int32 USGCustomWaveform::GetRepeatAmount() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetRepeatAmount(&InstanceContainer);
}
void USGCustomWaveform::SetRepeatAmount(const int32 Amount)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetRepeatAmount(&InstanceContainer, Amount);
}
float USGCustomWaveform::GetAttackTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetAttackTime(&InstanceContainer);
}
void USGCustomWaveform::SetAttackTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetAttackTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetSustainTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetSustainTime(&InstanceContainer);
}
void USGCustomWaveform::SetSustainTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetSustainTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetDecayTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetDecayTime(&InstanceContainer);
}
void USGCustomWaveform::SetDecayTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetDecayTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetFrequencyStart() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencyStart(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencyStart(const float Frequency)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencyStart(&InstanceContainer, Frequency);
}
float USGCustomWaveform::GetFrequencyEnd() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencyEnd(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencyEnd(const float Frequency)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencyEnd(&InstanceContainer, Frequency);
}
float USGCustomWaveform::GetFrequencySwitchTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencySwitchTime(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencySwitchTime(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencySwitchTime(&InstanceContainer, Time);
}
float USGCustomWaveform::GetFrequencySwitchFactor() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetFrequencySwitchFactor(&InstanceContainer);
}
void USGCustomWaveform::SetFrequencySwitchFactor(const float Time)
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
SGCoreImpl_FSGCustomWaveformImpl_SetFrequencySwitchFactor(&InstanceContainer, Time);
}
float USGCustomWaveform::GetEffectTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetEffectTime(&InstanceContainer);
}
float USGCustomWaveform::GetTotalEffectTime() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_GetTotalEffectTime(&InstanceContainer);
}
bool USGCustomWaveform::FrequencyJumps() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_FrequencyJumps(&InstanceContainer);
}
bool USGCustomWaveform::Equals(const USGCustomWaveform* CustomWaveform) const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_FSGCustomWaveformImpl CustomWaveformContainer{CustomWaveform->ToCustomWaveformImpl()};
return SGCoreImpl_FSGCustomWaveformImpl_Equals(&InstanceContainer, &CustomWaveformContainer);
}
FString USGCustomWaveform::ToString() const
{
FSGIC_FSGCustomWaveformImpl InstanceContainer{ToCustomWaveformImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGCustomWaveformImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGCustomWaveform::FImpl::FImpl(USGCustomWaveform* InOwner)
: Owner(InOwner)
{
}
USGCustomWaveform::FImpl::~FImpl() = default;
void USGCustomWaveform::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -36,25 +36,25 @@
#include "SGCore/SGDevice.h" #include "SGCore/SGDevice.h"
#include "Engine/Engine.h" #include "Engine/Engine.h"
#include "Engine/GameViewportClient.h"
#include "Engine/World.h"
#include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
#include "SGCoreImpl/SGBetaDeviceImpl.h"
#include "SGCoreImpl/SGDeviceImpl.h" #include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGConnectionType.h" #include "SGInterop/SGIC_ESGConnectionType.h"
#include "SGInterop/SGIC_ESGDeviceType.h" #include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticChannelType.h"
#include "SGInterop/SGIC_FSGBetaDeviceImpl.h" #include "SGInterop/SGIC_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_FSGDeviceImpl.h" #include "SGInterop/SGIC_FSGDeviceImpl.h"
#include "SGInterop/SGIC_FSGHapticChannelInfoImpl.h"
#include "SGInterop/SGIC_FSGHapticGloveImpl.h" #include "SGInterop/SGIC_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_FSGSenseGloveImpl.h"
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
@@ -93,6 +93,24 @@ void USGDevice::ParseFirmware(const FString& RawFirmware, int32& OutMainVersion,
SGCoreImpl_FSGDeviceImpl_ParseFirmware(&RawFirmwareContainer, &OutMainVersion, &OutSubVersion); SGCoreImpl_FSGDeviceImpl_ParseFirmware(&RawFirmwareContainer, &OutMainVersion, &OutSubVersion);
} }
bool USGDevice::FirmwareNewerThan(
const int32 MyFirmwareMain, const int32 MyFirmwareSub, const int32 ReferenceMain, const int32 ReferenceSub,
const bool bInclusive)
{
return
SGCoreImpl_FSGDeviceImpl_FirmwareNewerThan_MyFirmwareMain_MyFirmwareSub_ReferenceMain_ReferenceSub_bInclusive(
MyFirmwareMain, MyFirmwareSub, ReferenceMain, ReferenceSub, bInclusive);
}
bool USGDevice::FirmwareOlderThan(
const int32 MyFirmwareMain, const int32 MyFirmwareSub, const int32 ReferenceMain, const int32 ReferenceSub,
const bool bInclusive)
{
return
SGCoreImpl_FSGDeviceImpl_FirmwareOlderThan_MyFirmwareMain_MyFirmwareSub_ReferenceMain_ReferenceSub_bInclusive(
MyFirmwareMain, MyFirmwareSub, ReferenceMain, ReferenceSub, bInclusive);
}
FString USGDevice::ToString(const ESGDeviceType DeviceType) FString USGDevice::ToString(const ESGDeviceType DeviceType)
{ {
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType}; FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
@@ -140,6 +158,16 @@ USGDevice::USGDevice(const FSGHapticGloveImpl& HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr); Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
} }
USGDevice::USGDevice(const FSGNova2GloveImpl& Nova2GloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNova2GloveImpl RhsContainer{Nova2GloveImpl};
SGCoreImpl_FSGNova2GloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl) USGDevice::USGDevice(const FSGNovaGloveImpl& NovaGloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter)) : Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{ {
@@ -178,6 +206,12 @@ USGDevice::USGDevice(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl); Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
} }
USGDevice::USGDevice(TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->SGDeviceImpl = MoveTemp(Nova2GloveImpl);
}
USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl) USGDevice::USGDevice(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter)) : Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{ {
@@ -216,6 +250,14 @@ void USGDevice::SetSGDeviceImpl(const FSGHapticGloveImpl& HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr); Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
} }
void USGDevice::SetSGDeviceImpl(const FSGNova2GloveImpl& Nova2GloveImpl)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNova2GloveImpl RhsContainer{Nova2GloveImpl};
SGCoreImpl_FSGNovaGloveImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->SGDeviceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGDevice::SetSGDeviceImpl(const FSGNovaGloveImpl& NovaGloveImpl) void USGDevice::SetSGDeviceImpl(const FSGNovaGloveImpl& NovaGloveImpl)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer; FSGIC_TSharedPtr_FSGNovaGloveImpl OutSharedPtrContainer;
@@ -247,6 +289,11 @@ void USGDevice::SetSGDeviceImpl(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl); Pimpl->SGDeviceImpl = MoveTemp(HapticGloveImpl);
} }
void USGDevice::SetSGDeviceImpl(TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
{
Pimpl->SGDeviceImpl = MoveTemp(Nova2GloveImpl);
}
void USGDevice::SetSGDeviceImpl(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl) void USGDevice::SetSGDeviceImpl(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
{ {
Pimpl->SGDeviceImpl = MoveTemp(NovaGloveImpl); Pimpl->SGDeviceImpl = MoveTemp(NovaGloveImpl);
@@ -284,6 +331,20 @@ FString USGDevice::GetFirmwareString() const
return MoveTemp(OutStringContainer.String); return MoveTemp(OutStringContainer.String);
} }
bool USGDevice::FirmwareNewerThan(int32 FirmwareMain, int32 FirmwareSub, bool bInclusive) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_FirmwareNewerThan_MyFirmwareMain_MyFirmwareSub_bInclusive(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
bool USGDevice::FirmwareOlderThan(int32 FirmwareMain, int32 FirmwareSub, bool bInclusive) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_FirmwareOlderThan_MyFirmwareMain_MyFirmwareSub_bInclusive(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
FString USGDevice::GetAddress() const FString USGDevice::GetAddress() const
{ {
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()}; FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
@@ -357,6 +418,26 @@ bool USGDevice::GetBatteryLevel(float& OutLevel)
return bResult; return bResult;
} }
void USGDevice::SetHapticChannels(const USGHapticChannelInfo* Channels)
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_FSGHapticChannelInfoImpl ChannelsContainer{Channels->ToHapticChannelInfoImpl()};
SGCoreImpl_FSGDeviceImpl_SetHapticChannels(&InstanceContainer, &ChannelsContainer);
}
int32 USGDevice::GetHapticChannelCount() const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
return SGCoreImpl_FSGDeviceImpl_GetHapticChannelCount(&InstanceContainer);
}
int32 USGDevice::GetHapticChannelCount(ESGHapticChannelType ChannelType) const
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
FSGIC_ESGHapticChannelType ChannelTypeContainer{ChannelType};
return SGCoreImpl_FSGDeviceImpl_GetHapticChannelCount_ChannelType(&InstanceContainer, &ChannelTypeContainer);
}
FString USGDevice::ToString() const FString USGDevice::ToString() const
{ {
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()}; FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{ToSGDeviceImpl()};
@@ -39,11 +39,13 @@
#include "SGCoreImpl/SGDeviceImpl.h" #include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHapticGloveImpl.h" #include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGNova2GloveImpl.h"
#include "SGCoreImpl/SGNovaGloveImpl.h" #include "SGCoreImpl/SGNovaGloveImpl.h"
#include "SGCoreImpl/SGSenseGloveImpl.h" #include "SGCoreImpl/SGSenseGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGBetaDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
@@ -63,6 +65,14 @@ TSharedRef<FSGHapticGloveImpl> FSGDeviceImplCast::ToHapticGloveImpl(TSharedRef<F
return OutSharedPtrContainer.Ptr.ToSharedRef(); return OutSharedPtrContainer.Ptr.ToSharedRef();
} }
TSharedRef<FSGNova2GloveImpl> FSGDeviceImplCast::ToNova2GloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
{
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{MoveTemp(SGDeviceImpl)};
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGDeviceImpl_ToNova2GloveImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGNovaGloveImpl> FSGDeviceImplCast::ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl) TSharedRef<FSGNovaGloveImpl> FSGDeviceImplCast::ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl)
{ {
FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{MoveTemp(SGDeviceImpl)}; FSGIC_TSharedPtr_FSGDeviceImpl InstanceContainer{MoveTemp(SGDeviceImpl)};
@@ -40,6 +40,7 @@
class FSGBetaDeviceImpl; class FSGBetaDeviceImpl;
class FSGDeviceImpl; class FSGDeviceImpl;
class FSGHapticGloveImpl; class FSGHapticGloveImpl;
class FSGNova2GloveImpl;
class FSGNovaGloveImpl; class FSGNovaGloveImpl;
class FSGSenseGloveImpl; class FSGSenseGloveImpl;
@@ -50,6 +51,8 @@ public:
static TSharedRef<FSGHapticGloveImpl> ToHapticGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl); static TSharedRef<FSGHapticGloveImpl> ToHapticGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGNova2GloveImpl> ToNova2GloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGNovaGloveImpl> ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl); static TSharedRef<FSGNovaGloveImpl> ToNovaGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
static TSharedRef<FSGSenseGloveImpl> ToSenseGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl); static TSharedRef<FSGSenseGloveImpl> ToSenseGloveImpl(TSharedRef<FSGDeviceImpl> SGDeviceImpl);
@@ -165,11 +165,12 @@ bool FSGDeviceList::GetSensorDataString(const int32 IpcIndex, const FString& Ipc
return bReturn; return bReturn;
} }
bool FSGDeviceList::SendHaptics(const int32 IpcIndex, const FString& IpcAddress, const FString& Commands) bool FSGDeviceList::SendHaptics(
const int32 IpcIndex, const FString& IpcAddress, const int32 ChannelIndex, const FString& Commands)
{ {
FSGIC_FString IpcAddressContainer{IpcAddress}; FSGIC_FString IpcAddressContainer{IpcAddress};
FSGIC_FString CommandsContainer{Commands}; FSGIC_FString CommandsContainer{Commands};
return SGCoreImpl_FSGDeviceListImpl_SendHaptics(IpcIndex, &IpcAddressContainer, &CommandsContainer); return SGCoreImpl_FSGDeviceListImpl_SendHaptics(IpcIndex, &IpcAddressContainer, ChannelIndex, &CommandsContainer);
} }
FString FSGDeviceList::GetDeviceStringAt(const int32 IpcIndex, const FString& IpcAddress, const int32 Index) FString FSGDeviceList::GetDeviceStringAt(const int32 IpcIndex, const FString& IpcAddress, const int32 Index)
@@ -188,6 +188,22 @@ int32 USGDeviceModel::GetSubFirmwareVersion() const
return SGCoreImpl_FSGDeviceModelImpl_GetSubFirmwareVersion(&InstanceContainer); return SGCoreImpl_FSGDeviceModelImpl_GetSubFirmwareVersion(&InstanceContainer);
} }
bool USGDeviceModel::FirmwareNewerThan(const int32 FirmwareMain, const int32 FirmwareSub,
const bool bInclusive) const
{
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
return SGCoreImpl_FSGDeviceModelImpl_FirmwareNewerThan(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
bool USGDeviceModel::FirmwareOlderThan(const int32 FirmwareMain, const int32 FirmwareSub,
const bool bInclusive) const
{
FSGIC_FSGDeviceModelImpl InstanceContainer{ToDeviceModelImpl()};
return SGCoreImpl_FSGDeviceModelImpl_FirmwareOlderThan(
&InstanceContainer, FirmwareMain, FirmwareSub, bInclusive);
}
USGDeviceModel::FImpl::FImpl(USGDeviceModel* InOwner) USGDeviceModel::FImpl::FImpl(USGDeviceModel* InOwner)
: Owner(InOwner) : Owner(InOwner)
{ {
@@ -1,274 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGFingerCommand.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedBuzzCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
struct USGFingerCommand::FImpl
{
/************************
* Member variables
************************/
TSharedPtr<FSGFingerCommandImpl> FingerCommandImpl;
/************************
* Owner object
************************/
USGFingerCommand* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGFingerCommand* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGFingerCommand::USGFingerCommand()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const TArray<int32>& InLevels)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 LevelsContainer{InLevels};
SGCoreImpl_FSGFingerCommandImpl_ctor_Levels_MakeShared(&OutSharedPtrContainer, &LevelsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGFingerCommandImpl& FingerCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
SGCoreImpl_FSGFingerCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGBuzzCommandImpl& BuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
SGCoreImpl_FSGBuzzCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
}
USGFingerCommand::USGFingerCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
}
USGFingerCommand::~USGFingerCommand() = default;
void USGFingerCommand::SetFingerCommandImpl(const FSGFingerCommandImpl& FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl OutSharedPtrContainer;
FSGIC_FSGFingerCommandImpl RhsContainer{FingerCommandImpl};
SGCoreImpl_FSGFingerCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGBuzzCommandImpl& BuzzCommandImpl)
{
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl RhsContainer{BuzzCommandImpl};
SGCoreImpl_FSGBuzzCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_FSGForceFeedbackCommandImpl RhsContainer{ForceFeedbackCommandImpl};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGTimedBuzzCommandImpl RhsContainer{TimedBuzzCommandImpl};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->FingerCommandImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(FingerCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGBuzzCommandImpl> BuzzCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(BuzzCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(ForceFeedbackCommandImpl);
}
void USGFingerCommand::SetFingerCommandImpl(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
{
Pimpl->FingerCommandImpl = MoveTemp(TimedBuzzCommandImpl);
}
TSharedRef<FSGFingerCommandImpl> USGFingerCommand::ToFingerCommandImpl() const
{
return Pimpl->FingerCommandImpl.ToSharedRef();
}
TArray<int32> USGFingerCommand::GetLevels() const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_TArray_int32 OutLevelsContainer;
SGCoreImpl_FSGFingerCommandImpl_GetLevels(&InstanceContainer, &OutLevelsContainer);
return MoveTemp(OutLevelsContainer.Array);
}
int32 USGFingerCommand::GetLevel(const int32 Finger) const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
const int32 Level = SGCoreImpl_FSGFingerCommandImpl_GetLevel(&InstanceContainer, Finger);
return Level;
}
void USGFingerCommand::SetLevel(const int32 Finger, const int32 Value)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
SGCoreImpl_FSGFingerCommandImpl_SetLevel(&InstanceContainer, Finger, Value);
}
bool USGFingerCommand::Equals(const USGFingerCommand* FingerCommand) const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_FSGFingerCommandImpl FingerCommandImplContainer{FingerCommand->ToFingerCommandImpl().Get()};
const bool bEquals = SGCoreImpl_FSGFingerCommandImpl_Equals(&InstanceContainer, &FingerCommandImplContainer);
return bEquals;
}
FString USGFingerCommand::ToString() const
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{ToFingerCommandImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGFingerCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGFingerCommand::FImpl::FImpl(USGFingerCommand* InOwner)
: Owner(InOwner)
{
}
USGFingerCommand::FImpl::~FImpl() = default;
void USGFingerCommand::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,70 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
TSharedRef<FSGBuzzCommandImpl> FSGFingerCommandImplCast::ToBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToBuzzCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGForceFeedbackCommandImpl> FSGFingerCommandImplCast::ToForceFeedbackCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToForceFeedbackCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
TSharedRef<FSGTimedBuzzCommandImpl> FSGFingerCommandImplCast::ToTimedBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl)
{
FSGIC_TSharedPtr_FSGFingerCommandImpl InstanceContainer{MoveTemp(FingerCommandImpl)};
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGFingerCommandImpl_ToTimedBuzzCommandImplRef(&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
@@ -1,55 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Templates/SharedPointer.h"
class FSGFingerCommandImpl;
class FSGBuzzCommandImpl;
class FSGForceFeedbackCommandImpl;
class FSGTimedBuzzCommandImpl;
class SENSEGLOVECORE_API FSGFingerCommandImplCast
{
public:
static TSharedRef<FSGBuzzCommandImpl> ToBuzzCommandImpl(TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
static TSharedRef<FSGForceFeedbackCommandImpl> ToForceFeedbackCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
static TSharedRef<FSGTimedBuzzCommandImpl> ToTimedBuzzCommandImpl(
TSharedRef<FSGFingerCommandImpl> FingerCommandImpl);
};
@@ -1,187 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGFingerCommandImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TArray_int32.h"
#include "SGInterop/SGIC_TSharedPtr_FSGForceFeedbackCommandImpl.h"
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer,
const FSGForceFeedbackCommandImpl&
ForceFeedbackCommandImpl)
{
USGForceFeedbackCommand* Instance = NewObject<USGForceFeedbackCommand>(Outer);
Instance->SetFingerCommandImpl(ForceFeedbackCommandImpl);
return Instance;
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer,
TSharedRef<FSGForceFeedbackCommandImpl>
ForceFeedbackCommandImpl)
{
USGForceFeedbackCommand* Instance = NewObject<USGForceFeedbackCommand>(Outer);
Instance->SetFingerCommandImpl(MoveTemp(ForceFeedbackCommandImpl));
return Instance;
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(UObject* Outer)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, const TArray<int32>& ForceFeedbackLevels)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_ForceFeedbackLevels_MakeShared(
&OutSharedPtrContainer, &ForceFeedbackLevelsContainer);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::NewForceFeedbackCommand(
UObject* Outer, ESGFinger Finger, const int32 BuzzLevel)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
return NewForceFeedbackCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Off(UObject* Outer)
{
FSGIC_FSGForceFeedbackCommandImpl OutContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Off(&OutContainer);
return NewForceFeedbackCommand(Outer, OutContainer.ForceFeedbackCommandImpl);
}
USGForceFeedbackCommand::USGForceFeedbackCommand()
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const TArray<int32>& ForceFeedbackLevels)
: USGFingerCommand(ForceFeedbackLevels)
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_TArray_int32 ForceFeedbackLevelsContainer{ForceFeedbackLevels};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_ForceFeedbackLevels_MakeShared(
&OutSharedPtrContainer, &ForceFeedbackLevelsContainer);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(
const int32 Thumb, const int32 Index, const int32 Middle, const int32 Ring, const int32 Pinky)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Thumb_Index_Middle_Ring_Pinky_MakeShared(
&OutSharedPtrContainer, Thumb, Index, Middle, Ring, Pinky);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const ESGFinger Finger, const int32 BuzzLevel)
: USGFingerCommand()
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGForceFeedbackCommandImpl_ctor_Finger_BuzzLevel_MakeShared(
&OutSharedPtrContainer, &FingerContainer, BuzzLevel);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGForceFeedbackCommand::USGForceFeedbackCommand(const FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl)
: USGFingerCommand(ForceFeedbackCommandImpl)
{
}
USGForceFeedbackCommand::USGForceFeedbackCommand(TSharedRef<FSGForceFeedbackCommandImpl> ForceFeedbackCommandImpl)
: USGFingerCommand(MoveTemp(ForceFeedbackCommandImpl))
{
}
USGForceFeedbackCommand::~USGForceFeedbackCommand() = default;
TSharedRef<FSGForceFeedbackCommandImpl> USGForceFeedbackCommand::ToForceFeedbackCommandImpl() const
{
return FSGFingerCommandImplCast::ToForceFeedbackCommandImpl(ToFingerCommandImpl());
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Copy(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Copy(&InstanceContainer, &OutForceFeedbackCommandImplContainer);
return NewForceFeedbackCommand(Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
USGForceFeedbackCommand* USGForceFeedbackCommand::Merge(UObject* Outer,
const USGForceFeedbackCommand* ForceFeedbackCommand) const
{
FSGIC_TSharedPtr_FSGForceFeedbackCommandImpl InstanceContainer{ToForceFeedbackCommandImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandImplContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
SGCoreImpl_FSGForceFeedbackCommandImpl_Merge(&InstanceContainer, &OutForceFeedbackCommandImplContainer,
&ForceFeedbackCommandImplContainer);
return NewForceFeedbackCommand(Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
@@ -50,6 +50,8 @@
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h" #include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FVector.h" #include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TArray_TArray_float.h"
#include "SGInterop/SGIC_TArray_TArray_FSGInterpolationSetImpl.h" #include "SGInterop/SGIC_TArray_TArray_FSGInterpolationSetImpl.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h" #include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGUtils/SGArrayUtils.h" #include "SGUtils/SGArrayUtils.h"
@@ -99,155 +101,26 @@ USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(UObject* Outer)
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl)); return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
} }
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator( USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(UObject* Outer, const bool bRightHanded)
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations)
{ {
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer; FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{ SGCoreImpl_FSGHandInterpolatorImpl_ctor_bRightHanded(&OutHandInterpolatorImplContainer,
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl, bRightHanded);
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl)); return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
} }
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator( USGHandInterpolator* USGHandInterpolator::Deserialize(UObject* Outer,
UObject* Outer, const FString& SerializedString, const bool bRightHanded)
const TArray<FSGInterpolationSetArray>& JointInterpolations)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FQuat& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<TArray<USGInterpolationSet*>>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FQuat& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::NewHandInterpolator(
UObject* Outer,
const TArray<FSGInterpolationSetArray>& JointInterpolations, const FRotator& CmcStartRotation)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
SGCoreImpl_FSGHandInterpolatorImpl_Default(&OutHandInterpolatorImplContainer, bRightHanded);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
}
USGHandInterpolator* USGHandInterpolator::Deserialize(UObject* Outer, const FString& SerializedString)
{ {
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer; FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString}; FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGHandInterpolatorImpl_Deserialize(&OutHandInterpolatorImplContainer, &SerializedStringContainer); SGCoreImpl_FSGHandInterpolatorImpl_Deserialize(&OutHandInterpolatorImplContainer,
&SerializedStringContainer, bRightHanded);
return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl)); return NewHandInterpolator(Outer, MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl));
} }
TArray<FVector> USGHandInterpolator::InterpolateFingerAngles(const ESGFinger Finger,
const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles)
{
FSGIC_TArray_FVector OutAnglesContainer;
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_FVector TotalGloveAnglesContainer{TotalGloveAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateFingerAngles(&OutAnglesContainer, &FingerContainer,
&InterpolatorContainer, &TotalGloveAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<FVector> USGHandInterpolator::InterpolateThumbAngles(const USGHandInterpolator* Interpolator,
const FVector& TotalGloveAngles)
{
FSGIC_TArray_FVector OutAnglesContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_FVector TotalGloveAnglesContainer{TotalGloveAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateThumbAngles(&OutAnglesContainer, &InterpolatorContainer,
&TotalGloveAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(const USGHandInterpolator* Interpolator,
const TArray<FVector>& TotalAngles)
{
FSGIC_TArray_TArray_FVector OutAnglesContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_TArray_FVector TotalAnglesContainer{TotalAngles};
SGCoreImpl_FSGHandInterpolatorImpl_InterpolateHandAngles(&OutAnglesContainer, &InterpolatorContainer,
&TotalAnglesContainer);
return MoveTemp(OutAnglesContainer.Array);
}
USGHandInterpolator::USGHandInterpolator() USGHandInterpolator::USGHandInterpolator()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter)) : Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{ {
@@ -257,97 +130,12 @@ USGHandInterpolator::USGHandInterpolator()
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl); Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
} }
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations) USGHandInterpolator::USGHandInterpolator(const bool bRightHanded)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter)) : Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{ {
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer; FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{ SGCoreImpl_FSGHandInterpolatorImpl_ctor_bRightHanded(&OutHandInterpolatorImplContainer,
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl, bRightHanded);
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations(&OutHandInterpolatorImplContainer,
&JointInterpolationsContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FQuat& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<TArray<USGInterpolationSet*>>& JointInterpolations,
const FRotator& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl>(JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FQuat& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
}
USGHandInterpolator::USGHandInterpolator(const TArray<FSGInterpolationSetArray>& JointInterpolations,
const FRotator& CmcStartRotation)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandInterpolatorImpl OutHandInterpolatorImplContainer;
FSGIC_TArray_TArray_FSGInterpolationSetImpl JointInterpolationsContainer{
FSGArrayUtils::ToImplType<
USGInterpolationSet, FSGInterpolationSetImpl,
&USGInterpolationSet::ToInterpolationSetImpl,
FSGInterpolationSetArray, &FSGInterpolationSetArray::InterpolationSetArray>(
JointInterpolations)};
FSGIC_FQuat CmcStartRotationContainer{CmcStartRotation.Quaternion()};
SGCoreImpl_FSGHandInterpolatorImpl_ctor_JointInterpolations_CmcStartRotation(
&OutHandInterpolatorImplContainer, &JointInterpolationsContainer, &CmcStartRotationContainer);
Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl); Pimpl->HandInterpolatorImpl = MoveTemp(OutHandInterpolatorImplContainer.HandInterpolatorImpl);
} }
@@ -373,104 +161,36 @@ const FSGHandInterpolatorImpl& USGHandInterpolator::ToHandInterpolatorImpl() con
return Pimpl->HandInterpolatorImpl; return Pimpl->HandInterpolatorImpl;
} }
TArray<TArray<USGInterpolationSet*>> USGHandInterpolator::GetJointInterpolations(UObject* Outer) const float USGHandInterpolator::CalculateAngle(
const ESGFingerMovement Movement, const float Value, const bool bApplyLimits) const
{ {
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()}; FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_TArray_TArray_FSGInterpolationSetImpl OutInterpolationsContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetJointInterpolations(&InstanceContainer, &OutInterpolationsContainer);
TArray<TArray<USGInterpolationSet*>> JointInterpolations{
FSGArrayUtils::FromImplType<FSGInterpolationSetImpl, USGInterpolationSet,
&USGInterpolationSet::NewInterpolationSet>(
Outer, MoveTemp(OutInterpolationsContainer.Array))
};
return JointInterpolations;
}
FQuat USGHandInterpolator::GetCmcStartRotationQ() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetCmcStartRotation(&InstanceContainer, &OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGHandInterpolator::GetCmcStartRotation() const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetCmcStartRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const int32 Movement, const float Value) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_int32Movement_Value(
&InstanceContainer, &FingerContainer, Movement, Value);
return Angle;
}
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGFingerMovement Movement,
const float Value) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGFingerMovement MovementContainer{Movement}; FSGIC_ESGFingerMovement MovementContainer{Movement};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_ESGFingerMovement_Value( const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_ESGFingerMovement_Value_bApplyLimits(
&InstanceContainer, &FingerContainer, &MovementContainer, Value); &InstanceContainer, &MovementContainer, Value, bApplyLimits);
return Angle; return Angle;
} }
float USGHandInterpolator::CalculateAngle(const ESGFinger Finger, const ESGThumbMovement Movement, float USGHandInterpolator::CalculateAngle(
const float Value) const const ESGThumbMovement Movement, const float Value, const bool bApplyLimits) const
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGThumbMovement MovementContainer{Movement};
const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_Finger_ESGThumbMovement_Value(
&InstanceContainer, &FingerContainer, &MovementContainer, Value);
return Angle;
}
void USGHandInterpolator::SetInterpolation(const int32 Finger, const int32 Movement, const float InputAt0,
const float InputAt1, const float AngleAt0, const float AngleAt1)
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_int32Finger_int32Movement_InputAt0_InputAt1_AngleAt0_AngleAt1(
&InstanceContainer, Finger, Movement, InputAt0, InputAt1, AngleAt0, AngleAt1);
}
void USGHandInterpolator::SetInterpolation(const ESGFinger Finger, const ESGFingerMovement Movement,
const float InputAt0, const float InputAt1, const float AngleAt0,
const float AngleAt1)
{
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGFingerMovement MovementContainer{Movement};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_ESGFinger_ESGFingerMovement_InputAt0_InputAt1_AngleAt0_AngleAt1(
&InstanceContainer, &FingerContainer, &MovementContainer, InputAt0, InputAt1, AngleAt0, AngleAt1);
}
void USGHandInterpolator::SetInterpolation(const ESGThumbMovement Movement, const float InputAt0, const float InputAt1,
const float AngleAt0, const float AngleAt1)
{ {
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()}; FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_ESGThumbMovement MovementContainer{Movement}; FSGIC_ESGThumbMovement MovementContainer{Movement};
SGCoreImpl_FSGHandInterpolatorImpl_SetInterpolation_Movement_InputAt0_InputAt1_AngleAt0_AngleAt1( const float Angle = SGCoreImpl_FSGHandInterpolatorImpl_CalculateAngle_ESGThumbMovement_Value_bApplyLimits(
&InstanceContainer, &MovementContainer, InputAt0, InputAt1, AngleAt0, AngleAt1); &InstanceContainer, &MovementContainer, Value, bApplyLimits);
return Angle;
} }
USGInterpolationSet* USGHandInterpolator::GetInterpolation(UObject* Outer, TArray<TArray<FVector>> USGHandInterpolator::InterpolateHandAngles(
const int32 Finger, const int32 Movement) const const TArray<TArray<float>>& Flexions, const TArray<float>& Abductions, const float CmcTwist) const
{ {
FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()}; FSGIC_FSGHandInterpolatorImpl InstanceContainer{ToHandInterpolatorImpl()};
FSGIC_FSGInterpolationSetImpl OutInterpolationContainer; FSGIC_TArray_TArray_FVector OutAnglesContainer;
SGCoreImpl_FSGHandInterpolatorImpl_GetInterpolation(&InstanceContainer, &OutInterpolationContainer, Finger, FSGIC_TArray_TArray_float FlexionsContainer{Flexions};
Movement); FSGIC_TArray_float AbductionsContainer{Abductions};
return USGInterpolationSet::NewInterpolationSet(Outer, MoveTemp(OutInterpolationContainer.InterpolationSetImpl)); SGCoreImpl_FSGHandInterpolatorImpl_InterpolateHandAngles(
&InstanceContainer, &OutAnglesContainer, &FlexionsContainer, &AbductionsContainer, CmcTwist);
return MoveTemp(OutAnglesContainer.Array);
} }
bool USGHandInterpolator::Equals(const USGHandInterpolator* HandInterpolator) const bool USGHandInterpolator::Equals(const USGHandInterpolator* HandInterpolator) const
@@ -0,0 +1,213 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHandLayer.h"
#include "SGCore/SGCustomWaveform.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGHapticLocation.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
bool FSGHandLayer::DeviceConnected(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_DeviceConnected(bRightHanded);
}
ESGDeviceType FSGHandLayer::GetDeviceType(const bool bRightHanded)
{
FSGIC_ESGDeviceType DeviceTypeContainer;
SGCoreImpl_FSGHandLayerImpl_GetDeviceType(&DeviceTypeContainer, bRightHanded);
return DeviceTypeContainer.Type;
}
bool FSGHandLayer::GetFirstGloveHandedness()
{
return SGCoreImpl_FSGHandLayerImpl_GetFirstGloveHandedness();
}
int32 FSGHandLayer::GlovesConnected()
{
return SGCoreImpl_FSGHandLayerImpl_GlovesConnected();
}
bool FSGHandLayer::GetGloveInstance(UObject* Outer, const bool bRightHanded, USGHapticGlove*& OutGlove)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer;
const bool bResult = SGCoreImpl_FSGHandLayerImpl_GetGloveInstance(bRightHanded, &OutGloveContainer);
OutGlove = USGHapticGlove::NewHapticGlove(Outer, OutGloveContainer.Ptr.ToSharedRef());
return bResult;
}
ESGHapticGloveCalibrationState FSGHandLayer::GetCalibrationState(const bool bRightHanded)
{
FSGIC_ESGHapticGloveCalibrationState HapticGloveCalibrationStateContainer;
SGCoreImpl_FSGHandLayerImpl_GetDeviceType(&HapticGloveCalibrationStateContainer, bRightHanded);
return HapticGloveCalibrationStateContainer.State;
}
FString FSGHandLayer::GetCalibrationInstructions(const bool bRightHanded)
{
FSGIC_FString CalibrationInstructionsContainer;
SGCoreImpl_FSGHandLayerImpl_GetCalibrationInstructions(&CalibrationInstructionsContainer, bRightHanded);
return MoveTemp(CalibrationInstructionsContainer.String);
}
void FSGHandLayer::ResetCalibration(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_ResetCalibration(bRightHanded);
}
void FSGHandLayer::EndCalibration(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_EndCalibration(bRightHanded);
}
bool FSGHandLayer::GetHandPose(UObject* Outer, const bool bRightHanded, USGHandPose*& OutHandPose)
{
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHandLayerImpl_GetHandPose(bRightHanded, &OutHandPoseContainer);
OutHandPose = USGHandPose::NewHandPose(Outer, OutHandPose->ToHandPoseImpl());
return bResult;
}
void FSGHandLayer::GetWristLocation(
const bool bRightHanded, const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, FVector& OutWristPosition, FQuat& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGHandLayerImpl_GetWristLocation(
bRightHanded, &ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
bool FSGHandLayer::SendHaptics(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SendHaptics(bRightHanded);
}
void FSGHandLayer::StopAllHaptics(const bool bRightHanded)
{
SGCoreImpl_FSGHandLayerImpl_StopAllHaptics(bRightHanded);
}
bool FSGHandLayer::QueueCommand_ForceFeedbackLevel(
const bool bRightHanded, const int32 Finger, const float Level01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ForceFeedbackLevel(bRightHanded, Finger, Level01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_ForceFeedbackLevels(
const bool bRightHanded, const TArray<float>& Levels01, const bool bSendImmediate)
{
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ForceFeedbackLevels(
bRightHanded, &Levels01Container, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_SetVibroLevel(
const bool bRightHanded, const int32 Finger, const float Level01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_SetVibroLevel(bRightHanded, Finger, Level01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_SetVibroLevels(
const bool bRightHanded, const TArray<float>& Levels01, const bool bSendImmediate)
{
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_SetVibroLevels(bRightHanded, &Levels01Container, bSendImmediate);
}
bool FSGHandLayer::SupportsCustomWaveform(
const bool bRightHanded, const ESGHapticLocation AtLocation)
{
FSGIC_ESGHapticLocation AtLocationContainer{AtLocation};
return SGCoreImpl_FSGHandLayerImpl_SupportsCustomWaveform(bRightHanded, &AtLocationContainer);
}
bool FSGHandLayer::SendCustomWaveform(
const bool bRightHanded, USGCustomWaveform*& OutWaveform, const ESGHapticLocation Location)
{
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGHapticLocation LocationContainer{Location};
return SGCoreImpl_FSGHandLayerImpl_SendCustomWaveform(bRightHanded, &OutWaveformContainer, &LocationContainer);
}
bool FSGHandLayer::SupportsWristSqueeze(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SupportsWristSqueeze(bRightHanded);
}
bool FSGHandLayer::QueueCommand_WristSqueeze(
const bool bRightHanded, const float SqueezeLevel01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_WristSqueeze(bRightHanded, SqueezeLevel01, bSendImmediate);
}
bool FSGHandLayer::SupportsFlexionLocks(const bool bRightHanded)
{
return SGCoreImpl_FSGHandLayerImpl_SupportsFlexionLocks(bRightHanded);
}
bool FSGHandLayer::QueueCommand_FlexionLock(
const bool bRightHanded, const int32 Finger, const float Flexion01, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_FlexionLock(bRightHanded, Finger, Flexion01, bSendImmediate);
}
bool FSGHandLayer::QueueCommand_ClearFlexionLock(
const bool bRightHanded, const int32 Finger, const bool bSendImmediate)
{
return SGCoreImpl_FSGHandLayerImpl_QueueCommand_ClearFlexionLock(bRightHanded, Finger, bSendImmediate);
}
@@ -35,8 +35,6 @@
#include "SGCore/SGHandPose.h" #include "SGCore/SGHandPose.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBasicHandModel.h" #include "SGCore/SGBasicHandModel.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandPoseImpl.h" #include "SGCoreImpl/SGHandPoseImpl.h"
@@ -423,7 +421,6 @@ TArray<TArray<FVector>> USGHandPose::GetHandAngles() const
bool USGHandPose::Equals(const USGHandPose* HandPose) const bool USGHandPose::Equals(const USGHandPose* HandPose) const
{ {
FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()}; FSGIC_FSGHandPoseImpl InstanceContainer{ToHandPoseImpl()};
FSGIC_FSGHandPoseImpl HandPoseContainer{HandPose->ToHandPoseImpl()}; FSGIC_FSGHandPoseImpl HandPoseContainer{HandPose->ToHandPoseImpl()};
return SGCoreImpl_FSGHandPoseImpl_Equals(&InstanceContainer, &HandPoseContainer); return SGCoreImpl_FSGHandPoseImpl_Equals(&InstanceContainer, &HandPoseContainer);
@@ -1,284 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHandProfile.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGHandProfile::FImpl
{
/************************
* Member variables
************************/
FSGHandProfileImpl HandProfileImpl;
/************************
* Owner object
************************/
USGHandProfile* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHandProfile* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer, const FSGHandProfileImpl& HandProfileImpl)
{
USGHandProfile* Instance = NewObject<USGHandProfile>(Outer);
Instance->SetHandProfileImpl(HandProfileImpl);
return Instance;
}
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::NewHandProfile(UObject* Outer, const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
{SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer
{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_ctor_bRightHanded_SenseGloveHandProfile_NovaGloveHandProfile(
&OutHandProfileImplContainer, bRightHanded, &SenseGloveHandProfileContainer, &NovaGloveHandProfileContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_Default(&OutHandProfileImplContainer, bRightHanded);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
USGHandProfile* USGHandProfile::Deserialize(UObject* Outer, const FString& SerializedString)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGHandProfileImpl_Deserialize(&OutHandProfileImplContainer,
&SerializedStringContainer);
return NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
FString USGHandProfile::GetProfileDirectory()
{
FSGIC_FString OutDirectoryContainer;
SGCoreImpl_FSGHandProfileImpl_GetProfileDirectory(&OutDirectoryContainer);
return MoveTemp(OutDirectoryContainer.String);
}
FString USGHandProfile::GetLeftHandFileName()
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetLeftHandFileName(&OutFileName);
return MoveTemp(OutFileName.String);
}
FString USGHandProfile::GetRightHandFileName()
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetRightHandFileName(&OutFileName);
return MoveTemp(OutFileName.String);
}
FString USGHandProfile::GetProfileFileName(const bool bRightHanded)
{
FSGIC_FString OutFileName;
SGCoreImpl_FSGHandProfileImpl_GetProfileFileName(&OutFileName, bRightHanded);
return MoveTemp(OutFileName.String);
}
bool USGHandProfile::GetLatestProfile(UObject* Outer, const bool bRightHanded, USGHandProfile*& OutLatestProfile)
{
FSGIC_FSGHandProfileImpl OutLatestProfileContainer;
const bool bResult = SGCoreImpl_FSGHandProfileImpl_GetLatestProfile(bRightHanded, &OutLatestProfileContainer);
if (bResult)
{
OutLatestProfile = NewHandProfile(Outer, MoveTemp(OutLatestProfileContainer.HandProfileImpl));
}
return bResult;
}
bool USGHandProfile::StoreProfile(const USGHandProfile* ProfileToStore)
{
FSGIC_FSGHandProfileImpl ProfileToStoreContainer{ProfileToStore->ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_StoreProfile(&ProfileToStoreContainer);
}
bool USGHandProfile::ResetCalibration(const bool bRightHanded, const bool bOnDisk)
{
return SGCoreImpl_FSGHandProfileImpl_ResetCalibration_bRightHanded_bOnDisk(bRightHanded, bOnDisk);
}
void USGHandProfile::ResetCalibration(const bool bOnDisk)
{
return SGCoreImpl_FSGHandProfileImpl_ResetCalibration_bOnDisk(bOnDisk);
}
USGHandProfile::USGHandProfile()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHandProfileImpl_ctor(&OutHandProfileImplContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
}
USGHandProfile::USGHandProfile(const bool bRightHanded,
const USGSenseGloveHandProfile* SenseGloveHandProfile,
const USGNovaGloveHandProfile* NovaGloveHandProfile)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer
{SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer
{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_ctor_bRightHanded_SenseGloveHandProfile_NovaGloveHandProfile(
&OutHandProfileImplContainer, bRightHanded, &SenseGloveHandProfileContainer, &NovaGloveHandProfileContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileImplContainer.HandProfileImpl);
}
USGHandProfile::USGHandProfile(const FSGHandProfileImpl& HandProfileImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetHandProfileImpl(HandProfileImpl);
}
USGHandProfile::~USGHandProfile() = default;
void USGHandProfile::SetHandProfileImpl(const FSGHandProfileImpl& HandProfileImpl)
{
FSGIC_FSGHandProfileImpl OutHandProfileContainer;
FSGIC_FSGHandProfileImpl RhsContainer{HandProfileImpl};
SGCoreImpl_FSGHandProfileImpl_ctor_copy(&OutHandProfileContainer, &RhsContainer);
Pimpl->HandProfileImpl = MoveTemp(OutHandProfileContainer.HandProfileImpl);
}
const FSGHandProfileImpl& USGHandProfile::ToHandProfileImpl() const
{
return Pimpl->HandProfileImpl;
}
bool USGHandProfile::IsRight() const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_IsRight(&InstanceContainer);
}
USGSenseGloveHandProfile* USGHandProfile::GetSenseGloveHandProfile(UObject* Outer) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGSenseGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHandProfileImpl_GetSenseGloveHandProfile(&InstanceContainer, &OutProfileContainer);
return USGSenseGloveHandProfile::NewSenseGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.SenseGloveHandProfileImpl));
}
USGNovaGloveHandProfile* USGHandProfile::GetNovaGloveHandProfile(UObject* Outer) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHandProfileImpl_GetNovaGloveHandProfile(&InstanceContainer, &OutProfileContainer);
return USGNovaGloveHandProfile::NewNovaGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.NovaGloveHandProfileImpl));
}
bool USGHandProfile::Equals(const USGHandProfile* HandProfile) const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
return SGCoreImpl_FSGHandProfileImpl_Equals(&InstanceContainer, &HandProfileContainer);
}
void USGHandProfile::Reset()
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
SGCoreImpl_FSGHandProfileImpl_Reset(&InstanceContainer);
}
FString USGHandProfile::SGSerialize() const
{
FSGIC_FSGHandProfileImpl InstanceContainer{ToHandProfileImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGHandProfile::FImpl::FImpl(USGHandProfile* InOwner)
: Owner(InOwner)
{
}
USGHandProfile::FImpl::~FImpl() = default;
void USGHandProfile::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,236 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticChannelInfo.h"
#include "SGCoreImpl/SGHapticChannelInfoImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGHapticChannelType.h"
#include "SGInterop/SGIC_ESGWaveformType.h"
#include "SGInterop/SGIC_FSGHapticChannelInfoImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_FString.h"
#include "SGInterop/SGIC_TArray_int32.h"
struct USGHapticChannelInfo::FImpl
{
/************************
* Member variables
************************/
FSGHapticChannelInfoImpl HapticChannelInfoImpl;
/************************
* Owner object
************************/
USGHapticChannelInfo* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHapticChannelInfo* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHapticChannelInfo* USGHapticChannelInfo::NewHapticChannelInfo(UObject* Outer,
const FSGHapticChannelInfoImpl& HapticChannelInfoImpl)
{
USGHapticChannelInfo* Instance = NewObject<USGHapticChannelInfo>(Outer);
Instance->SetHapticChannelInfoImpl(HapticChannelInfoImpl);
return Instance;
}
USGHapticChannelInfo* USGHapticChannelInfo::NewHapticChannelInfo(UObject* Outer)
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoImplContainer;
SGCoreImpl_FSGHapticChannelInfoImpl_ctor(&OutHapticChannelInfoImplContainer);
return NewHapticChannelInfo(Outer, MoveTemp(OutHapticChannelInfoImplContainer.HapticChannelInfoImpl));
}
USGHapticChannelInfo* USGHapticChannelInfo::NewHapticChannelInfo(
UObject* Outer,
const TArray<int32>& StreamIndex, const TArray<int32>& FireAndForgetIndex)
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoImplContainer;
FSGIC_TArray_int32 StreamIndexContainer{StreamIndex};
FSGIC_TArray_int32 FireAndForgetContainer{FireAndForgetIndex};
SGCoreImpl_FSGHapticChannelInfoImpl_ctor_StreamIndex_FireAndForgetIndex(
&OutHapticChannelInfoImplContainer, &StreamIndexContainer, &FireAndForgetContainer);
return NewHapticChannelInfo(Outer, MoveTemp(OutHapticChannelInfoImplContainer.HapticChannelInfoImpl));
}
FString USGHapticChannelInfo::GenerateAddress(const int32 DeviceIndex, const int32 ChannelIndex)
{
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHapticChannelInfoImpl_GenerateAddress(&OutStringContainer, DeviceIndex, ChannelIndex);
return MoveTemp(OutStringContainer.String);
}
USGHapticChannelInfo* USGHapticChannelInfo::Parse(UObject* Outer, const FString& IpcString)
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoImplContainer;
FSGIC_FString IpcStringContainer{IpcString};
SGCoreImpl_FSGHapticChannelInfoImpl_Parse(&OutHapticChannelInfoImplContainer, &IpcStringContainer);
return NewHapticChannelInfo(Outer, MoveTemp(OutHapticChannelInfoImplContainer.HapticChannelInfoImpl));
}
int32 USGHapticChannelInfo::GetStreamingType()
{
return SGCoreImpl_FSGHapticChannelInfoImpl_GetStreamingType();
}
int32 USGHapticChannelInfo::GetFireAndForgetType()
{
return SGCoreImpl_FSGHapticChannelInfoImpl_GetFireAndForgetType();
}
USGHapticChannelInfo::USGHapticChannelInfo()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoImplContainer;
SGCoreImpl_FSGHapticChannelInfoImpl_ctor(&OutHapticChannelInfoImplContainer);
Pimpl->HapticChannelInfoImpl = MoveTemp(OutHapticChannelInfoImplContainer.HapticChannelInfoImpl);
}
USGHapticChannelInfo::USGHapticChannelInfo(const TArray<int32>& StreamIndex, const TArray<int32>& FireAndForgetIndex)
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoImplContainer;
FSGIC_TArray_int32 StreamIndexContainer{StreamIndex};
FSGIC_TArray_int32 FireAndForgetContainer{FireAndForgetIndex};
SGCoreImpl_FSGHapticChannelInfoImpl_ctor_StreamIndex_FireAndForgetIndex(
&OutHapticChannelInfoImplContainer, &StreamIndexContainer, &FireAndForgetContainer);
Pimpl->HapticChannelInfoImpl = MoveTemp(OutHapticChannelInfoImplContainer.HapticChannelInfoImpl);
}
USGHapticChannelInfo::USGHapticChannelInfo(const FSGHapticChannelInfoImpl& HapticChannelInfoImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetHapticChannelInfoImpl(HapticChannelInfoImpl);
}
USGHapticChannelInfo::~USGHapticChannelInfo() = default;
void USGHapticChannelInfo::SetHapticChannelInfoImpl(const FSGHapticChannelInfoImpl& HapticChannelInfoImpl)
{
FSGIC_FSGHapticChannelInfoImpl OutHapticChannelInfoContainer;
FSGIC_FSGHapticChannelInfoImpl RhsContainer{HapticChannelInfoImpl};
SGCoreImpl_FSGHapticChannelInfoImpl_ctor_copy(&OutHapticChannelInfoContainer, &RhsContainer);
Pimpl->HapticChannelInfoImpl = MoveTemp(OutHapticChannelInfoContainer.HapticChannelInfoImpl);
}
const FSGHapticChannelInfoImpl& USGHapticChannelInfo::ToHapticChannelInfoImpl() const
{
return Pimpl->HapticChannelInfoImpl;
}
int32 USGHapticChannelInfo::GetStreamChannelCount() const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
return SGCoreImpl_FSGHapticChannelInfoImpl_GetStreamChannelCount(&InstanceContainer);
}
int32 USGHapticChannelInfo::GetFireAndForgetChannelCount() const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
return SGCoreImpl_FSGHapticChannelInfoImpl_GetFireAndForgetChannelCount(&InstanceContainer);
}
int32 USGHapticChannelInfo::GetTotalChannelCount() const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
return SGCoreImpl_FSGHapticChannelInfoImpl_GetTotalChannelCount(&InstanceContainer);
}
FString USGHapticChannelInfo::GetAddress_Unguarded(const ESGHapticChannelType Type, const int32 TypeIndex) const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
FSGIC_FString OutStringContainer;
FSGIC_ESGHapticChannelType TypeContainer{Type};
SGCoreImpl_FSGHapticChannelInfoImpl_GetAddress_Unguarded(
&InstanceContainer, &OutStringContainer, &TypeContainer, TypeIndex);
return MoveTemp(OutStringContainer.String);
}
void USGHapticChannelInfo::GetIpcParams_Unguarded(
const ESGHapticChannelType Type, const int32 TypeIndex, int32& OutIndex, FString& OutAddressString) const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
FSGIC_ESGHapticChannelType TypeContainer{Type};
FSGIC_FString OutAddressStringContainer;
SGCoreImpl_FSGHapticChannelInfoImpl_GetIpcParams_Unguarded(
&InstanceContainer, &TypeContainer, TypeIndex, &OutIndex, &OutAddressString);
OutAddressString = MoveTemp(OutAddressStringContainer.String);
}
void USGHapticChannelInfo::RegenerateAddresses(const int32 ForDeviceIndex)
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
SGCoreImpl_FSGHapticChannelInfoImpl_RegenerateAddresses(&InstanceContainer, ForDeviceIndex);
}
TArray<FString> USGHapticChannelInfo::GetAllAddresses() const
{
FSGIC_FSGHapticChannelInfoImpl InstanceContainer{ToHapticChannelInfoImpl()};
FSGIC_TArray_FString* OutArrayContainer;
SGCoreImpl_FSGHapticChannelInfoImpl_GetAllAddresses(&InstanceContainer, &OutArrayContainer);
return MoveTemp(OutArrayContainer->Array);
}
USGHapticChannelInfo::FImpl::FImpl(USGHapticChannelInfo* InOwner)
: Owner(InOwner)
{
}
USGHapticChannelInfo::FImpl::~FImpl() = default;
void USGHapticChannelInfo::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -35,27 +35,28 @@
#include "SGCore/SGHapticGlove.h" #include "SGCore/SGHapticGlove.h"
#include "Runtime/Launch/Resources/Version.h" #include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGCustomWaveform.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGDeviceImplCast.h" #include "SGCore/SGDeviceImplCast.h"
#include "SGCoreImpl/SGBasicHandModelImpl.h"
#include "SGCoreImpl/SGCustomWaveformImpl.h"
#include "SGCoreImpl/SGDeviceImpl.h" #include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h" #include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGDeviceType.h" #include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGHapticLocation.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h" #include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_FQuat.h" #include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGBasicHandModelImpl.h" #include "SGInterop/SGIC_FSGBasicHandModelImpl.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h" #include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h" #include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h" #include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FVector.h" #include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TSharedRef_FSGHapticGloveImpl.h" #include "SGInterop/SGIC_TArray_TSharedRef_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
USGHapticGlove* USGHapticGlove::NewHapticGlove(UObject* Outer, const FSGHapticGloveImpl& HapticGloveImpl) USGHapticGlove* USGHapticGlove::NewHapticGlove(UObject* Outer, const FSGHapticGloveImpl& HapticGloveImpl)
@@ -80,10 +81,10 @@ USGHapticGlove* USGHapticGlove::NewHapticGlove(UObject* Outer)
return NewHapticGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef()); return NewHapticGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
} }
TArray<USGHapticGlove*> USGHapticGlove::GetHapticGloves(UObject* Outer) TArray<USGHapticGlove*> USGHapticGlove::GetHapticGloves(UObject* Outer, const bool bConnectedOnly)
{ {
FSGIC_TArray_TSharedRef_FSGHapticGloveImpl OutGlovesContainer; FSGIC_TArray_TSharedRef_FSGHapticGloveImpl OutGlovesContainer;
SGCoreImpl_FSGHapticGloveImpl_GetHapticGloves(&OutGlovesContainer); SGCoreImpl_FSGHapticGloveImpl_GetHapticGloves(&OutGlovesContainer, bConnectedOnly);
TArray<USGHapticGlove*> HapticGloves; TArray<USGHapticGlove*> HapticGloves;
for (TSharedRef<FSGHapticGloveImpl> HapticGloveImpl: OutGlovesContainer.Array) for (TSharedRef<FSGHapticGloveImpl> HapticGloveImpl: OutGlovesContainer.Array)
{ {
@@ -109,7 +110,8 @@ bool USGHapticGlove::GetGlove(UObject* Outer, const bool bRightHanded, USGHaptic
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer; FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetGlove_bRightHanded_OutGlove(bRightHanded, &OutGloveContainer); const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetGlove_bRightHanded_OutGlove(
bRightHanded, &OutGloveContainer);
if (bResult) if (bResult)
{ {
OutGlove = NewHapticGlove(Outer, OutGloveContainer.Ptr.ToSharedRef()); OutGlove = NewHapticGlove(Outer, OutGloveContainer.Ptr.ToSharedRef());
@@ -118,6 +120,22 @@ bool USGHapticGlove::GetGlove(UObject* Outer, const bool bRightHanded, USGHaptic
return bResult; return bResult;
} }
FString USGHapticGlove::ToString(const ESGHapticGloveCalibrationState State)
{
FSGIC_ESGHapticGloveCalibrationState StateContainer{State};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHapticGloveImpl_ToString_State(&StateContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
FString USGHapticGlove::ToString(const ESGHapticLocation Location)
{
FSGIC_ESGHapticLocation LocationContainer{Location};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHapticGloveImpl_ToString_Location(&LocationContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGHapticGlove::USGHapticGlove() USGHapticGlove::USGHapticGlove()
: USGDevice() : USGDevice()
{ {
@@ -137,6 +155,11 @@ USGHapticGlove::USGHapticGlove(const FSGHapticGloveImpl& HapticGloveImpl)
{ {
} }
USGHapticGlove::USGHapticGlove(const FSGNova2GloveImpl& Nova2GloveImpl)
: USGDevice(Nova2GloveImpl)
{
}
USGHapticGlove::USGHapticGlove(const FSGNovaGloveImpl& NovaGloveImpl) USGHapticGlove::USGHapticGlove(const FSGNovaGloveImpl& NovaGloveImpl)
: USGDevice(NovaGloveImpl) : USGDevice(NovaGloveImpl)
{ {
@@ -157,6 +180,11 @@ USGHapticGlove::USGHapticGlove(TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
{ {
} }
USGHapticGlove::USGHapticGlove(TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
: USGDevice(MoveTemp(Nova2GloveImpl))
{
}
USGHapticGlove::USGHapticGlove(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl) USGHapticGlove::USGHapticGlove(TSharedRef<FSGNovaGloveImpl> NovaGloveImpl)
: USGDevice(MoveTemp(NovaGloveImpl)) : USGDevice(MoveTemp(NovaGloveImpl))
{ {
@@ -245,41 +273,7 @@ bool USGHapticGlove::GetImuRotation(FRotator& OutImu)
} }
bool USGHapticGlove::GetHandPose( bool USGHapticGlove::GetHandPose(
UObject* Outer, UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose) const
const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
&InstanceContainer, &HandGeometryContainer, &HandProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult;
}
bool USGHapticGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGHandProfileImpl HandProfileContainer{HandProfile->ToHandProfileImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_HandProfile_OutHandPose(
&InstanceContainer, &HandProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult;
}
bool USGHapticGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()}; FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
@@ -310,22 +304,63 @@ bool USGHapticGlove::GetHandPose(UObject* Outer, USGHandPose*& OutHandPose)
return bResult; return bResult;
} }
#if PLATFORM_ANDROID bool USGHapticGlove::GetHandAngles(TArray<TArray<FVector>>& OutHandAngles) const
bool USGHapticGlove::GetHandPose(UObject* Outer, const float DeltaTime, USGHandPose*& OutHandPose)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer; FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandPose_DeltaTime_OutHandPose( const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetHandAngles_OutHandAngles(
&InstanceContainer, DeltaTime, &OutHandPoseContainer); &InstanceContainer, &OutHandAnglesContainer);
if (bResult) if (bResult)
{ {
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl)); OutHandAngles = MoveTemp(OutHandAnglesContainer.Array);
} }
return bResult; return bResult;
} }
#endif /* PLATFORM_ANDROID */
USGBasicHandModel* USGHapticGlove::GetHandGeometry(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGBasicHandModelImpl OutBasicHandModelContainer;
SGCoreImpl_FSGHapticGloveImpl_GetHandGeometry(&InstanceContainer, &OutBasicHandModelContainer);
return USGBasicHandModel::NewBasicHandModel(Outer, MoveTemp(OutBasicHandModelContainer.BasicHandModelImpl));
}
void USGHapticGlove::SetHandGeometry(const USGBasicHandModel* HandGeometry)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()};
SGCoreImpl_FSGHapticGloveImpl_SetHandGeometry(&InstanceContainer, &HandGeometryContainer);
}
ESGHapticGloveCalibrationState USGHapticGlove::GetCalibrationState() const
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_ESGHapticGloveCalibrationState OutHapticGloveCalibrationStateContainer;
SGCoreImpl_FSGHapticGloveImpl_GetCalibrationState(&InstanceContainer, &OutHapticGloveCalibrationStateContainer);
return OutHapticGloveCalibrationStateContainer.State;
}
void USGHapticGlove::EndCalibration()
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveImpl_EndCalibration(&InstanceContainer);
}
void USGHapticGlove::ResetCalibration()
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveImpl_ResetCalibration(&InstanceContainer);
}
FString USGHapticGlove::GetCalibrationInstruction() const
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHapticGloveImpl_GetCalibrationInstruction(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
void USGHapticGlove::StopHaptics() void USGHapticGlove::StopHaptics()
{ {
@@ -339,113 +374,39 @@ void USGHapticGlove::StopVibrations()
SGCoreImpl_FSGHapticGloveImpl_StopVibrations(&InstanceContainer); SGCoreImpl_FSGHapticGloveImpl_StopVibrations(&InstanceContainer);
} }
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand) bool USGHapticGlove::SendHaptics()
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ return SGCoreImpl_FSGHapticGloveImpl_SendHaptics(&InstanceContainer);
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
} }
void USGHapticGlove::SendHaptics(const USGBuzzCommand* BuzzCommand) bool USGHapticGlove::QueueForceFeedbackLevels(const TArray<float>& Levels01)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()}; FSGIC_TArray_float Levels01Container{Levels01};
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_BuzzCommand(&InstanceContainer, &BuzzCommandContainer); return SGCoreImpl_FSGHapticGloveImpl_QueueForceFeedbackLevels(&InstanceContainer, &Levels01Container);
} }
void USGHapticGlove::SendHaptics(const USGThumperCommand* ThumperCommand) bool USGHapticGlove::QueueForceFeedbackLevel(const int32 Finger, const float Level01)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()}; return SGCoreImpl_FSGHapticGloveImpl_QueueForceFeedbackLevel(&InstanceContainer, Finger, Level01);
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ThumperCommand(&InstanceContainer, &ThumperCommandContainer);
} }
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, bool USGHapticGlove::SupportsCustomWaveform(const ESGHapticLocation AtLocation) const
const USGBuzzCommand* BuzzCommand)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ FSGIC_ESGHapticLocation AtLocationContainer{AtLocation};
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()}; return SGCoreImpl_FSGHapticGloveImpl_SupportsCustomWaveform(&InstanceContainer, &AtLocationContainer);
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand(
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer);
} }
void USGHapticGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, bool USGHapticGlove::SendCustomWaveform(USGCustomWaveform* OutWaveform, const ESGHapticLocation Location)
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand)
{ {
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()}; FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()}; FSGIC_ESGHapticLocation LocationContainer{Location};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()}; return SGCoreImpl_FSGHapticGloveImpl_SendCustomWaveform(
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()}; &InstanceContainer, &OutWaveformContainer, &LocationContainer);
SGCoreImpl_FSGHapticGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
}
bool USGHapticGlove::GetCalibrationValues(TArray<FVector>& OutValues)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_TArray_FVector OutValuesContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveImpl_GetCalibrationValues(&InstanceContainer, &OutValuesContainer);
if (bResult)
{
OutValues = MoveTemp(OutValuesContainer.Array);
}
return bResult;
}
void USGHapticGlove::ResetCalibrationRange()
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveImpl_ResetCalibrationRange(&InstanceContainer);
}
void USGHapticGlove::UpdateCalibrationRange()
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibrationRange(&InstanceContainer);
}
void USGHapticGlove::UpdateCalibrationRange(const TArray<FVector>& CalibrationValues)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_TArray_FVector CalibrationValuesContainer{CalibrationValues};
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibrationRange_CalibrationValues(
&InstanceContainer, &CalibrationValuesContainer);
}
void USGHapticGlove::GetCalibrationRange(TArray<FVector>& OutMinValues, TArray<FVector>& OutMaxValues)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_TArray_FVector OutMinValuesContainer;
FSGIC_TArray_FVector OutMaxValuesContainer;
SGCoreImpl_FSGHapticGloveImpl_GetCalibrationRange(&InstanceContainer, &OutMinValues, &OutMaxValues);
OutMinValues = MoveTemp(OutMinValuesContainer.Array);
OutMaxValues = MoveTemp(OutMaxValuesContainer.Array);
}
void USGHapticGlove::UpdateCalibration(UObject* Outer, USGHandProfile*& OutProfile)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHapticGloveImpl_UpdateCalibration(&InstanceContainer, &OutProfileContainer);
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
}
void USGHapticGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FSGHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHapticGloveImpl_ApplyCalibration(&InstanceContainer, &OutProfileContainer);
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
} }
void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation, void USGHapticGlove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
@@ -528,4 +489,12 @@ void USGHapticGlove::GetGloveLocation(const FVector& ReferencePosition, const FR
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector); OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator(); OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
FString USGHapticGlove::ToString() const
{
FSGIC_TSharedPtr_FSGHapticGloveImpl InstanceContainer{ToHapticGloveImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGHapticGloveImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
} }
@@ -1,259 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveCalibrationCheck.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGCalibrationStage.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_FSGHapticGloveCalibrationCheckImpl.h"
#include "SGInterop/SGIC_FSGSensorRangeImpl.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGUtils/SGArrayUtils.h"
struct USGHapticGloveCalibrationCheck::FImpl
{
/************************
* Member variables
************************/
FSGHapticGloveCalibrationCheckImpl HapticGloveCalibrationCheckImpl;
/************************
* Owner object
************************/
USGHapticGloveCalibrationCheck* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHapticGloveCalibrationCheck* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHapticGloveCalibrationCheck* USGHapticGloveCalibrationCheck::NewHapticGloveCalibrationCheck(
UObject* Outer, const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl)
{
USGHapticGloveCalibrationCheck* Instance = NewObject<USGHapticGloveCalibrationCheck>(Outer);
Instance->SetHapticGloveCalibrationCheckImpl(HapticGloveCalibrationCheckImpl);
return Instance;
}
USGHapticGloveCalibrationCheck* USGHapticGloveCalibrationCheck::NewHapticGloveCalibrationCheck(UObject* Outer)
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor(&OutHapticGloveCalibrationCheckImplContainer);
return NewHapticGloveCalibrationCheck(
Outer, MoveTemp(OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl));
}
USGHapticGloveCalibrationCheck* USGHapticGloveCalibrationCheck::NewHapticGloveCalibrationCheck(
UObject* Outer, const USGSensorRange* LastCalibrationRange)
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
FSGIC_FSGSensorRangeImpl LastCalibrationRangeContainer{LastCalibrationRange->ToSensorRangeImpl()};
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor_LastCalibrationRange(
&OutHapticGloveCalibrationCheckImplContainer, &LastCalibrationRangeContainer);
return NewHapticGloveCalibrationCheck(
Outer, MoveTemp(OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl));
}
float USGHapticGloveCalibrationCheck::GetSenseGloveThreshold()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetSenseGloveThreshold();
}
float USGHapticGloveCalibrationCheck::GetNovaGloveThreshold()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetNovaGloveThreshold();
}
float USGHapticGloveCalibrationCheck::GetSenseGloveMinFlexion()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetSenseGloveMinFlexion();
}
float USGHapticGloveCalibrationCheck::GetNovaGloveMinFlexion()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetNovaGloveMinFlexion();
}
float USGHapticGloveCalibrationCheck::GetSenseGloveMinAbduction()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetSenseGloveMinAbduction();
}
float USGHapticGloveCalibrationCheck::GetNovaGloveMinAbduction()
{
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetNovaGloveMinAbduction();
}
bool USGHapticGloveCalibrationCheck::NeedsCheck(const ESGDeviceType DeviceType)
{
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_NeedsCheck(&DeviceTypeContainer);
}
int32 USGHapticGloveCalibrationCheck::OutOfBounds(
const USGSensorRange* PreviousRange, const TArray<FVector>& CurrentValues, const ESGDeviceType DeviceType)
{
FSGIC_FSGSensorRangeImpl PreviousRangeContainer{PreviousRange->ToSensorRangeImpl()};
FSGIC_TArray_FVector CurrentValuesContainer{CurrentValues};
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_OutOfBounds(
&PreviousRangeContainer, &CurrentValuesContainer, &DeviceTypeContainer);
}
bool USGHapticGloveCalibrationCheck::MovedMinimum(const TArray<FVector>& CurrentRange, const ESGDeviceType DeviceType)
{
FSGIC_TArray_FVector CurrentRangeContainer{CurrentRange};
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_MovedMinimum(&CurrentRangeContainer, &DeviceTypeContainer);
}
bool USGHapticGloveCalibrationCheck::MatchesLast(const TArray<FVector>& CurrentRange, const TArray<FVector>& LastRange,
const ESGDeviceType DeviceType)
{
FSGIC_TArray_FVector CurrentRangeContainer{CurrentRange};
FSGIC_TArray_FVector LastRangeContainer{LastRange};
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_MatchesLast(
&CurrentRangeContainer, &LastRangeContainer, &DeviceTypeContainer);
}
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor(&OutHapticGloveCalibrationCheckImplContainer);
Pimpl->HapticGloveCalibrationCheckImpl = MoveTemp(
OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl);
}
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(const USGSensorRange* LastCalibrationRange)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckImplContainer;
FSGIC_FSGSensorRangeImpl LastCalibrationRangeContainer{LastCalibrationRange->ToSensorRangeImpl()};
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor_LastCalibrationRange(
&OutHapticGloveCalibrationCheckImplContainer, &LastCalibrationRangeContainer);
Pimpl->HapticGloveCalibrationCheckImpl = MoveTemp(
OutHapticGloveCalibrationCheckImplContainer.HapticGloveCalibrationCheckImpl);
}
USGHapticGloveCalibrationCheck::USGHapticGloveCalibrationCheck(
const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetHapticGloveCalibrationCheckImpl(HapticGloveCalibrationCheckImpl);
}
USGHapticGloveCalibrationCheck::~USGHapticGloveCalibrationCheck() = default;
void USGHapticGloveCalibrationCheck::SetHapticGloveCalibrationCheckImpl(
const FSGHapticGloveCalibrationCheckImpl& HapticGloveCalibrationCheckImpl)
{
FSGIC_FSGHapticGloveCalibrationCheckImpl OutHapticGloveCalibrationCheckContainer;
FSGIC_FSGHapticGloveCalibrationCheckImpl RhsContainer{HapticGloveCalibrationCheckImpl};
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ctor_copy(&OutHapticGloveCalibrationCheckContainer, &RhsContainer);
Pimpl->HapticGloveCalibrationCheckImpl = MoveTemp(
OutHapticGloveCalibrationCheckContainer.HapticGloveCalibrationCheckImpl);
}
const FSGHapticGloveCalibrationCheckImpl& USGHapticGloveCalibrationCheck::ToHapticGloveCalibrationCheckImpl() const
{
return Pimpl->HapticGloveCalibrationCheckImpl;
}
ESGCalibrationStage USGHapticGloveCalibrationCheck::GetCalibrationStage() const
{
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
FSGIC_ESGCalibrationStage OutStageContainer;
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_GetCalibrationStage(&InstanceContainer, &OutStageContainer);
return MoveTemp(OutStageContainer.Stage);
}
bool USGHapticGloveCalibrationCheck::ReachedConclusion() const
{
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_ReachedConclusion(&InstanceContainer);
}
void USGHapticGloveCalibrationCheck::Reset()
{
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_Reset(&InstanceContainer);
}
void USGHapticGloveCalibrationCheck::CheckRange(
const TArray<FVector>& CurrentValues, const float DeltaSeconds, const ESGDeviceType DeviceType)
{
FSGIC_FSGHapticGloveCalibrationCheckImpl InstanceContainer{ToHapticGloveCalibrationCheckImpl()};
FSGIC_TArray_FVector CurrentValuesContainer{CurrentValues};
FSGIC_ESGDeviceType DeviceTypeContainer{DeviceType};
SGCoreImpl_FSGHapticGloveCalibrationCheckImpl_CheckRange(&InstanceContainer, &CurrentValuesContainer,
DeltaSeconds, &DeviceTypeContainer);
}
USGHapticGloveCalibrationCheck::FImpl::FImpl(USGHapticGloveCalibrationCheck* InOwner)
: Owner(InOwner)
{
}
USGHapticGloveCalibrationCheck::FImpl::~FImpl() = default;
void USGHapticGloveCalibrationCheck::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,421 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveCalibrationSequence.h"
#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"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHapticGloveCalibrationSequenceImpl.h"
#include "SGInterop/SGIC_FSGHapticGloveQuickCalibrationImpl.h"
#include "SGInterop/SGIC_FSGSensorRangeImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_FSGCalibrationDataPointImpl.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl.h"
#include "SGUtils/SGArrayUtils.h"
struct USGHapticGloveCalibrationSequence::FImpl
{
/************************
* Member variables
************************/
TSharedPtr<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl;
/************************
* Owner object
************************/
USGHapticGloveCalibrationSequence* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHapticGloveCalibrationSequence* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHapticGloveCalibrationSequence* USGHapticGloveCalibrationSequence::NewHapticGloveCalibrationSequence(UObject* Outer,
const FSGHapticGloveCalibrationSequenceImpl& HapticGloveCalibrationSequence)
{
USGHapticGloveCalibrationSequence* Instance = NewObject<USGHapticGloveCalibrationSequence>(Outer);
Instance->SetHapticGloveCalibrationSequenceImpl(HapticGloveCalibrationSequence);
return Instance;
}
USGHapticGloveCalibrationSequence* USGHapticGloveCalibrationSequence::NewHapticGloveCalibrationSequence(UObject* Outer,
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequence)
{
USGHapticGloveCalibrationSequence* Instance = NewObject<USGHapticGloveCalibrationSequence>(Outer);
Instance->SetHapticGloveCalibrationSequenceImpl(MoveTemp(HapticGloveCalibrationSequence));
return Instance;
}
USGHapticGloveCalibrationSequence* USGHapticGloveCalibrationSequence::NewHapticGloveCalibrationSequence(UObject* Outer)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewHapticGloveCalibrationSequence(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGHapticGloveCalibrationSequence* USGHapticGloveCalibrationSequence::NewHapticGloveCalibrationSequence(UObject* Outer,
const USGHapticGlove* LinkedGlove)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_LinkedGlove_MakeShared(
&OutSharedPtrContainer, &LinkedGloveContainer);
return NewHapticGloveCalibrationSequence(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
int32 USGHapticGloveCalibrationSequence::GetMaxDataPoints()
{
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetMaxDataPoints();
}
bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
const USGSensorRange* SensorRange, const ESGDeviceType ForDevice,
const bool bRightHanded, USGHandProfile*& OutProfile)
{
FSGIC_FSGSensorRangeImpl SensorRangeContainer{SensorRange->ToSensorRangeImpl()};
FSGIC_ESGDeviceType ForDeviceContainer{ForDevice};
FSGIC_FSGHandProfileImpl OutProfileContainer;
const bool bResult =
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_CompileProfile_SensorRange_ForDevice_bRightHanded_OutProfile(
&SensorRangeContainer, &ForDeviceContainer, bRightHanded, &OutProfileContainer);
if (bResult)
{
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
}
return bResult;
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_MakeShared(&OutSharedPtrContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(const USGHapticGlove* LinkedGlove)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_LinkedGlove_MakeShared(
&OutSharedPtrContainer, &LinkedGloveContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
const FSGHapticGloveCalibrationSequenceImpl& HapticGloveCalibrationSequenceImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveCalibrationSequenceImpl RhsContainer{HapticGloveCalibrationSequenceImpl};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveQuickCalibrationImpl RhsContainer{HapticGloveQuickCalibrationImpl};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_copy_MakeShared(
&OutSharedPtrContainer, &RhsContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveCalibrationSequenceImpl);
}
USGHapticGloveCalibrationSequence::USGHapticGloveCalibrationSequence(
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveQuickCalibrationImpl);
}
USGHapticGloveCalibrationSequence::~USGHapticGloveCalibrationSequence() = default;
void USGHapticGloveCalibrationSequence::SetHapticGloveCalibrationSequenceImpl(
const FSGHapticGloveCalibrationSequenceImpl& HapticGloveCalibrationSequenceImpl)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveCalibrationSequenceImpl RhsContainer{HapticGloveCalibrationSequenceImpl};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGHapticGloveCalibrationSequence::SetHapticGloveCalibrationSequenceImpl(
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_FSGHapticGloveQuickCalibrationImpl RhsContainer{HapticGloveQuickCalibrationImpl};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_copy_MakeShared(&OutSharedPtrContainer, &RhsContainer);
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(OutSharedPtrContainer.Ptr);
}
void USGHapticGloveCalibrationSequence::SetHapticGloveCalibrationSequenceImpl(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl)
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveCalibrationSequenceImpl);
}
void USGHapticGloveCalibrationSequence::SetHapticGloveCalibrationSequenceImpl(
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
{
Pimpl->HapticGloveCalibrationSequenceImpl = MoveTemp(HapticGloveQuickCalibrationImpl);
}
TSharedRef<FSGHapticGloveCalibrationSequenceImpl>
USGHapticGloveCalibrationSequence::ToHapticGloveCalibrationSequenceImpl() const
{
return Pimpl->HapticGloveCalibrationSequenceImpl.ToSharedRef();
}
USGHapticGlove* USGHapticGloveCalibrationSequence::GetLinkedGlove(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_TSharedPtr_FSGHapticGloveImpl OutGloveContainer;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetLinkedGlove(&InstanceContainer, &OutGloveContainer);
return USGHapticGlove::NewHapticGlove(Outer, OutGloveContainer.Ptr.ToSharedRef());
}
void USGHapticGloveCalibrationSequence::SetLinkedGlove(const USGHapticGlove* LinkedGlove)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_TSharedPtr_FSGHapticGloveImpl LinkedGloveContainer{LinkedGlove->ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_SetLinkedGlove(&InstanceContainer, &LinkedGloveContainer);
}
TArray<USGCalibrationDataPoint*> USGHapticGloveCalibrationSequence::GetCalibrationPoints(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_TArray_FSGCalibrationDataPointImpl OutPoints;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCalibrationPoints(&InstanceContainer, &OutPoints);
TArray<USGCalibrationDataPoint*> Points{
FSGArrayUtils::FromImplType<FSGCalibrationDataPointImpl, USGCalibrationDataPoint,
&USGCalibrationDataPoint::NewCalibrationDataPoint>(
Outer, MoveTemp(OutPoints.Array))
};
return MoveTemp(Points);
}
float USGHapticGloveCalibrationSequence::GetElapsedTime() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetElapsedTime(&InstanceContainer);
}
bool USGHapticGloveCalibrationSequence::IsManuallyCompleted() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_IsManuallyCompleted(&InstanceContainer);
}
int32 USGHapticGloveCalibrationSequence::GetCurrentStage() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCurrentStage(&InstanceContainer);
}
SIZE_T USGHapticGloveCalibrationSequence::GetCalibrationPointsCount() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCalibrationPointsCount(&InstanceContainer);
}
bool USGHapticGloveCalibrationSequence::AutoCompleted() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_AutoCompleted(&InstanceContainer);
}
bool USGHapticGloveCalibrationSequence::Completed() const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
return SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Completed(&InstanceContainer);
}
void USGHapticGloveCalibrationSequence::Reset()
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Reset(&InstanceContainer);
}
void USGHapticGloveCalibrationSequence::AddDataPoint(const TArray<FVector>& CalibrationPoints)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_TArray_FVector CalibrationPointsContainer{CalibrationPoints};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_AddDataPoint(&InstanceContainer, &CalibrationPointsContainer);
}
void USGHapticGloveCalibrationSequence::Update(const float DeltaSeconds)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_Update(&InstanceContainer, DeltaSeconds);
}
void USGHapticGloveCalibrationSequence::ConfirmCurrentStep()
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ConfirmCurrentStep(&InstanceContainer);
}
bool USGHapticGloveCalibrationSequence::CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_FSGSensorRangeImpl OutSensorRangeContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_CompileRange(
&InstanceContainer, &OutSensorRangeContainer);
if (bResult)
{
OutSensorRange = USGSensorRange::NewSensorRange(Outer, MoveTemp(OutSensorRangeContainer.SensorRangeImpl));
}
return bResult;
}
bool USGHapticGloveCalibrationSequence::CompileProfile(UObject* Outer,
const ESGDeviceType ForDevice, const bool bRightHanded,
USGHandProfile*& OutProfile) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_ESGDeviceType ForDeviceContainer{ForDevice};
FSGIC_FSGHandProfileImpl OutProfileContainer;
const bool bResult =
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_CompileProfile_ForDevice_bRightHanded_OutProfile(
&InstanceContainer, &ForDeviceContainer, bRightHanded, &OutProfileContainer);
if (bResult)
{
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
}
return bResult;
}
bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer, USGHandPose*& OutCurrentHandPose) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetHandPose_OutCurrentHandPose(
&InstanceContainer, &OutCurrentHandPoseContainer);
if (bResult)
{
OutCurrentHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutCurrentHandPoseContainer.HandPoseImpl));
}
return bResult;
}
bool USGHapticGloveCalibrationSequence::GetHandPose(UObject* Outer,
const bool bRightHanded, USGHandPose*& OutCurrentHandPose) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetHandPose_bRightHanded_OutCurrentHandPose(
&InstanceContainer, bRightHanded, &OutCurrentHandPoseContainer);
if (bResult)
{
OutCurrentHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutCurrentHandPoseContainer.HandPoseImpl));
}
return bResult;
}
FString USGHapticGloveCalibrationSequence::GetCurrentInstruction(const FString& NextStepKey) const
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{ToHapticGloveCalibrationSequenceImpl()};
FSGIC_FString OutInstructionContainer;
FSGIC_FString NextStepKeyContainer{NextStepKey};
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_GetCurrentInstruction(
&InstanceContainer, &OutInstructionContainer, &NextStepKeyContainer);
return MoveTemp(OutInstructionContainer.String);
}
USGHapticGloveCalibrationSequence::FImpl::FImpl(USGHapticGloveCalibrationSequence* InOwner)
: Owner(InOwner)
{
}
USGHapticGloveCalibrationSequence::FImpl::~FImpl() = default;
void USGHapticGloveCalibrationSequence::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,55 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveCalibrationSequenceImplCast.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGHapticGloveCalibrationSequenceImpl.h"
#include "SGCoreImpl/SGHapticGloveQuickCalibrationImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl.h"
TSharedRef<FSGHapticGloveQuickCalibrationImpl> FSGHapticGloveCalibrationSequenceImplCast::
ToHapticGloveQuickCalibrationImpl(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl)
{
FSGIC_TSharedPtr_FSGHapticGloveCalibrationSequenceImpl InstanceContainer{
MoveTemp(HapticGloveCalibrationSequenceImpl)
};
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveCalibrationSequenceImpl_ToHapticGloveQuickCalibrationImplRef(
&InstanceContainer, &OutSharedPtrContainer);
return OutSharedPtrContainer.Ptr.ToSharedRef();
}
@@ -1,48 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Templates/SharedPointer.h"
class FSGHapticGloveCalibrationSequenceImpl;
class FSGHapticGloveQuickCalibrationImpl;
class SENSEGLOVECORE_API FSGHapticGloveCalibrationSequenceImplCast
{
public:
static TSharedRef<FSGHapticGloveQuickCalibrationImpl> ToHapticGloveQuickCalibrationImpl(
TSharedRef<FSGHapticGloveCalibrationSequenceImpl> HapticGloveCalibrationSequenceImpl);
};
@@ -1,345 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveCommandBuffer.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGTimedBuzzCommand.h"
#include "SGCore/SGThumperCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_FSGHapticGloveCommandBufferImpl.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedBuzzCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedThumpCommandImpl.h"
#include "SGInterop/SGIC_TArray_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_TArray_FSGTimedBuzzCommandImpl.h"
#include "SGInterop/SGIC_TArray_FSGTimedThumpCommandImpl.h"
#include "SGUtils/SGArrayUtils.h"
struct USGHapticGloveCommandBuffer::FImpl
{
/************************
* Member variables
************************/
FSGHapticGloveCommandBufferImpl HapticGloveCommandBufferImpl;
/************************
* Owner object
************************/
USGHapticGloveCommandBuffer* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGHapticGloveCommandBuffer* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGHapticGloveCommandBuffer* USGHapticGloveCommandBuffer::NewHapticGloveCommandBuffer(
UObject* Outer, const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl)
{
USGHapticGloveCommandBuffer* Instance = NewObject<USGHapticGloveCommandBuffer>(Outer);
Instance->SetHapticGloveCommandBufferImpl(HapticGloveCommandBufferImpl);
return Instance;
}
USGHapticGloveCommandBuffer* USGHapticGloveCommandBuffer::NewHapticGloveCommandBuffer(UObject* Outer)
{
FSGIC_FSGHapticGloveCommandBufferImpl OutHapticGloveCommandBufferImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ctor(&OutHapticGloveCommandBufferImplContainer);
return NewHapticGloveCommandBuffer(
Outer, MoveTemp(OutHapticGloveCommandBufferImplContainer.HapticGloveCommandBufferImpl));
}
int32 USGHapticGloveCommandBuffer::GetMaxForceFeedbackCommands()
{
return SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetMaxForceFeedbackCommands();
}
int32 USGHapticGloveCommandBuffer::GetMaxBuzzCommands()
{
return SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetMaxBuzzCommands();
}
int32 USGHapticGloveCommandBuffer::GetMaxThumpCommands()
{
return SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetMaxThumpCommands();
}
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGHapticGloveCommandBufferImpl OutHapticGloveCommandBufferImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ctor(&OutHapticGloveCommandBufferImplContainer);
Pimpl->HapticGloveCommandBufferImpl = MoveTemp(
OutHapticGloveCommandBufferImplContainer.HapticGloveCommandBufferImpl);
}
USGHapticGloveCommandBuffer::USGHapticGloveCommandBuffer(
const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetHapticGloveCommandBufferImpl(HapticGloveCommandBufferImpl);
}
USGHapticGloveCommandBuffer::~USGHapticGloveCommandBuffer() = default;
void USGHapticGloveCommandBuffer::SetHapticGloveCommandBufferImpl(
const FSGHapticGloveCommandBufferImpl& HapticGloveCommandBufferImpl)
{
FSGIC_FSGHapticGloveCommandBufferImpl OutHapticGloveCommandBufferContainer;
FSGIC_FSGHapticGloveCommandBufferImpl RhsContainer{HapticGloveCommandBufferImpl};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ctor_copy(&OutHapticGloveCommandBufferContainer, &RhsContainer);
Pimpl->HapticGloveCommandBufferImpl = MoveTemp(OutHapticGloveCommandBufferContainer.HapticGloveCommandBufferImpl);
}
const FSGHapticGloveCommandBufferImpl& USGHapticGloveCommandBuffer::ToHapticGloveCommandBufferImpl() const
{
return Pimpl->HapticGloveCommandBufferImpl;
}
TArray<USGForceFeedbackCommand*> USGHapticGloveCommandBuffer::GetForceFeedbackCommandsQueue(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_TArray_FSGForceFeedbackCommandImpl OutForceFeedbackCommandsQueueContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetForceFeedbackCommandsQueue(&InstanceContainer,
&OutForceFeedbackCommandsQueueContainer);
TArray<USGForceFeedbackCommand*> CommandsQueue;
for (FSGForceFeedbackCommandImpl& ForceFeedbackCommandImpl: OutForceFeedbackCommandsQueueContainer.Array)
{
CommandsQueue.Add(USGForceFeedbackCommand::NewForceFeedbackCommand(
Outer, MoveTemp(ForceFeedbackCommandImpl)));
}
return MoveTemp(CommandsQueue);
}
TArray<USGTimedBuzzCommand*> USGHapticGloveCommandBuffer::GetBuzzCommandsQueue(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_TArray_FSGTimedBuzzCommandImpl OutBuzzCommandsQueueContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetBuzzCommandsQueue(&InstanceContainer, &OutBuzzCommandsQueueContainer);
TArray<USGTimedBuzzCommand*> CommandsQueue;
for (FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl: OutBuzzCommandsQueueContainer.Array)
{
CommandsQueue.Add(USGTimedBuzzCommand::NewTimedBuzzCommand(Outer, MoveTemp(TimedBuzzCommandImpl)));
}
return MoveTemp(CommandsQueue);
}
TArray<USGTimedThumpCommand*> USGHapticGloveCommandBuffer::GetThumperCommandsQueue(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_TArray_FSGTimedThumpCommandImpl OutThumperCommandsQueueContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetThumperCommandsQueue(&InstanceContainer,
&OutThumperCommandsQueueContainer);
TArray<USGTimedThumpCommand*> CommandsQueue;
for (FSGTimedThumpCommandImpl& TimedThumpCommandImpl: OutThumperCommandsQueueContainer.Array)
{
CommandsQueue.Add(USGTimedThumpCommand::NewTimedThumpCommand(Outer, MoveTemp(TimedThumpCommandImpl)));
}
return MoveTemp(CommandsQueue);
}
void USGHapticGloveCommandBuffer::ClearForceFeedbackCommandsQueue()
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ClearForceFeedbackCommandsQueue(&InstanceContainer);
}
void USGHapticGloveCommandBuffer::ClearVibrations()
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_ClearVibrations(&InstanceContainer);
}
void USGHapticGloveCommandBuffer::Clear()
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_Clear(&InstanceContainer);
}
void USGHapticGloveCommandBuffer::AddCommand(const USGForceFeedbackCommand* ForceFeedbackCommand)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_ForceFeedbackCommand(
&InstanceContainer, &ForceFeedbackCommandContainer);
}
void USGHapticGloveCommandBuffer::AddCommand(const USGTimedBuzzCommand* BuzzCommand)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGTimedBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToTimedBuzzCommandImpl().Get()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_BuzzCommand(&InstanceContainer, &BuzzCommandContainer);
}
void USGHapticGloveCommandBuffer::AddCommand(const USGTimedThumpCommand* ThumpCommand)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGTimedThumpCommandImpl ThumpCommandContainer{ThumpCommand->ToTimedThumpCommandImpl()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_AddCommand_ThumpCommand(&InstanceContainer, &ThumpCommandContainer);
}
void USGHapticGloveCommandBuffer::UpdateTimedCommands(const float DeltaSeconds)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_UpdateTimedCommands(&InstanceContainer, DeltaSeconds);
}
USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevels(
UObject* Outer, const USGForceFeedbackCommand* LastForceFeedbackCommand) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
FSGIC_FSGForceFeedbackCommandImpl LastForceFeedbackCommandContainer{
LastForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalForceFeedbackLevels_LastForceFeedbackCommand(
&InstanceContainer, &OutForceFeedbackCommandImplContainer, &LastForceFeedbackCommandContainer);
return USGForceFeedbackCommand::NewForceFeedbackCommand(
Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
USGForceFeedbackCommand* USGHapticGloveCommandBuffer::GetTotalForceFeedbackLevels(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalForceFeedbackLevels(
&InstanceContainer, &OutForceFeedbackCommandImplContainer);
return USGForceFeedbackCommand::NewForceFeedbackCommand(
Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
}
USGBuzzCommand* USGHapticGloveCommandBuffer::GetTotalBuzzLevels(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalBuzzLevels(&InstanceContainer, &OutBuzzCommandImplContainer);
return USGBuzzCommand::NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
USGThumperCommand* USGHapticGloveCommandBuffer::GetTotalThumperLevels(UObject* Outer) const
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_GetTotalThumperLevels(&InstanceContainer,
&OutThumperCommandImplContainer);
return USGThumperCommand::NewThumperCommand(Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
const USGForceFeedbackCommand* LastBrakeLevel,
USGForceFeedbackCommand*& OutForceFeedbackCommand,
USGBuzzCommand*& OutBuzzCommand,
USGThumperCommand*& OutThumperCommand,
const bool bClearForceFeedbackQueue)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGForceFeedbackCommandImpl LastBrakeLevelContainer{LastBrakeLevel->ToForceFeedbackCommandImpl().Get()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_FlushHaptics_LastBrakeLevel_OutForceFeedbackCommand_OutBuzzCommand_OutThumperCommand_bClearForceFeedbackQueue(
&InstanceContainer, &LastBrakeLevelContainer, &OutForceFeedbackCommandImplContainer,
&OutBuzzCommandImplContainer, &OutThumperCommandImplContainer, bClearForceFeedbackQueue);
OutForceFeedbackCommand = USGForceFeedbackCommand::NewForceFeedbackCommand(
Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
OutBuzzCommand = USGBuzzCommand::NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
OutThumperCommand = USGThumperCommand::NewThumperCommand(
Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
void USGHapticGloveCommandBuffer::FlushHaptics(UObject* Outer,
const float DeltaSeconds,
const USGForceFeedbackCommand* LastBrakeLevel,
USGForceFeedbackCommand*& OutForceFeedbackCommand,
USGBuzzCommand*& OutBuzzCommand,
USGThumperCommand*& OutThumperCommand)
{
FSGIC_FSGHapticGloveCommandBufferImpl InstanceContainer{ToHapticGloveCommandBufferImpl()};
FSGIC_FSGForceFeedbackCommandImpl LastBrakeLevelContainer{LastBrakeLevel->ToForceFeedbackCommandImpl().Get()};
FSGIC_FSGForceFeedbackCommandImpl OutForceFeedbackCommandImplContainer;
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGHapticGloveCommandBufferImpl_FlushHaptics_DeltaSeconds_LastBrakeLevel_OutForceFeedbackCommand_OutBuzzCommand_OutThumperCommand(
&InstanceContainer, DeltaSeconds, &LastBrakeLevelContainer, &OutForceFeedbackCommandImplContainer,
&OutBuzzCommandImplContainer, &OutThumperCommandImplContainer);
OutForceFeedbackCommand = USGForceFeedbackCommand::NewForceFeedbackCommand(
Outer, MoveTemp(OutForceFeedbackCommandImplContainer.ForceFeedbackCommandImpl));
OutBuzzCommand = USGBuzzCommand::NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
OutThumperCommand = USGThumperCommand::NewThumperCommand(
Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
USGHapticGloveCommandBuffer::FImpl::FImpl(USGHapticGloveCommandBuffer* InOwner)
: Owner(InOwner)
{
}
USGHapticGloveCommandBuffer::FImpl::~FImpl() = default;
void USGHapticGloveCommandBuffer::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,144 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_FSGSensorRangeImpl.h"
#include "SGInterop/SGIC_FString.h"
FString FSGHapticGloveHandProfiles::GetProfileDirectory()
{
FSGIC_FString OutDirectoryContainer;
SGCoreImpl_FSGHapticGloveHandProfilesImpl_GetProfileDirectory(&OutDirectoryContainer);
return MoveTemp(OutDirectoryContainer.String);
}
void FSGHapticGloveHandProfiles::SetProfileDirectory(const FString& Directory)
{
FSGIC_FString DirectoryContainer{Directory};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_SetProfileDirectory(&DirectoryContainer);
}
void FSGHapticGloveHandProfiles::GetLeftHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer{OutHandProfile->ToHandProfileImpl()};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_GetLeftHandProfile(&OutHandProfileImplContainer);
OutHandProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
void FSGHapticGloveHandProfiles::SetLeftHandProfile(const USGHandProfile* HandProfile)
{
FSGIC_FSGHandProfileImpl HandProfileImplContainer{HandProfile->ToHandProfileImpl()};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_SetLeftHandProfile(&HandProfileImplContainer);
}
void FSGHapticGloveHandProfiles::GetRightHandProfile(UObject* Outer, USGHandProfile*& OutHandProfile)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHapticGloveHandProfilesImpl_GetRightHandProfile(&OutHandProfileImplContainer);
OutHandProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
void FSGHapticGloveHandProfiles::SetRightHandProfile(const USGHandProfile* HandProfile)
{
FSGIC_FSGHandProfileImpl HandProfileImplContainer{HandProfile->ToHandProfileImpl()};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_SetRightHandProfile(&HandProfileImplContainer);
}
void FSGHapticGloveHandProfiles::GetProfile(UObject* Outer,
const bool bRightHanded, USGHandProfile*& OutHandProfile)
{
FSGIC_FSGHandProfileImpl OutHandProfileImplContainer;
SGCoreImpl_FSGHapticGloveHandProfilesImpl_GetProfile(bRightHanded, &OutHandProfileImplContainer);
OutHandProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutHandProfileImplContainer.HandProfileImpl));
}
void FSGHapticGloveHandProfiles::SetProfile(const USGHandProfile* HandProfile)
{
FSGIC_FSGHandProfileImpl HandProfileImplContainer{HandProfile->ToHandProfileImpl()};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_SetProfile_HandProfileImpl(&HandProfileImplContainer);
}
void FSGHapticGloveHandProfiles::SetProfile(const USGHandProfile* HandProfile,
const bool bRightHanded)
{
FSGIC_FSGHandProfileImpl HandProfileImplContainer{HandProfile->ToHandProfileImpl()};
SGCoreImpl_FSGHapticGloveHandProfilesImpl_SetProfile_HandProfileImpl_bRightHanded(
&HandProfileImplContainer, bRightHanded);
}
void FSGHapticGloveHandProfiles::RestoreDefaults()
{
SGCoreImpl_FSGHapticGloveHandProfilesImpl_RestoreDefaults();
}
void FSGHapticGloveHandProfiles::RestoreDefaults(const bool bRightHanded)
{
SGCoreImpl_FSGHapticGloveHandProfilesImpl_RestoreDefaults_bRightHanded(bRightHanded);
}
void FSGHapticGloveHandProfiles::TryLoadingFromDisk()
{
SGCoreImpl_FSGHapticGloveHandProfilesImpl_TryLoadingFromDisk();
}
bool FSGHapticGloveHandProfiles::SaveLastRange(
const USGSensorRange* CurrentRange, const USGHapticGlove* ForGlove)
{
FSGIC_FSGSensorRangeImpl CurrentRangeContainer{CurrentRange->ToSensorRangeImpl()};
FSGIC_TSharedPtr_FSGHapticGloveImpl ForGloveContainer{ForGlove->ToHapticGloveImpl()};
return SGCoreImpl_FSGHapticGloveHandProfilesImpl_SaveLastRange(&CurrentRangeContainer, &ForGloveContainer);
}
bool FSGHapticGloveHandProfiles::LoadLastRange(UObject* Outer,
const USGHapticGlove* ForGlove, USGSensorRange*& OutLastRange)
{
FSGIC_TSharedPtr_FSGHapticGloveImpl ForGloveContainer{ForGlove->ToHapticGloveImpl()};
FSGIC_FSGSensorRangeImpl OutLastRangeContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveHandProfilesImpl_LoadLastRange(
&ForGloveContainer, &OutLastRangeContainer);
OutLastRange = USGSensorRange::NewSensorRange(Outer, MoveTemp(OutLastRangeContainer.SensorRangeImpl));
return bResult;
}
@@ -1,236 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGHapticGloveQuickCalibration.h"
#include "SGHapticGloveCalibrationSequenceImplCast.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGSensorRange.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSensorRangeImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl.h"
#include "SGUtils/SGArrayUtils.h"
USGHapticGloveQuickCalibration* USGHapticGloveQuickCalibration::NewHapticGloveQuickCalibration(UObject* Outer,
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibration)
{
USGHapticGloveQuickCalibration* Instance = NewObject<USGHapticGloveQuickCalibration>(Outer);
Instance->SetHapticGloveCalibrationSequenceImpl(HapticGloveQuickCalibration);
return Instance;
}
USGHapticGloveQuickCalibration* USGHapticGloveQuickCalibration::NewHapticGloveQuickCalibration(UObject* Outer,
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibration)
{
USGHapticGloveQuickCalibration* Instance = NewObject<USGHapticGloveQuickCalibration>(Outer);
Instance->SetHapticGloveCalibrationSequenceImpl(MoveTemp(HapticGloveQuickCalibration));
return Instance;
}
USGHapticGloveQuickCalibration* USGHapticGloveQuickCalibration::NewHapticGloveQuickCalibration(UObject* Outer)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewHapticGloveQuickCalibration(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGHapticGloveQuickCalibration* USGHapticGloveQuickCalibration::NewHapticGloveQuickCalibration(UObject* Outer,
const USGHapticGlove* GloveToCalibrate, float AutoEndTimeout)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl GloveToCalibrateContainer{GloveToCalibrate->ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_GloveToCalibrate_AutoEndTimeout_MakeShared(
&OutSharedPtrContainer, &GloveToCalibrateContainer, AutoEndTimeout);
return NewHapticGloveQuickCalibration(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
float USGHapticGloveQuickCalibration::GetDefaultAutoEndTimeout()
{
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetDefaultAutoEndTimeout();
}
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration()
: USGHapticGloveCalibrationSequence()
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetHapticGloveCalibrationSequenceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
const USGHapticGlove* GloveToCalibrate, const float AutoEndTimeout)
: USGHapticGloveCalibrationSequence(GloveToCalibrate)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl OutSharedPtrContainer;
FSGIC_TSharedPtr_FSGHapticGloveImpl GloveToCalibrateContainer{GloveToCalibrate->ToHapticGloveImpl()};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ctor_GloveToCalibrate_AutoEndTimeout_MakeShared(
&OutSharedPtrContainer, &GloveToCalibrateContainer, AutoEndTimeout);
SetHapticGloveCalibrationSequenceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
const FSGHapticGloveQuickCalibrationImpl& HapticGloveQuickCalibrationImpl)
: USGHapticGloveCalibrationSequence(HapticGloveQuickCalibrationImpl)
{
}
USGHapticGloveQuickCalibration::USGHapticGloveQuickCalibration(
TSharedRef<FSGHapticGloveQuickCalibrationImpl> HapticGloveQuickCalibrationImpl)
: USGHapticGloveCalibrationSequence(MoveTemp(HapticGloveQuickCalibrationImpl))
{
}
USGHapticGloveQuickCalibration::~USGHapticGloveQuickCalibration() = default;
TSharedRef<FSGHapticGloveQuickCalibrationImpl> USGHapticGloveQuickCalibration::ToHapticGloveQuickCalibrationImpl() const
{
return FSGHapticGloveCalibrationSequenceImplCast::ToHapticGloveQuickCalibrationImpl(
ToHapticGloveCalibrationSequenceImpl());
}
float USGHapticGloveQuickCalibration::GetAutoEndTimeout() const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetAutoEndTimeout(&InstanceContainer);
}
int32 USGHapticGloveQuickCalibration::GetSmoothingSamples() const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetSmoothingSamples(&InstanceContainer);
}
USGSensorRange* USGHapticGloveQuickCalibration::GetSensorRange(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_FSGSensorRangeImpl OutRangeContainer;
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetSensorRange(&InstanceContainer, &OutRangeContainer);
return USGSensorRange::NewSensorRange(Outer, MoveTemp(OutRangeContainer.SensorRangeImpl));
}
USGHandProfile* USGHapticGloveQuickCalibration::GetTemporaryProfile(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_FSGHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetTemporaryProfile(&InstanceContainer, &OutProfileContainer);
return USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
}
bool USGHapticGloveQuickCalibration::CanAnimate() const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_CanAnimate(&InstanceContainer);
}
bool USGHapticGloveQuickCalibration::AutoCompleted() const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
return SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_AutoCompleted(&InstanceContainer);
}
void USGHapticGloveQuickCalibration::Reset()
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_Reset(&InstanceContainer);
}
void USGHapticGloveQuickCalibration::Update(const float DeltaSeconds)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_Update(&InstanceContainer, DeltaSeconds);
}
void USGHapticGloveQuickCalibration::AddDataPoint(const TArray<FVector>& CalibrationPoints)
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_TArray_FVector CalibrationPointsContainer{CalibrationPoints};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_AddDataPoint(&InstanceContainer, &CalibrationPointsContainer);
}
void USGHapticGloveQuickCalibration::ConfirmCurrentStep()
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_ConfirmCurrentStep(&InstanceContainer);
}
bool USGHapticGloveQuickCalibration::CompileRange(UObject* Outer, USGSensorRange*& OutSensorRange) const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_FSGSensorRangeImpl OutSensorRangeContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_CompileRange(
&InstanceContainer, &OutSensorRangeContainer);
OutSensorRange = USGSensorRange::NewSensorRange(Outer, MoveTemp(OutSensorRangeContainer.SensorRangeImpl));
return bResult;
}
bool USGHapticGloveQuickCalibration::GetHandPose(UObject* Outer,
const bool bRightHanded, USGHandPose*& OutCurrentHandPose) const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_FSGHandPoseImpl OutCurrentHandPoseContainer;
const bool bResult = SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetHandPose(
&InstanceContainer, bRightHanded, &OutCurrentHandPoseContainer);
OutCurrentHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutCurrentHandPoseContainer.HandPoseImpl));
return bResult;
}
FString USGHapticGloveQuickCalibration::GetCurrentInstruction(const FString& NextStepKey) const
{
FSGIC_TSharedPtr_FSGHapticGloveQuickCalibrationImpl InstanceContainer{ToHapticGloveQuickCalibrationImpl()};
FSGIC_FString OutInstructionContainer;
FSGIC_FString NextStepKeyContainer{NextStepKey};
SGCoreImpl_FSGHapticGloveQuickCalibrationImpl_GetCurrentInstruction(
&InstanceContainer, &OutInstructionContainer, &NextStepKeyContainer);
return MoveTemp(OutInstructionContainer.String);
}
@@ -0,0 +1,730 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGNova2Glove.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGCustomWaveform.h"
#include "SGCore/SGDeviceImplCast.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGNovaGloveInfo.h"
#include "SGCore/SGNova2GloveSensorData.h"
#include "SGCore/SGSensorNormalization.h"
#include "SGCore/SGThresholdCommand.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNova2GloveImpl.h"
#include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGHapticLocation.h"
#include "SGInterop/SGIC_ESGNova2VibroMotor.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGBasicHandModelImpl.h"
#include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h"
#include "SGInterop/SGIC_FSGNova2GloveSensorDataImpl.h"
#include "SGInterop/SGIC_FSGSensorNormalizationImpl.h"
#include "SGInterop/SGIC_FSGThresholdCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FSGNova2GloveImpl.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNova2GloveImpl.h"
USGNova2Glove* USGNova2Glove::NewNova2Glove(UObject* Outer, const FSGNova2GloveImpl& Nova2GloveImpl)
{
USGNova2Glove* Instance = NewObject<USGNova2Glove>(Outer);
Instance->SetSGDeviceImpl(Nova2GloveImpl);
return Instance;
}
USGNova2Glove* USGNova2Glove::NewNova2Glove(UObject* Outer, TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
{
USGNova2Glove* Instance = NewObject<USGNova2Glove>(Outer);
Instance->SetSGDeviceImpl(MoveTemp(Nova2GloveImpl));
return Instance;
}
USGNova2Glove* USGNova2Glove::NewNova2Glove(UObject* Outer)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGNova2GloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
return NewNova2Glove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGNova2Glove* USGNova2Glove::NewNova2Glove(UObject* Outer, const USGNovaGloveInfo& DeviceInfo)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNovaGloveInfoImpl DeviceInfoContainer{DeviceInfo.ToNovaGloveInfoImpl()};
SGCoreImpl_FSGNova2GloveImpl_ctor_DeviceInfo_MakeShared(&OutSharedPtrContainer, &DeviceInfoContainer);
return NewNova2Glove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGDevice* USGNova2Glove::Parse(UObject* Outer, const FString& ConstantsString)
{
FSGIC_FSGNova2GloveImpl OutNova2GloveImplContainer;
FSGIC_FString ConstantsStringContainer{ConstantsString};
SGCoreImpl_FSGNova2GloveImpl_Parse(&OutNova2GloveImplContainer, &ConstantsStringContainer);
return NewNova2Glove(Outer, MoveTemp(OutNova2GloveImplContainer.Nova2GloveImpl));
}
TArray<USGNova2Glove*> USGNova2Glove::GetNova2Gloves(UObject* Outer)
{
FSGIC_TArray_FSGNova2GloveImpl OutGlovesContainer;
SGCoreImpl_FSGNova2GloveImpl_GetNova2Gloves(&OutGlovesContainer);
TArray<USGNova2Glove*> Gloves;
for (const FSGNova2GloveImpl& Nova2GloveImpl: OutGlovesContainer.Array)
{
USGNova2Glove* Nova2Glove = USGNova2Glove::NewNova2Glove(Outer, Nova2GloveImpl);
Gloves.Add(Nova2Glove);
}
return MoveTemp(Gloves);
}
bool USGNova2Glove::GetNova2Glove(UObject* Outer, USGNova2Glove*& OutGlove)
{
FSGIC_FSGNova2GloveImpl OutGloveContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetNova2Glove_OutGlove(&OutGloveContainer);
if (bResult)
{
OutGlove = NewNova2Glove(Outer, MoveTemp(OutGloveContainer.Nova2GloveImpl));
}
return bResult;
}
bool USGNova2Glove::GetNova2Glove(UObject* Outer, const bool bRightHanded, USGNova2Glove*& OutGlove)
{
FSGIC_FSGNova2GloveImpl OutGloveContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetNova2Glove_bRightHanded_OutGlove(
bRightHanded, &OutGloveContainer);
if (bResult)
{
OutGlove = NewNova2Glove(Outer, MoveTemp(OutGloveContainer.Nova2GloveImpl));
}
return bResult;
}
void USGNova2Glove::CalculateGloveLocation(
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FString& HardwareVersion,
FVector& OutGlovePosition, FQuat& OutGloveRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_CalculateGloveLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGNova2Glove::CalculateGloveLocation(
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FString& HardwareVersion,
FVector& OutGlovePosition, FRotator& OutGloveRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_CalculateGloveLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGNova2Glove::CalculateWristLocation(
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FString& HardwareVersion,
FVector& OutWristPosition, FQuat& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_CalculateWristLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGNova2Glove::CalculateWristLocation(
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FString& HardwareVersion,
FVector& OutWristPosition, FRotator& OutWristRotation)
{
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_CalculateWristLocation(
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
ANSICHAR USGNova2Glove::GetStreamByte()
{
return SGCoreImpl_FSGNova2GloveImpl_GetStreamByte();
}
TArray<float> USGNova2Glove::GetNova2SensorRanges()
{
FSGIC_TArray_float OutNova2SensorRangesContainer;
SGCoreImpl_FSGNova2GloveImpl_GetNova2SensorRanges(&OutNova2SensorRangesContainer);
return MoveTemp(OutNova2SensorRangesContainer.Array);
}
TArray<float> USGNova2Glove::ToNormalizedValues(const USGNova2GloveSensorData* SensorData)
{
FSGIC_TArray_float OutNormalizedValuesContainer;
FSGIC_FSGNova2GloveSensorDataImpl SensorDataContainer{SensorData->ToNova2GloveSensorDataImpl()};
SGCoreImpl_FSGNova2GloveImpl_ToNormalizedValues_SensorData(
&OutNormalizedValuesContainer, &SensorDataContainer);
return MoveTemp(OutNormalizedValuesContainer.Array);
}
TArray<float> USGNova2Glove::ToNormalizedValues(
UObject* Outer, const USGNova2GloveSensorData* SensorData, USGSensorNormalization*& OutSensorNormalizer)
{
FSGIC_TArray_float OutNormalizedValuesContainer;
FSGIC_FSGNova2GloveSensorDataImpl SensorDataContainer{SensorData->ToNova2GloveSensorDataImpl()};
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizerContainer;
SGCoreImpl_FSGNova2GloveImpl_ToNormalizedValues_SensorData_OutSensorNormalizer(
&OutNormalizedValuesContainer, &SensorDataContainer, &OutSensorNormalizerContainer);
OutSensorNormalizer = USGSensorNormalization::NewSensorNormalization(
Outer, MoveTemp(OutSensorNormalizerContainer.SensorNormalizationImpl));
return MoveTemp(OutNormalizedValuesContainer.Array);
}
TArray<TArray<FVector>> USGNova2Glove::CalculateHandAngles(
const TArray<float>& NormalizedValues, const USGHandInterpolator* Interpolator, const bool bInfluenceIndex)
{
FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
FSGIC_TArray_float NormalizedValuesContainer{NormalizedValues};
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
SGCoreImpl_FSGNova2GloveImpl_CalculateHandAngles(
&OutHandAnglesContainer, &NormalizedValuesContainer, &InterpolatorContainer, bInfluenceIndex);
return MoveTemp(OutHandAnglesContainer.Array);
}
TArray<TArray<FVector>> USGNova2Glove::ToNormalizedAngles(
const TArray<float>& NormalizedData, const USGNovaGloveInfo* GloveInfo)
{
FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
FSGIC_TArray_float NormalizedDataContainer{NormalizedData};
FSGIC_FSGNovaGloveInfoImpl GloveInfoContainer{GloveInfo->ToNovaGloveInfoImpl()};
SGCoreImpl_FSGNova2GloveImpl_ToNormalizedAngles(
&OutHandAnglesContainer, &NormalizedDataContainer, &GloveInfoContainer);
return MoveTemp(OutHandAnglesContainer.Array);
}
USGNova2Glove::USGNova2Glove()
: USGHapticGlove()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
SGCoreImpl_FSGNova2GloveImpl_ctor_MakeShared(&OutSharedPtrContainer);
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGNova2Glove::USGNova2Glove(const USGNovaGloveInfo& DeviceInfo)
: USGHapticGlove()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl OutSharedPtrContainer;
FSGIC_FSGNovaGloveInfoImpl DeviceInfoContainer{DeviceInfo.ToNovaGloveInfoImpl()};
SGCoreImpl_FSGNova2GloveImpl_ctor_DeviceInfo_MakeShared(&OutSharedPtrContainer, &DeviceInfoContainer);
SetSGDeviceImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGNova2Glove::USGNova2Glove(const FSGDeviceImpl& SGDeviceImpl)
: USGHapticGlove(SGDeviceImpl)
{
}
USGNova2Glove::USGNova2Glove(const FSGHapticGloveImpl& HapticGloveImpl)
: USGHapticGlove(HapticGloveImpl)
{
}
USGNova2Glove::USGNova2Glove(const FSGNova2GloveImpl& Nova2GloveImpl)
: USGHapticGlove(Nova2GloveImpl)
{
}
USGNova2Glove::USGNova2Glove(const TSharedRef<FSGDeviceImpl> SGDeviceImpl)
: USGHapticGlove(SGDeviceImpl)
{
}
USGNova2Glove::USGNova2Glove(const TSharedRef<FSGHapticGloveImpl> HapticGloveImpl)
: USGHapticGlove(HapticGloveImpl)
{
}
USGNova2Glove::USGNova2Glove(const TSharedRef<FSGNova2GloveImpl> Nova2GloveImpl)
: USGHapticGlove(Nova2GloveImpl)
{
}
USGNova2Glove::~USGNova2Glove() = default;
TSharedRef<FSGNova2GloveImpl> USGNova2Glove::ToNova2GloveImpl() const
{
return FSGDeviceImplCast::ToNova2GloveImpl(ToSGDeviceImpl());
}
ESGDeviceType USGNova2Glove::GetDeviceType() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_ESGDeviceType OutTypeContainer;
SGCoreImpl_FSGNova2GloveImpl_GetDeviceType(&InstanceContainer, &OutTypeContainer);
return OutTypeContainer.Type;
}
FString USGNova2Glove::GetDeviceId() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FString OutIdContainer;
SGCoreImpl_FSGNova2GloveImpl_GetDeviceId(&InstanceContainer, &OutIdContainer);
return MoveTemp(OutIdContainer.String);
}
FString USGNova2Glove::GetHardwareVersion() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FString OutVersionContainer;
SGCoreImpl_FSGNova2GloveImpl_GetHardwareVersion(&InstanceContainer, &OutVersionContainer);
return MoveTemp(OutVersionContainer.String);
}
int32 USGNova2Glove::GetFirmwareVersion() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_GetFirmwareVersion(&InstanceContainer);
}
int32 USGNova2Glove::GetSubFirmwareVersion() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_GetSubFirmwareVersion(&InstanceContainer);
}
bool USGNova2Glove::HasBattery() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_HasBattery(&InstanceContainer);
}
bool USGNova2Glove::IsCharging()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_IsCharging(&InstanceContainer);
return bResult;
}
bool USGNova2Glove::GetBatteryLevel(float& OutBatteryLevel)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetBatteryLevel(&InstanceContainer, &OutBatteryLevel);
return bResult;
}
bool USGNova2Glove::IsRight() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_IsRight(&InstanceContainer);
}
bool USGNova2Glove::GetImuRotation(FQuat& OutImu)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FQuat OutImuContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
if (bResult)
{
OutImu = MoveTemp(OutImuContainer.Quat);
}
return bResult;
}
bool USGNova2Glove::GetImuRotation(FRotator& OutImu)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FQuat OutImuContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetImuRotation(&InstanceContainer, &OutImuContainer);
if (bResult)
{
OutImu = OutImuContainer.Quat.Rotator();
}
return bResult;
}
bool USGNova2Glove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandGeometry->ToBasicHandModelImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetHandPose(
&InstanceContainer, &HandModelContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult;
}
bool USGNova2Glove::GetHandAngles(TArray<TArray<FVector>>& OutHandAngles) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetHandAngles(&InstanceContainer, &OutHandAnglesContainer);
OutHandAngles = MoveTemp(OutHandAnglesContainer.Array);
return bResult;
}
ESGHapticGloveCalibrationState USGNova2Glove::GetCalibrationState() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_ESGHapticGloveCalibrationState OutHapticGloveCalibrationStateContainer;
SGCoreImpl_FSGNova2GloveImpl_GetCalibrationState(&InstanceContainer, &OutHapticGloveCalibrationStateContainer);
return MoveTemp(OutHapticGloveCalibrationStateContainer.State);
}
void USGNova2Glove::EndCalibration()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
SGCoreImpl_FSGNova2GloveImpl_EndCalibration(&InstanceContainer);
}
void USGNova2Glove::ResetCalibration()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
SGCoreImpl_FSGNova2GloveImpl_ResetCalibration(&InstanceContainer);
}
void USGNova2Glove::StopHaptics()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
SGCoreImpl_FSGNova2GloveImpl_StopHaptics(&InstanceContainer);
}
void USGNova2Glove::StopVibrations()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
SGCoreImpl_FSGNova2GloveImpl_StopVibrations(&InstanceContainer);
}
bool USGNova2Glove::SendHaptics()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SendHaptics(&InstanceContainer);
}
bool USGNova2Glove::SupportsCustomWaveform(ESGHapticLocation AtLocation) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SendHaptics(&InstanceContainer);
}
bool USGNova2Glove::SendCustomWaveform(USGCustomWaveform* OutWaveform, ESGHapticLocation Location)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SendHaptics(&InstanceContainer);
}
bool USGNova2Glove::QueueForceFeedbackLevels(const TArray<float>& Levels01)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGNova2GloveImpl_QueueForceFeedbackLevels(&InstanceContainer, &Levels01Container);
}
bool USGNova2Glove::QueueForceFeedbackLevel(const int32 Finger, const float Level01)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_QueueForceFeedbackLevel(&InstanceContainer, Finger, Level01);
}
bool USGNova2Glove::QueueSqueezeLevel(const float SqueezeLevel01)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_QueueSqueezeLevel(&InstanceContainer, SqueezeLevel01);
}
void USGNova2Glove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_GetGloveLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
}
void USGNova2Glove::GetGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutGlovePositionContainer;
FSGIC_FQuat OutGloveRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_GetGloveLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutGlovePositionContainer, &OutGloveRotationContainer);
OutGlovePosition = MoveTemp(OutGlovePositionContainer.Vector);
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
}
void USGNova2Glove::GetWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_GetWristLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
}
void USGNova2Glove::GetWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
FSGIC_FVector OutWristPositionContainer;
FSGIC_FQuat OutWristRotationContainer;
SGCoreImpl_FSGNova2GloveImpl_GetWristLocation(
&InstanceContainer,
&ReferencePositionContainer, &ReferenceRotationContainer,
&TrackingHardwareContainer,
&OutWristPositionContainer, &OutWristRotationContainer);
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
}
USGNovaGloveInfo* USGNova2Glove::GetGloveInfo(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FSGNovaGloveInfoImpl OutGloveInfoContainer;
SGCoreImpl_FSGNova2GloveImpl_GetGloveInfo(&InstanceContainer, &OutGloveInfoContainer);
return USGNovaGloveInfo::NewNovaGloveInfo(Outer, MoveTemp(OutGloveInfoContainer.NovaGloveInfoImpl));
}
bool USGNova2Glove::DoesIndexInfluenceOthers() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_DoesIndexInfluenceOthers(&InstanceContainer);
}
void USGNova2Glove::SetIndexInfluencesOthers(const bool bInfluenceOthers)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
SGCoreImpl_FSGNova2GloveImpl_SetIndexInfluencesOthers(&InstanceContainer, bInfluenceOthers);
}
bool USGNova2Glove::SupportsOnBoardNormalization() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SupportsOnBoardNormalization(&InstanceContainer);
}
bool USGNova2Glove::GetSensorData(UObject* Outer, USGNova2GloveSensorData*& OutSensorData)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FSGNova2GloveSensorDataImpl OutSensorDataContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
if (bResult)
{
OutSensorData = USGNova2GloveSensorData::NewNova2GloveSensorData(
Outer, MoveTemp(OutSensorDataContainer.Nova2GloveSensorDataImpl));
}
return bResult;
}
bool USGNova2Glove::GetNormalizedInput(TArray<float>& OutNormalizedValues) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_TArray_float OutNormalizedValuesContainer;
const bool bResult = SGCoreImpl_FSGNova2GloveImpl_GetNormalizedInput(
&InstanceContainer, &OutNormalizedValuesContainer);
if (bResult)
{
OutNormalizedValues = MoveTemp(OutNormalizedValuesContainer.Array);
}
return bResult;
}
bool USGNova2Glove::SendRawData()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SendRawData(&InstanceContainer);
}
bool USGNova2Glove::SendNormalizedData()
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
return SGCoreImpl_FSGNova2GloveImpl_SendNormalizedData(&InstanceContainer);
}
ESGNova2VibroMotor USGNova2Glove::ToNovaMotor(const ESGHapticLocation Location) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_ESGNova2VibroMotor OutVibroMotorContainer;
FSGIC_ESGHapticLocation LocationContainer{Location};
SGCoreImpl_FSGNova2GloveImpl_ToNovaMotor(&InstanceContainer, &OutVibroMotorContainer, &LocationContainer);
return OutVibroMotorContainer.Motor;
}
int32 USGNova2Glove::ChannelIndex(const ESGNova2VibroMotor Motor) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_ESGNova2VibroMotor MotorContainer{Motor};
return SGCoreImpl_FSGNova2GloveImpl_ChannelIndex(&InstanceContainer, &MotorContainer);
}
void USGNova2Glove::ValidateWaveform(USGCustomWaveform* OutWaveform, const ESGNova2VibroMotor Motor) const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGNova2VibroMotor MotorContainer{Motor};
SGCoreImpl_FSGNova2GloveImpl_ValidateWaveform(&InstanceContainer, &OutWaveformContainer, &MotorContainer);
}
bool USGNova2Glove::SendCustomWaveform_Nova2(
USGCustomWaveform* OutWaveform, const ESGNova2VibroMotor Motor, const bool bValidateWaveform)
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGNova2VibroMotor MotorContainer{Motor};
return SGCoreImpl_FSGNova2GloveImpl_SendCustomWaveform_Nova2(
&InstanceContainer, &OutWaveformContainer, &MotorContainer, bValidateWaveform);
}
FString USGNova2Glove::ToString() const
{
FSGIC_TSharedPtr_FSGNova2GloveImpl InstanceContainer{ToNova2GloveImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGNova2GloveImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);;
}
@@ -0,0 +1,379 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGNova2GloveSensorData.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGNovaGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNova2GloveSensorDataImpl.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_ESGNormalizationState.h"
#include "SGInterop/SGIC_ESGNova2SensorLocation.h"
#include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGNova2GloveSensorDataImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGUtils/SGArrayUtils.h"
struct USGNova2GloveSensorData::FImpl
{
/************************
* Member variables
************************/
FSGNova2GloveSensorDataImpl Nova2GloveSensorDataImpl;
/************************
* Owner object
************************/
USGNova2GloveSensorData* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGNova2GloveSensorData* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(
UObject* Outer, const FSGNova2GloveSensorDataImpl& Nova2GloveSensorDataImpl)
{
USGNova2GloveSensorData* Instance = NewObject<USGNova2GloveSensorData>(Outer);
Instance->SetNova2GloveSensorDataImpl(Nova2GloveSensorDataImpl);
return Instance;
}
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(UObject* Outer)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor(&OutNova2GloveSensorDataImplContainer);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(
UObject* Outer, const ESGNormalizationState NormalizationState,
const TArray<TArray<FVector>>& Values, const int32 ParsedValues,
const FQuat& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(
UObject* Outer, const ESGNormalizationState NormalizationState,
const TArray<FSGVectorArray>& Values, const int32 ParsedValues,
const FQuat& ImuRotation, const bool bImuParsed, const float BatteryLevel, const bool bCharging)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(Values)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(
UObject* Outer, const ESGNormalizationState NormalizationState,
const TArray<TArray<FVector>>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed, const float BatteryLevel, const bool bCharging)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData* USGNova2GloveSensorData::NewNova2GloveSensorData(
UObject* Outer, const ESGNormalizationState NormalizationState,
const TArray<FSGVectorArray>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed, const float BatteryLevel, const bool bCharging)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(Values)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData* USGNova2GloveSensorData::Parse(UObject* Outer,
const FString& RawData, const USGNovaGloveInfo* GloveInfo)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_FString RawDataString{RawData};
FSGIC_FSGNovaGloveInfoImpl GloveInfoContainer{GloveInfo->ToNovaGloveInfoImpl()};
SGCoreImpl_FSGNova2GloveSensorDataImpl_Parse(&OutNova2GloveSensorDataImplContainer,
&RawDataString, &GloveInfoContainer);
return NewNova2GloveSensorData(Outer, MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl));
}
USGNova2GloveSensorData::USGNova2GloveSensorData()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor(&OutNova2GloveSensorDataImplContainer);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::USGNova2GloveSensorData(const ESGNormalizationState NormalizationState,
const TArray<TArray<FVector>>& Values, const int32 ParsedValues,
const FQuat& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::USGNova2GloveSensorData(const ESGNormalizationState NormalizationState,
const TArray<FSGVectorArray>& Values, const int32 ParsedValues,
const FQuat& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(Values)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::USGNova2GloveSensorData(const ESGNormalizationState NormalizationState,
const TArray<TArray<FVector>>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{Values};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::USGNova2GloveSensorData(const ESGNormalizationState NormalizationState,
const TArray<FSGVectorArray>& Values, const int32 ParsedValues,
const FRotator& ImuRotation, const bool bImuParsed,
const float BatteryLevel, const bool bCharging)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataImplContainer;
FSGIC_ESGNormalizationState NormalizationStateContainer{NormalizationState};
FSGIC_TArray_TArray_FVector ValuesContainer{
FSGArrayUtils::FromNestedBPArray<FVector, FSGVectorArray, &FSGVectorArray::VectorArray>(Values)
};
FSGIC_FQuat ImuRotationContainer{ImuRotation.Quaternion()};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_NormalizationState_Values_ParsedValues_ImuRotation_bImuParsed_BatteryLevel_bCharging(
&OutNova2GloveSensorDataImplContainer, &NormalizationStateContainer,
&ValuesContainer, ParsedValues,
&ImuRotationContainer, bImuParsed, BatteryLevel, bCharging);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataImplContainer.Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::USGNova2GloveSensorData(const FSGNova2GloveSensorDataImpl& Nova2GloveSensorDataImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetNova2GloveSensorDataImpl(Nova2GloveSensorDataImpl);
}
USGNova2GloveSensorData::~USGNova2GloveSensorData() = default;
void USGNova2GloveSensorData::SetNova2GloveSensorDataImpl(const FSGNova2GloveSensorDataImpl& Nova2GloveSensorDataImpl)
{
FSGIC_FSGNova2GloveSensorDataImpl OutNova2GloveSensorDataContainer;
FSGIC_FSGNova2GloveSensorDataImpl RhsContainer{Nova2GloveSensorDataImpl};
SGCoreImpl_FSGNova2GloveSensorDataImpl_ctor_copy(&OutNova2GloveSensorDataContainer, &RhsContainer);
Pimpl->Nova2GloveSensorDataImpl = MoveTemp(OutNova2GloveSensorDataContainer.Nova2GloveSensorDataImpl);
}
const FSGNova2GloveSensorDataImpl& USGNova2GloveSensorData::ToNova2GloveSensorDataImpl() const
{
return Pimpl->Nova2GloveSensorDataImpl;
}
ESGNormalizationState USGNova2GloveSensorData::GetSensorState() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_ESGNormalizationState OutNormalizationState;
SGCoreImpl_FSGNova2GloveSensorDataImpl_GetSensorState(&InstanceContainer, &OutNormalizationState);
return OutNormalizationState.State;
}
TArray<TArray<FVector>> USGNova2GloveSensorData::GetSensorValues() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_TArray_TArray_FVector OutValuesContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_GetSensorValues(&InstanceContainer, &OutValuesContainer);
return MoveTemp(OutValuesContainer.Array);
}
float USGNova2GloveSensorData::GetSensorValue(const ESGFinger Finger, const ESGNova2SensorLocation Location) const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGNova2SensorLocation LocationContainer{Location};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_GetSensorValue(
&InstanceContainer, &FingerContainer, &LocationContainer);
}
int32 USGNova2GloveSensorData::GetParsedValues() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_GetParsedValues(&InstanceContainer);
}
FQuat USGNova2GloveSensorData::GetImuRotationQ() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_GetImuRotation(&InstanceContainer, &OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator USGNova2GloveSensorData::GetImuRotation() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_GetImuRotation(&InstanceContainer, &OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
bool USGNova2GloveSensorData::IsImuParsed() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_IsImuParsed(&InstanceContainer);
}
float USGNova2GloveSensorData::GetBatteryLevel() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_GetBatteryLevel(&InstanceContainer);
}
bool USGNova2GloveSensorData::IsCharging() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_IsCharging(&InstanceContainer);
}
bool USGNova2GloveSensorData::Equals(const USGNova2GloveSensorData* Nova2GloveSensorData) const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_FSGNova2GloveSensorDataImpl Nova2GloveSensorDataContainer{Nova2GloveSensorData->ToNova2GloveSensorDataImpl()};
return SGCoreImpl_FSGNova2GloveSensorDataImpl_Equals(&InstanceContainer, &Nova2GloveSensorDataContainer);
}
FString USGNova2GloveSensorData::ToString() const
{
FSGIC_FSGNova2GloveSensorDataImpl InstanceContainer{ToNova2GloveSensorDataImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGNova2GloveSensorDataImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGNova2GloveSensorData::FImpl::FImpl(USGNova2GloveSensorData* InOwner)
: Owner(InOwner)
{
}
USGNova2GloveSensorData::FImpl::~FImpl() = default;
void USGNova2GloveSensorData::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -38,36 +38,39 @@
#include "Runtime/Launch/Resources/Version.h" #include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBasicHandModel.h" #include "SGCore/SGBasicHandModel.h"
#include "SGCore/SGBuzzCommand.h" #include "SGCore/SGCustomWaveform.h"
#include "SGCore/SGDeviceImplCast.h" #include "SGCore/SGDeviceImplCast.h"
#include "SGCore/SGForceFeedbackCommand.h" #include "SGCore/SGHandInterpolator.h"
#include "SGCore/SGHandPose.h" #include "SGCore/SGHandPose.h"
#include "SGCore/SGHandProfile.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGNovaGloveInfo.h" #include "SGCore/SGNovaGloveInfo.h"
#include "SGCore/SGNovaGloveSensorData.h" #include "SGCore/SGNovaGloveSensorData.h"
#include "SGCore/SGThumperCommand.h" #include "SGCore/SGSensorNormalization.h"
#include "SGCore/SGThresholdCommand.h"
#include "SGCoreImpl/SGDeviceImpl.h" #include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h" #include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNovaGloveImpl.h" #include "SGCoreImpl/SGNovaGloveImpl.h"
#include "SGInterop/SGIC_ESGDeviceType.h" #include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGHapticLocation.h"
#include "SGInterop/SGIC_ESGNovaVibroMotor.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h" #include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_FQuat.h" #include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGBasicHandModelImpl.h" #include "SGInterop/SGIC_FSGBasicHandModelImpl.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h" #include "SGInterop/SGIC_FSGCustomWaveformImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h" #include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h" #include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h" #include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveSensorDataImpl.h" #include "SGInterop/SGIC_FSGNovaGloveSensorDataImpl.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h" #include "SGInterop/SGIC_FSGSensorNormalizationImpl.h"
#include "SGInterop/SGIC_FSGThresholdCommandImpl.h"
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h" #include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_TArray_FSGNovaGloveImpl.h"
#include "SGInterop/SGIC_TArray_FVector.h" #include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGNovaGloveImpl.h"
USGNovaGlove* USGNovaGlove::NewNovaGlove(UObject* Outer, const FSGNovaGloveImpl& NovaGloveImpl) USGNovaGlove* USGNovaGlove::NewNovaGlove(UObject* Outer, const FSGNovaGloveImpl& NovaGloveImpl)
@@ -101,33 +104,6 @@ USGNovaGlove* USGNovaGlove::NewNovaGlove(UObject* Outer, const USGNovaGloveInfo&
return NewNovaGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef()); return NewNovaGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
} }
ANSICHAR USGNovaGlove::GetHapticsByte()
{
return SGCoreImpl_FSGNovaGloveImpl_GetHapticsByte();
}
FVector USGNovaGlove::GetMinCalibrationRange()
{
FSGIC_FVector OutRangeContainer;
SGCoreImpl_FSGNovaGloveImpl_GetMinCalibrationRange(&OutRangeContainer);
return MoveTemp(OutRangeContainer.Vector);
}
USGHandPose* USGNovaGlove::CalculateHandPose(UObject* Outer,
const USGBasicHandModel* HandModel,
const USGNovaGloveSensorData* NovaData,
const USGNovaGloveHandProfile* Profile)
{
FSGIC_FSGHandPoseImpl OutPoseContainer;
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()};
FSGIC_FSGNovaGloveSensorDataImpl NovaDataContainer{NovaData->ToNovaGloveSensorDataImpl()};
FSGIC_FSGNovaGloveHandProfileImpl ProfileContainer{Profile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGNovaGloveImpl_CalculateHandPose(
&OutPoseContainer, &HandModelContainer, &NovaDataContainer, &ProfileContainer);
return USGHandPose::NewHandPose(Outer, MoveTemp(OutPoseContainer.HandPoseImpl));
}
USGDevice* USGNovaGlove::Parse(UObject* Outer, const FString& ConstantsString) USGDevice* USGNovaGlove::Parse(UObject* Outer, const FString& ConstantsString)
{ {
FSGIC_FSGNovaGloveImpl OutNovaGloveImplContainer; FSGIC_FSGNovaGloveImpl OutNovaGloveImplContainer;
@@ -177,30 +153,10 @@ bool USGNovaGlove::GetNovaGlove(UObject* Outer, const bool bRightHanded, USGNova
return bResult; return bResult;
} }
TArray<FVector> USGNovaGlove::GetCalibrationValues(const USGNovaGloveSensorData* SensorData) void USGNovaGlove::CalculateGloveLocation(
{ const FVector& ReferencePosition, const FQuat& ReferenceRotation,
FSGIC_TArray_FVector OutValuesContainer; const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FSGIC_FSGNovaGloveSensorDataImpl SensorDataContainer{SensorData->ToNovaGloveSensorDataImpl()}; FVector& OutGlovePosition, FQuat& OutGloveRotation)
SGCoreImpl_FSGNovaGloveImpl_GetCalibrationValues_SensorData(&OutValuesContainer, &SensorDataContainer);
return MoveTemp(OutValuesContainer.Array);
}
void USGNovaGlove::CalibrateInterpolation(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues,
USGNovaGloveHandProfile*& OutProfile)
{
FSGIC_TArray_FVector MinValuesContainer{MinValues};
FSGIC_TArray_FVector MaxValuesContainer{MaxValues};
FSGIC_FSGNovaGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGNovaGloveImpl_CalibrateInterpolation(
&MinValuesContainer, &MaxValuesContainer, &OutProfileContainer);
OutProfile = USGNovaGloveHandProfile::NewNovaGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.NovaGloveHandProfileImpl));
}
void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutGlovePosition, FQuat& OutGloveRotation)
{ {
FSGIC_FVector ReferencePositionContainer{ReferencePosition}; FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation}; FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
@@ -217,9 +173,10 @@ void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, cons
OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat); OutGloveRotation = MoveTemp(OutGloveRotationContainer.Quat);
} }
void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation, void USGNovaGlove::CalculateGloveLocation(
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FVector& ReferencePosition, const FRotator& ReferenceRotation,
FVector& OutGlovePosition, FRotator& OutGloveRotation) const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutGlovePosition, FRotator& OutGloveRotation)
{ {
FSGIC_FVector ReferencePositionContainer{ReferencePosition}; FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()}; FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
@@ -236,9 +193,10 @@ void USGNovaGlove::CalculateGloveLocation(const FVector& ReferencePosition, cons
OutGloveRotation = OutGloveRotationContainer.Quat.Rotator(); OutGloveRotation = OutGloveRotationContainer.Quat.Rotator();
} }
void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation, void USGNovaGlove::CalculateWristLocation(
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FVector& ReferencePosition, const FQuat& ReferenceRotation,
FVector& OutWristPosition, FQuat& OutWristRotation) const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutWristPosition, FQuat& OutWristRotation)
{ {
FSGIC_FVector ReferencePositionContainer{ReferencePosition}; FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation}; FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation};
@@ -255,9 +213,10 @@ void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, cons
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat); OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
} }
void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, const FRotator& ReferenceRotation, void USGNovaGlove::CalculateWristLocation(
const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded, const FVector& ReferencePosition, const FRotator& ReferenceRotation,
FVector& OutWristPosition, FRotator& OutWristRotation) const ESGPositionalTrackingHardware TrackingHardware, const bool bRightHanded,
FVector& OutWristPosition, FRotator& OutWristRotation)
{ {
FSGIC_FVector ReferencePositionContainer{ReferencePosition}; FSGIC_FVector ReferencePositionContainer{ReferencePosition};
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()}; FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
@@ -274,29 +233,80 @@ void USGNovaGlove::CalculateWristLocation(const FVector& ReferencePosition, cons
OutWristRotation = OutWristRotationContainer.Quat.Rotator(); OutWristRotation = OutWristRotationContainer.Quat.Rotator();
} }
FString USGNovaGlove::ToBytes(const USGThumperCommand* ThumperCommand) ANSICHAR USGNovaGlove::GetHapticsByte()
{ {
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()}; return SGCoreImpl_FSGNovaGloveImpl_GetHapticsByte();
FSGIC_FString OutBytesContainer;
SGCoreImpl_FSGNovaGloveImpl_ToBytes_ThumperCommand(&OutBytesContainer, &ThumperCommandContainer);
return MoveTemp(OutBytesContainer.String);;
} }
FString USGNovaGlove::ToBytes(const USGForceFeedbackCommand* ForceFeedbackCommand) ANSICHAR USGNovaGlove::GetThresholdsByte()
{ {
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ return SGCoreImpl_FSGNovaGloveImpl_GetThresholdsByte();
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
FSGIC_FString OutBytesContainer;
SGCoreImpl_FSGNovaGloveImpl_ToBytes_ForceFeedbackCommand(&OutBytesContainer, &ForceFeedbackCommandContainer);
return MoveTemp(OutBytesContainer.String);;
} }
FString USGNovaGlove::ToBytes(const USGBuzzCommand* BuzzCommand) ANSICHAR USGNovaGlove::GetIgnoreThresholdsByte()
{ {
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()}; return SGCoreImpl_FSGNovaGloveImpl_GetIgnoreThresholdsByte();
FSGIC_FString OutBytesContainer; }
SGCoreImpl_FSGNovaGloveImpl_ToBytes_BuzzCommand(&OutBytesContainer, &BuzzCommandContainer);
return MoveTemp(OutBytesContainer.String);; TArray<float> USGNovaGlove::GetNovaSensorRanges()
{
FSGIC_TArray_float OutNovaSensorRangesContainer;
SGCoreImpl_FSGNovaGloveImpl_GetNovaSensorRanges(&OutNovaSensorRangesContainer);
return MoveTemp(OutNovaSensorRangesContainer.Array);
}
TArray<float> USGNovaGlove::ToNormalizedValues(const USGNovaGloveSensorData* SensorData)
{
FSGIC_TArray_float OutNormalizedValuesContainer;
FSGIC_FSGNovaGloveSensorDataImpl SensorDataContainer{SensorData->ToNovaGloveSensorDataImpl()};
SGCoreImpl_FSGNovaGloveImpl_ToNormalizedValues_SensorData(
&OutNormalizedValuesContainer, &SensorDataContainer);
return MoveTemp(OutNormalizedValuesContainer.Array);
}
TArray<float> USGNovaGlove::ToNormalizedValues(
UObject* Outer, const USGNovaGloveSensorData* SensorData, USGSensorNormalization*& OutSensorNormalizer)
{
FSGIC_TArray_float OutNormalizedValuesContainer;
FSGIC_FSGNovaGloveSensorDataImpl SensorDataContainer{SensorData->ToNovaGloveSensorDataImpl()};
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizerContainer;
SGCoreImpl_FSGNovaGloveImpl_ToNormalizedValues_SensorData_OutSensorNormalizer(
&OutNormalizedValuesContainer, &SensorDataContainer, &OutSensorNormalizerContainer);
OutSensorNormalizer = USGSensorNormalization::NewSensorNormalization(
Outer, MoveTemp(OutSensorNormalizerContainer.SensorNormalizationImpl));
return MoveTemp(OutNormalizedValuesContainer.Array);
}
TArray<TArray<FVector>> USGNovaGlove::CalculateHandAngles(
const TArray<float>& NormalizedValues, const USGHandInterpolator* Interpolator)
{
FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
FSGIC_TArray_float NormalizedValuesContainer{NormalizedValues};
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
SGCoreImpl_FSGNovaGloveImpl_CalculateHandAngles(
&OutHandAnglesContainer, &NormalizedValuesContainer, &InterpolatorContainer);
return MoveTemp(OutHandAnglesContainer.Array);
}
FString USGNovaGlove::ToNovaCommandAsFlexion(const USGThresholdCommand* Thresholds)
{
FSGIC_FString OutStringContainer;
FSGIC_FSGThresholdCommandImpl ThresholdsContainer{Thresholds->ToThresholdCommandImpl()};
SGCoreImpl_FSGNovaGloveImpl_ToNovaCommandAsFlexion(&OutStringContainer, &ThresholdsContainer);
return MoveTemp(OutStringContainer.String);
}
FString USGNovaGlove::ToNovaCommandAsRaw(
const USGThresholdCommand* Thresholds, const USGSensorNormalization* Interpolator)
{
FSGIC_FString OutStringContainer;
FSGIC_FSGThresholdCommandImpl ThresholdsContainer{Thresholds->ToThresholdCommandImpl()};
FSGIC_FSGSensorNormalizationImpl InterpolatorContainer{Interpolator->ToSensorNormalizationImpl()};
SGCoreImpl_FSGNovaGloveImpl_ToNovaCommandAsRaw(
&OutStringContainer, &ThresholdsContainer, &InterpolatorContainer);
return MoveTemp(OutStringContainer.String);
} }
USGNovaGlove::USGNovaGlove() USGNovaGlove::USGNovaGlove()
@@ -391,6 +401,12 @@ int32 USGNovaGlove::GetSubFirmwareVersion() const
return SGCoreImpl_FSGNovaGloveImpl_GetSubFirmwareVersion(&InstanceContainer); return SGCoreImpl_FSGNovaGloveImpl_GetSubFirmwareVersion(&InstanceContainer);
} }
void USGNovaGlove::SetDeviceIndex(int32 NewIndex)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_SetDeviceIndex(&InstanceContainer, NewIndex);
}
bool USGNovaGlove::HasBattery() const bool USGNovaGlove::HasBattery() const
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
@@ -411,21 +427,13 @@ bool USGNovaGlove::GetBatteryLevel(float& OutBatteryLevel)
return bResult; return bResult;
} }
bool USGNovaGlove::GetSensorData(UObject* Outer, USGNovaGloveSensorData*& OutSensorData) bool USGNovaGlove::IsRight() const
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGNovaGloveSensorDataImpl OutSensorDataContainer; return SGCoreImpl_FSGNovaGloveImpl_IsRight(&InstanceContainer);
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
if (bResult)
{
OutSensorData = USGNovaGloveSensorData::NewNovaGloveSensorData(
Outer, MoveTemp(OutSensorDataContainer.NovaGloveSensorDataImpl));
}
return bResult;
} }
bool USGNovaGlove::GetImuRotation(FQuat& OutImu) bool USGNovaGlove::GetImuRotation(FQuat& OutImu)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
@@ -454,16 +462,13 @@ bool USGNovaGlove::GetImuRotation(FRotator& OutImu)
return bResult; return bResult;
} }
bool USGNovaGlove::GetHandPose( bool USGNovaGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose) const
UObject* Outer, const USGBasicHandModel* HandModel, const USGNovaGloveHandProfile* Profile,
USGHandPose*& OutHandPose)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()}; FSGIC_FSGBasicHandModelImpl HandModelContainer{HandGeometry->ToBasicHandModelImpl()};
FSGIC_FSGNovaGloveHandProfileImpl ProfileContainer{Profile->ToNovaGloveHandProfileImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer; FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandModel_Profile_OutHandPose( const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose(
&InstanceContainer, &HandModelContainer, &ProfileContainer, &OutHandPoseContainer); &InstanceContainer, &HandModelContainer, &OutHandPoseContainer);
if (bResult) if (bResult)
{ {
@@ -473,105 +478,77 @@ bool USGNovaGlove::GetHandPose(
return bResult; return bResult;
} }
bool USGNovaGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, bool USGNovaGlove::GetHandAngles(TArray<TArray<FVector>>& OutHandAngles) const
USGHandPose*& OutHandPose)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()}; FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()}; const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandAngles(&InstanceContainer, &OutHandAnglesContainer);
FSGIC_FSGHandPoseImpl OutHandPoseContainer; OutHandAngles = MoveTemp(OutHandAnglesContainer.Array);
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
&InstanceContainer, &HandGeometryContainer, &ProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult; return bResult;
} }
bool USGNovaGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose) ESGHapticGloveCalibrationState USGNovaGlove::GetCalibrationState() const
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()}; FSGIC_ESGHapticGloveCalibrationState OutHapticGloveCalibrationStateContainer;
FSGIC_FSGHandPoseImpl OutHandPoseContainer; SGCoreImpl_FSGNovaGloveImpl_GetCalibrationState(&InstanceContainer, &OutHapticGloveCalibrationStateContainer);
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetHandPose_HandProfile_OutHandPose( return MoveTemp(OutHapticGloveCalibrationStateContainer.State);
&InstanceContainer, &ProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult;
} }
void USGNovaGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, void USGNovaGlove::EndCalibration()
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ SGCoreImpl_FSGNovaGloveImpl_EndCalibration(&InstanceContainer);
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
} }
void USGNovaGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand) void USGNovaGlove::ResetCalibration()
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ SGCoreImpl_FSGNovaGloveImpl_ResetCalibration(&InstanceContainer);
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()};
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
} }
void USGNovaGlove::SendHaptics(const USGBuzzCommand* BuzzCommand) void USGNovaGlove::StopHaptics()
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()}; SGCoreImpl_FSGNovaGloveImpl_StopHaptics(&InstanceContainer);
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &BuzzCommandContainer);
} }
void USGNovaGlove::SendHaptics(const USGThumperCommand* ThumperCommand) void USGNovaGlove::StopVibrations()
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()}; SGCoreImpl_FSGNovaGloveImpl_StopVibrations(&InstanceContainer);
SGCoreImpl_FSGNovaGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ThumperCommandContainer);
} }
bool USGNovaGlove::GetCalibrationValues(TArray<FVector>& OutValues) bool USGNovaGlove::SendHaptics()
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_TArray_FVector OutValuesContainer; return SGCoreImpl_FSGNovaGloveImpl_SendHaptics(&InstanceContainer);
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetCalibrationValues_OutValues(
&InstanceContainer, &OutValuesContainer);
if (bResult)
{
OutValues = MoveTemp(OutValuesContainer.Array);
}
return bResult;
} }
void USGNovaGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const bool USGNovaGlove::SupportsCustomWaveform(ESGHapticLocation AtLocation) const
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGHandProfileImpl OutProfileContainer; return SGCoreImpl_FSGNovaGloveImpl_SendHaptics(&InstanceContainer);
SGCoreImpl_FSGNovaGloveImpl_ApplyCalibration_HandProfile(&InstanceContainer, &OutProfileContainer);
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
} }
void USGNovaGlove::ApplyCalibration(UObject* Outer, USGNovaGloveHandProfile*& OutProfile) const bool USGNovaGlove::SendCustomWaveform(USGCustomWaveform* OutWaveform, ESGHapticLocation Location)
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGNovaGloveHandProfileImpl OutProfileContainer; return SGCoreImpl_FSGNovaGloveImpl_SendHaptics(&InstanceContainer);
SGCoreImpl_FSGNovaGloveImpl_ApplyCalibration_NovaGloveHandProfile(&InstanceContainer, &OutProfileContainer); }
OutProfile = USGNovaGloveHandProfile::NewNovaGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.NovaGloveHandProfileImpl)); bool USGNovaGlove::QueueForceFeedbackLevels(const TArray<float>& Levels01)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_TArray_float Levels01Container{Levels01};
return SGCoreImpl_FSGNovaGloveImpl_QueueForceFeedbackLevels(&InstanceContainer, &Levels01Container);
}
bool USGNovaGlove::QueueForceFeedbackLevel(const int32 Finger, const float Level01)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_QueueForceFeedbackLevel(&InstanceContainer, Finger, Level01);
} }
void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation, void USGNovaGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
@@ -656,6 +633,139 @@ void USGNovaGlove::GetWristLocation(const FVector& ReferencePosition, const FRot
OutWristRotation = OutWristRotationContainer.Quat.Rotator(); OutWristRotation = OutWristRotationContainer.Quat.Rotator();
} }
USGNovaGloveInfo* USGNovaGlove::GetGloveInfo(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGNovaGloveInfoImpl OutGloveInfoContainer;
SGCoreImpl_FSGNovaGloveImpl_GetGloveInfo(&InstanceContainer, &OutGloveInfoContainer);
return USGNovaGloveInfo::NewNovaGloveInfo(Outer, MoveTemp(OutGloveInfoContainer.NovaGloveInfoImpl));
}
bool USGNovaGlove::SupportsThresholds() const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_SupportsThresholds(&InstanceContainer);
}
bool USGNovaGlove::SupportsCustomWaveforms() const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_SupportsCustomWaveforms(&InstanceContainer);
}
bool USGNovaGlove::SupportsOnBoardNormalization() const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_SupportsOnBoardNormalization(&InstanceContainer);
}
bool USGNovaGlove::GetSensorData(UObject* Outer, USGNovaGloveSensorData*& OutSensorData)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGNovaGloveSensorDataImpl OutSensorDataContainer;
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
if (bResult)
{
OutSensorData = USGNovaGloveSensorData::NewNovaGloveSensorData(
Outer, MoveTemp(OutSensorDataContainer.NovaGloveSensorDataImpl));
}
return bResult;
}
bool USGNovaGlove::GetNormalizedInput(TArray<float>& OutNormalizedValues) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_TArray_float OutNormalizedValuesContainer;
const bool bResult = SGCoreImpl_FSGNovaGloveImpl_GetNormalizedInput(
&InstanceContainer, &OutNormalizedValuesContainer);
if (bResult)
{
OutNormalizedValues = MoveTemp(OutNormalizedValuesContainer.Array);
}
return bResult;
}
FString USGNovaGlove::ToNovaCommand(
const TArray<float>& ForceFeedbackLevels, const TArray<float>& BuzzLevels, float WristLevel) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FString OutStringContainer;
FSGIC_TArray_float ForceFeedbackLevelsContainer{ForceFeedbackLevels};
FSGIC_TArray_float BuzzLevelsContainer{BuzzLevels};
SGCoreImpl_FSGNovaGloveImpl_ToNovaCommand(&InstanceContainer, &OutStringContainer,
&ForceFeedbackLevelsContainer, &BuzzLevelsContainer, WristLevel);
return MoveTemp(OutStringContainer.String);
}
bool USGNovaGlove::QueueVibroLevels(const TArray<float>& Amplitudes)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_TArray_float AmplitudesContainer{Amplitudes};
return SGCoreImpl_FSGNovaGloveImpl_QueueVibroLevels(&InstanceContainer, &AmplitudesContainer);
}
bool USGNovaGlove::QueueVibroLevel(const int32 Finger, const float Amplitude)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_QueueVibroLevel(&InstanceContainer, Finger, Amplitude);
}
bool USGNovaGlove::QueueWristLevel(const float Amplitude)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_QueueWristLevel(&InstanceContainer, Amplitude);
}
ESGNovaVibroMotor USGNovaGlove::ToNovaMotor(const ESGHapticLocation Location) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_ESGNovaVibroMotor OutVibroMotorContainer;
FSGIC_ESGHapticLocation LocationContainer{Location};
SGCoreImpl_FSGNovaGloveImpl_ToNovaMotor(&InstanceContainer, &OutVibroMotorContainer, &LocationContainer);
return OutVibroMotorContainer.Motor;
}
int32 USGNovaGlove::ChannelIndex(const ESGNovaVibroMotor Motor) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_ESGNovaVibroMotor MotorContainer{Motor};
return SGCoreImpl_FSGNovaGloveImpl_ChannelIndex(&InstanceContainer, &MotorContainer);
}
void USGNovaGlove::ValidateWaveform(USGCustomWaveform* OutWaveform, const ESGNovaVibroMotor Motor) const
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGNovaVibroMotor MotorContainer{Motor};
SGCoreImpl_FSGNovaGloveImpl_ValidateWaveform(&InstanceContainer, &OutWaveformContainer, &MotorContainer);
}
bool USGNovaGlove::SendCustomWaveform_Nova(
USGCustomWaveform* OutWaveform, const ESGNovaVibroMotor Motor, const bool bValidateWaveform)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
FSGIC_FSGCustomWaveformImpl OutWaveformContainer{OutWaveform->ToCustomWaveformImpl()};
FSGIC_ESGNovaVibroMotor MotorContainer{Motor};
return SGCoreImpl_FSGNovaGloveImpl_SendCustomWaveform_Nova(
&InstanceContainer, &OutWaveformContainer, &MotorContainer, bValidateWaveform);
}
bool USGNovaGlove::QueueThresholdCommand_Flexion(const int32 Finger, const float FlexionThreshold)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_QueueThresholdCommand_Flexion(&InstanceContainer, Finger, FlexionThreshold);
}
bool USGNovaGlove::QueueClearThreshold(const int32 Finger)
{
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
return SGCoreImpl_FSGNovaGloveImpl_QueueClearThreshold(&InstanceContainer, Finger);
}
FString USGNovaGlove::ToString() const FString USGNovaGlove::ToString() const
{ {
FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()}; FSGIC_TSharedPtr_FSGNovaGloveImpl InstanceContainer{ToNovaGloveImpl()};
@@ -1,72 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGNovaGloveCalibration.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCore/SGNovaGloveHandProfile.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h"
void FSGNovaGloveCalibration::ApplyDefaultCalibrationInterpolationValues(const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const USGNovaGloveHandProfile* Profile)
{
FSGIC_TArray_FVector RetractedValuesContainer{RetractedValues};
FSGIC_TArray_FVector ExtendedValuesContainer{ExtendedValues};
FSGIC_FSGNovaGloveHandProfileImpl ProfileContainer{Profile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGNovaGloveCalibrationImpl_ApplyDefaultCalibrationInterpolationValues(
&RetractedValuesContainer, &ExtendedValuesContainer, &ProfileContainer);
}
void FSGNovaGloveCalibration::ApplyInterpolationValues(const TArray<FVector>& RetractedValues,
const TArray<FVector>& ExtendedValues,
const TArray<TArray<FVector>>& RetractedAngles,
const TArray<TArray<FVector>>& ExtendedAngles,
const USGNovaGloveHandProfile* Profile)
{
FSGIC_TArray_FVector RetractedValuesContainer{RetractedValues};
FSGIC_TArray_FVector ExtendedValuesContainer{ExtendedValues};
FSGIC_TArray_TArray_FVector RetractedAnglesContainer{RetractedAngles};
FSGIC_TArray_TArray_FVector ExtendedAnglesContainer{ExtendedAngles};
FSGIC_FSGNovaGloveHandProfileImpl ProfileContainer{Profile->ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGNovaGloveCalibrationImpl_ApplyInterpolationValues(
&RetractedValuesContainer, &ExtendedValuesContainer,
&RetractedAnglesContainer, &ExtendedAnglesContainer,
&ProfileContainer);
}
@@ -1,208 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGNovaGloveHandProfile.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGNovaGloveHandProfile::FImpl
{
/************************
* Member variables
************************/
FSGNovaGloveHandProfileImpl NovaGloveHandProfileImpl;
/************************
* Owner object
************************/
USGNovaGloveHandProfile* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGNovaGloveHandProfile* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGNovaGloveHandProfile* USGNovaGloveHandProfile::NewNovaGloveHandProfile(
UObject* Outer, const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl)
{
USGNovaGloveHandProfile* Instance = NewObject<USGNovaGloveHandProfile>(Outer);
Instance->SetNovaGloveHandProfileImpl(NovaGloveHandProfileImpl);
return Instance;
}
USGNovaGloveHandProfile* USGNovaGloveHandProfile::NewNovaGloveHandProfile(UObject* Outer)
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor(&OutNovaGloveHandProfileImplContainer);
return NewNovaGloveHandProfile(Outer, MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl));
}
USGNovaGloveHandProfile* USGNovaGloveHandProfile::NewNovaGloveHandProfile(
UObject* Outer, const bool bRightHanded, const USGHandInterpolator* Interpolator)
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor_bRightHanded_Interpolator(
&OutNovaGloveHandProfileImplContainer, bRightHanded, &InterpolatorContainer);
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()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor(&OutNovaGloveHandProfileImplContainer);
Pimpl->NovaGloveHandProfileImpl = MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl);
}
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const bool bRightHanded, const USGHandInterpolator* Interpolator)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor_bRightHanded_Interpolator(
&OutNovaGloveHandProfileImplContainer, bRightHanded, &InterpolatorContainer);
Pimpl->NovaGloveHandProfileImpl = MoveTemp(OutNovaGloveHandProfileImplContainer.NovaGloveHandProfileImpl);
}
USGNovaGloveHandProfile::USGNovaGloveHandProfile(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetNovaGloveHandProfileImpl(NovaGloveHandProfileImpl);
}
USGNovaGloveHandProfile::~USGNovaGloveHandProfile() = default;
void USGNovaGloveHandProfile::SetNovaGloveHandProfileImpl(const FSGNovaGloveHandProfileImpl& NovaGloveHandProfileImpl)
{
FSGIC_FSGNovaGloveHandProfileImpl OutNovaGloveHandProfileContainer;
FSGIC_FSGNovaGloveHandProfileImpl RhsContainer{NovaGloveHandProfileImpl};
SGCoreImpl_FSGNovaGloveHandProfileImpl_ctor_copy(&OutNovaGloveHandProfileContainer, &RhsContainer);
Pimpl->NovaGloveHandProfileImpl = MoveTemp(OutNovaGloveHandProfileContainer.NovaGloveHandProfileImpl);
}
const FSGNovaGloveHandProfileImpl& USGNovaGloveHandProfile::ToNovaGloveHandProfileImpl() const
{
return Pimpl->NovaGloveHandProfileImpl;
}
bool USGNovaGloveHandProfile::IsRight() const
{
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
return SGCoreImpl_FSGNovaGloveHandProfileImpl_IsRight(&InstanceContainer);
}
USGHandInterpolator* USGNovaGloveHandProfile::GetInterpolationSet(UObject* Outer) const
{
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
FSGIC_FSGHandInterpolatorImpl OutSetContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_GetInterpolationSet(&InstanceContainer, &OutSetContainer);
return USGHandInterpolator::NewHandInterpolator(Outer, MoveTemp(OutSetContainer.HandInterpolatorImpl));
}
bool USGNovaGloveHandProfile::Equals(const USGNovaGloveHandProfile* NovaGloveHandProfile) const
{
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
FSGIC_FSGNovaGloveHandProfileImpl NovaGloveHandProfileContainer{NovaGloveHandProfile->ToNovaGloveHandProfileImpl()};
return SGCoreImpl_FSGNovaGloveHandProfileImpl_Equals(&InstanceContainer, &NovaGloveHandProfileContainer);
}
void USGNovaGloveHandProfile::Reset()
{
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
SGCoreImpl_FSGNovaGloveHandProfileImpl_Reset(&InstanceContainer);
}
FString USGNovaGloveHandProfile::SGSerialize() const
{
FSGIC_FSGNovaGloveHandProfileImpl InstanceContainer{ToNovaGloveHandProfileImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGNovaGloveHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGNovaGloveHandProfile::FImpl::FImpl(USGNovaGloveHandProfile* InOwner)
: Owner(InOwner)
{
}
USGNovaGloveHandProfile::FImpl::~FImpl() = default;
void USGNovaGloveHandProfile::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -235,6 +235,22 @@ int32 USGNovaGloveInfo::GetNumberOfSensors() const
return SGCoreImpl_FSGNovaGloveInfoImpl_GetNumberOfSensors(&InstanceContainer); return SGCoreImpl_FSGNovaGloveInfoImpl_GetNumberOfSensors(&InstanceContainer);
} }
bool USGNovaGloveInfo::FirmwareNewerThan(
const int32 FirmwareMain, const int32 FirmwareSub, const bool bInclusive) const
{
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
return SGCoreImpl_FSGNovaGloveInfoImpl_FirmwareNewerThan(&InstanceContainer,
FirmwareMain, FirmwareSub, bInclusive);
}
bool USGNovaGloveInfo::FirmwareOlderThan(
const int32 FirmwareMain, const int32 FirmwareSub, const bool bInclusive) const
{
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
return SGCoreImpl_FSGNovaGloveInfoImpl_FirmwareOlderThan(&InstanceContainer,
FirmwareMain, FirmwareSub, bInclusive);
}
bool USGNovaGloveInfo::Equals(const USGNovaGloveInfo* NovaGloveInfo) const bool USGNovaGloveInfo::Equals(const USGNovaGloveInfo* NovaGloveInfo) const
{ {
FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()}; FSGIC_FSGNovaGloveInfoImpl InstanceContainer{ToNovaGloveInfoImpl()};
@@ -40,6 +40,8 @@
#include "SGCore/SGNovaGloveInfo.h" #include "SGCore/SGNovaGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGNovaGloveSensorDataImpl.h" #include "SGCoreImpl/SGNovaGloveSensorDataImpl.h"
#include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_ESGNovaSensorLocation.h"
#include "SGInterop/SGIC_FQuat.h" #include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h" #include "SGInterop/SGIC_FSGNovaGloveInfoImpl.h"
#include "SGInterop/SGIC_FSGNovaGloveSensorDataImpl.h" #include "SGInterop/SGIC_FSGNovaGloveSensorDataImpl.h"
@@ -216,6 +218,21 @@ TArray<FVector> USGNovaGloveSensorData::GetSensorValues() const
return MoveTemp(OutValuesContainer.Array); return MoveTemp(OutValuesContainer.Array);
} }
float USGNovaGloveSensorData::GetSensorValue(const ESGFinger Finger, const ESGNovaSensorLocation Location) const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
FSGIC_ESGFinger FingerContainer{Finger};
FSGIC_ESGNovaSensorLocation LocationContainer{Location};
return SGCoreImpl_FSGNovaGloveSensorDataImpl_GetSensorValue(
&InstanceContainer, &FingerContainer, &LocationContainer);
}
int32 USGNovaGloveSensorData::GetParsedValues() const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
return SGCoreImpl_FSGNovaGloveSensorDataImpl_GetParsedValues(&InstanceContainer);
}
FQuat USGNovaGloveSensorData::GetImuRotationQ() const FQuat USGNovaGloveSensorData::GetImuRotationQ() const
{ {
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()}; FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
@@ -232,12 +249,6 @@ FRotator USGNovaGloveSensorData::GetImuRotation() const
return OutRotationContainer.Quat.Rotator(); return OutRotationContainer.Quat.Rotator();
} }
int32 USGNovaGloveSensorData::GetParsedValues() const
{
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
return SGCoreImpl_FSGNovaGloveSensorDataImpl_GetParsedValues(&InstanceContainer);
}
bool USGNovaGloveSensorData::IsImuParsed() const bool USGNovaGloveSensorData::IsImuParsed() const
{ {
FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()}; FSGIC_FSGNovaGloveSensorDataImpl InstanceContainer{ToNovaGloveSensorDataImpl()};
@@ -37,33 +37,37 @@
#include "Runtime/Launch/Resources/Version.h" #include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGDeviceImplCast.h" #include "SGCore/SGDeviceImplCast.h"
#include "SGCore/SGForceFeedbackCommand.h" #include "SGCore/SGHandInterpolator.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGSenseGloveSensorNormalizer.h"
#include "SGCoreImpl/SGDeviceImpl.h" #include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGHandInterpolatorImpl.h"
#include "SGCoreImpl/SGHandPoseImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h" #include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGSenseGloveSensorNormalizerImpl.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGloveImpl.h" #include "SGCoreImpl/SGSenseGloveImpl.h"
#include "SGInterop/SGIC_ESGDeviceType.h" #include "SGInterop/SGIC_ESGDeviceType.h"
#include "SGInterop/SGIC_ESGFinger.h" #include "SGInterop/SGIC_ESGFinger.h"
#include "SGInterop/SGIC_ESGHapticGloveCalibrationState.h"
#include "SGInterop/SGIC_ESGPositionalTrackingHardware.h" #include "SGInterop/SGIC_ESGPositionalTrackingHardware.h"
#include "SGInterop/SGIC_ESGSenseGloveThumperCommand.h" #include "SGInterop/SGIC_ESGSenseGloveThumperCommand.h"
#include "SGInterop/SGIC_FQuat.h" #include "SGInterop/SGIC_FQuat.h"
#include "SGInterop/SGIC_FSGBasicHandModelImpl.h" #include "SGInterop/SGIC_FSGBasicHandModelImpl.h"
#include "SGInterop/SGIC_FSGBuzzCommandImpl.h" #include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
#include "SGInterop/SGIC_FSGForceFeedbackCommandImpl.h"
#include "SGInterop/SGIC_FSGHandPoseImpl.h" #include "SGInterop/SGIC_FSGHandPoseImpl.h"
#include "SGInterop/SGIC_FSGHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_FSGSenseGloveImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveInfoImpl.h" #include "SGInterop/SGIC_FSGSenseGloveInfoImpl.h"
#include "SGInterop/SGIC_FSGSenseGlovePoseImpl.h" #include "SGInterop/SGIC_FSGSenseGlovePoseImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveSensorDataImpl.h" #include "SGInterop/SGIC_FSGSenseGloveSensorDataImpl.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h" #include "SGInterop/SGIC_FSGSenseGloveSensorNormalizerImpl.h"
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h" #include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_TArray_float.h"
#include "SGInterop/SGIC_TArray_FVector.h" #include "SGInterop/SGIC_TArray_FVector.h"
#include "SGInterop/SGIC_TArray_FSGSenseGloveImpl.h"
#include "SGInterop/SGIC_TArray_TArray_FVector.h" #include "SGInterop/SGIC_TArray_TArray_FVector.h"
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h" #include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
@@ -98,57 +102,6 @@ USGSenseGlove* USGSenseGlove::NewSenseGlove(UObject* Outer, const USGSenseGloveI
return NewSenseGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef()); return NewSenseGlove(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
} }
ANSICHAR USGSenseGlove::GetHapticsByte()
{
return SGCoreImpl_FSGSenseGloveImpl_GetHapticsByte();
}
ANSICHAR USGSenseGlove::GetThumperByte()
{
return SGCoreImpl_FSGSenseGloveImpl_GetThumperByte();
}
USGSenseGlovePose* USGSenseGlove::CalculateGlovePose(UObject* Outer,
const USGSenseGloveSensorData* SensorData,
const USGSenseGloveInfo* GloveModel)
{
FSGIC_FSGSenseGlovePoseImpl OutPoseContainer;
FSGIC_FSGSenseGloveSensorDataImpl SensorDataContainer{SensorData->ToSenseGloveSensorDataImpl()};
FSGIC_FSGSenseGloveInfoImpl GloveModelContainer{GloveModel->ToSenseGloveInfoImpl()};
SGCoreImpl_FSGSenseGloveImpl_CalculateGlovePose_SensorData_GloveModel(
&OutPoseContainer, &SensorDataContainer, &GloveModelContainer);
return USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutPoseContainer.SenseGlovePoseImpl));
}
USGSenseGlovePose* USGSenseGlove::CalculateGlovePose(UObject* Outer,
const TArray<TArray<FVector>>& GloveAngles,
const USGSenseGloveInfo* GloveModel)
{
FSGIC_FSGSenseGlovePoseImpl OutPoseContainer;
FSGIC_TArray_TArray_FVector GloveAnglesContainer{GloveAngles};
FSGIC_FSGSenseGloveInfoImpl GloveModelContainer{GloveModel->ToSenseGloveInfoImpl()};
SGCoreImpl_FSGSenseGloveImpl_CalculateGlovePose_GloveAngles_GloveModel(
&OutPoseContainer, &GloveAnglesContainer, &GloveModelContainer);
return USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutPoseContainer.SenseGlovePoseImpl));
}
USGHandPose* USGSenseGlove::CalculateHandPose(UObject* Outer,
const USGSenseGlovePose* GlovePose,
const USGBasicHandModel* HandModel,
const USGSenseGloveHandProfile* Profile)
{
FSGIC_FSGHandPoseImpl OutPoseContainer;
FSGIC_FSGSenseGlovePoseImpl GlovePoseContainer{GlovePose->ToSenseGlovePoseImpl()};
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()};
FSGIC_FSGSenseGloveHandProfileImpl ProfileContainer{Profile->ToSenseGloveHandProfileImpl()};
SGCoreImpl_FSGSenseGloveImpl_CalculateHandPose(
&OutPoseContainer, &GlovePoseContainer, &HandModelContainer, &ProfileContainer);
return USGHandPose::NewHandPose(Outer, MoveTemp(OutPoseContainer.HandPoseImpl));
}
USGDevice* USGSenseGlove::Parse(UObject* Outer, const FString& ConstantsString) USGDevice* USGSenseGlove::Parse(UObject* Outer, const FString& ConstantsString)
{ {
FSGIC_FSGSenseGloveImpl OutSenseGloveImplContainer; FSGIC_FSGSenseGloveImpl OutSenseGloveImplContainer;
@@ -198,27 +151,6 @@ bool USGSenseGlove::GetSenseGlove(UObject* Outer, const bool bRightHanded, USGSe
return bResult; return bResult;
} }
TArray<FVector> USGSenseGlove::GetCalibrationValues(const USGSenseGlovePose* GlovePose)
{
FSGIC_TArray_FVector OutValuesContainer;
FSGIC_FSGSenseGlovePoseImpl GlovePoseContainer{GlovePose->ToSenseGlovePoseImpl()};
SGCoreImpl_FSGSenseGloveImpl_GetCalibrationValues_GlovePose(&OutValuesContainer, &GlovePoseContainer);
return MoveTemp(OutValuesContainer.Array);
}
void USGSenseGlove::CalibrateInterpolation(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues,
const bool bRightHanded, USGSenseGloveHandProfile*& OutProfile)
{
FSGIC_TArray_FVector MinValuesContainer{MinValues};
FSGIC_TArray_FVector MaxValuesContainer{MaxValues};
FSGIC_FSGSenseGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGSenseGloveImpl_CalibrateInterpolation(
&MinValuesContainer, &MaxValuesContainer, bRightHanded, &OutProfileContainer);
OutProfile = USGSenseGloveHandProfile::NewSenseGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.SenseGloveHandProfileImpl));
}
void USGSenseGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation, void USGSenseGlove::CalculateGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
const ESGPositionalTrackingHardware TrackingHardware, const ESGPositionalTrackingHardware TrackingHardware,
const bool bRightHanded, const ESGFinger MountedOn, const bool bRightHanded, const ESGFinger MountedOn,
@@ -317,6 +249,95 @@ void USGSenseGlove::CalculateWristLocation(const FVector& ReferencePosition, con
OutWristRotation = OutWristRotationContainer.Quat.Rotator(); OutWristRotation = OutWristRotationContainer.Quat.Rotator();
} }
ANSICHAR USGSenseGlove::GetHapticsByte()
{
return SGCoreImpl_FSGSenseGloveImpl_GetHapticsByte();
}
ANSICHAR USGSenseGlove::GetThumperByte()
{
return SGCoreImpl_FSGSenseGloveImpl_GetThumperByte();
}
FVector USGSenseGlove::GetDefaultThimbleOffset()
{
FSGIC_FVector OutOffsetContainer;
SGCoreImpl_FSGSenseGloveImpl_GetDefaultThimbleOffset(&OutOffsetContainer);
return MoveTemp(OutOffsetContainer.Vector);
}
USGSenseGlovePose* USGSenseGlove::CalculateGlovePose(UObject* Outer,
const USGSenseGloveSensorData* SensorData,
const USGSenseGloveInfo* GloveModel)
{
FSGIC_FSGSenseGlovePoseImpl OutPoseContainer;
FSGIC_FSGSenseGloveSensorDataImpl SensorDataContainer{SensorData->ToSenseGloveSensorDataImpl()};
FSGIC_FSGSenseGloveInfoImpl GloveModelContainer{GloveModel->ToSenseGloveInfoImpl()};
SGCoreImpl_FSGSenseGloveImpl_CalculateGlovePose_SensorData_GloveModel(
&OutPoseContainer, &SensorDataContainer, &GloveModelContainer);
return USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutPoseContainer.SenseGlovePoseImpl));
}
USGSenseGlovePose* USGSenseGlove::CalculateGlovePose(UObject* Outer,
const TArray<TArray<FVector>>& GloveAngles,
const USGSenseGloveInfo* GloveModel)
{
FSGIC_FSGSenseGlovePoseImpl OutPoseContainer;
FSGIC_TArray_TArray_FVector GloveAnglesContainer{GloveAngles};
FSGIC_FSGSenseGloveInfoImpl GloveModelContainer{GloveModel->ToSenseGloveInfoImpl()};
SGCoreImpl_FSGSenseGloveImpl_CalculateGlovePose_GloveAngles_GloveModel(
&OutPoseContainer, &GloveAnglesContainer, &GloveModelContainer);
return USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutPoseContainer.SenseGlovePoseImpl));
}
void USGSenseGlove::NormalizeValues(
const TArray<FVector>& SumAngles, const USGSenseGloveSensorNormalizer* Normalizer,
TArray<float>& OutFlexions, TArray<float>& OutAbductions)
{
FSGIC_TArray_FVector SumAnglesContainer{SumAngles};
FSGIC_FSGSenseGloveSensorNormalizerImpl NormalizerContainer{Normalizer->ToSenseGloveSensorNormalizerImpl()};
FSGIC_TArray_float OutFlexionsContainer;
FSGIC_TArray_float OutAbductionsContainer;
SGCoreImpl_FSGSenseGloveImpl_NormalizeValues(
&SumAnglesContainer, &NormalizerContainer, &OutFlexionsContainer, &OutAbductionsContainer);
OutFlexions = MoveTemp(OutFlexionsContainer.Array);
OutAbductions = MoveTemp(OutAbductionsContainer.Array);
}
void USGSenseGlove::CalculateHandAngles(
const USGSenseGlovePose* GlovePose,
const USGSenseGloveSensorNormalizer* Normalizer, const USGHandInterpolator* NormalizedToAngles,
TArray<TArray<FVector>>& OutHandAngles)
{
FSGIC_FSGSenseGlovePoseImpl GlovePoseContainer{GlovePose->ToSenseGlovePoseImpl()};
FSGIC_FSGSenseGloveSensorNormalizerImpl NormalizerContainer{Normalizer->ToSenseGloveSensorNormalizerImpl()};
FSGIC_FSGHandInterpolatorImpl NormalizedToAnglesContainer{NormalizedToAngles->ToHandInterpolatorImpl()};
FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
SGCoreImpl_FSGSenseGloveImpl_CalculateHandAngles(
&GlovePoseContainer, &NormalizerContainer, &NormalizedToAnglesContainer, &OutHandAnglesContainer);
OutHandAngles = MoveTemp(OutHandAnglesContainer.Array);
}
void USGSenseGlove::CalculateHandPose(
UObject* Outer,
const USGSenseGlovePose* GlovePose, const USGBasicHandModel* HandModel,
const USGSenseGloveSensorNormalizer* Normalizer, const USGHandInterpolator* NormalizedToAngles,
USGHandPose*& OutHandPose)
{
FSGIC_FSGSenseGlovePoseImpl GlovePoseContainer{GlovePose->ToSenseGlovePoseImpl()};
FSGIC_FSGSenseGloveSensorNormalizerImpl NormalizerContainer{Normalizer->ToSenseGloveSensorNormalizerImpl()};
FSGIC_FSGHandInterpolatorImpl NormalizedToAnglesContainer{NormalizedToAngles->ToHandInterpolatorImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer;
SGCoreImpl_FSGSenseGloveImpl_CalculateHandAngles(
&GlovePoseContainer, &NormalizerContainer, &NormalizedToAnglesContainer, &OutHandPoseContainer);
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
USGSenseGlove::USGSenseGlove() USGSenseGlove::USGSenseGlove()
: USGHapticGlove() : USGHapticGlove()
{ {
@@ -368,21 +389,6 @@ TSharedRef<FSGSenseGloveImpl> USGSenseGlove::ToSenseGloveImpl() const
return FSGDeviceImplCast::ToSenseGloveImpl(ToSGDeviceImpl()); return FSGDeviceImplCast::ToSenseGloveImpl(ToSGDeviceImpl());
} }
USGSenseGloveInfo* USGSenseGlove::GetGloveModel(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveInfoImpl OutModelContainer;
SGCoreImpl_FSGSenseGloveImpl_GetGloveModel(&InstanceContainer, &OutModelContainer);
return USGSenseGloveInfo::NewSenseGloveInfo(Outer, MoveTemp(OutModelContainer.SenseGloveInfoImpl));
}
bool USGSenseGlove::IsRight() const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
return SGCoreImpl_FSGSenseGloveImpl_IsRight(&InstanceContainer);
}
ESGDeviceType USGSenseGlove::GetDeviceType() const ESGDeviceType USGSenseGlove::GetDeviceType() const
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
@@ -419,19 +425,10 @@ int32 USGSenseGlove::GetSubFirmwareVersion() const
return SGCoreImpl_FSGSenseGloveImpl_GetSubFirmwareVersion(&InstanceContainer); return SGCoreImpl_FSGSenseGloveImpl_GetSubFirmwareVersion(&InstanceContainer);
} }
bool USGSenseGlove::GetSensorData(UObject* Outer, USGSenseGloveSensorData*& OutSensorData) const bool USGSenseGlove::IsRight() const
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveSensorDataImpl OutSensorDataContainer; return SGCoreImpl_FSGSenseGloveImpl_IsRight(&InstanceContainer);
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
if (bResult)
{
OutSensorData = USGSenseGloveSensorData::NewSenseGloveSensorData(
Outer, MoveTemp(OutSensorDataContainer.SenseGloveSensorDataImpl));
}
return bResult;
} }
bool USGSenseGlove::GetImuRotation(FQuat& OutImu) bool USGSenseGlove::GetImuRotation(FQuat& OutImu)
@@ -462,48 +459,13 @@ bool USGSenseGlove::GetImuRotation(FRotator& OutImu)
return bResult; return bResult;
} }
bool USGSenseGlove::GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePose) bool USGSenseGlove::GetHandPose(UObject* Outer, const USGBasicHandModel* HandGeometry, USGHandPose*& OutHandPose) const
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer; FSGIC_FSGBasicHandModelImpl HandModelContainer{HandGeometry->ToBasicHandModelImpl()};
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_OutGlovePose(
&InstanceContainer, &OutGlovePoseContainer);
if (bResult)
{
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
}
return bResult;
}
bool USGSenseGlove::GetGlovePose(
UObject* Outer, const USGSenseGloveSensorData* SensorData, USGSenseGlovePose*& OutGlovePose)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveSensorDataImpl SensorDataContainer{SensorData->ToSenseGloveSensorDataImpl()};
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_SensorData_OutGlovePose(
&InstanceContainer, &SensorDataContainer, &OutGlovePoseContainer);
if (bResult)
{
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
}
return bResult;
}
bool USGSenseGlove::GetHandPose(
UObject* Outer, const USGBasicHandModel* HandModel, const USGSenseGloveHandProfile* Profile,
USGHandPose*& OutHandPose)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandModelContainer{HandModel->ToBasicHandModelImpl()};
FSGIC_FSGSenseGloveHandProfileImpl ProfileContainer{Profile->ToSenseGloveHandProfileImpl()};
FSGIC_FSGHandPoseImpl OutHandPoseContainer; FSGIC_FSGHandPoseImpl OutHandPoseContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandModel_Profile_OutHandPose( const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose(
&InstanceContainer, &HandModelContainer, &ProfileContainer, &OutHandPoseContainer); &InstanceContainer, &HandModelContainer, &OutHandPoseContainer);
if (bResult) if (bResult)
{ {
@@ -513,134 +475,64 @@ bool USGSenseGlove::GetHandPose(
return bResult; return bResult;
} }
bool USGSenseGlove::GetHandPose( bool USGSenseGlove::GetHandAngles(TArray<TArray<FVector>>& OutHandAngles) const
UObject* Outer, const USGBasicHandModel* HandGeometry, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose)
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGBasicHandModelImpl HandGeometryContainer{HandGeometry->ToBasicHandModelImpl()}; FSGIC_TArray_TArray_FVector OutHandAnglesContainer;
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()}; const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandAngles(&InstanceContainer, &OutHandAnglesContainer);
FSGIC_FSGHandPoseImpl OutHandPoseContainer; OutHandAngles = MoveTemp(OutHandAnglesContainer.Array);
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandGeometry_HandProfile_OutHandPose(
&InstanceContainer, &HandGeometryContainer, &ProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult; return bResult;
} }
bool USGSenseGlove::GetHandPose(UObject* Outer, const USGHandProfile* HandProfile, USGHandPose*& OutHandPose) ESGHapticGloveCalibrationState USGSenseGlove::GetCalibrationState() const
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGHandProfileImpl ProfileContainer{HandProfile->ToHandProfileImpl()}; FSGIC_ESGHapticGloveCalibrationState OutHapticGloveCalibrationStateContainer;
FSGIC_FSGHandPoseImpl OutHandPoseContainer; SGCoreImpl_FSGSenseGloveImpl_GetCalibrationState(&InstanceContainer, &OutHapticGloveCalibrationStateContainer);
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetHandPose_HandProfile_OutHandPose( return MoveTemp(OutHapticGloveCalibrationStateContainer.State);
&InstanceContainer, &ProfileContainer, &OutHandPoseContainer);
if (bResult)
{
OutHandPose = USGHandPose::NewHandPose(Outer, MoveTemp(OutHandPoseContainer.HandPoseImpl));
}
return bResult;
} }
bool USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, const USGBuzzCommand* BuzzCommand, void USGSenseGlove::EndCalibration()
ESGSenseGloveThumperCommand ThumperCommand)
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ SGCoreImpl_FSGSenseGloveImpl_EndCalibration(&InstanceContainer);
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);
return bResult;
} }
bool USGSenseGlove::SendHaptics(ESGSenseGloveThumperCommand ThumperCommand) void USGSenseGlove::ResetCalibration()
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_ESGSenseGloveThumperCommand ThumperCommandContainer{ThumperCommand}; SGCoreImpl_FSGSenseGloveImpl_ResetCalibration(&InstanceContainer);
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ThumperCommand(
&InstanceContainer, &ThumperCommandContainer);
return bResult;
} }
void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand) void USGSenseGlove::StopHaptics()
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ SGCoreImpl_FSGSenseGloveImpl_StopHaptics(&InstanceContainer);
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
};
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &ForceFeedbackCommandContainer);
} }
void USGSenseGlove::SendHaptics(const USGBuzzCommand* BuzzCommand) void USGSenseGlove::StopVibrations()
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()}; SGCoreImpl_FSGSenseGloveImpl_StopVibrations(&InstanceContainer);
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand(&InstanceContainer, &BuzzCommandContainer);
} }
void USGSenseGlove::SendHaptics(const USGForceFeedbackCommand* ForceFeedbackCommand, bool USGSenseGlove::SendHaptics()
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand)
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGForceFeedbackCommandImpl ForceFeedbackCommandContainer{ return SGCoreImpl_FSGSenseGloveImpl_SendHaptics(&InstanceContainer);
ForceFeedbackCommand->ToForceFeedbackCommandImpl().Get()
};
FSGIC_FSGBuzzCommandImpl BuzzCommandContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGThumperCommandImpl ThumperCommandContainer{ThumperCommand->ToThumperCommandImpl()};
SGCoreImpl_FSGSenseGloveImpl_SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
&InstanceContainer, &ForceFeedbackCommandContainer, &BuzzCommandContainer, &ThumperCommandContainer);
} }
bool USGSenseGlove::GetCalibrationValues(TArray<FVector>& OutValues) bool USGSenseGlove::QueueForceFeedbackLevels(const TArray<float>& Levels01)
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_TArray_FVector OutValuesContainer; FSGIC_TArray_float Levels01Container{Levels01};
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetCalibrationValues_OutValues( return SGCoreImpl_FSGSenseGloveImpl_QueueForceFeedbackLevels(&InstanceContainer, &Levels01Container);
&InstanceContainer, &OutValuesContainer);
if (bResult)
{
OutValues = MoveTemp(OutValuesContainer.Array);
}
return bResult;
} }
void USGSenseGlove::ResetCalibrationRange() bool USGSenseGlove::QueueForceFeedbackLevel(const int32 Finger, const float Level01)
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
SGCoreImpl_FSGSenseGloveImpl_ResetCalibrationRange(&InstanceContainer); return SGCoreImpl_FSGSenseGloveImpl_QueueForceFeedbackLevel(&InstanceContainer, Finger, Level01);
}
void USGSenseGlove::ApplyCalibration(UObject* Outer, USGHandProfile*& OutProfile) const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGSenseGloveImpl_ApplyCalibration_HandProfile(&InstanceContainer, &OutProfileContainer);
OutProfile = USGHandProfile::NewHandProfile(Outer, MoveTemp(OutProfileContainer.HandProfileImpl));
}
void USGSenseGlove::ApplyCalibration(UObject* Outer, USGSenseGloveHandProfile*& OutProfile) const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveHandProfileImpl OutProfileContainer;
SGCoreImpl_FSGSenseGloveImpl_ApplyCalibration_SenseGloveHandProfile(&InstanceContainer, &OutProfileContainer);
OutProfile = USGSenseGloveHandProfile::NewSenseGloveHandProfile(
Outer, MoveTemp(OutProfileContainer.SenseGloveHandProfileImpl));
} }
void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation, void USGSenseGlove::GetGloveLocation(const FVector& ReferencePosition, const FQuat& ReferenceRotation,
@@ -819,6 +711,105 @@ void USGSenseGlove::GetWristLocation(const FVector& ReferencePosition, const FRo
OutWristRotation = OutWristRotationContainer.Quat.Rotator(); OutWristRotation = OutWristRotationContainer.Quat.Rotator();
} }
USGSenseGloveInfo* USGSenseGlove::GetGloveInfo(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveInfoImpl OutGloveInfoContainer;
SGCoreImpl_FSGSenseGloveImpl_GetGloveInfo(&InstanceContainer, &OutGloveInfoContainer);
return USGSenseGloveInfo::NewSenseGloveInfo(Outer, MoveTemp(OutGloveInfoContainer.SenseGloveInfoImpl));
}
TArray<FVector> USGSenseGlove::GetFingerThimbleOffsets() const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_TArray_FVector OutFingerThimbleOffsetsContainer;
SGCoreImpl_FSGSenseGloveImpl_GetFingerThimbleOffsets(&InstanceContainer, &OutFingerThimbleOffsetsContainer);
return MoveTemp(OutFingerThimbleOffsetsContainer.Array);
}
void USGSenseGlove::SetFingerThimbleOffset(const int32 Finger, const FVector& Offset)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FVector OffsetContainer{Offset};
SGCoreImpl_FSGSenseGloveImpl_SetFingerThimbleOffset(&InstanceContainer, Finger, &OffsetContainer);
}
bool USGSenseGlove::SupportsWristActuator() const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
return SGCoreImpl_FSGSenseGloveImpl_SupportsWristActuator(&InstanceContainer);
}
bool USGSenseGlove::GetSensorData(UObject* Outer, USGSenseGloveSensorData*& OutSensorData) const
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveSensorDataImpl OutSensorDataContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetSensorData(&InstanceContainer, &OutSensorDataContainer);
if (bResult)
{
OutSensorData = USGSenseGloveSensorData::NewSenseGloveSensorData(
Outer, MoveTemp(OutSensorDataContainer.SenseGloveSensorDataImpl));
}
return bResult;
}
bool USGSenseGlove::GetGlovePose(UObject* Outer, USGSenseGlovePose*& OutGlovePose)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_OutGlovePose(
&InstanceContainer, &OutGlovePoseContainer);
if (bResult)
{
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(
Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
}
return bResult;
}
bool USGSenseGlove::GetGlovePose(
UObject* Outer, const USGSenseGloveSensorData* SensorData, USGSenseGlovePose*& OutGlovePose)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_FSGSenseGloveSensorDataImpl SensorDataContainer{SensorData->ToSenseGloveSensorDataImpl()};
FSGIC_FSGSenseGlovePoseImpl OutGlovePoseContainer;
const bool bResult = SGCoreImpl_FSGSenseGloveImpl_GetGlovePose_SensorData_OutGlovePose(
&InstanceContainer, &SensorDataContainer, &OutGlovePoseContainer);
if (bResult)
{
OutGlovePose = USGSenseGlovePose::NewSenseGlovePose(
Outer, MoveTemp(OutGlovePoseContainer.SenseGlovePoseImpl));
}
return bResult;
}
bool USGSenseGlove::QueueVibroLevels(const TArray<float>& Amplitudes)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_TArray_float AmplitudesContainer{Amplitudes};
return SGCoreImpl_FSGSenseGloveImpl_QueueVibroLevels(&InstanceContainer, &AmplitudesContainer);
}
bool USGSenseGlove::QueueVibroLevel(const int32 Finger, const float Amplitude)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
return SGCoreImpl_FSGSenseGloveImpl_QueueVibroLevel(&InstanceContainer, Finger, Amplitude);
}
bool USGSenseGlove::QueueThumperCommand(ESGSenseGloveThumperCommand Command)
{
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
FSGIC_ESGSenseGloveThumperCommand CommandContainer{Command};
return SGCoreImpl_FSGSenseGloveImpl_QueueThumperCommand(&InstanceContainer, &CommandContainer);
}
FString USGSenseGlove::ToString() const FString USGSenseGlove::ToString() const
{ {
FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()}; FSGIC_TSharedPtr_FSGSenseGloveImpl InstanceContainer{ToSenseGloveImpl()};
@@ -1,256 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGSenseGloveHandProfile.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGHandInterpolator.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_ESGFingerSolver.h"
#include "SGInterop/SGIC_ESGThumbSolver.h"
#include "SGInterop/SGIC_FSGHandInterpolatorImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FVector.h"
struct USGSenseGloveHandProfile::FImpl
{
/************************
* Member variables
************************/
FSGSenseGloveHandProfileImpl SenseGloveHandProfileImpl;
/************************
* Owner object
************************/
USGSenseGloveHandProfile* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGSenseGloveHandProfile* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGSenseGloveHandProfile* USGSenseGloveHandProfile::NewSenseGloveHandProfile(
UObject* Outer, const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl)
{
USGSenseGloveHandProfile* Instance = NewObject<USGSenseGloveHandProfile>(Outer);
Instance->SetSenseGloveHandProfileImpl(SenseGloveHandProfileImpl);
return Instance;
}
USGSenseGloveHandProfile* USGSenseGloveHandProfile::NewSenseGloveHandProfile(UObject* Outer)
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor(&OutSenseGloveHandProfileImplContainer);
return NewSenseGloveHandProfile(Outer, MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl));
}
USGSenseGloveHandProfile* USGSenseGloveHandProfile::NewSenseGloveHandProfile(
UObject* Outer, const bool bRightHanded, const USGHandInterpolator* Interpolator,
const ESGThumbSolver ThumbSolver, const ESGFingerSolver FingerSolver, const TArray<FVector>& FingerThimbleOffset)
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_ESGThumbSolver ThumbSolverContainer{ThumbSolver};
FSGIC_ESGFingerSolver FingerSolverContainer{FingerSolver};
FSGIC_TArray_FVector FingerThimbleOffsetContainer{FingerThimbleOffset};
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor_bRightHanded_Interpolator_ThumbSolver_FingerSolver_FingerThimbleOffset(
&OutSenseGloveHandProfileImplContainer, bRightHanded, &InterpolatorContainer,
&ThumbSolverContainer, &FingerSolverContainer, &FingerThimbleOffsetContainer);
return NewSenseGloveHandProfile(Outer, MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl));
}
USGSenseGloveHandProfile* USGSenseGloveHandProfile::Default(UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_Default(&OutSenseGloveHandProfileImplContainer, bRightHanded);
return NewSenseGloveHandProfile(Outer, MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl));
}
USGSenseGloveHandProfile* USGSenseGloveHandProfile::Deserialize(UObject* Outer, const FString& SerializedString)
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGSenseGloveHandProfileImpl_Deserialize(&OutSenseGloveHandProfileImplContainer,
&SerializedStringContainer);
return NewSenseGloveHandProfile(Outer, MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl));
}
FVector USGSenseGloveHandProfile::GetDefaultThimbleOffset()
{
FSGIC_FVector OutOffsetContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_GetDefaultThimbleOffset(&OutOffsetContainer);
return MoveTemp(OutOffsetContainer.Vector);
}
USGSenseGloveHandProfile::USGSenseGloveHandProfile()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor(&OutSenseGloveHandProfileImplContainer);
Pimpl->SenseGloveHandProfileImpl = MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl);
}
USGSenseGloveHandProfile::USGSenseGloveHandProfile(const bool bRightHanded, const USGHandInterpolator* Interpolator,
const ESGThumbSolver ThumbSolver, const ESGFingerSolver FingerSolver,
const TArray<FVector>& FingerThimbleOffset)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileImplContainer;
FSGIC_FSGHandInterpolatorImpl InterpolatorContainer{Interpolator->ToHandInterpolatorImpl()};
FSGIC_ESGThumbSolver ThumbSolverContainer{ThumbSolver};
FSGIC_ESGFingerSolver FingerSolverContainer{FingerSolver};
FSGIC_TArray_FVector FingerThimbleOffsetContainer{FingerThimbleOffset};
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor_bRightHanded_Interpolator_ThumbSolver_FingerSolver_FingerThimbleOffset(
&OutSenseGloveHandProfileImplContainer, bRightHanded, &InterpolatorContainer,
&ThumbSolverContainer, &FingerSolverContainer, &FingerThimbleOffsetContainer);
Pimpl->SenseGloveHandProfileImpl = MoveTemp(OutSenseGloveHandProfileImplContainer.SenseGloveHandProfileImpl);
}
USGSenseGloveHandProfile::USGSenseGloveHandProfile(const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetSenseGloveHandProfileImpl(SenseGloveHandProfileImpl);
}
USGSenseGloveHandProfile::~USGSenseGloveHandProfile() = default;
void USGSenseGloveHandProfile::SetSenseGloveHandProfileImpl(
const FSGSenseGloveHandProfileImpl& SenseGloveHandProfileImpl)
{
FSGIC_FSGSenseGloveHandProfileImpl OutSenseGloveHandProfileContainer;
FSGIC_FSGSenseGloveHandProfileImpl RhsContainer{SenseGloveHandProfileImpl};
SGCoreImpl_FSGSenseGloveHandProfileImpl_ctor_copy(&OutSenseGloveHandProfileContainer, &RhsContainer);
Pimpl->SenseGloveHandProfileImpl = MoveTemp(OutSenseGloveHandProfileContainer.SenseGloveHandProfileImpl);
}
const FSGSenseGloveHandProfileImpl& USGSenseGloveHandProfile::ToSenseGloveHandProfileImpl() const
{
return Pimpl->SenseGloveHandProfileImpl;
}
bool USGSenseGloveHandProfile::IsRight() const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
return SGCoreImpl_FSGSenseGloveHandProfileImpl_IsRight(&InstanceContainer);
}
USGHandInterpolator* USGSenseGloveHandProfile::GetInterpolationSet(UObject* Outer) const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_FSGHandInterpolatorImpl OutSetContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_GetInterpolationSet(&InstanceContainer, &OutSetContainer);
return USGHandInterpolator::NewHandInterpolator(Outer, MoveTemp(OutSetContainer.HandInterpolatorImpl));
}
ESGThumbSolver USGSenseGloveHandProfile::GetThumbSolver() const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_ESGThumbSolver OutSolverContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_GetThumbSolver(&InstanceContainer, &OutSolverContainer);
return OutSolverContainer.Solver;
}
ESGFingerSolver USGSenseGloveHandProfile::GetFingerSolver() const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_ESGFingerSolver OutSolverContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_GetFingerSolver(&InstanceContainer, &OutSolverContainer);
return OutSolverContainer.Solver;
}
TArray<FVector> USGSenseGloveHandProfile::GetFingerThimbleOffset() const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_TArray_FVector OutOffsetContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_GetFingerThimbleOffset(&InstanceContainer, &OutOffsetContainer);
return MoveTemp(OutOffsetContainer.Array);
}
bool USGSenseGloveHandProfile::Equals(const USGSenseGloveHandProfile* SenseGloveHandProfile) const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileContainer{
SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
return SGCoreImpl_FSGSenseGloveHandProfileImpl_Equals(&InstanceContainer, &SenseGloveHandProfileContainer);
}
void USGSenseGloveHandProfile::Reset()
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
SGCoreImpl_FSGSenseGloveHandProfileImpl_Reset(&InstanceContainer);
}
FString USGSenseGloveHandProfile::SGSerialize() const
{
FSGIC_FSGSenseGloveHandProfileImpl InstanceContainer{ToSenseGloveHandProfileImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSenseGloveHandProfileImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGSenseGloveHandProfile::FImpl::FImpl(USGSenseGloveHandProfile* InOwner)
: Owner(InOwner)
{
}
USGSenseGloveHandProfile::FImpl::~FImpl() = default;
void USGSenseGloveHandProfile::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -520,14 +520,6 @@ bool USGSenseGloveInfo::Equals(const USGSenseGloveInfo* SenseGloveInfo) const
return SGCoreImpl_FSGSenseGloveInfoImpl_Equals(&InstanceContainer, &SenseGloveInfoImplContainer); return SGCoreImpl_FSGSenseGloveInfoImpl_Equals(&InstanceContainer, &SenseGloveInfoImplContainer);
} }
FString USGSenseGloveInfo::ToString() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSenseGloveInfoImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
FString USGSenseGloveInfo::ToString(const bool bShortNotation) const FString USGSenseGloveInfo::ToString(const bool bShortNotation) const
{ {
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()}; FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
@@ -536,6 +528,14 @@ FString USGSenseGloveInfo::ToString(const bool bShortNotation) const
return MoveTemp(OutStringContainer.String); return MoveTemp(OutStringContainer.String);
} }
FString USGSenseGloveInfo::ToString() const
{
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSenseGloveInfoImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
FString USGSenseGloveInfo::SGSerialize() const FString USGSenseGloveInfo::SGSerialize() const
{ {
FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()}; FSGIC_FSGSenseGloveInfoImpl InstanceContainer{ToSenseGloveInfoImpl()};
@@ -37,11 +37,9 @@
#include "Runtime/Launch/Resources/Version.h" #include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGSenseGloveHandProfile.h"
#include "SGCore/SGSenseGloveInfo.h" #include "SGCore/SGSenseGloveInfo.h"
#include "SGCoreImpl/SGExportedFunctions.h" #include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGlovePoseImpl.h" #include "SGCoreImpl/SGSenseGlovePoseImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveHandProfileImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveInfoImpl.h" #include "SGInterop/SGIC_FSGSenseGloveInfoImpl.h"
#include "SGInterop/SGIC_FSGSenseGlovePoseImpl.h" #include "SGInterop/SGIC_FSGSenseGlovePoseImpl.h"
#include "SGInterop/SGIC_FString.h" #include "SGInterop/SGIC_FString.h"
@@ -367,25 +365,14 @@ TArray<FVector> USGSenseGlovePose::GetTotalGloveAngles() const
return MoveTemp(OutAnglesContainer.Array); return MoveTemp(OutAnglesContainer.Array);
} }
TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const USGSenseGloveHandProfile* SenseGloveHandProfile) const TArray<FVector> USGSenseGlovePose::CalculateFingertips(const TArray<FVector>& FingerOffsets) const
{ {
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()}; FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
FSGIC_TArray_FVector OutFingerTipsContainer; FSGIC_TArray_FVector OutFingertipsContainer;
FSGIC_FSGSenseGloveHandProfileImpl SenseGloveHandProfileImplContainer{
SenseGloveHandProfile->ToSenseGloveHandProfileImpl()};
SGCoreImpl_FSGSenseGlovePoseImpl_CalculateFingerTips_SenseGloveHandProfileImpl(
&InstanceContainer, &OutFingerTipsContainer, &SenseGloveHandProfileImplContainer);
return MoveTemp(OutFingerTipsContainer.Array);
}
TArray<FVector> USGSenseGlovePose::CalculateFingerTips(const TArray<FVector>& FingerOffsets) const
{
FSGIC_FSGSenseGlovePoseImpl InstanceContainer{ToSenseGlovePoseImpl()};
FSGIC_TArray_FVector OutFingerTipsContainer;
FSGIC_TArray_FVector FingerOffsetsContainer{FingerOffsets}; FSGIC_TArray_FVector FingerOffsetsContainer{FingerOffsets};
SGCoreImpl_FSGSenseGlovePoseImpl_CalculateFingerTips_FingerOffsets(&InstanceContainer, &OutFingerTipsContainer, SGCoreImpl_FSGSenseGlovePoseImpl_CalculateFingertips(&InstanceContainer, &OutFingertipsContainer,
&FingerOffsetsContainer); &FingerOffsetsContainer);
return MoveTemp(OutFingerTipsContainer.Array); return MoveTemp(OutFingertipsContainer.Array);
} }
bool USGSenseGlovePose::Equals(const USGSenseGlovePose* SenseGlovePose) const bool USGSenseGlovePose::Equals(const USGSenseGlovePose* SenseGlovePose) const
@@ -271,6 +271,24 @@ TArray<TArray<float>> USGSenseGloveSensorData::GetSensorAngles() const
return MoveTemp(OutAnglesContainer.Array); return MoveTemp(OutAnglesContainer.Array);
} }
TArray<float> USGSenseGloveSensorData::GetSensorAngles(const ESGFinger Finger) const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_TArray_float OutAnglesContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGSenseGloveSensorDataImpl_GetSensorAngles_Finger(&InstanceContainer, &OutAnglesContainer,
&FingerContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<float> USGSenseGloveSensorData::GetAngleSequence() const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_TArray_float OutSequenceContainer;
SGCoreImpl_FSGSenseGloveSensorDataImpl_GetAngleSequence(&InstanceContainer, &OutSequenceContainer);
return MoveTemp(OutSequenceContainer.Array);
}
FQuat USGSenseGloveSensorData::GetImuRotationQ() const FQuat USGSenseGloveSensorData::GetImuRotationQ() const
{ {
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()}; FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
@@ -299,24 +317,6 @@ bool USGSenseGloveSensorData::IsImuParsed() const
return SGCoreImpl_FSGSenseGloveSensorDataImpl_IsImuParsed(&InstanceContainer); return SGCoreImpl_FSGSenseGloveSensorDataImpl_IsImuParsed(&InstanceContainer);
} }
TArray<float> USGSenseGloveSensorData::GetSensorAngles(const ESGFinger Finger) const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_TArray_float OutAnglesContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGSenseGloveSensorDataImpl_GetSensorAngles_Finger(&InstanceContainer, &OutAnglesContainer,
&FingerContainer);
return MoveTemp(OutAnglesContainer.Array);
}
TArray<float> USGSenseGloveSensorData::GetAngleSequence() const
{
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
FSGIC_TArray_float OutSequenceContainer;
SGCoreImpl_FSGSenseGloveSensorDataImpl_GetAngleSequence(&InstanceContainer, &OutSequenceContainer);
return MoveTemp(OutSequenceContainer.Array);
}
bool USGSenseGloveSensorData::Equals(const USGSenseGloveSensorData* SenseGloveSensorData) const bool USGSenseGloveSensorData::Equals(const USGSenseGloveSensorData* SenseGloveSensorData) const
{ {
FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()}; FSGIC_FSGSenseGloveSensorDataImpl InstanceContainer{ToSenseGloveSensorDataImpl()};
@@ -0,0 +1,172 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGSenseGloveSensorNormalizer.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSenseGloveSensorNormalizerImpl.h"
#include "SGInterop/SGIC_FSGSenseGloveSensorNormalizerImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_bool.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGUtils/SGArrayUtils.h"
struct USGSenseGloveSensorNormalizer::FImpl
{
/************************
* Member variables
************************/
FSGSenseGloveSensorNormalizerImpl SenseGloveSensorNormalizerImpl;
/************************
* Owner object
************************/
USGSenseGloveSensorNormalizer* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGSenseGloveSensorNormalizer* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGSenseGloveSensorNormalizer* USGSenseGloveSensorNormalizer::NewSenseGloveSensorNormalizer(
UObject* Outer, const FSGSenseGloveSensorNormalizerImpl& SenseGloveSensorNormalizerImpl)
{
USGSenseGloveSensorNormalizer* Instance = NewObject<USGSenseGloveSensorNormalizer>(Outer);
Instance->SetSenseGloveSensorNormalizerImpl(SenseGloveSensorNormalizerImpl);
return Instance;
}
USGSenseGloveSensorNormalizer* USGSenseGloveSensorNormalizer::NewSenseGloveSensorNormalizer(UObject* Outer)
{
FSGIC_FSGSenseGloveSensorNormalizerImpl OutSenseGloveSensorNormalizerImplContainer;
SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_ctor(&OutSenseGloveSensorNormalizerImplContainer);
return NewSenseGloveSensorNormalizer(
Outer, MoveTemp(OutSenseGloveSensorNormalizerImplContainer.SenseGloveSensorNormalizerImpl));
}
USGSenseGloveSensorNormalizer* USGSenseGloveSensorNormalizer::NewSenseGloveSensorNormalizer(
UObject* Outer, const bool bRightHanded)
{
FSGIC_FSGSenseGloveSensorNormalizerImpl OutSenseGloveSensorNormalizerImplContainer;
SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_ctor_bRightHanded(
&OutSenseGloveSensorNormalizerImplContainer, bRightHanded);
return NewSenseGloveSensorNormalizer(
Outer, MoveTemp(OutSenseGloveSensorNormalizerImplContainer.SenseGloveSensorNormalizerImpl));
}
USGSenseGloveSensorNormalizer::USGSenseGloveSensorNormalizer()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSenseGloveSensorNormalizerImpl OutSenseGloveSensorNormalizerImplContainer;
SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_ctor(&OutSenseGloveSensorNormalizerImplContainer);
Pimpl->SenseGloveSensorNormalizerImpl = MoveTemp(
OutSenseGloveSensorNormalizerImplContainer.SenseGloveSensorNormalizerImpl);
}
USGSenseGloveSensorNormalizer::USGSenseGloveSensorNormalizer(bool bRightHanded)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSenseGloveSensorNormalizerImpl OutSenseGloveSensorNormalizerImplContainer;
SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_ctor_bRightHanded(
&OutSenseGloveSensorNormalizerImplContainer, bRightHanded);
Pimpl->SenseGloveSensorNormalizerImpl =
MoveTemp(OutSenseGloveSensorNormalizerImplContainer.SenseGloveSensorNormalizerImpl);
}
USGSenseGloveSensorNormalizer::USGSenseGloveSensorNormalizer(
const FSGSenseGloveSensorNormalizerImpl& SenseGloveSensorNormalizerImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetSenseGloveSensorNormalizerImpl(SenseGloveSensorNormalizerImpl);
}
USGSenseGloveSensorNormalizer::~USGSenseGloveSensorNormalizer() = default;
void USGSenseGloveSensorNormalizer::SetSenseGloveSensorNormalizerImpl(
const FSGSenseGloveSensorNormalizerImpl& SenseGloveSensorNormalizerImpl)
{
FSGIC_FSGSenseGloveSensorNormalizerImpl OutSenseGloveSensorNormalizerContainer;
FSGIC_FSGSenseGloveSensorNormalizerImpl RhsContainer{SenseGloveSensorNormalizerImpl};
SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_ctor_copy(&OutSenseGloveSensorNormalizerContainer, &RhsContainer);
Pimpl->SenseGloveSensorNormalizerImpl = MoveTemp(
OutSenseGloveSensorNormalizerContainer.SenseGloveSensorNormalizerImpl);
}
const FSGSenseGloveSensorNormalizerImpl& USGSenseGloveSensorNormalizer::ToSenseGloveSensorNormalizerImpl() const
{
return Pimpl->SenseGloveSensorNormalizerImpl;
}
float USGSenseGloveSensorNormalizer::NormalizeFlexion(const int32 Finger, const float SumFlexionAngles) const
{
FSGIC_FSGSenseGloveSensorNormalizerImpl InstanceContainer{ToSenseGloveSensorNormalizerImpl()};
return SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_NormalizeFlexion(
&InstanceContainer, Finger, SumFlexionAngles);
}
float USGSenseGloveSensorNormalizer::NormalizeAbduction(const int32 Finger, const float SumAbductionAngles) const
{
FSGIC_FSGSenseGloveSensorNormalizerImpl InstanceContainer{ToSenseGloveSensorNormalizerImpl()};
return SGCoreImpl_FSGSenseGloveSensorNormalizerImpl_NormalizeAbduction(
&InstanceContainer, Finger, SumAbductionAngles);
}
USGSenseGloveSensorNormalizer::FImpl::FImpl(USGSenseGloveSensorNormalizer* InOwner)
: Owner(InOwner)
{
}
USGSenseGloveSensorNormalizer::FImpl::~FImpl() = default;
void USGSenseGloveSensorNormalizer::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,228 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGSensorNormalization.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGSensorNormalizationImpl.h"
#include "SGInterop/SGIC_FSGSensorNormalizationImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_bool.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGUtils/SGArrayUtils.h"
struct USGSensorNormalization::FImpl
{
/************************
* Member variables
************************/
FSGSensorNormalizationImpl SensorNormalizationImpl;
/************************
* Owner object
************************/
USGSensorNormalization* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGSensorNormalization* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGSensorNormalization* USGSensorNormalization::NewSensorNormalization(
UObject* Outer, const FSGSensorNormalizationImpl& SensorNormalizationImpl)
{
USGSensorNormalization* Instance = NewObject<USGSensorNormalization>(Outer);
Instance->SetSensorNormalizationImpl(SensorNormalizationImpl);
return Instance;
}
USGSensorNormalization* USGSensorNormalization::NewSensorNormalization(UObject* Outer)
{
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizationImplContainer;
SGCoreImpl_FSGSensorNormalizationImpl_ctor(&OutSensorNormalizationImplContainer);
return NewSensorNormalization(Outer, MoveTemp(OutSensorNormalizationImplContainer.SensorNormalizationImpl));
}
USGSensorNormalization* USGSensorNormalization::NewSensorNormalization(
UObject* Outer, const TArray<float>& MovementRanges)
{
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizationImplContainer;
FSGIC_TArray_float MovementRangesContainer{MovementRanges};
SGCoreImpl_FSGSensorNormalizationImpl_ctor_MovementRanges(
&OutSensorNormalizationImplContainer, &MovementRangesContainer);
return NewSensorNormalization(Outer, MoveTemp(OutSensorNormalizationImplContainer.SensorNormalizationImpl));
}
USGSensorNormalization::USGSensorNormalization()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizationImplContainer;
SGCoreImpl_FSGSensorNormalizationImpl_ctor(&OutSensorNormalizationImplContainer);
Pimpl->SensorNormalizationImpl = MoveTemp(OutSensorNormalizationImplContainer.SensorNormalizationImpl);
}
USGSensorNormalization::USGSensorNormalization(const TArray<float>& MovementRanges)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizationImplContainer;
FSGIC_TArray_float MovementRangesContainer{MovementRanges};
SGCoreImpl_FSGSensorNormalizationImpl_ctor_MovementRanges(
&OutSensorNormalizationImplContainer, &MovementRangesContainer);
Pimpl->SensorNormalizationImpl = MoveTemp(OutSensorNormalizationImplContainer.SensorNormalizationImpl);
}
USGSensorNormalization::USGSensorNormalization(const FSGSensorNormalizationImpl& SensorNormalizationImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetSensorNormalizationImpl(SensorNormalizationImpl);
}
USGSensorNormalization::~USGSensorNormalization() = default;
void USGSensorNormalization::SetSensorNormalizationImpl(const FSGSensorNormalizationImpl& SensorNormalizationImpl)
{
FSGIC_FSGSensorNormalizationImpl OutSensorNormalizationContainer;
FSGIC_FSGSensorNormalizationImpl RhsContainer{SensorNormalizationImpl};
SGCoreImpl_FSGSensorNormalizationImpl_ctor_copy(&OutSensorNormalizationContainer, &RhsContainer);
Pimpl->SensorNormalizationImpl = MoveTemp(OutSensorNormalizationContainer.SensorNormalizationImpl);
}
const FSGSensorNormalizationImpl& USGSensorNormalization::ToSensorNormalizationImpl() const
{
return Pimpl->SensorNormalizationImpl;
}
bool USGSensorNormalization::CollectsNormalization() const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_CollectsNormalization(&InstanceContainer);
}
void USGSensorNormalization::SetCollectNormalization(const bool bCollectNormalization)
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
SGCoreImpl_FSGSensorNormalizationImpl_SetCollectNormalization(
&InstanceContainer, bCollectNormalization);
}
int32 USGSensorNormalization::GetLength() const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_GetLength(&InstanceContainer);
}
int32 USGSensorNormalization::GetMoveCount() const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_GetMoveCount(&InstanceContainer);
}
bool USGSensorNormalization::AllSensorsMoving() const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_AllSensorsMoving(&InstanceContainer);
}
void USGSensorNormalization::ResetNormalization()
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_ResetNormalization(&InstanceContainer);
}
void USGSensorNormalization::UpdateNormalization(const float Value, const int32 Index)
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_UpdateNormalization(
&InstanceContainer, Value, Index);
}
float USGSensorNormalization::NormalizeValue(const float Value, const int32 Index)
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_NormalizeValue(
&InstanceContainer, Value, Index);
}
TArray<float> USGSensorNormalization::NormalizeValues(const TArray<float>& Values)
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
FSGIC_TArray_float ValuesContainer{Values};
FSGIC_TArray_float OutNormalizedValuesContainer;
SGCoreImpl_FSGSensorNormalizationImpl_NormalizeValues(
&InstanceContainer, &ValuesContainer, &OutNormalizedValuesContainer);
return MoveTemp(OutNormalizedValuesContainer.Array);
}
bool USGSensorNormalization::MovedEnough(const int32 Index) const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_MovedEnough(&InstanceContainer, Index);
}
float USGSensorNormalization::Denormalize(const float Value01, const int32 Index, const float FallbackValue) const
{
FSGIC_FSGSensorNormalizationImpl InstanceContainer{ToSensorNormalizationImpl()};
return SGCoreImpl_FSGSensorNormalizationImpl_Denormalize(
&InstanceContainer, Value01, Index, FallbackValue);
}
USGSensorNormalization::FImpl::FImpl(USGSensorNormalization* InOwner)
: Owner(InOwner)
{
}
USGSensorNormalization::FImpl::~FImpl() = default;
void USGSensorNormalization::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,262 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGSensorRange.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGSensorRangeImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_TArray_FVector.h"
struct USGSensorRange::FImpl
{
/************************
* Member variables
************************/
FSGSensorRangeImpl SensorRangeImpl;
/************************
* Owner object
************************/
USGSensorRange* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGSensorRange* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGSensorRange* USGSensorRange::NewSensorRange(UObject* Outer, const FSGSensorRangeImpl& SensorRangeImpl)
{
USGSensorRange* Instance = NewObject<USGSensorRange>(Outer);
Instance->SetSensorRangeImpl(SensorRangeImpl);
return Instance;
}
USGSensorRange* USGSensorRange::NewSensorRange(UObject* Outer)
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
SGCoreImpl_FSGSensorRangeImpl_ctor(&OutSensorRangeImplContainer);
return NewSensorRange(Outer, MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl));
}
USGSensorRange* USGSensorRange::NewSensorRange(UObject* Outer,
const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues)
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
FSGIC_TArray_FVector MinValuesContainer{MinValues};
FSGIC_TArray_FVector MaxValuesContainer{MaxValues};
SGCoreImpl_FSGSensorRangeImpl_ctor_MinValues_MaxValues(
&OutSensorRangeImplContainer, &MinValuesContainer, &MaxValuesContainer);
return NewSensorRange(Outer, MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl));
}
USGSensorRange* USGSensorRange::ForCalibration(UObject* Outer)
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
SGCoreImpl_FSGSensorRangeImpl_ForCalibration(&OutSensorRangeImplContainer);
return NewSensorRange(Outer, MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl));
}
USGSensorRange* USGSensorRange::Deserialize(UObject* Outer, const FString& SerializedString)
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
FSGIC_FString SerializedStringContainer{SerializedString};
SGCoreImpl_FSGSensorRangeImpl_Deserialize(&OutSensorRangeImplContainer, &SerializedStringContainer);
return NewSensorRange(Outer, MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl));
}
void USGSensorRange::CheckMax(const FVector CurrentValues, FVector& OutMaxValues)
{
FSGIC_FVector CurrentValuesContainer{CurrentValues};
FSGIC_FVector OutMaxValuesContainer;
SGCoreImpl_FSGSensorRangeImpl_CheckMax(&CurrentValuesContainer, &OutMaxValuesContainer);
OutMaxValues = MoveTemp(OutMaxValuesContainer.Vector);
}
void USGSensorRange::CheckMin(const FVector& CurrentValues, FVector& OutMinValues)
{
FSGIC_FVector CurrentValuesContainer{CurrentValues};
FSGIC_FVector OutMinValuesContainer;
SGCoreImpl_FSGSensorRangeImpl_CheckMin(&CurrentValuesContainer, &OutMinValuesContainer);
OutMinValues = MoveTemp(OutMinValuesContainer.Vector);
}
USGSensorRange::USGSensorRange()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
SGCoreImpl_FSGSensorRangeImpl_ctor(&OutSensorRangeImplContainer);
Pimpl->SensorRangeImpl = MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl);
}
USGSensorRange::USGSensorRange(const TArray<FVector>& MinValues, const TArray<FVector>& MaxValues)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGSensorRangeImpl OutSensorRangeImplContainer;
FSGIC_TArray_FVector MinValuesContainer{MinValues};
FSGIC_TArray_FVector MaxValuesContainer{MaxValues};
SGCoreImpl_FSGSensorRangeImpl_ctor_MinValues_MaxValues(
&OutSensorRangeImplContainer, &MinValuesContainer, &MaxValuesContainer);
Pimpl->SensorRangeImpl = MoveTemp(OutSensorRangeImplContainer.SensorRangeImpl);
}
USGSensorRange::USGSensorRange(const FSGSensorRangeImpl& SensorRangeImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetSensorRangeImpl(SensorRangeImpl);
}
USGSensorRange::~USGSensorRange() = default;
void USGSensorRange::SetSensorRangeImpl(const FSGSensorRangeImpl& SensorRangeImpl)
{
FSGIC_FSGSensorRangeImpl OutSensorRangeContainer;
FSGIC_FSGSensorRangeImpl RhsContainer{SensorRangeImpl};
SGCoreImpl_FSGSensorRangeImpl_ctor_copy(&OutSensorRangeContainer, &RhsContainer);
Pimpl->SensorRangeImpl = MoveTemp(OutSensorRangeContainer.SensorRangeImpl);
}
const FSGSensorRangeImpl& USGSensorRange::ToSensorRangeImpl() const
{
return Pimpl->SensorRangeImpl;
}
TArray<FVector> USGSensorRange::GetMinValues() const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector OutMinValuesContainer;
SGCoreImpl_FSGSensorRangeImpl_GetMinValues(&InstanceContainer, &OutMinValuesContainer);
return MoveTemp(OutMinValuesContainer.Array);
}
void USGSensorRange::SetMinValues(const TArray<FVector>& Values)
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector MinValuesContainer{Values};
SGCoreImpl_FSGSensorRangeImpl_SetMinValues(&InstanceContainer, &MinValuesContainer);
}
TArray<FVector> USGSensorRange::GetMaxValues() const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector OutMaxValuesContainer;
SGCoreImpl_FSGSensorRangeImpl_GetMaxValues(&InstanceContainer, &OutMaxValuesContainer);
return MoveTemp(OutMaxValuesContainer.Array);
}
void USGSensorRange::SetMaxValues(const TArray<FVector>& Values)
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector MaxValuesContainer{Values};
SGCoreImpl_FSGSensorRangeImpl_SetMaxValues(&InstanceContainer, &MaxValuesContainer);
}
TArray<FVector> USGSensorRange::GetRange() const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector OutRangeContainer;
SGCoreImpl_FSGSensorRangeImpl_GetRange(&InstanceContainer, &OutRangeContainer);
return MoveTemp(OutRangeContainer.Array);
}
void USGSensorRange::UpdateRange()
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
SGCoreImpl_FSGSensorRangeImpl_UpdateRange(&InstanceContainer);
}
void USGSensorRange::CheckForExtremes(const TArray<FVector>& OtherValues)
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_TArray_FVector OtherValuesContainer{OtherValues};
SGCoreImpl_FSGSensorRangeImpl_CheckForExtremes(&InstanceContainer, &OtherValuesContainer);
}
FString USGSensorRange::RangeString(const bool bYOnly) const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSensorRangeImpl_RangeString(&InstanceContainer, &OutStringContainer, bYOnly);
return MoveTemp(OutStringContainer.String);
}
FString USGSensorRange::ToString(const bool bYOnly) const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSensorRangeImpl_ToString(&InstanceContainer, &OutStringContainer, bYOnly);
return MoveTemp(OutStringContainer.String);
}
FString USGSensorRange::SGSerialize() const
{
FSGIC_FSGSensorRangeImpl InstanceContainer{ToSensorRangeImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGSensorRangeImpl_Serialize(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGSensorRange::FImpl::FImpl(USGSensorRange* InOwner)
: Owner(InOwner)
{
}
USGSensorRange::FImpl::~FImpl() = default;
void USGSensorRange::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -0,0 +1,225 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGThresholdCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGThresholdCommandImpl.h"
#include "SGInterop/SGIC_FSGThresholdCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TArray_bool.h"
#include "SGInterop/SGIC_TArray_float.h"
#include "SGUtils/SGArrayUtils.h"
struct USGThresholdCommand::FImpl
{
/************************
* Member variables
************************/
FSGThresholdCommandImpl ThresholdCommandImpl;
/************************
* Owner object
************************/
USGThresholdCommand* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGThresholdCommand* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGThresholdCommand* USGThresholdCommand::NewThresholdCommand(
UObject* Outer, const FSGThresholdCommandImpl& ThresholdCommandImpl)
{
USGThresholdCommand* Instance = NewObject<USGThresholdCommand>(Outer);
Instance->SetThresholdCommandImpl(ThresholdCommandImpl);
return Instance;
}
USGThresholdCommand* USGThresholdCommand::NewThresholdCommand(UObject* Outer)
{
FSGIC_FSGThresholdCommandImpl OutThresholdCommandImplContainer;
SGCoreImpl_FSGThresholdCommandImpl_ctor(&OutThresholdCommandImplContainer);
return NewThresholdCommand(Outer, MoveTemp(OutThresholdCommandImplContainer.ThresholdCommandImpl));
}
USGThresholdCommand* USGThresholdCommand::NewThresholdCommand(
UObject* Outer, const TArray<bool>& AffectedFingers, const TArray<float>& ThresholdValues)
{
FSGIC_FSGThresholdCommandImpl OutThresholdCommandImplContainer;
FSGIC_TArray_bool AffectedFingersContainer{AffectedFingers};
FSGIC_TArray_float ThresholdValuesContainer{ThresholdValues};
SGCoreImpl_FSGThresholdCommandImpl_ctor_AffectedFingers_ThresholdValues(
&OutThresholdCommandImplContainer, &AffectedFingersContainer, &ThresholdValuesContainer);
return NewThresholdCommand(Outer, MoveTemp(OutThresholdCommandImplContainer.ThresholdCommandImpl));
}
USGThresholdCommand::USGThresholdCommand()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGThresholdCommandImpl OutThresholdCommandImplContainer;
SGCoreImpl_FSGThresholdCommandImpl_ctor(&OutThresholdCommandImplContainer);
Pimpl->ThresholdCommandImpl = MoveTemp(OutThresholdCommandImplContainer.ThresholdCommandImpl);
}
USGThresholdCommand::USGThresholdCommand(const TArray<bool>& AffectedFingers, const TArray<float>& ThresholdValues)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGThresholdCommandImpl OutThresholdCommandImplContainer;
FSGIC_TArray_bool AffectedFingersContainer{AffectedFingers};
FSGIC_TArray_float ThresholdValuesContainer{ThresholdValues};
SGCoreImpl_FSGThresholdCommandImpl_ctor_AffectedFingers_ThresholdValues(
&OutThresholdCommandImplContainer, &AffectedFingersContainer, &ThresholdValuesContainer);
Pimpl->ThresholdCommandImpl = MoveTemp(OutThresholdCommandImplContainer.ThresholdCommandImpl);
}
USGThresholdCommand::USGThresholdCommand(const FSGThresholdCommandImpl& ThresholdCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetThresholdCommandImpl(ThresholdCommandImpl);
}
USGThresholdCommand::~USGThresholdCommand() = default;
void USGThresholdCommand::SetThresholdCommandImpl(const FSGThresholdCommandImpl& ThresholdCommandImpl)
{
FSGIC_FSGThresholdCommandImpl OutThresholdCommandContainer;
FSGIC_FSGThresholdCommandImpl RhsContainer{ThresholdCommandImpl};
SGCoreImpl_FSGThresholdCommandImpl_ctor_copy(&OutThresholdCommandContainer, &RhsContainer);
Pimpl->ThresholdCommandImpl = MoveTemp(OutThresholdCommandContainer.ThresholdCommandImpl);
}
const FSGThresholdCommandImpl& USGThresholdCommand::ToThresholdCommandImpl() const
{
return Pimpl->ThresholdCommandImpl;
}
float USGThresholdCommand::GetThreshold(const int32 Finger) const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
return SGCoreImpl_FSGThresholdCommandImpl_GetThreshold(&InstanceContainer, Finger);
}
void USGThresholdCommand::SetThreshold(const int32 Finger, const float ThresholdValue)
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
return SGCoreImpl_FSGThresholdCommandImpl_SetThreshold(&InstanceContainer, Finger, ThresholdValue);
}
TArray<float> USGThresholdCommand::GetThresholds() const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
FSGIC_TArray_float ThresholdsContainer;
SGCoreImpl_FSGThresholdCommandImpl_GetThresholds(&InstanceContainer, &ThresholdsContainer);
return MoveTemp(ThresholdsContainer.Array);
}
void USGThresholdCommand::SetThresholds(const TArray<bool>& AffectedFingers, const TArray<float>& ThresholdValues)
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
FSGIC_TArray_bool AffectedFingersContainer{AffectedFingers};
FSGIC_TArray_float ThresholdValuesContainer{ThresholdValues};
SGCoreImpl_FSGThresholdCommandImpl_SetThresholds(
&InstanceContainer, &AffectedFingersContainer, &ThresholdValuesContainer);
}
bool USGThresholdCommand::GetFingerActive(const int32 Finger) const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
return SGCoreImpl_FSGThresholdCommandImpl_GetFingerActive(&InstanceContainer, Finger);
}
TArray<bool> USGThresholdCommand::GetActiveFingers() const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
FSGIC_TArray_bool OutActiveFingersContainer;
SGCoreImpl_FSGThresholdCommandImpl_GetActiveFingers(&InstanceContainer, &OutActiveFingersContainer);
return MoveTemp(OutActiveFingersContainer.Array);
}
void USGThresholdCommand::ClearThreshold(const int32 Finger)
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
SGCoreImpl_FSGThresholdCommandImpl_ClearThreshold(&InstanceContainer, Finger);
}
void USGThresholdCommand::ClearThresholds()
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
SGCoreImpl_FSGThresholdCommandImpl_ClearThresholds(&InstanceContainer);
}
bool USGThresholdCommand::Equals(const USGThresholdCommand* ThresholdCommand) const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
FSGIC_FSGThresholdCommandImpl ThresholdCommandContainer{ThresholdCommand->ToThresholdCommandImpl()};
return SGCoreImpl_FSGThresholdCommandImpl_Equals(&InstanceContainer, &ThresholdCommandContainer);
}
FString USGThresholdCommand::ToString() const
{
FSGIC_FSGThresholdCommandImpl InstanceContainer{ToThresholdCommandImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGThresholdCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGThresholdCommand::FImpl::FImpl(USGThresholdCommand* InOwner)
: Owner(InOwner)
{
}
USGThresholdCommand::FImpl::~FImpl() = default;
void USGThresholdCommand::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,187 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGThumperCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
struct USGThumperCommand::FImpl
{
/************************
* Member variables
************************/
FSGThumperCommandImpl ThumperCommandImpl;
/************************
* Owner object
************************/
USGThumperCommand* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGThumperCommand* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGThumperCommand* USGThumperCommand::NewThumperCommand(UObject* Outer, const FSGThumperCommandImpl& ThumperCommandImpl)
{
USGThumperCommand* Instance = NewObject<USGThumperCommand>(Outer);
Instance->SetThumperCommandImpl(ThumperCommandImpl);
return Instance;
}
USGThumperCommand* USGThumperCommand::NewThumperCommand(UObject* Outer)
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor(&OutThumperCommandImplContainer);
return NewThumperCommand(Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
USGThumperCommand* USGThumperCommand::NewThumperCommand(UObject* Outer, const int32 Magnitude)
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor_Magnitude(&OutThumperCommandImplContainer, Magnitude);
return NewThumperCommand(Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
USGThumperCommand* USGThumperCommand::Off(UObject* Outer)
{
FSGIC_FSGThumperCommandImpl OutContainer;
SGCoreImpl_FSGThumperCommandImpl_Off(&OutContainer);
return NewThumperCommand(Outer, OutContainer.ThumperCommandImpl);
}
USGThumperCommand::USGThumperCommand()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor(&OutThumperCommandImplContainer);
Pimpl->ThumperCommandImpl = MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl);
}
USGThumperCommand::USGThumperCommand(const int32 Magnitude)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_ctor_Magnitude(&OutThumperCommandImplContainer, Magnitude);
Pimpl->ThumperCommandImpl = MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl);
}
USGThumperCommand::USGThumperCommand(const FSGThumperCommandImpl& ThumperCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetThumperCommandImpl(ThumperCommandImpl);
}
USGThumperCommand::~USGThumperCommand() = default;
void USGThumperCommand::SetThumperCommandImpl(const FSGThumperCommandImpl& ThumperCommandImpl)
{
FSGIC_FSGThumperCommandImpl OutThumperCommandContainer;
FSGIC_FSGThumperCommandImpl RhsContainer{ThumperCommandImpl};
SGCoreImpl_FSGThumperCommandImpl_ctor_copy(&OutThumperCommandContainer, &RhsContainer);
Pimpl->ThumperCommandImpl = MoveTemp(RhsContainer.ThumperCommandImpl);
}
const FSGThumperCommandImpl& USGThumperCommand::ToThumperCommandImpl() const
{
return Pimpl->ThumperCommandImpl;
}
int32 USGThumperCommand::GetMagnitude() const
{
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ToThumperCommandImpl()};
return SGCoreImpl_FSGThumperCommandImpl_GetMagnitude(&ThumperCommandImplContainer);
}
void USGThumperCommand::SetMagnitude(const int32 Magnitude)
{
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ToThumperCommandImpl()};
SGCoreImpl_FSGThumperCommandImpl_SetMagnitude(&ThumperCommandImplContainer, Magnitude);
}
USGThumperCommand* USGThumperCommand::Copy(UObject* Outer) const
{
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_Copy(&InstanceContainer, &OutThumperCommandImplContainer);
return NewThumperCommand(Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
USGThumperCommand* USGThumperCommand::Merge(UObject* Outer, const USGThumperCommand* ThumperCommand) const
{
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ThumperCommand->ToThumperCommandImpl()};
FSGIC_FSGThumperCommandImpl OutThumperCommandImplContainer;
SGCoreImpl_FSGThumperCommandImpl_Merge(&InstanceContainer, &OutThumperCommandImplContainer,
&ThumperCommandImplContainer);
return NewThumperCommand(Outer, MoveTemp(OutThumperCommandImplContainer.ThumperCommandImpl));
}
bool USGThumperCommand::Equals(const USGThumperCommand* ThumperCommand) const
{
FSGIC_FSGThumperCommandImpl InstanceContainer{ToThumperCommandImpl()};
FSGIC_FSGThumperCommandImpl ThumperCommandImplContainer{ThumperCommand->ToThumperCommandImpl()};
return SGCoreImpl_FSGThumperCommandImpl_Equals(&InstanceContainer, &ThumperCommandImplContainer);
}
USGThumperCommand::FImpl::FImpl(USGThumperCommand* InOwner)
: Owner(InOwner)
{
}
USGThumperCommand::FImpl::~FImpl() = default;
void USGThumperCommand::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -1,218 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGTimedBuzzCommand.h"
#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"
#include "SGInterop/SGIC_FSGFingerCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedBuzzCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
UObject* Outer, const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
{
USGTimedBuzzCommand* Instance = NewObject<USGTimedBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(TimedBuzzCommandImpl);
return Instance;
}
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
UObject* Outer, TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
{
USGTimedBuzzCommand* Instance = NewObject<USGTimedBuzzCommand>(Outer);
Instance->SetFingerCommandImpl(MoveTemp(TimedBuzzCommandImpl));
return Instance;
}
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(UObject* Outer)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor(&OutSharedPtrContainer);
return NewTimedBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
UObject* Outer,
const ESGFinger Finger, const int32 Magnitude, const float DurationSeconds, const float StartTimeSeconds)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_Finger_Magnitude_DurationSeconds_StartTimeSeconds_MakeShared(
&OutSharedPtrContainer, &FingerContainer, Magnitude, DurationSeconds, StartTimeSeconds);
return NewTimedBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand* USGTimedBuzzCommand::NewTimedBuzzCommand(
UObject* Outer,
const USGBuzzCommand* BaseCommand, const float DurationSeconds, const float StartTimeSeconds)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl BaseCommandContainer{BaseCommand->ToBuzzCommandImpl().Get()};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_BaseCommand_DurationSeconds_StartTimeSeconds_MakeShared(
&OutSharedPtrContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
return NewTimedBuzzCommand(Outer, OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand::USGTimedBuzzCommand()
: USGBuzzCommand()
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutTimedBuzzCommandImplContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_MakeShared(&OutTimedBuzzCommandImplContainer);
SetFingerCommandImpl(OutTimedBuzzCommandImplContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand::USGTimedBuzzCommand(const ESGFinger Finger, const int32 Magnitude,
const float DurationSeconds, const float StartTimeSeconds)
: USGBuzzCommand()
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_ESGFinger FingerContainer{Finger};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_Finger_Magnitude_DurationSeconds_StartTimeSeconds_MakeShared(
&OutSharedPtrContainer, &FingerContainer, Magnitude, DurationSeconds, StartTimeSeconds);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand::USGTimedBuzzCommand(const USGBuzzCommand* BaseCommand,
const float DurationSeconds, const float StartTimeSeconds)
: USGBuzzCommand()
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl OutSharedPtrContainer;
FSGIC_FSGBuzzCommandImpl BaseCommandContainer{BaseCommand->ToBuzzCommandImpl().Get()};
SGCoreImpl_FSGTimedBuzzCommandImpl_ctor_BaseCommand_DurationSeconds_StartTimeSeconds_MakeShared(
&OutSharedPtrContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
SetFingerCommandImpl(OutSharedPtrContainer.Ptr.ToSharedRef());
}
USGTimedBuzzCommand::USGTimedBuzzCommand(const FSGTimedBuzzCommandImpl& TimedBuzzCommandImpl)
: USGBuzzCommand(TimedBuzzCommandImpl)
{
}
USGTimedBuzzCommand::USGTimedBuzzCommand(TSharedRef<FSGTimedBuzzCommandImpl> TimedBuzzCommandImpl)
: USGBuzzCommand(MoveTemp(TimedBuzzCommandImpl))
{
}
USGTimedBuzzCommand::~USGTimedBuzzCommand() = default;
TSharedRef<FSGTimedBuzzCommandImpl> USGTimedBuzzCommand::ToTimedBuzzCommandImpl() const
{
return FSGFingerCommandImplCast::ToTimedBuzzCommandImpl(ToFingerCommandImpl());
}
USGBuzzCommand* USGTimedBuzzCommand::Copy(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_Copy(&InstanceContainer, &OutBuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
USGBuzzCommand* USGTimedBuzzCommand::Merge(UObject* Outer, const USGBuzzCommand* BuzzCommand) const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl BuzzCommandImplContainer{BuzzCommand->ToBuzzCommandImpl().Get()};
FSGIC_FSGBuzzCommandImpl OutBuzzCommandImplContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_Merge(&InstanceContainer, &OutBuzzCommandImplContainer,
&BuzzCommandImplContainer);
return NewBuzzCommand(Outer, MoveTemp(OutBuzzCommandImplContainer.BuzzCommandImpl));
}
USGBuzzCommand* USGTimedBuzzCommand::GetBaseCommand(UObject* Outer) const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
FSGIC_FSGBuzzCommandImpl OutCommandContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_GetBaseCommand(&InstanceContainer, &OutCommandContainer);
return NewBuzzCommand(Outer, MoveTemp(OutCommandContainer.BuzzCommandImpl));
}
float USGTimedBuzzCommand::GetDuration() const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
return SGCoreImpl_FSGTimedBuzzCommandImpl_GetDuration(&InstanceContainer);
}
float USGTimedBuzzCommand::GetElapsedTime() const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
return SGCoreImpl_FSGTimedBuzzCommandImpl_GetElapsedTime(&InstanceContainer);
}
bool USGTimedBuzzCommand::HasTimeElapsed() const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
return SGCoreImpl_FSGTimedBuzzCommandImpl_HasTimeElapsed(&InstanceContainer);
}
float USGTimedBuzzCommand::NormalizedTime(const bool bClamp01) const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
return SGCoreImpl_FSGTimedBuzzCommandImpl_NormalizedTime(&InstanceContainer, bClamp01);
}
void USGTimedBuzzCommand::ResetTiming()
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
SGCoreImpl_FSGTimedBuzzCommandImpl_ResetTiming(&InstanceContainer);
}
void USGTimedBuzzCommand::UpdateTiming(const float DeltaSeconds)
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
SGCoreImpl_FSGTimedBuzzCommandImpl_UpdateTiming(&InstanceContainer, DeltaSeconds);
}
FString USGTimedBuzzCommand::ToString() const
{
FSGIC_TSharedPtr_FSGTimedBuzzCommandImpl InstanceContainer{ToTimedBuzzCommandImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGTimedBuzzCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
@@ -1,229 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGTimedThumpCommand.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGCore/SGThumperCommand.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FSGThumperCommandImpl.h"
#include "SGInterop/SGIC_FSGTimedThumpCommandImpl.h"
#include "SGInterop/SGIC_FString.h"
struct USGTimedThumpCommand::FImpl
{
/************************
* Member variables
************************/
FSGTimedThumpCommandImpl TimedThumpCommandImpl;
/************************
* Owner object
************************/
USGTimedThumpCommand* Owner;
/************************
* Constructor / Destructor
************************/
explicit FImpl(USGTimedThumpCommand* InOwner);
~FImpl();
/************************
* Default copy constructor & copy assignment operator
************************/
FImpl(const FImpl& Rhs) = default;
FImpl& operator=(const FImpl& Rhs) = default;
};
USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
UObject* Outer, const FSGTimedThumpCommandImpl& TimedThumpCommandImpl)
{
USGTimedThumpCommand* Instance = NewObject<USGTimedThumpCommand>(Outer);
Instance->SetTimedThumpCommandImpl(TimedThumpCommandImpl);
return Instance;
}
USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(UObject* Outer)
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor(&OutTimedThumpCommandImplContainer);
return NewTimedThumpCommand(Outer, MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl));
}
USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
UObject* Outer, const int32 Magnitude, const float DurationSeconds, const float StartTimeSeconds)
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_Magnitude_DurationSeconds_StartTimeSeconds(
&OutTimedThumpCommandImplContainer, Magnitude, DurationSeconds, StartTimeSeconds);
return NewTimedThumpCommand(Outer, MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl));
}
USGTimedThumpCommand* USGTimedThumpCommand::NewTimedThumpCommand(
UObject* Outer, const USGThumperCommand* BaseCommand, const float DurationSeconds, const float StartTimeSeconds)
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
FSGIC_FSGThumperCommandImpl BaseCommandContainer{BaseCommand->ToThumperCommandImpl()};
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_BaseCommand_DurationSeconds_StartTimeSeconds(
&OutTimedThumpCommandImplContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
return NewTimedThumpCommand(Outer, MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl));
}
USGTimedThumpCommand::USGTimedThumpCommand()
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor(&OutTimedThumpCommandImplContainer);
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
}
USGTimedThumpCommand::USGTimedThumpCommand(const int32 Magnitude,
const float DurationSeconds, const float StartTimeSeconds)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_Magnitude_DurationSeconds_StartTimeSeconds(
&OutTimedThumpCommandImplContainer, Magnitude, DurationSeconds, StartTimeSeconds);
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
}
USGTimedThumpCommand::USGTimedThumpCommand(const USGThumperCommand* BaseCommand,
const float DurationSeconds, const float StartTimeSeconds)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
FSGIC_FSGThumperCommandImpl BaseCommandContainer{BaseCommand->ToThumperCommandImpl()};
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_BaseCommand_DurationSeconds_StartTimeSeconds(
&OutTimedThumpCommandImplContainer, &BaseCommandContainer, DurationSeconds, StartTimeSeconds);
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
}
USGTimedThumpCommand::USGTimedThumpCommand(const FSGTimedThumpCommandImpl& TimedThumpCommandImpl)
: Pimpl(TUniquePtr<FImpl, FImplDeleter>(new FImpl{this}, PimplDeleter))
{
SetTimedThumpCommandImpl(TimedThumpCommandImpl);
}
USGTimedThumpCommand::~USGTimedThumpCommand() = default;
void USGTimedThumpCommand::SetTimedThumpCommandImpl(const FSGTimedThumpCommandImpl& TimedThumpCommandImpl)
{
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandContainer;
FSGIC_FSGTimedThumpCommandImpl RhsContainer{TimedThumpCommandImpl};
SGCoreImpl_FSGTimedThumpCommandImpl_ctor_copy(&OutTimedThumpCommandContainer, &RhsContainer);
Pimpl->TimedThumpCommandImpl = MoveTemp(OutTimedThumpCommandContainer.TimedThumpCommandImpl);
}
const FSGTimedThumpCommandImpl& USGTimedThumpCommand::ToTimedThumpCommandImpl() const
{
return Pimpl->TimedThumpCommandImpl;
}
int32 USGTimedThumpCommand::GetMagnitude() const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
return SGCoreImpl_FSGTimedThumpCommandImpl_GetMagnitude(&InstanceContainer);
}
float USGTimedThumpCommand::GetDuration() const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
return SGCoreImpl_FSGTimedThumpCommandImpl_GetDuration(&InstanceContainer);
}
float USGTimedThumpCommand::GetElapsedTime() const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
return SGCoreImpl_FSGTimedThumpCommandImpl_GetElapsedTime(&InstanceContainer);
}
bool USGTimedThumpCommand::HasTimeElapsed() const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
return SGCoreImpl_FSGTimedThumpCommandImpl_HasTimeElapsed(&InstanceContainer);
}
USGTimedThumpCommand* USGTimedThumpCommand::Copy(UObject* Outer, const bool bCopyElapsed) const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
FSGIC_FSGTimedThumpCommandImpl OutTimedThumpCommandImplContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_Copy(&InstanceContainer, &OutTimedThumpCommandImplContainer, bCopyElapsed);
return NewTimedThumpCommand(Outer, OutTimedThumpCommandImplContainer.TimedThumpCommandImpl);
}
void USGTimedThumpCommand::Update(const float DeltaSeconds)
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
SGCoreImpl_FSGTimedThumpCommandImpl_Update(&InstanceContainer, DeltaSeconds);
}
bool USGTimedThumpCommand::Equals(const USGTimedThumpCommand* TimedThumpCommand) const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
FSGIC_FSGTimedThumpCommandImpl TimedThumpCommandImplContainer{TimedThumpCommand->ToTimedThumpCommandImpl()};
return SGCoreImpl_FSGTimedThumpCommandImpl_Equals(&InstanceContainer, &TimedThumpCommandImplContainer);
}
FString USGTimedThumpCommand::ToString() const
{
FSGIC_FSGTimedThumpCommandImpl InstanceContainer{ToTimedThumpCommandImpl()};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGTimedThumpCommandImpl_ToString(&InstanceContainer, &OutStringContainer);
return MoveTemp(OutStringContainer.String);
}
USGTimedThumpCommand::FImpl::FImpl(USGTimedThumpCommand* InOwner)
: Owner(InOwner)
{
}
USGTimedThumpCommand::FImpl::~FImpl() = default;
void USGTimedThumpCommand::FImplDeleter::operator()(const FImpl* P) const
{
delete P;
}
@@ -248,31 +248,6 @@ FRotator FSGTracking::GetNovaToWristRotationOffset()
return OutOffsetContainer.Quat.Rotator(); return OutOffsetContainer.Quat.Rotator();
} }
void FSGTracking::GetNovaGloveWristOffset(const bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaGloveWristOffset(bRightHanded,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
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() FVector FSGTracking::GetRightNovaViveToAttachPosition()
{ {
FSGIC_FVector OutPositionContainer; FSGIC_FVector OutPositionContainer;
@@ -392,6 +367,115 @@ FRotator FSGTracking::GetLeftNovaPico2ToAttachRotation()
return OutRotationContainer.Quat.Rotator(); return OutRotationContainer.Quat.Rotator();
} }
FVector FSGTracking::GetRightNovaQuestProToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuestProToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNovaQuestProToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuestProToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNovaQuestProToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuestProToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNovaQuestProToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuestProToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNovaQuestProToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuestProToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNovaQuestProToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuestProToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNovaViveFocus3ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaViveFocus3ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNovaViveFocus3ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaViveFocus3ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNovaViveFocus3ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaViveFocus3ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNovaViveFocus3ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaViveFocus3ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNovaViveFocus3ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaViveFocus3ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNovaViveFocus3ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaViveFocus3ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
void FSGTracking::GetNovaGloveWristOffset(const bool bRightHanded, FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNovaGloveWristOffset(bRightHanded,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
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();
}
void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded, void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
FVector& OutPositionOffset, FQuat& OutRotationOffset) FVector& OutPositionOffset, FQuat& OutRotationOffset)
{ {
@@ -420,6 +504,276 @@ void FSGTracking::GetNovaGloveTrackerOffset(const ESGPositionalTrackingHardware
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator(); OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
} }
FVector FSGTracking::GetRightNova2ToWristPositionOffset()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ToWristPositionOffset(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNova2ToWristRotationOffsetQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ToWristRotationOffset(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNova2ToWristRotationOffset()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ToWristRotationOffset(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNova2ToWristPositionOffset()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ToWristPositionOffset(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNova2ToWristRotationOffsetQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ToWristRotationOffset(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNova2ToWristRotationOffset()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ToWristRotationOffset(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNova2Quest2ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2Quest2ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNova2Quest2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2Quest2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNova2Quest2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2Quest2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNova2Quest2ToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2Quest2ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNova2Quest2ToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2Quest2ToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNova2Quest2ToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2Quest2ToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNova2QuestProToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNovaQuest2ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNova2QuestProToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2QuestProToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNova2QuestProToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2QuestProToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNova2QuestProToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNovaQuest2ToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNova2QuestProToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2QuestProToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNova2QuestProToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2QuestProToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNova2ViveTrackerToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveTrackerToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNova2ViveTrackerToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveTrackerToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNova2ViveTrackerToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveTrackerToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNova2ViveTrackerToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveTrackerToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNova2ViveTrackerToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveTrackerToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNova2ViveTrackerToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveTrackerToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetRightNova2ViveWristTrackerToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveWristTrackerToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetRightNova2ViveWristTrackerToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveWristTrackerToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetRightNova2ViveWristTrackerToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetRightNova2ViveWristTrackerToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
FVector FSGTracking::GetLeftNova2ViveWristTrackerToAttachPosition()
{
FSGIC_FVector OutPositionContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveWristTrackerToAttachPosition(&OutPositionContainer);
return MoveTemp(OutPositionContainer.Vector);
}
FQuat FSGTracking::GetLeftNova2ViveWristTrackerToAttachRotationQ()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveWristTrackerToAttachRotation(&OutRotationContainer);
return MoveTemp(OutRotationContainer.Quat);
}
FRotator FSGTracking::GetLeftNova2ViveWristTrackerToAttachRotation()
{
FSGIC_FQuat OutRotationContainer;
SGCoreImpl_FSGTrackingImpl_GetLeftNova2ViveWristTrackerToAttachRotation(&OutRotationContainer);
return OutRotationContainer.Quat.Rotator();
}
void FSGTracking::GetNova2GloveWristOffset(const bool bRightHanded, const FString& HardwareVersion,
FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNova2GloveWristOffset(
bRightHanded, &HardwareVersionContainer,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = MoveTemp(OutRotationOffsetContainer.Quat);
}
void FSGTracking::GetNova2GloveWristOffset(const bool bRightHanded, const FString& HardwareVersion,
FVector& OutPositionOffset, FRotator& OutRotationOffset)
{
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNova2GloveWristOffset(
bRightHanded, &HardwareVersionContainer,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
}
void FSGTracking::GetNova2GloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
const FString& HardwareVersion,
FVector& OutPositionOffset, FQuat& OutRotationOffset)
{
FSGIC_ESGPositionalTrackingHardware HardwareContainer{Hardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNova2GloveTrackerOffset(
&HardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = MoveTemp(OutRotationOffsetContainer.Quat);
}
void FSGTracking::GetNova2GloveTrackerOffset(const ESGPositionalTrackingHardware Hardware, const bool bRightHanded,
const FString& HardwareVersion,
FVector& OutPositionOffset, FRotator& OutRotationOffset)
{
FSGIC_ESGPositionalTrackingHardware HardwareContainer{Hardware};
FSGIC_FString HardwareVersionContainer{HardwareVersion};
FSGIC_FVector OutPositionOffsetContainer;
FSGIC_FQuat OutRotationOffsetContainer;
SGCoreImpl_FSGTrackingImpl_GetNova2GloveTrackerOffset(
&HardwareContainer, bRightHanded, &HardwareVersionContainer,
&OutPositionOffsetContainer, &OutRotationOffsetContainer);
OutPositionOffset = MoveTemp(OutPositionOffsetContainer.Vector);
OutRotationOffset = OutRotationOffsetContainer.Quat.Rotator();
}
FString FSGTracking::ToString(const ESGPositionalTrackingHardware Hardware) FString FSGTracking::ToString(const ESGPositionalTrackingHardware Hardware)
{ {
FSGIC_FString OutStringContainer; FSGIC_FString OutStringContainer;

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