Compare commits

...
39 Commits
Author SHA1 Message Date
Mamadou Babaei dbd252f487 bump the plugin version to v1.3.0 2023-04-28 01:19:56 +02:00
Mamadou Babaei 37efb4cf51 temporarily revert changes that are not part of the v1.3.0 release 2023-04-28 01:19:56 +02:00
Mamadou Babaei eded9f5ad5 bump senseglove libraries for linux and android to v2.6.0-aac3d56 2023-04-28 01:19:55 +02:00
Mamadou Babaei 82c3993ea9 bump the senseglove libraries for windows/msvc to v2.6.0-aac3d56 2023-04-28 01:19:55 +02:00
Mamadou Babaei 873a850498 document recent changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei a1d78fa767 document the senseglove libraries bump in the changelog 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7b4b06e3d0 adjust senseglove/unreal coordinate system conversions according to changes in the recent sgcore release 2023-04-28 01:19:54 +02:00
Mamadou Babaei daa22b3940 fix a gramatical error 2023-04-28 01:19:54 +02:00
Mamadou Babaei cf8fc5fcda add a debug virtual hand and some other fixes 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7b57334ed0 fix the hand right hand offset 2023-04-28 01:19:54 +02:00
Mamadou Babaei 22ca963bd6 remove redundant headers 2023-04-28 01:19:54 +02:00
Mamadou Babaei 66d0201d12 fix debug gizmo default colors 2023-04-28 01:19:54 +02:00
Mamadou Babaei 3b68860eeb refactor the debug gizmo draw method 2023-04-28 01:19:54 +02:00
Mamadou Babaei 649d88e85d update the changelog with unreleased changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei 2ff9e6f984 refactor the wrist tracker's debug gzmo settings into a ustruct in order to be re-used 2023-04-28 01:19:54 +02:00
Mamadou Babaei 51e1d5f252 fix gizmo drawing issue happens due to a null world object 2023-04-28 01:19:54 +02:00
Mamadou Babaei 66aec3cdea add a new generic senseglove debug module 2023-04-28 01:19:54 +02:00
Mamadou Babaei 1426e2b2c2 add the base implementation for the senseglove grab component 2023-04-28 01:19:54 +02:00
Mamadou Babaei cb9a319a6a increase the default DebugWristTrackerGizmoLength value in the plugin's settings 2023-04-28 01:19:54 +02:00
Mamadou Babaei 1539b09925 increase the default DebugWristTrackerGizmoLength value on the wrist tracker 2023-04-28 01:19:54 +02:00
Mamadou Babaei fd9b8d6a01 document unreleased changes 2023-04-28 01:19:54 +02:00
Mamadou Babaei e1353bb0ec fix the wrong hand offset calculations 2023-04-28 01:19:54 +02:00
Mamadou Babaei 7481d2cd8e fix the wrong tracker origin calculations 2023-04-28 01:19:54 +02:00
Mamadou Babaei 3d0e7fe8d2 fix the platform support matrix for unreal versions >= 5.0 2023-04-20 15:54:59 +02:00
Mamadou Babaei da7bc22ed7 minor code improvements and clean up 2023-04-20 15:54:59 +02:00
Mamadou Babaei a54d252971 fix the directory structure 2023-04-11 21:05:17 +02:00
Mamadou Babaei d711d42562 remove the development virtual hand mesh from master and all the release branches 2023-04-11 20:57:34 +02:00
Mamadou Babaei 3c56af0e1f bump the plugin version to v1.2.1 2023-03-30 06:42:46 +02:00
Mamadou Babaei 9cbdf5cea7 add the engine settings module into the private include paths for the senseglove settings module in order to solve run uat build issues 2023-03-30 06:22:27 +02:00
Mamadou Babaei 032422de1c remove the engine settings module from the senseglove module's private dependencies list 2023-03-30 06:14:59 +02:00
Mamadou Babaei 0f89d1c4dd remove the launch and settings from the android module's private includes 2023-03-30 05:58:15 +02:00
Mamadou Babaei 8d289c0f2f bump the plugin version to v1.2.0 2023-03-28 21:38:59 +02:00
Mamadou Babaei 62a2dd44f0 add the new dev/test hand model (this hand mesh is not meant to be published) 2023-03-28 18:28:01 +02:00
Mamadou Babaei c3001c588c alternative approach to constructor helpers in order to set the default hand mesh as it won't causes annoying ue pop-up cdo messages 2023-03-28 18:28:01 +02:00
Mamadou Babaei f3b21fecfa remove the old virtual hand model mesh 2023-03-28 18:28:00 +02:00
Mamadou Babaei 94e1b9ffcb fix the hand animation implementation and angle conversions to work with the standard ue5.1+ hand from epic 2023-03-28 18:28:00 +02:00
Mamadou Babaei 01078b6cd6 add missing paths headers that causes uat build issues 2023-03-28 11:45:17 +02:00
Mamadou Babaei a62f615036 add missing vershon headers and clean up unused headers 2023-03-28 11:45:16 +02:00
Mamadou Babaei 5213282f25 fix uat errors C4458 when building the virtual hand component 2023-03-28 11:22:22 +02:00
125 changed files with 1310 additions and 1063 deletions
+32 -1
View File
@@ -5,7 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [v1.3.0] - 2023-04-28
This release breaks ABI/API compatibility with the previous versions in addition to breaking coordinates systems conversions between Unreal Engine and the SenseGlove libraries.
### Added
- A new generic SenseGlove Debug module.
- A debug virtual hand.
### Fixed
- Fix the wrist tracker miscalculations for the Quest 2 controllers (other headsets might needs fixing as well, in that case future releases will address that).
- Minor code improvement and fixes.
- Minor documentation fixes.
### Changed
- Breaking API/ABI changes in the Settings and the main SenseGlove module due to some settings refactoring.
- Breaking changes in the SenseGlove/Unreal coordinates systems conversions due to underlying changes in the SenseGlove Core Libraries.
- SenseGlove libraries have been updated to v2.6.0-aac3d56.
## [v1.2.1] - 2023-03-30
### Fixed
- Fix RunUAT build issues with Android.
## [v1.2.0] - 2023-03-28
This release breaks ABI/API compatibility with the previous versions.
@@ -35,6 +62,10 @@ This release breaks ABI/API compatibility with the previous versions.
- Removed redundant SGConnectImpl/SGPlatform.
- Removed redundant SGTypes/SGConnectTypes.
### Known Issues
- Wrist Tracker's offsets are a bit off (e.g. on Quest 2), scheduled to be fixed in the next patch release.
## [1.1.1] - 2023-02-07
### Added
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5 -5
View File
@@ -13,10 +13,10 @@ This repository relies on Git LFS for storing binary blobs (e.g. third-party lib
| **4.24** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
| **4.25** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
| **4.26** | ⚠️ v1.0.x | ⚠️ v1.0.x | ❌ | ⚠️ v1.0.x | ❌ | ❌ |
| **4.27** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r21e) |
| **5.0** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r21e) |
| **5.1** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r25b) |
| **5.2** | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ✅ v1.2.x | ❌ | ✅ v1.2.x (r25b) |
| **4.27** | ✅ v1.3.x | ✅ v1.3.x | ✅ v1.3.x | ✅ v1.3.x | ❌ | ✅ v1.3.x (r21e) |
| **5.0** | | ✅ v1.3.x | ✅ v1.3.x | ✅ v1.3.x | ❌ | ✅ v1.3.x (r21e) |
| **5.1** | | ✅ v1.3.x | ✅ v1.3.x | ✅ v1.3.x | ❌ | ✅ v1.3.x (r25b) |
| **5.2** | | ✅ v1.3.x | ✅ v1.3.x | ✅ v1.3.x | ❌ | ✅ v1.3.x (r25b) |
* <code>✅</code> Supported
* <code>⚠️</code> Not supported by the latest release and might be lacking features
@@ -54,7 +54,7 @@ Please note that modules postfixed with **Impl** are intended for interal use an
## Directory Structure
```
Source
/
├── Config
+11 -1
View File
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.1.1",
"VersionName": "1.3.0",
"FriendlyName": "SenseGlove",
"Description": "Integrating the SenseGlove haptic controller into Unreal Engine",
"Category": "Virtual Reality",
@@ -120,6 +120,16 @@
"Win64"
]
},
{
"Name": "SenseGloveDebug",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"WhitelistPlatforms": [
"Android",
"Linux",
"Win64"
]
},
{
"Name": "SenseGloveEditor",
"Type": "Editor",
@@ -43,6 +43,7 @@
#include "Containers/UnrealString.h"
#include "Engine/SkeletalMesh.h"
#include "Math/Rotator.h"
#include "Runtime/Launch/Resources/Version.h"
#include "SGLog/SGLog.h"
#include "SenseGlove/Components/SGVirtualHandComponent.h"
@@ -39,14 +39,17 @@
#include "Components/SkeletalMeshComponent.h"
#include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h"
#include "Runtime/Launch/Resources/Version.h"
#include "UObject/ConstructorHelpers.h"
#include "SenseGlove/Animation/SGVirtualHandAnimInstance.h"
#include "SenseGlove/Components/SGWristTrackerComponent.h"
#include "SGConnect/SGConnect.h"
#include "SGCore/SGDeviceList.h"
#include "SGCore/SGHandPose.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGDebug/SGDebugVirtualHand.h"
#include "SGLog/SGLog.h"
struct USGVirtualHandComponent::FImpl
@@ -122,7 +125,9 @@ struct USGVirtualHandComponent::FImpl
bool UninitializeBackend() const;
bool CheckGlove() const;
void SetVisibility(bool bVisible) const;
void SetVisibility(bool bInVisible) const;
void DrawDebugVirtualHand() const;
};
const TArray<TArray<FName>>& USGVirtualHandComponent::GetLeftHandFingerBoneNames()
@@ -204,15 +209,22 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
bRight = true;
bHiddenInGameIfNoGloveDetected = false;
DebugVirtualHandSettings = FSGDebugVirtualHandSettings{
ESGDebugVirtualHandDrawingMode::None,
FVector(0.5f, 0.5f, 0.5f),
FColor(255, 0, 0, 255),
0.1f, 1.0f, 1.0f,
FColor(255, 0, 0, 255),
FColor(0, 255, 0, 255),
FColor(0, 0, 255, 255),
false, 1.1f, 0
};
const FString SkeletalMeshPath{Pimpl->GetDefaultMeshPath()};
const ConstructorHelpers::FObjectFinder<USkeletalMesh> SkeletalMesh{*SkeletalMeshPath};
ensureAlwaysMsgf(SkeletalMesh.Succeeded() && SkeletalMesh.Object,
TEXT("Failed to load the skeletal mesh: '%s'"), *SkeletalMeshPath);
Super::SetSkeletalMesh(SkeletalMesh.Object, true);
Super::SetSkeletalMesh(nullptr, true);
bBackendInitialized = false;
Glove = nullptr;
WristTracker = nullptr;
}
void USGVirtualHandComponent::SetRight(const bool bInRight)
@@ -233,6 +245,16 @@ void USGVirtualHandComponent::SetAnimClass(UClass* NewClass)
Super::SetAnimClass(NewClass);
}
void USGVirtualHandComponent::PostInitProperties()
{
Super::PostInitProperties();
if (!Pimpl->IsUsingUserMesh())
{
Pimpl->SetDefaultMesh();
}
}
#if WITH_EDITOR
void USGVirtualHandComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
@@ -306,6 +328,11 @@ void USGVirtualHandComponent::TickComponent(
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
(void) Pimpl->CheckGlove();
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
}
void USGVirtualHandComponent::SetSkeletalMesh(USkeletalMesh* NewMesh, const bool bReinitPose)
@@ -324,6 +351,11 @@ void USGVirtualHandComponent::EditorTick(
const float DeltaTime, const ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
(void) Pimpl->CheckGlove();
if (IsValid(Glove) && DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
}
bool USGVirtualHandComponent::IsGloveConnected() const
@@ -458,13 +490,13 @@ FString USGVirtualHandComponent::FImpl::GetDefaultMeshPath() const
bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
{
const USkeletalMesh* SkeletalMesh{GetMesh()};
if (!IsValid(SkeletalMesh))
const USkeletalMesh* CurrentMesh{GetMesh()};
if (!IsValid(CurrentMesh))
{
return false;
}
const FString CurrentMeshPath(SkeletalMesh->GetPathName());
const FString CurrentMeshPath(CurrentMesh->GetPathName());
const FString LeftHandDefaultMeshPath(GetDefaultLeftHandMeshPath());
const FString LeftHandDefaultMeshPathOnly(GetDefaultLeftHandMeshPathOnly());
const FString RightHandDefaultMeshPath(GetDefaultRightHandMeshPath());
@@ -482,14 +514,17 @@ bool USGVirtualHandComponent::FImpl::IsUsingUserMesh() const
USkeletalMesh* USGVirtualHandComponent::FImpl::LoadDefaultMesh() const
{
const FString SkeletalMeshPath{GetDefaultMeshPath()};
USkeletalMesh* SkeletalMesh{
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *SkeletalMeshPath))
const FString DefaultMeshPath{GetDefaultMeshPath()};
USkeletalMesh* DefaultMesh{
Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), nullptr, *DefaultMeshPath))
};
ensureAlwaysMsgf(SkeletalMesh, TEXT("Failed to load the skeletal mesh: '%s'"), *SkeletalMeshPath);
if (!IsValid(DefaultMesh))
{
SGLOG_WARNING(FString::Printf(TEXT("Failed to load the default skeletal mesh: '%s'"), *DefaultMeshPath));
}
return SkeletalMesh;
return DefaultMesh;
}
void USGVirtualHandComponent::FImpl::SetDefaultMesh() const
@@ -510,16 +545,16 @@ USkeletalMesh* USGVirtualHandComponent::FImpl::GetMesh() const
USkeleton* USGVirtualHandComponent::FImpl::GetSkeleton() const
{
USkeletalMesh* SkeletalMesh{GetMesh()};
ensureAlwaysMsgf(IsValid(SkeletalMesh), TEXT("Invalid SkeletalMesh object!"));
return SkeletalMesh->GetSkeleton();
USkeletalMesh* Mesh{GetMesh()};
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
return Mesh->GetSkeleton();
}
const FReferenceSkeleton& USGVirtualHandComponent::FImpl::GetRefSkeleton() const
{
const USkeletalMesh* SkeletalMesh{GetMesh()};
ensureAlwaysMsgf(IsValid(SkeletalMesh), TEXT("Invalid SkeletalMesh object!"));
return SkeletalMesh->GetRefSkeleton();
const USkeletalMesh* Mesh{GetMesh()};
ensureAlwaysMsgf(IsValid(Mesh), TEXT("Invalid SkeletalMesh object!"));
return Mesh->GetRefSkeleton();
}
bool USGVirtualHandComponent::FImpl::InitializeBackend() const
@@ -665,9 +700,34 @@ bool USGVirtualHandComponent::FImpl::CheckGlove() const
return bFoundGlove;
}
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bVisible) const
void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) const
{
Owner->SetVisibility(bVisible, true);
Owner->SetVisibility(bInVisible, true);
}
void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
{
const UWorld* World{Owner->GetWorld()};
if (!IsValid(Owner->WristTracker))
{
return;
}
const FVector& WristLocation{Owner->WristTracker->GetWristLocation()};
const FRotator& WristRotation{Owner->WristTracker->GetWristRotation()};
const USGHandPose* HandPose{Owner->GetHandPose()};
if (!IsValid(HandPose))
{
return;
}
const TArray<TArray<FVector>>& JointPositions{HandPose->GetJointPositions()};
const TArray<TArray<FRotator>>& JointRotations{HandPose->GetJointRotations()};
FSGDebugVirtualHand::Draw(World, WristLocation, WristRotation, JointPositions, JointRotations,
Owner->DebugVirtualHandSettings);
}
void USGVirtualHandComponent::FImplDeleter::operator()(const FImpl* P) const
@@ -37,15 +37,14 @@
#include "Animation/Skeleton.h"
#include "Components/SkeletalMeshComponent.h"
#include "DrawDebugHelpers.h"
#include "Engine/SkeletalMesh.h"
#include "Kismet/GameplayStatics.h"
#include "UObject/ConstructorHelpers.h"
#include "SGConnect/SGConnect.h"
#include "SGCore/SGDeviceList.h"
#include "SGCore/SGHapticGlove.h"
#include "SGCore/SGHapticGloveHandProfiles.h"
#include "SGDebug/SGDebugGizmo.h"
#include "SGLog/SGLog.h"
#include "SGSettings/SGSettings.h"
@@ -110,21 +109,21 @@ USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& Obj
SetRight(true);
bOverridePluginWristTrackingSettings = false;
bDrawDebugWristTrackerGizmo = false;
bDrawWristTrackerDebugGizmo = false;
TrackingHardware = ESGPositionalTrackingHardware::None;
TrackingHardwareLocationOffset = FVector::ZeroVector;
TrackingHardwareLocationOffset = FVector::ZeroVector;
bOverridePluginWristTrackingDebugSettings = false;
bDrawDebugWristTrackerGizmo = false;
DebugWristTrackerGizmoLength = 1.0f;
DebugWristTrackerGizmoXAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoYAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f);
bDebugWristTrackerGizmoPersistentLines = false;
DebugWristTrackerGizmoLifeTimeModifier = 1.1f;
DebugWristTrackerGizmoDepthPriority = 0;
DebugWristTrackerGizmoThickness = 1.0f;
bDrawWristTrackerDebugGizmo = false;
WristTrackerDebugGizmoSettings = FSGDebugGizmoSettings(
4.0f, 1.0f,
FColor(255, 0, 0, 255),
FColor(0, 255, 0, 255),
FColor(0, 0, 255, 255),
false, 1.1f, 0
);
bDrawWristTrackerDebugGizmo = false;
bBackendInitialized = false;
Glove = nullptr;
@@ -219,265 +218,53 @@ void USGWristTrackerComponent::SetTrackingHardwareRotationOffset(const FRotator&
TrackingHardwareRotationOffset = InTrackingHardwareRotationOffset;
}
bool USGWristTrackerComponent::GetDrawDebugWristTrackerGizmo() const
bool USGWristTrackerComponent::GetDrawWristTrackerDebugGizmo() const
{
if (OverridesPluginWristTrackingDebugSettings())
{
return !!bDrawDebugWristTrackerGizmo;
return !!bDrawWristTrackerDebugGizmo;
}
return USGSettings::GetInstance()->GetDrawDebugWristTrackerGizmo();
return USGSettings::GetInstance()->GetDrawWristTrackerDebugGizmo();
}
void USGWristTrackerComponent::SetDrawDebugWristTrackerGizmo(const bool bInDrawDebugWristTrackerGizmo)
void USGWristTrackerComponent::SetDrawWristTrackerDebugGizmo(const bool bInDrawWristTrackerDebugGizmo)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT( "Setting bDrawDebugWristTrackerGizmo is only permitted when bOverridePluginWristTrackingDebugSettings is"
TEXT( "Setting bDrawWristTrackerDebugGizmo is only permitted when bOverridePluginWristTrackingDebugSettings is"
" enabled!"));
bDrawDebugWristTrackerGizmo = bInDrawDebugWristTrackerGizmo;
bDrawWristTrackerDebugGizmo = bInDrawWristTrackerDebugGizmo;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLength() const
const FSGDebugGizmoSettings& USGWristTrackerComponent::GetWristTrackerDebugGizmoSettings() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
GetDrawWristTrackerDebugGizmo(),
TEXT("Getting WristTrackerDebugGizmoLength is only permitted when bDrawWristTrackerDebugGizmo is enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoLength;
return WristTrackerDebugGizmoSettings;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLength();
return USGSettings::GetInstance()->GetWristTrackerDebugGizmoSettings();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLength(const float InDebugWristTrackerGizmoLength)
void USGWristTrackerComponent::SetWristTrackerDebugGizmoSettings(
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bOverridePluginWristTrackingDebugSettings is"
TEXT("Setting WristTrackerDebugGizmoLength is only permitted when bOverridePluginWristTrackingDebugSettings is"
" enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
GetDrawWristTrackerDebugGizmo(),
TEXT("Setting WristTrackerDebugGizmoLength is only permitted when bDrawWristTrackerDebugGizmo is enabled!"));
DebugWristTrackerGizmoLength = InDebugWristTrackerGizmoLength;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoXAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoXAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoXAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoXAxisColor(
const FColor& InDebugWristTrackerGizmoXAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoXAxisColor = InDebugWristTrackerGizmoXAxisColor;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoYAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoYAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoYAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoYAxisColor(
const FColor& InDebugWristTrackerGizmoYAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoYAxisColor = InDebugWristTrackerGizmoYAxisColor;
}
const FColor& USGWristTrackerComponent::GetDebugWristTrackerGizmoZAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoZAxisColor;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoZAxisColor();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoZAxisColor(
const FColor& InDebugWristTrackerGizmoZAxisColor)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bOverridePluginWristTrackingDebugSettings"
" is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoZAxisColor = InDebugWristTrackerGizmoZAxisColor;
}
bool USGWristTrackerComponent::GetDebugWristTrackerGizmoPersistentLines() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return !!bDebugWristTrackerGizmoPersistentLines;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoPersistentLines();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoPersistentLines(
const bool bInDebugWristTrackerGizmoPersistentLines)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoPersistentLines is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
bDebugWristTrackerGizmoPersistentLines = bInDebugWristTrackerGizmoPersistentLines;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoLifeTimeModifier() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoLifeTimeModifier;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoLifeTimeModifier();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoLifeTimeModifier(
const float InDebugWristTrackerGizmoLifeTimeModifier)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoLifetimeModifier is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoLifeTimeModifier = InDebugWristTrackerGizmoLifeTimeModifier;
}
uint8 USGWristTrackerComponent::GetDebugWristTrackerGizmoDepthPriority() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoDepthPriority;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoDepthPriority();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoDepthPriority(const uint8 InDebugWristTrackerGizmoDepthPriority)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoDepthPriority = InDebugWristTrackerGizmoDepthPriority;
}
float USGWristTrackerComponent::GetDebugWristTrackerGizmoThickness() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
if (OverridesPluginWristTrackingDebugSettings())
{
return DebugWristTrackerGizmoThickness;
}
return USGSettings::GetInstance()->GetDebugWristTrackerGizmoThickness();
}
void USGWristTrackerComponent::SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness)
{
ensureAlwaysMsgf(
OverridesPluginWristTrackingDebugSettings(),
TEXT("Setting DebugWristTrackerGizmoDepthThickness is only permitted when"
" bOverridePluginWristTrackingDebugSettings is enabled!"));
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
DebugWristTrackerGizmoThickness = InDebugWristTrackerGizmoThickness;
WristTrackerDebugGizmoSettings = InWristTrackerDebugGizmoSettings;
}
#if WITH_EDITOR
@@ -542,7 +329,7 @@ void USGWristTrackerComponent::TickComponent(
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (GetDrawDebugWristTrackerGizmo())
if (GetDrawWristTrackerDebugGizmo())
{
Pimpl->DrawDebugGizmo();
}
@@ -595,7 +382,7 @@ bool USGWristTrackerComponent::FImpl::InitializeBackend() const
case 0:
// Do not pollute the logs!
//SGLOG_ERROR("Device Scanning is already running within this program.");
// We must return here in case there are two virtual hand components are present in the scene.
// We must return here in case two virtual hand components are present in the scene.
return true;
case 1:
SGLOG("Successfully started up DeviceScanning from the current program.");
@@ -697,8 +484,8 @@ void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
{
ensureAlwaysMsgf(Owner->Glove, TEXT("Invalid Glove!"));
FVector TrackerLocation{Owner->GetRelativeLocation()};
FRotator TrackerRotation{Owner->GetRelativeRotation()};
FVector TrackerLocation{Owner->GetComponentLocation()};
FRotator TrackerRotation{Owner->GetComponentRotation()};
ESGPositionalTrackingHardware TrackerHardware = Owner->GetTrackingHardware();
if (TrackerHardware == ESGPositionalTrackingHardware::None)
@@ -748,26 +535,12 @@ void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const
void USGWristTrackerComponent::FImpl::DrawDebugGizmo()
{
const UWorld* World{Owner->GetWorld()};
const FVector& Location{Owner->GetRelativeLocation()};
const FRotator& Rotation{Owner->GetRelativeRotation()};
const float Length = Owner->GetDebugWristTrackerGizmoLength();
const bool bPersistentLines = Owner->GetDebugWristTrackerGizmoPersistentLines();
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World)
* Owner->GetDebugWristTrackerGizmoLifeTimeModifier();
const float DepthPriority = Owner->GetDebugWristTrackerGizmoDepthPriority();
const float Thickness = Owner->GetDebugWristTrackerGizmoThickness();
const FColor& XAxisColor{Owner->GetDebugWristTrackerGizmoXAxisColor()};
const FColor& YAxisColor{Owner->GetDebugWristTrackerGizmoYAxisColor()};
const FColor& ZAxisColor{Owner->GetDebugWristTrackerGizmoZAxisColor()};
const FVector& Location{Owner->GetComponentLocation()};
const FRotator& Rotation{Owner->GetComponentRotation()};
const FSGDebugGizmoSettings& DebugGizmoSettings{Owner->GetWristTrackerDebugGizmoSettings()};
const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Length, 0.0f, 0.0f)));
DrawDebugLine(World, Location, XAxisLineEnd, XAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Length, 0.0f}));
DrawDebugLine(World, Location, YAxisLineEnd, YAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Length})};
DrawDebugLine(World, Location, ZAxisLineEnd, ZAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness);
FSGDebugGizmo::Draw(World, Location, Rotation, DebugGizmoSettings);
//FSGDebugGizmo::Draw(World, Owner->WristLocation, Owner->WristRotation, DebugGizmoSettings);
}
void USGWristTrackerComponent::FImplDeleter::operator()(const FImpl* P) const
@@ -93,8 +93,11 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandLeft->SetupAttachment(GetRootComponent());
HandLeft->SetRight(false);
HandLeft->SetHiddenIfNoGloveDetected(true);
HandLeft->SetWorldLocation(FVector{30.0f, -20.0f, -10.0f},
HandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
false, nullptr, ETeleportType::None);
HandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
false, nullptr, ETeleportType::None);
HandLeft->SetWristTracker(WristTrackerLeft);
WristTrackerRight = ObjectInitializer.CreateDefaultSubobject<USGWristTrackerComponent>(
this, TEXT("WristTrackerRight"));
@@ -105,8 +108,11 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandRight->SetupAttachment(GetRootComponent());
HandRight->SetRight(true);
HandRight->SetHiddenIfNoGloveDetected(true);
HandRight->SetWorldLocation(FVector{30.0f, 20.0f, -10.0f},
HandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
false, nullptr, ETeleportType::None);
HandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
false, nullptr, ETeleportType::None);
HandRight->SetWristTracker(WristTrackerRight);
}
void ASGPawn::BeginPlay()
@@ -122,22 +128,22 @@ void ASGPawn::BeginPlay()
WristTrackerLeft->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
{
HandLeft->SetRelativeLocation(Location);
HandLeft->SetWorldLocation(Location);
});
WristTrackerLeft->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
{
HandLeft->SetRelativeRotation(Rotation);
HandLeft->SetWorldRotation(Rotation);
});
WristTrackerRight->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
{
HandRight->SetRelativeLocation(Location);
HandRight->SetWorldLocation(Location);
});
WristTrackerRight->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
{
HandRight->SetRelativeRotation(Rotation);
HandRight->SetWorldRotation(Rotation);
});
}
@@ -76,6 +76,8 @@ ASGVirtualHandActor::ASGVirtualHandActor(const FObjectInitializer& ObjectInitial
VirtualHand = CreateDefaultSubobject<USGVirtualHandComponent>(TEXT("VirtualHand"));
VirtualHand->SetupAttachment(RootComponent);
VirtualHand->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
false, nullptr, ETeleportType::None);
WristTracker = CreateDefaultSubobject<USGWristTrackerComponent>(TEXT("WristTracker"));
WristTracker->SetupAttachment(RootComponent);
@@ -94,12 +96,12 @@ void ASGVirtualHandActor::BeginPlay()
WristTracker->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
{
VirtualHand->SetRelativeLocation(Location);
VirtualHand->SetWorldLocation(Location);
});
WristTracker->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
{
VirtualHand->SetRelativeRotation(Rotation);
VirtualHand->SetWorldRotation(Rotation);
});
}
@@ -45,12 +45,15 @@
#include "Templates/UniquePtr.h"
#include "UObject/NameTypes.h"
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGVirtualHandComponent.generated.h"
class USkeletalMesh;
class USGHandPose;
class USGHapticGlove;
class USGWristTrackerComponent;
UCLASS(Config=Engine, Blueprintable, ClassGroup=(Rendering, Common), hidecategories=(Object, "Mesh|SkeletalAsset"),
editinlinenew, meta=(BlueprintSpawnableComponent))
@@ -83,6 +86,10 @@ private:
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bHiddenInGameIfNoGloveDetected : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove",
meta=(AllowPrivateAccess="false", EditCondition="bDrawDebugVirtualHand", EditConditionHides))
FSGDebugVirtualHandSettings DebugVirtualHandSettings;
private:
UPROPERTY(Transient)
uint8 bBackendInitialized : 1;
@@ -90,6 +97,9 @@ private:
UPROPERTY(Transient)
USGHapticGlove* Glove;
UPROPERTY(Transient)
USGWristTrackerComponent* WristTracker;
public:
FORCEINLINE bool IsLeft() const
{
@@ -113,9 +123,16 @@ public:
bHiddenInGameIfNoGloveDetected = bInHiddenIfNoGloveDetected;
}
FORCEINLINE void SetWristTracker(USGWristTrackerComponent* InWristTracker)
{
WristTracker = InWristTracker;
}
public:
virtual void SetAnimClass(class UClass* NewClass) override;
virtual void PostInitProperties() override;
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif /* WITH_EDITOR */
@@ -41,6 +41,7 @@
#include "MotionControllerComponent.h"
#include "Templates/UniquePtr.h"
#include "SGSettings/SGDebugGizmoSettings.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGWristTrackerComponent.generated.h"
@@ -129,71 +130,15 @@ private:
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings", EditConditionHides))
uint8 bDrawDebugWristTrackerGizmo : 1;
uint8 bDrawWristTrackerDebugGizmo : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
* Valid only if bDrawWristTrackerDebugGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawWristTrackerDebugGizmo",
EditConditionHides))
float DebugWristTrackerGizmoLength;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoXAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoYAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
FColor DebugWristTrackerGizmoZAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
uint8 bDebugWristTrackerGizmoPersistentLines : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
float DebugWristTrackerGizmoLifeTimeModifier;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
uint8 DebugWristTrackerGizmoDepthPriority;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditAnywhere, Category = "Override Plugin Settings",
meta=(EditCondition="bOverridePluginWristTrackingDebugSettings && bDrawDebugWristTrackerGizmo",
EditConditionHides))
float DebugWristTrackerGizmoThickness;
FSGDebugGizmoSettings WristTrackerDebugGizmoSettings;
private:
UPROPERTY(Transient)
@@ -238,32 +183,11 @@ public:
bOverridePluginWristTrackingDebugSettings = bInOverridePluginWristTrackingDebugSettings;
}
bool GetDrawDebugWristTrackerGizmo() const;
void SetDrawDebugWristTrackerGizmo(bool bInDrawDebugWristTrackerGizmo);
bool GetDrawWristTrackerDebugGizmo() const;
void SetDrawWristTrackerDebugGizmo(bool bInDrawWristTrackerDebugGizmo);
float GetDebugWristTrackerGizmoLength() const;
void SetDebugWristTrackerGizmoLength(float InDebugWristTrackerGizmoLength);
const FColor& GetDebugWristTrackerGizmoXAxisColor() const;
void SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor);
const FColor& GetDebugWristTrackerGizmoYAxisColor() const;
void SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor);
const FColor& GetDebugWristTrackerGizmoZAxisColor() const;
void SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor);
bool GetDebugWristTrackerGizmoPersistentLines() const;
void SetDebugWristTrackerGizmoPersistentLines(bool bInDebugWristTrackerGizmoPersistentLines);
float GetDebugWristTrackerGizmoLifeTimeModifier() const;
void SetDebugWristTrackerGizmoLifeTimeModifier(float InDebugWristTrackerGizmoLifeTimeModifier);
uint8 GetDebugWristTrackerGizmoDepthPriority() const;
void SetDebugWristTrackerGizmoDepthPriority(uint8 InDebugWristTrackerGizmoDepthPriority);
float GetDebugWristTrackerGizmoThickness() const;
void SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness);
const FSGDebugGizmoSettings& GetWristTrackerDebugGizmoSettings() const;
void SetWristTrackerDebugGizmoSettings(const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
FORCEINLINE bool IsLeft() const
{
+1
View File
@@ -58,6 +58,7 @@ public class SenseGlove : ModuleRules
"HeadMountedDisplay",
"SenseGloveConnect",
"SenseGloveCore",
"SenseGloveDebug",
"SenseGloveLog",
"SenseGloveSettings",
"SenseGloveTypes",
@@ -40,6 +40,8 @@
#include "Android/AndroidJava.h"
#endif /* PLATFORM_ANDROID */
#include "Misc/Paths.h"
#if PLATFORM_ANDROID
#include "SGConnectImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FString.h"
@@ -40,6 +40,8 @@
#include "Android/AndroidJava.h"
#endif /* PLATFORM_ANDROID */
#include "Misc/Paths.h"
#if PLATFORM_ANDROID
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FString.h"
@@ -64,15 +64,8 @@ public class SenseGloveAndroid : ModuleRules
if (Target.Platform == UnrealTargetPlatform.Android)
{
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"Launch",
"Settings",
}
);
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(ModuleDirectory, "SenseGloveAndroid_UPL.xml"));
AdditionalPropertiesForReceipt.Add("AndroidPlugin",
Path.Combine(ModuleDirectory, "SenseGloveAndroid_UPL.xml"));
}
}
}
@@ -154,7 +154,7 @@ FSGQuatImpl::FSGQuatImpl(const FQuat& Quat)
/// Forward X
/// Right Y
/// Up Z
Pimpl->Quat = FQuatType(-Quat.X, Quat.Y, -Quat.Z, Quat.W);
Pimpl->Quat = FQuatType(-Quat.Y, -Quat.X, -Quat.Z, Quat.W);
}
FSGQuatImpl::FSGQuatImpl(const FSGQuatImpl& Rhs)
@@ -192,7 +192,7 @@ FQuat FSGQuatImpl::ToFQuat() const
/// Forward X
/// Left Y
/// Up Z
return FQuat(-Pimpl->Quat.GetX(), Pimpl->Quat.GetY(), -Pimpl->Quat.GetZ(), Pimpl->Quat.GetW());
return FQuat(-Pimpl->Quat.GetY(), -Pimpl->Quat.GetX(), -Pimpl->Quat.GetZ(), Pimpl->Quat.GetW());
}
FSGQuatImpl FSGQuatImpl::operator*(const FSGQuatImpl& QuatImpl) const
@@ -38,7 +38,6 @@
#include "Containers/UnrealString.h"
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -113,7 +113,7 @@ FSGVect3DImpl::FSGVect3DImpl(const FVector& Vector)
/// Right Y
/// Up Z
FVect3DType Vect3D(Vector.X, -Vector.Y, Vector.Z);
FVect3DType Vect3D(Vector.Y, Vector.X, Vector.Z);
Pimpl->Vect3D = MoveTemp(Vect3D);
}
@@ -153,7 +153,7 @@ FVector FSGVect3DImpl::ToFVector() const
/// Right Y
/// Up Z
FVector Vector(Pimpl->Vect3D.GetX(), -Pimpl->Vect3D.GetY(), Pimpl->Vect3D.GetZ());
FVector Vector(Pimpl->Vect3D.GetY(), Pimpl->Vect3D.GetX(), Pimpl->Vect3D.GetZ());
return MoveTemp(Vector);
}
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -38,7 +38,6 @@
#include "Containers/UnrealString.h"
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "HAL/Platform.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -38,7 +38,6 @@
#include <vector>
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "SGCoreImpl/SGAnatomyImpl.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGTypes/SGCoreTypes.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/Array.h"
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -36,7 +36,6 @@
#pragma once
#include "HAL/Platform.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -38,7 +38,6 @@
#include "Containers/UnrealString.h"
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/Array.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -36,11 +36,9 @@
#pragma once
#include "Containers/Array.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
{
@@ -32,7 +32,6 @@
*
*/
#pragma once
#include <memory>
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGHapticGloveCalibrationSequenceImpl.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,11 +36,9 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
{
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "Containers/UnrealString.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "Math/Vector.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -36,7 +36,6 @@
#pragma once
#include "HAL/Platform.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
@@ -37,7 +37,6 @@
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
@@ -0,0 +1,57 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGDebug/SGDebugGizmo.h"
#include "DrawDebugHelpers.h"
#include "Kismet/GameplayStatics.h"
void FSGDebugGizmo::Draw(const UWorld* World, const FVector& Location, const FRotator& Rotation,
const FSGDebugGizmoSettings& Settings)
{
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * Settings.LifeTimeModifier;
const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Settings.Length, 0.0f, 0.0f)));
DrawDebugLine(World, Location, XAxisLineEnd,
Settings.XAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Settings.Length, 0.0f}));
DrawDebugLine(World, Location, YAxisLineEnd,
Settings.YAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Settings.Length})};
DrawDebugLine(World, Location, ZAxisLineEnd,
Settings.ZAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness);
}
@@ -0,0 +1,120 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGDebug/SGDebugVirtualHand.h"
#include "DrawDebugHelpers.h"
#include "Kismet/GameplayStatics.h"
#include "Math/Color.h"
#include "Math/Rotator.h"
#include "Math/Vector.h"
#include "SGDebug/SGDebugGizmo.h"
void FSGDebugVirtualHand::Draw(const UWorld* World, const FVector& WristLocation, const FRotator& WristRotation,
const TArray<TArray<FVector>>& JointPositions,
const TArray<TArray<FRotator>>& JointRotations,
const FSGDebugVirtualHandSettings& Settings)
{
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
TEXT("Invalid virtual hand drawing mode!"));
const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * Settings.LifeTimeModifier;
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
{
DrawDebugBox(World, WristLocation, Settings.CubeExtent,
WristRotation.Quaternion(), Settings.CubeColor,
Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.CubeThickness);
}
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
{
FSGDebugGizmo::Draw(World,
WristLocation, WristRotation,
FSGDebugGizmoSettings{
Settings.GizmoLength,
Settings.GizmoThickness,
Settings.GizmoXAxisColor,
Settings.GizmoYAxisColor,
Settings.GizmoZAxisColor,
!!Settings.bPersistentLines,
Settings.LifeTimeModifier,
Settings.DepthPriority
});
}
uint32 JointRotationsIndex = -1;
for (const TArray<FVector>& FingerJointPositions: JointPositions)
{
++JointRotationsIndex;
uint32 FingerJointRotationsIndex = -1;
const TArray<FRotator>& FingerJointRotations{JointRotations[JointRotationsIndex]};
for (const FVector& FingerJointPosition: FingerJointPositions)
{
++FingerJointRotationsIndex;
const FRotator& FingerJointRotation(FingerJointRotations[FingerJointRotationsIndex]);
const FVector DrawJointLocation(WristRotation.RotateVector(FingerJointPosition) + WristLocation);
const FQuat JointQuat{FingerJointRotation};
const FQuat WristQuat{WristRotation};
const FRotator DrawJointRotation{WristQuat * JointQuat};
if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints)
{
DrawDebugBox(World, DrawJointLocation, Settings.CubeExtent,
DrawJointRotation.Quaternion(), Settings.CubeColor,
Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.CubeThickness);
}
else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints)
{
FSGDebugGizmo::Draw(World,
DrawJointLocation, DrawJointRotation,
FSGDebugGizmoSettings{
Settings.GizmoLength,
Settings.GizmoThickness,
Settings.GizmoXAxisColor,
Settings.GizmoYAxisColor,
Settings.GizmoZAxisColor,
!!Settings.bPersistentLines,
Settings.LifeTimeModifier,
Settings.DepthPriority
});
}
}
}
}
@@ -0,0 +1,42 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGloveDebug.h"
#include "Modules/ModuleManager.h"
#include "SenseGloveDebugModule.h"
IMPLEMENT_MODULE(FSenseGloveDebugModule, SenseGloveDebug)
@@ -0,0 +1,38 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "CoreMinimal.h"
@@ -0,0 +1,62 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SenseGloveDebugModule.h"
#include "SGLog/SGLog.h"
#define LOCTEXT_NAMESPACE "FSenseGloveDebugModule"
void FSenseGloveDebugModule::StartupModule()
{
SGLOG("Starting up SenseGloveDebug module...");
}
void FSenseGloveDebugModule::PreUnloadCallback()
{
SGLOG("Unloading SenseGloveDebug module...");
}
void FSenseGloveDebugModule::PostLoadCallback()
{
SGLOG("Loading of SenseGloveDebug module has succeeded!");
}
void FSenseGloveDebugModule::ShutdownModule()
{
SGLOG("Shutting down SenseGloveDebug module...");
}
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,51 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "Modules/ModuleInterface.h"
#define LOCTEXT_NAMESPACE "SenseGloveDebug"
class FSenseGloveDebugModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void PreUnloadCallback() override;
virtual void PostLoadCallback() override;
virtual void ShutdownModule() override;
};
#undef LOCTEXT_NAMESPACE
@@ -0,0 +1,51 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "SGSettings/SGDebugGizmoSettings.h"
class SENSEGLOVEDEBUG_API FSGDebugGizmo final
{
public:
static void Draw(
const UWorld* World,
const FVector& Location, const FRotator& Rotation,
const FSGDebugGizmoSettings& Settings);
public:
FSGDebugGizmo() = delete;
virtual ~FSGDebugGizmo() = delete;
};
@@ -0,0 +1,52 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "SGSettings/SGDebugVirtualHandSettings.h"
class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final
{
public:
static void Draw(
const UWorld* World,
const FVector& WristLocation, const FRotator& WristRotation,
const TArray<TArray<FVector>>& JointPositions, const TArray<TArray<FRotator>>& JointRotations,
const FSGDebugVirtualHandSettings& Settings);
public:
FSGDebugVirtualHand() = delete;
virtual ~FSGDebugVirtualHand() = delete;
};
@@ -0,0 +1,63 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
using System;
using UnrealBuildTool;
public class SenseGloveDebug : ModuleRules
{
public SenseGloveDebug(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"SenseGloveLog",
"SenseGloveSettings",
"SenseGloveTypes",
}
);
}
}
@@ -99,112 +99,28 @@ void UWristTrackerComponentKismetLibrary::OverridePluginWristTrackingDebugSettin
WristTrackerComponent->OverridePluginWristTrackingDebugSettings(bInOverridePluginWristTrackingDebugSettings);
}
bool UWristTrackerComponentKismetLibrary::GetDrawDebugWristTrackerGizmo(
bool UWristTrackerComponentKismetLibrary::GetDrawWristTrackerDebugGizmo(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDrawDebugWristTrackerGizmo();
return WristTrackerComponent->GetDrawWristTrackerDebugGizmo();
}
void UWristTrackerComponentKismetLibrary::SetDrawDebugWristTrackerGizmo(
USGWristTrackerComponent* WristTrackerComponent, const bool bInDrawDebugWristTrackerGizmo)
void UWristTrackerComponentKismetLibrary::SetDrawWristTrackerDebugGizmo(
USGWristTrackerComponent* WristTrackerComponent, const bool bInDrawWristTrackerDebugGizmo)
{
WristTrackerComponent->SetDrawDebugWristTrackerGizmo(bInDrawDebugWristTrackerGizmo);
WristTrackerComponent->SetDrawWristTrackerDebugGizmo(bInDrawWristTrackerDebugGizmo);
}
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoLength(
const FSGDebugGizmoSettings& UWristTrackerComponentKismetLibrary::GetWristTrackerDebugGizmoSettings(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoLength();
return WristTrackerComponent->GetWristTrackerDebugGizmoSettings();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoLength(
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoLength)
void UWristTrackerComponentKismetLibrary::SetWristTrackerDebugGizmoSettings(
USGWristTrackerComponent* WristTrackerComponent, const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
{
WristTrackerComponent->SetDebugWristTrackerGizmoLength(InDebugWristTrackerGizmoLength);
}
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoXAxisColor(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoXAxisColor();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoXAxisColor(
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoXAxisColor)
{
WristTrackerComponent->SetDebugWristTrackerGizmoXAxisColor(InDebugWristTrackerGizmoXAxisColor);
}
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoYAxisColor(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoYAxisColor();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoYAxisColor(
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoYAxisColor)
{
WristTrackerComponent->SetDebugWristTrackerGizmoYAxisColor(InDebugWristTrackerGizmoYAxisColor);
}
const FColor& UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoZAxisColor(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoZAxisColor();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoZAxisColor(
USGWristTrackerComponent* WristTrackerComponent, const FColor& InDebugWristTrackerGizmoZAxisColor)
{
WristTrackerComponent->SetDebugWristTrackerGizmoZAxisColor(InDebugWristTrackerGizmoZAxisColor);
}
bool UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoPersistentLines(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoPersistentLines();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoPersistentLines(
USGWristTrackerComponent* WristTrackerComponent, const bool bInDebugWristTrackerGizmoPersistentLines)
{
WristTrackerComponent->SetDebugWristTrackerGizmoPersistentLines(bInDebugWristTrackerGizmoPersistentLines);
}
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoLifeTimeModifier(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoLifeTimeModifier();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoLifeTimeModifier(
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoLifeTimeModifier)
{
WristTrackerComponent->SetDebugWristTrackerGizmoLifeTimeModifier(InDebugWristTrackerGizmoLifeTimeModifier);
}
uint8 UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoDepthPriority(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoDepthPriority();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoDepthPriority(
USGWristTrackerComponent* WristTrackerComponent, const uint8 InDebugWristTrackerGizmoDepthPriority)
{
WristTrackerComponent->SetDebugWristTrackerGizmoDepthPriority(InDebugWristTrackerGizmoDepthPriority);
}
float UWristTrackerComponentKismetLibrary::GetDebugWristTrackerGizmoThickness(
const USGWristTrackerComponent* WristTrackerComponent)
{
return WristTrackerComponent->GetDebugWristTrackerGizmoThickness();
}
void UWristTrackerComponentKismetLibrary::SetDebugWristTrackerGizmoThickness(
USGWristTrackerComponent* WristTrackerComponent, const float InDebugWristTrackerGizmoThickness)
{
WristTrackerComponent->SetDebugWristTrackerGizmoThickness(InDebugWristTrackerGizmoThickness);
WristTrackerComponent->SetWristTrackerDebugGizmoSettings(InWristTrackerDebugGizmoSettings);
}
bool UWristTrackerComponentKismetLibrary::IsLeft(const USGWristTrackerComponent* WristTrackerComponent)
@@ -40,6 +40,8 @@
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGSettings/SGDebugGizmoSettings.h"
#include "SGWristTrackerComponentKismetLibrary.generated.h"
class USkeletalMeshComponent;
@@ -89,70 +91,19 @@ public:
bool bInOverridePluginWristTrackingDebugSettings);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static bool GetDrawDebugWristTrackerGizmo(const USGWristTrackerComponent* WristTrackerComponent);
static bool GetDrawWristTrackerDebugGizmo(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDrawDebugWristTrackerGizmo(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
bool bInDrawDebugWristTrackerGizmo);
static void SetDrawWristTrackerDebugGizmo(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
bool bInDrawWristTrackerDebugGizmo);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static float GetDebugWristTrackerGizmoLength(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoLength(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
float InDebugWristTrackerGizmoLength);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static const FColor& GetDebugWristTrackerGizmoXAxisColor(
static const FSGDebugGizmoSettings& GetWristTrackerDebugGizmoSettings(
const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoXAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
const FColor& InDebugWristTrackerGizmoXAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static const FColor& GetDebugWristTrackerGizmoYAxisColor(
const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoYAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
const FColor& InDebugWristTrackerGizmoYAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static const FColor& GetDebugWristTrackerGizmoZAxisColor(
const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoZAxisColor(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
const FColor& InDebugWristTrackerGizmoZAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static bool GetDebugWristTrackerGizmoPersistentLines(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoPersistentLines(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
bool bInDebugWristTrackerGizmoPersistentLines);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static float GetDebugWristTrackerGizmoLifeTimeModifier(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoLifeTimeModifier(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
float InDebugWristTrackerGizmoLifeTimeModifier);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static uint8 GetDebugWristTrackerGizmoDepthPriority(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoDepthPriority(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
uint8 InDebugWristTrackerGizmoDepthPriority);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static float GetDebugWristTrackerGizmoThickness(const USGWristTrackerComponent* WristTrackerComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component")
static void SetDebugWristTrackerGizmoThickness(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
float InDebugWristTrackerGizmoThickness);
static void SetWristTrackerDebugGizmoSettings(UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent,
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Wrist Tracker Component")
static bool IsLeft(const USGWristTrackerComponent* WristTrackerComponent);
@@ -58,6 +58,7 @@ public class SenseGloveKismet : ModuleRules
"SenseGlove",
"SenseGloveCore",
"SenseGloveLog",
"SenseGloveSettings",
"SenseGloveTypes",
"SenseGloveUtils",
}
@@ -0,0 +1,51 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGDebugGizmoSettings.h"
FSGDebugGizmoSettings::FSGDebugGizmoSettings(
const float InLength, const float InThickness,
const FColor& InXAxisColor, const FColor& InYAxisColor, const FColor& InZAxisColor,
const bool bInPersistentLines, const float InLifeTimeModifier, const uint8 InDepthPriority)
: Length(InLength),
Thickness(InThickness),
XAxisColor(InXAxisColor),
YAxisColor(InYAxisColor),
ZAxisColor(InZAxisColor),
bPersistentLines(bInPersistentLines),
LifeTimeModifier(InLifeTimeModifier),
DepthPriority(InDepthPriority)
{
}
@@ -0,0 +1,57 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGDebugVirtualHandSettings.h"
FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings(
const ESGDebugVirtualHandDrawingMode InDrawingMode,
const FVector& InCubeExtent, const FColor& InCubeColor, const float InCubeThickness,
const float InGizmoLength, const float InGizmoThickness,
const FColor& InGizmoXAxisColor, const FColor& InGizmoYAxisColor, const FColor& InGizmoZAxisColor,
const bool bInPersistentLines, const float InLifeTimeModifier, const uint8 InDepthPriority)
: DrawingMode(InDrawingMode),
CubeExtent(InCubeExtent),
CubeColor(InCubeColor),
CubeThickness(InCubeThickness),
GizmoLength(InGizmoLength),
GizmoThickness(InGizmoThickness),
GizmoXAxisColor(InGizmoXAxisColor),
GizmoYAxisColor(InGizmoYAxisColor),
GizmoZAxisColor(InGizmoZAxisColor),
bPersistentLines(bInPersistentLines),
LifeTimeModifier(InLifeTimeModifier),
DepthPriority(InDepthPriority)
{
}
@@ -86,22 +86,20 @@ USGSettings::USGSettings()
Pimpl->ResetTrackingHardwareValuesToZero();
bDrawDebugWristTrackerGizmo = false;
TrackingHardware = ESGPositionalTrackingHardware::None;
TrackingHardwareLocationOffsetLeftHand = FVector::ZeroVector;
TrackingHardwareLocationOffsetRightHand = FVector::ZeroVector;
TrackingHardwareRotationOffsetLeftHand = FRotator::ZeroRotator;
TrackingHardwareRotationOffsetRightHand = FRotator::ZeroRotator;
bDrawDebugWristTrackerGizmo = false;
DebugWristTrackerGizmoLength = 1.0f;
DebugWristTrackerGizmoXAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoYAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f);
DebugWristTrackerGizmoZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f);
bDebugWristTrackerGizmoPersistentLines = false;
DebugWristTrackerGizmoLifeTimeModifier = 1.1f;
DebugWristTrackerGizmoDepthPriority = 0;
DebugWristTrackerGizmoThickness = 1.0f;
bDrawWristTrackerDebugGizmo = false;
WristTrackerDebugGizmoSettings = FSGDebugGizmoSettings(
4.0f, 1.0f,
FColor(255, 0, 0, 255),
FColor(0, 255, 0, 255),
FColor(0, 0, 255, 255),
false, 1.1f, 0
);
}
const FVector& USGSettings::GetTrackingHardwareLocationOffsetLeftHand() const
@@ -178,145 +176,22 @@ void USGSettings::SetTrackingHardwareRotationOffsetRightHand(
TrackingHardwareRotationOffsetRightHand = InTrackingHardwareRotationOffsetRightHand;
}
float USGSettings::GetDebugWristTrackerGizmoLength() const
const FSGDebugGizmoSettings& USGSettings::GetWristTrackerDebugGizmoSettings() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
return DebugWristTrackerGizmoLength;
}
void USGSettings::SetDebugWristTrackerGizmoLength(const float InDebugWristTrackerGizmoLength)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLength is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
DebugWristTrackerGizmoLength = InDebugWristTrackerGizmoLength;
}
const FColor& USGSettings::GetDebugWristTrackerGizmoXAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoXAxisColor;
}
void USGSettings::SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoXAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoXAxisColor = InDebugWristTrackerGizmoXAxisColor;
}
const FColor& USGSettings::GetDebugWristTrackerGizmoYAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoXAxisColor;
}
void USGSettings::SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoYAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoYAxisColor = InDebugWristTrackerGizmoYAxisColor;
}
const FColor& USGSettings::GetDebugWristTrackerGizmoZAxisColor() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoZAxisColor;
}
void USGSettings::SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoZAxisColor is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoZAxisColor = InDebugWristTrackerGizmoZAxisColor;
}
bool USGSettings::GetDebugWristTrackerGizmoPersistentLines() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return !!bDebugWristTrackerGizmoPersistentLines;
}
void USGSettings::SetDebugWristTrackerGizmoPersistentLines(const bool bInDebugWristTrackerGizmoPersistentLines)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting bDebugWristTrackerGizmoPersistentLines is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
bDebugWristTrackerGizmoPersistentLines = bInDebugWristTrackerGizmoPersistentLines;
}
float USGSettings::GetDebugWristTrackerGizmoLifeTimeModifier() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoLifeTimeModifier;
}
void USGSettings::SetDebugWristTrackerGizmoLifeTimeModifier(const float InDebugWristTrackerGizmoLifeTimeModifier)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting DebugWristTrackerGizmoLifeTimeModifier is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoLifeTimeModifier = InDebugWristTrackerGizmoLifeTimeModifier;
}
uint8 USGSettings::GetDebugWristTrackerGizmoDepthPriority() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Getting DebugWristTrackerGizmoDepthPriority is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoDepthPriority;
}
void USGSettings::SetDebugWristTrackerGizmoDepthPriority(const uint8 InDebugWristTrackerGizmoDepthPriority)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
TEXT("Setting is only permitted when bDrawDebugWristTrackerGizmo is enabled!"));
DebugWristTrackerGizmoDepthPriority = InDebugWristTrackerGizmoDepthPriority;
}
float USGSettings::GetDebugWristTrackerGizmoThickness() const
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
GetDrawWristTrackerDebugGizmo(),
TEXT("Getting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
return DebugWristTrackerGizmoThickness;
return WristTrackerDebugGizmoSettings;
}
void USGSettings::SetDebugWristTrackerGizmoThickness(const float InDebugWristTrackerGizmoThickness)
void USGSettings::SetWristTrackerDebugGizmoSettings(const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
{
ensureAlwaysMsgf(
GetDrawDebugWristTrackerGizmo(),
GetDrawWristTrackerDebugGizmo(),
TEXT("Setting DebugWristTrackerGizmoThickness is only permitted when bDrawDebugWristTrackerGizmo is"
" enabled!"));
DebugWristTrackerGizmoThickness = InDebugWristTrackerGizmoThickness;
WristTrackerDebugGizmoSettings = InWristTrackerDebugGizmoSettings;
}
bool USGSettings::ShouldCreateSubsystem(UObject* Outer) const
@@ -0,0 +1,81 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "SGDebugGizmoSettings.generated.h"
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGDebugGizmoSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
float Length;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
float Thickness;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
FColor XAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
FColor YAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
FColor ZAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
uint8 bPersistentLines : 1;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
float LifeTimeModifier;
UPROPERTY(EditAnywhere, Category = "Debug Gizmo Settings")
uint8 DepthPriority;
public:
explicit FSGDebugGizmoSettings(float InLength = 1.0f,
float InThickness = 1.0f,
const FColor& InXAxisColor = FColor(255, 0, 0, 255),
const FColor& InYAxisColor = FColor(0, 255, 0, 255),
const FColor& InZAxisColor = FColor(0, 0, 255, 255),
bool bInPersistentLines = false,
float InLifeTimeModifier = 1.1f,
uint8 InDepthPriority = 0);
};
@@ -0,0 +1,111 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "SGTypes/SGDebugTypes.h"
#include "SGDebugVirtualHandSettings.generated.h"
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGDebugVirtualHandSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings")
ESGDebugVirtualHandDrawingMode DrawingMode;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
FVector CubeExtent;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
FColor CubeColor;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints", EditConditionHides))
float CubeThickness;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
float GizmoLength;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
float GizmoThickness;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
FColor GizmoXAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
FColor GizmoYAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
FColor GizmoZAxisColor;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
uint8 bPersistentLines : 1;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
float LifeTimeModifier;
UPROPERTY(EditAnywhere, Category = "Debug Virtual Hand Settings",
meta=(EditCondition="DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints", EditConditionHides))
uint8 DepthPriority;
public:
explicit FSGDebugVirtualHandSettings(
ESGDebugVirtualHandDrawingMode InDrawingMode = ESGDebugVirtualHandDrawingMode::None,
const FVector& InCubeExtent = FVector(0.5f, 0.5f, 0.5f),
const FColor& InCubeColor = FColor(255, 0, 0, 255),
float InCubeThickness = 0.1f,
float InGizmoLength = 1.0f,
float InGizmoThickness = 0.2f,
const FColor& InGizmoXAxisColor = FColor(255, 0, 0, 255),
const FColor& InGizmoYAxisColor = FColor(0, 255, 0, 255),
const FColor& InGizmoZAxisColor = FColor(0, 0, 255, 255),
bool bInPersistentLines = false,
float InLifeTimeModifier = 1.1f,
uint8 InDepthPriority = 0);
};
@@ -42,6 +42,7 @@
#include "Templates/UniquePtr.h"
#include "UObject/ObjectMacros.h"
#include "SGSettings/SGDebugGizmoSettings.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGSettings.generated.h"
@@ -104,63 +105,14 @@ private:
* If enabled, draws debug Wrist trackers where possible.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug")
uint8 bDrawDebugWristTrackerGizmo : 1;
uint8 bDrawWristTrackerDebugGizmo : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
float DebugWristTrackerGizmoLength;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
FColor DebugWristTrackerGizmoXAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
FColor DebugWristTrackerGizmoYAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
FColor DebugWristTrackerGizmoZAxisColor;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
uint8 bDebugWristTrackerGizmoPersistentLines : 1;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
float DebugWristTrackerGizmoLifeTimeModifier;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
uint8 DebugWristTrackerGizmoDepthPriority;
/**
* Valid only if bDrawDebugWristTrackerGizmo is enabled.
*/
UPROPERTY(Config, EditDefaultsOnly, Category = "Wrist Tracking Debug",
meta=(EditCondition="bDrawDebugWristTrackerGizmo", EditConditionHides))
float DebugWristTrackerGizmoThickness;
FSGDebugGizmoSettings WristTrackerDebugGizmoSettings;
public:
USGSettings();
@@ -188,39 +140,18 @@ public:
const FRotator& GetTrackingHardwareRotationOffsetRightHand() const;
void SetTrackingHardwareRotationOffsetRightHand(const FRotator& InTrackingHardwareRotationOffsetRightHand);
FORCEINLINE bool GetDrawDebugWristTrackerGizmo() const
FORCEINLINE bool GetDrawWristTrackerDebugGizmo() const
{
return !!bDrawDebugWristTrackerGizmo;
return !!bDrawWristTrackerDebugGizmo;
}
void SetDrawDebugWristTrackerGizmo(const bool bInDrawDebugWristTrackerGizmo)
void SetDrawWristTrackerDebugGizmo(const bool bInDrawWristTrackerDebugGizmo)
{
bDrawDebugWristTrackerGizmo = bInDrawDebugWristTrackerGizmo;
bDrawWristTrackerDebugGizmo = bInDrawWristTrackerDebugGizmo;
}
float GetDebugWristTrackerGizmoLength() const;
void SetDebugWristTrackerGizmoLength(float InDebugWristTrackerGizmoLength);
const FColor& GetDebugWristTrackerGizmoXAxisColor() const;
void SetDebugWristTrackerGizmoXAxisColor(const FColor& InDebugWristTrackerGizmoXAxisColor);
const FColor& GetDebugWristTrackerGizmoYAxisColor() const;
void SetDebugWristTrackerGizmoYAxisColor(const FColor& InDebugWristTrackerGizmoYAxisColor);
const FColor& GetDebugWristTrackerGizmoZAxisColor() const;
void SetDebugWristTrackerGizmoZAxisColor(const FColor& InDebugWristTrackerGizmoZAxisColor);
bool GetDebugWristTrackerGizmoPersistentLines() const;
void SetDebugWristTrackerGizmoPersistentLines(bool bInDebugWristTrackerGizmoPersistentLines);
float GetDebugWristTrackerGizmoLifeTimeModifier() const;
void SetDebugWristTrackerGizmoLifeTimeModifier(float InDebugWristTrackerGizmoLifeTimeModifier);
uint8 GetDebugWristTrackerGizmoDepthPriority() const;
void SetDebugWristTrackerGizmoDepthPriority(uint8 InDebugWristTrackerGizmoDepthPriority);
float GetDebugWristTrackerGizmoThickness() const;
void SetDebugWristTrackerGizmoThickness(float InDebugWristTrackerGizmoThickness);
const FSGDebugGizmoSettings& GetWristTrackerDebugGizmoSettings() const;
void SetWristTrackerDebugGizmoSettings(const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
public:
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
@@ -54,11 +54,17 @@ public class SenseGloveSettings : ModuleRules
{
"CoreUObject",
"Engine",
"Settings",
"SenseGloveCore",
"SenseGloveLog",
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"Settings",
}
);
}
}
@@ -97,101 +97,24 @@ void USGSettingsKismetLibrary::SetTrackingHardwareRotationOffsetRightHand(
Settings->SetTrackingHardwareRotationOffsetRightHand(InTrackingHardwareRotationOffsetRightHand);
}
bool USGSettingsKismetLibrary::GetDrawDebugWristTrackerGizmo(const USGSettings* Settings)
bool USGSettingsKismetLibrary::GetDrawWristTrackerDebugGizmo(const USGSettings* Settings)
{
return Settings->GetDrawDebugWristTrackerGizmo();
return Settings->GetDrawWristTrackerDebugGizmo();
}
void USGSettingsKismetLibrary::SetDrawDebugWristTrackerGizmo(
USGSettings* Settings, const bool bInDrawDebugWristTrackerGizmo)
void USGSettingsKismetLibrary::SetDrawWristTrackerDebugGizmo(
USGSettings* Settings, const bool bInDrawWristTrackerDebugGizmo)
{
Settings->SetDrawDebugWristTrackerGizmo(bInDrawDebugWristTrackerGizmo);
Settings->SetDrawWristTrackerDebugGizmo(bInDrawWristTrackerDebugGizmo);
}
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoLength(const USGSettings* Settings)
const FSGDebugGizmoSettings& USGSettingsKismetLibrary::GetWristTrackerDebugGizmoSettings(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoLength();
return Settings->GetWristTrackerDebugGizmoSettings();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoLength(
USGSettings* Settings, const float InDebugWristTrackerGizmoLength)
void USGSettingsKismetLibrary::SetWristTrackerDebugGizmoSettings(USGSettings* Settings,
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings)
{
Settings->SetDebugWristTrackerGizmoLength(InDebugWristTrackerGizmoLength);
}
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoXAxisColor(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoXAxisColor();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoXAxisColor(
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoXAxisColor)
{
Settings->SetDebugWristTrackerGizmoXAxisColor(InDebugWristTrackerGizmoXAxisColor);
}
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoYAxisColor(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoYAxisColor();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoYAxisColor(
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoYAxisColor)
{
Settings->SetDebugWristTrackerGizmoYAxisColor(InDebugWristTrackerGizmoYAxisColor);
}
const FColor& USGSettingsKismetLibrary::GetDebugWristTrackerGizmoZAxisColor(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoZAxisColor();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoZAxisColor(
USGSettings* Settings, const FColor& InDebugWristTrackerGizmoZAxisColor)
{
Settings->SetDebugWristTrackerGizmoZAxisColor(InDebugWristTrackerGizmoZAxisColor);
}
bool USGSettingsKismetLibrary::GetDebugWristTrackerGizmoPersistentLines(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoPersistentLines();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoPersistentLines(
USGSettings* Settings, const bool bInDebugWristTrackerGizmoPersistentLines)
{
Settings->SetDebugWristTrackerGizmoPersistentLines(bInDebugWristTrackerGizmoPersistentLines);
}
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoLifeTimeModifier(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoLifeTimeModifier();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoLifeTimeModifier(
USGSettings* Settings, const float InDebugWristTrackerGizmoLifeTimeModifier)
{
Settings->SetDebugWristTrackerGizmoLifeTimeModifier(InDebugWristTrackerGizmoLifeTimeModifier);
}
uint8 USGSettingsKismetLibrary::GetDebugWristTrackerGizmoDepthPriority(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoDepthPriority();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoDepthPriority(
USGSettings* Settings, const uint8 InDebugWristTrackerGizmoDepthPriority)
{
Settings->SetDebugWristTrackerGizmoDepthPriority(InDebugWristTrackerGizmoDepthPriority);
}
float USGSettingsKismetLibrary::GetDebugWristTrackerGizmoThickness(const USGSettings* Settings)
{
return Settings->GetDebugWristTrackerGizmoThickness();
}
void USGSettingsKismetLibrary::SetDebugWristTrackerGizmoThickness(
USGSettings* Settings, const float InDebugWristTrackerGizmoThickness)
{
Settings->SetDebugWristTrackerGizmoThickness(InDebugWristTrackerGizmoThickness);
Settings->SetWristTrackerDebugGizmoSettings(InWristTrackerDebugGizmoSettings);
}
@@ -38,6 +38,8 @@
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGSettings/SGDebugGizmoSettings.h"
#include "SGSettingsKismetLibrary.generated.h"
class USGSettings;
@@ -55,7 +57,8 @@ public:
static ESGPositionalTrackingHardware GetTrackingHardware(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetTrackingHardware(UPARAM(ref) USGSettings* Settings, ESGPositionalTrackingHardware InTrackingHardware);
static void SetTrackingHardware(UPARAM(ref) USGSettings* Settings,
ESGPositionalTrackingHardware InTrackingHardware);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static const FVector& GetTrackingHardwareLocationOffsetLeftHand(const USGSettings* Settings);
@@ -86,64 +89,15 @@ public:
const FRotator& InTrackingHardwareRotationOffsetRightHand);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static bool GetDrawDebugWristTrackerGizmo(const USGSettings* Settings);
static bool GetDrawWristTrackerDebugGizmo(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDrawDebugWristTrackerGizmo(UPARAM(ref) USGSettings* Settings, bool bInDrawDebugWristTrackerGizmo);
static void SetDrawWristTrackerDebugGizmo(UPARAM(ref) USGSettings* Settings, bool bInDrawWristTrackerDebugGizmo);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static float GetDebugWristTrackerGizmoLength(const USGSettings* Settings);
static const FSGDebugGizmoSettings& GetWristTrackerDebugGizmoSettings(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoLength(UPARAM(ref) USGSettings* Settings,
float InDebugWristTrackerGizmoLength);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static const FColor& GetDebugWristTrackerGizmoXAxisColor(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoXAxisColor(UPARAM(ref) USGSettings* Settings,
const FColor& InDebugWristTrackerGizmoXAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static const FColor& GetDebugWristTrackerGizmoYAxisColor(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoYAxisColor(UPARAM(ref) USGSettings* Settings,
const FColor& InDebugWristTrackerGizmoYAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static const FColor& GetDebugWristTrackerGizmoZAxisColor(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoZAxisColor(UPARAM(ref) USGSettings* Settings,
const FColor& InDebugWristTrackerGizmoZAxisColor);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static bool GetDebugWristTrackerGizmoPersistentLines(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoPersistentLines(UPARAM(ref) USGSettings* Settings,
bool bInDebugWristTrackerGizmoPersistentLines);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static float GetDebugWristTrackerGizmoLifeTimeModifier(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoLifeTimeModifier(UPARAM(ref) USGSettings* Settings,
float InDebugWristTrackerGizmoLifeTimeModifier);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static uint8 GetDebugWristTrackerGizmoDepthPriority(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoDepthPriority(UPARAM(ref) USGSettings* Settings,
uint8 InDebugWristTrackerGizmoDepthPriority);
UFUNCTION(BlueprintPure, Category="SenseGlove | Settings")
static float GetDebugWristTrackerGizmoThickness(const USGSettings* Settings);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Settings")
static void SetDebugWristTrackerGizmoThickness(UPARAM(ref) USGSettings* Settings,
float InDebugWristTrackerGizmoThickness);
static void SetWristTrackerDebugGizmoSettings(UPARAM(ref) USGSettings* Settings,
const FSGDebugGizmoSettings& InWristTrackerDebugGizmoSettings);
};
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGTypes/SGDebugTypes.h"
@@ -0,0 +1,55 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "CoreTypes.h"
#include "UObject/ObjectMacros.h"
/**
* Determines the debug virtual hand drawing mode.
*/
UENUM(BlueprintType)
enum class ESGDebugVirtualHandDrawingMode : uint8
{
/** Do not draw any debug virtual hands. */
None UMETA(DisplayName = "None"),
/** Draw a debug virtual hand with cubic joints. */
CubicJoints UMETA(DisplayName = "Cubic Joints"),
/** Draw a debug virtual hand with gizmo joints. */
GizmoJoints UMETA(DisplayName = "Gizmo Joints"),
};
@@ -50,18 +50,18 @@ public:
static FORCEINLINE float TransformToSenseGlove(const int32 Movement, const float Direction)
{
// 0 = twist, 1 = flexion/extension, 2 = abduction
return FMath::DegreesToRadians(Movement != 1 ? Direction * -1.0f : Direction);
return FMath::DegreesToRadians(Movement != 1 ? -Direction : Direction);
}
static FORCEINLINE FVector TransformToSenseGlove(const FVector& Vector)
{
return FMath::DegreesToRadians(FVector(Vector.X * -1.0f, Vector.Z, Vector.Y));
return FMath::DegreesToRadians(FVector(-Vector.Y, Vector.X, Vector.Z));
}
template<typename V>
static FORCEINLINE V TransformToSenseGlove(const FVector& Vector)
{
return FMath::DegreesToRadians(V(Vector.X * -1.0f, Vector.Z, Vector.Y));
return FMath::DegreesToRadians(V(-Vector.Y, Vector.X, Vector.Z));
}
static FORCEINLINE float TransformToUnreal(const float Radians)
@@ -75,7 +75,7 @@ public:
/// values require validation.
// 0 = twist, 1 = flexion/extension, 2 = abduction
return Movement != 1 ? Direction * -1.0f : Direction;
return Movement != 1 ? -Direction : Direction;
}
static FORCEINLINE constexpr float TransformToUnreal(const ESGFingerMovement Movement, const float Direction)
@@ -90,7 +90,7 @@ public:
/// Which flexions should be ignored?
return (Movement != ESGFingerMovement::McpFlexion && Movement != ESGFingerMovement::PipFlexion && Movement !=
ESGFingerMovement::PipFlexion)
? Direction * -1.0f
? -Direction
: Direction;
}
@@ -108,19 +108,19 @@ public:
Movement != ESGThumbMovement::CmcFlexion
&& Movement != ESGThumbMovement::McpFlexion
&& Movement != ESGThumbMovement::IpFlexion
? Direction * -1.0f
? -Direction
: Direction);
}
static FORCEINLINE FVector TransformToUnreal(const FVector& Vector)
{
return FMath::RadiansToDegrees(FVector(Vector.X * -1.0f, Vector.Z, Vector.Y));
return FMath::RadiansToDegrees(FVector(-Vector.Y, Vector.X, Vector.Z));
}
template<typename V>
static FORCEINLINE FVector TransformToUnreal(const V& Vector)
{
return FMath::RadiansToDegrees(FVector(Vector.GetX() * -1.0f, Vector.GetZ(), Vector.GetY()));
return FMath::RadiansToDegrees(FVector(-Vector.GetY(), Vector.GetX(), Vector.GetZ()));
}
public:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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