revamp the whole settings system in order to unify the settings across various systems, modules, and api layers

This commit is contained in:
Mamadou Babaei
2024-08-16 18:01:40 +02:00
parent 4916aa394c
commit 332b0f3a82
36 changed files with 1362 additions and 819 deletions
@@ -51,7 +51,6 @@
#include "SGCore/SGHapticGlove.h"
#include "SGDebug/SGDebugVirtualHand.h"
#include "SGLog/SGLog.h"
#include "SGSettings/SGSettings.h"
#include "SGTracking/SGGloveTracker.h"
struct USGVirtualHandComponent::FImpl
@@ -88,13 +87,6 @@ struct USGVirtualHandComponent::FImpl
return Path;
}
static const FSGVirtualHandSettings& GetVirtualHandSettings()
{
const USGSettings* Settings{USGSettings::GetInstance()};
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
return Settings->GetVirtualHandSettings();
}
/************************
* Member variables
************************/
@@ -152,12 +144,12 @@ struct USGVirtualHandComponent::FImpl
const TArray<FName>& USGVirtualHandComponent::GetLeftHandBoneNames()
{
return FImpl::GetVirtualHandSettings().LeftHandBoneNames;
return GetVirtualHandSettings().MeshSettings.LeftHandBoneNames;
}
const TArray<FName>& USGVirtualHandComponent::GetRightHandBoneNames()
{
return FImpl::GetVirtualHandSettings().RightHandBoneNames;
return GetVirtualHandSettings().MeshSettings.RightHandBoneNames;
}
const FName& USGVirtualHandComponent::GetLeftHandBoneName(const int32 Joint)
@@ -214,29 +206,6 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec
bRight = true;
bVisibleWhenHandDataUnavailable = false;
AnimationBoneRotationCorrectionOffset = FRotator{0.0f, 90.0f, 90.0f};
bShouldAnimationApplyBoneLocation = true;
bAutoStopAllHapticsOnEndPlay = true;
GrabSocketName = FName{TEXT("GenericGrabPoint")};
DefaultFingertipsGrabColliderSize = FVector{0.08f, 0.08f, 0.08f};
ThumbFingertipGrabSocketName = FName{TEXT("GrabThumbFingertip")};
IndexFingertipGrabSocketName = FName{TEXT("GrabIndexFingertip")};
MiddleFingertipGrabSocketName = FName{TEXT("GrabMiddleFingertip")};
DefaultFingertipsTouchColliderSize = FVector{0.08f, 0.08f, 0.08f};
ThumbFingertipTouchSocketName = FName{TEXT("TouchThumbFingertip")};
IndexFingertipTouchSocketName = FName{TEXT("TouchIndexFingertip")};
MiddleFingertipTouchSocketName = FName{TEXT("TouchMiddleFingertip")};
RingFingertipTouchSocketName = FName{TEXT("TouchRingFingertip")};
PinkyFingertipTouchSocketName = FName{TEXT("TouchPinkyFingertip")};
DebugVirtualHandSettings = FSGDebugVirtualHandSettings{};
Super::SetSkeletalMesh(nullptr, true);
WristTracker = nullptr;
@@ -352,7 +321,7 @@ void USGVirtualHandComponent::TickComponent(
Pimpl->UpdateVisibility();
if (DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
if (GetVirtualHandDebuggingSettings().DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
@@ -375,7 +344,7 @@ void USGVirtualHandComponent::EditorTick(
{
Pimpl->UpdateVisibility();
if (DebugVirtualHandSettings.DrawingMode != ESGDebugVirtualHandDrawingMode::None)
if (GetVirtualHandDebuggingSettings().DrawingMode != ESGDebugVirtualHandDrawingMode::None)
{
Pimpl->DrawDebugVirtualHand();
}
@@ -677,7 +646,7 @@ void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const
return;
}
FSGDebugVirtualHand::Draw(World, MotionControllerData, Owner->DebugVirtualHandSettings);
FSGDebugVirtualHand::Draw(World, MotionControllerData, Owner->GetVirtualHandDebuggingSettings());
}
void USGVirtualHandComponent::FImpl::TriggerHandVisibilityChangedEvent(const bool bNewVisibility) const
@@ -189,7 +189,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
ControllerVisualizerLeft->SetupAttachment(WristTrackerLeft);
ControllerVisualizerLeft->SetDisplayModelSource(FName("OpenXR"));
HandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandLeft"));
HandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(
this, TEXT("HandLeft"));
HandLeft->SetupAttachment(GetRootComponent());
HandLeft->SetCanEverAffectNavigation(false);
HandLeft->SetGenerateOverlapEvents(true);
@@ -206,13 +207,14 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
HandLeft->SetRight(false);
HandLeft->SetVisibleWhenHandDataUnavailable(false);
HandLeft->SetRelativeRotation(FImpl::GetVirtualHandSettings().RootBoneRotationCorrection,
HandLeft->SetRelativeRotation(FImpl::GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection,
false, nullptr, ETeleportType::None);
HandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
false, nullptr, ETeleportType::None);
HandLeft->SetWristTracker(WristTrackerLeft);
RealHandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("RealHandLeft"));
RealHandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(
this, TEXT("RealHandLeft"));
RealHandLeft->SetupAttachment(GetRootComponent());
RealHandLeft->SetCanEverAffectNavigation(false);
RealHandLeft->SetGenerateOverlapEvents(true);
@@ -230,16 +232,17 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RealHandLeft->SetRight(false);
Pimpl->SetVisibility(RealHandLeft, false);
RealHandLeft->SetVisibleWhenHandDataUnavailable(false);
RealHandLeft->SetRelativeRotation(FImpl::GetVirtualHandSettings().RootBoneRotationCorrection,
RealHandLeft->SetRelativeRotation(FImpl::GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection,
false, nullptr, ETeleportType::None);
RealHandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
false, nullptr, ETeleportType::None);
RealHandLeft->SetWristTracker(WristTrackerLeft);
FSGDebugVirtualHandSettings RealHandLeftDebugSettings;
RealHandLeftDebugSettings.bDrawDebugVirtualHand = true;
RealHandLeftDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
RealHandLeft->SetDebugVirtualHandSettings(MoveTemp(RealHandLeftDebugSettings));
/// FIXME - REFACTOR
// FSGVirtualHandDebuggingSettings RealHandLeftDebugSettings;
// RealHandLeftDebugSettings.bDrawDebugVirtualHand = true;
// RealHandLeftDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
// RealHandLeft->SetVirtualHandDebuggingSettings(MoveTemp(RealHandLeftDebugSettings));
LeftThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("LeftThumbFingertipGrabCollider"));
@@ -348,7 +351,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
ControllerVisualizerRight->SetupAttachment(WristTrackerRight);
ControllerVisualizerRight->SetDisplayModelSource(FName("OpenXR"));
HandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandRight"));
HandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(
this, TEXT("HandRight"));
HandRight->SetupAttachment(GetRootComponent());
HandRight->SetCanEverAffectNavigation(false);
HandRight->SetGenerateOverlapEvents(true);
@@ -365,13 +369,14 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
HandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
HandRight->SetRight(true);
HandRight->SetVisibleWhenHandDataUnavailable(false);
HandRight->SetRelativeRotation(FImpl::GetVirtualHandSettings().RootBoneRotationCorrection,
HandRight->SetRelativeRotation(FImpl::GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection,
false, nullptr, ETeleportType::None);
HandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
false, nullptr, ETeleportType::None);
HandRight->SetWristTracker(WristTrackerRight);
RealHandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("RealHandRight"));
RealHandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(
this, TEXT("RealHandRight"));
RealHandRight->SetupAttachment(GetRootComponent());
RealHandRight->SetCanEverAffectNavigation(false);
RealHandRight->SetGenerateOverlapEvents(true);
@@ -389,16 +394,17 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
RealHandRight->SetRight(true);
Pimpl->SetVisibility(RealHandRight, false);
RealHandRight->SetVisibleWhenHandDataUnavailable(false);
RealHandRight->SetRelativeRotation(FImpl::GetVirtualHandSettings().RootBoneRotationCorrection,
RealHandRight->SetRelativeRotation(FImpl::GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection,
false, nullptr, ETeleportType::None);
RealHandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
false, nullptr, ETeleportType::None);
RealHandRight->SetWristTracker(WristTrackerRight);
FSGDebugVirtualHandSettings RealHandRightDebugSettings;
RealHandRightDebugSettings.bDrawDebugVirtualHand = true;
RealHandRightDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
RealHandRight->SetDebugVirtualHandSettings(MoveTemp(RealHandRightDebugSettings));
/// FIXME - REFACTOR
// FSGVirtualHandDebuggingSettings RealHandRightDebugSettings;
// RealHandRightDebugSettings.bDrawDebugVirtualHand = true;
// RealHandRightDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
// RealHandRight->SetVirtualHandDebuggingSettings(MoveTemp(RealHandRightDebugSettings));
RightThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
this, TEXT("RightThumbFingertipGrabCollider"));
@@ -498,11 +504,19 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
MaxNumberOfHandVelocitySamples = 10;
LeftHandGrabState = FSGGrabState(HandLeft, FVector::Zero(), {}, nullptr, nullptr, nullptr, nullptr);
LeftHandTouchState = FSGTouchState(HandLeft, nullptr, nullptr, nullptr, nullptr, nullptr);
LeftHandGrabState = FSGGrabState{
HandLeft, FVector::Zero(), {}, nullptr, nullptr, nullptr, nullptr
};
LeftHandTouchState = FSGTouchState{
HandLeft, nullptr, nullptr, nullptr, nullptr, nullptr
};
RightHandGrabState = FSGGrabState(HandRight, FVector::Zero(), {}, nullptr, nullptr, nullptr, nullptr);
RightHandTouchState = FSGTouchState(HandRight, nullptr, nullptr, nullptr, nullptr, nullptr);
RightHandGrabState = FSGGrabState{
HandRight, FVector::Zero(), {}, nullptr, nullptr, nullptr, nullptr
};
RightHandTouchState = FSGTouchState{
HandRight, nullptr, nullptr, nullptr, nullptr, nullptr
};
}
void ASGPawn::OnGrabStateUpdated_Implementation(const FSGGrabState& GrabState)
@@ -1702,7 +1716,7 @@ void ASGPawn::FImpl::UpdateHandRotation(const bool bRight, const FRotator& Rotat
void ASGPawn::FImpl::UpdateLeftHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
{
const FQuat NewRotation{
Rotation.Quaternion() * GetVirtualHandSettings().RootBoneRotationCorrection.Quaternion()
Rotation.Quaternion() * GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection.Quaternion()
};
if (bUpdateVirtualHand)
{
@@ -1714,7 +1728,7 @@ void ASGPawn::FImpl::UpdateLeftHandRotation(const FRotator& Rotation, const bool
void ASGPawn::FImpl::UpdateRightHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
{
const FQuat NewRotation{
Rotation.Quaternion() * GetVirtualHandSettings().RootBoneRotationCorrection.Quaternion()
Rotation.Quaternion() * GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection.Quaternion()
};
if (bUpdateVirtualHand)
{
@@ -42,11 +42,12 @@
#include "HeadMountedDisplayTypes.h"
#include "Math/Rotator.h"
#include "Math/Transform.h"
#include "Misc/AssertionMacros.h"
#include "ReferenceSkeleton.h"
#include "Templates/UniquePtr.h"
#include "UObject/NameTypes.h"
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGSettings/SGSettings.h"
#include "SGVirtualHandComponent.generated.h"
@@ -62,6 +63,14 @@ class SENSEGLOVE_API USGVirtualHandComponent : public USkeletalMeshComponent
{
GENERATED_UCLASS_BODY()
public:
static const FSGVirtualHandSettings& GetVirtualHandSettings()
{
const USGSettings* Settings{USGSettings::GetInstance()};
ensureAlwaysMsgf(Settings, TEXT("The settings subsystem has not been initialized!"));
return Settings->GetVirtualHandSettings();
}
public:
DECLARE_EVENT_OneParam(USGVirtualHandComponent, FHandVisibilityChangedEvent, bool bNewVisibiliy);
@@ -98,51 +107,6 @@ private:
UPROPERTY(EditAnywhere, Category="SenseGlove", meta=(AllowPrivateAccess="false"))
uint8 bVisibleWhenHandDataUnavailable : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove | Animation", meta=(AllowPrivateAccess="false"))
FRotator AnimationBoneRotationCorrectionOffset;
UPROPERTY(EditAnywhere, Category="SenseGlove | Animation", meta=(AllowPrivateAccess="false"))
uint8 bShouldAnimationApplyBoneLocation : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove | Haptics", meta=(AllowPrivateAccess="false"))
uint8 bAutoStopAllHapticsOnEndPlay : 1;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName GrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FVector DefaultFingertipsGrabColliderSize;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName ThumbFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName IndexFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Grab", meta=(AllowPrivateAccess="false"))
FName MiddleFingertipGrabSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FVector DefaultFingertipsTouchColliderSize;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName ThumbFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName IndexFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName MiddleFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName RingFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Touch", meta=(AllowPrivateAccess="false"))
FName PinkyFingertipTouchSocketName;
UPROPERTY(EditAnywhere, Category="SenseGlove | Debugging", meta=(AllowPrivateAccess="false"))
FSGDebugVirtualHandSettings DebugVirtualHandSettings;
private:
UPROPERTY(Transient)
USGWristTrackerComponent* WristTracker;
@@ -164,145 +128,79 @@ public:
void SetRight(const bool bInRight);
FORCEINLINE const FName& GetMiddleFingertipTouchSocketName() const
{
return MiddleFingertipTouchSocketName;
}
FORCEINLINE void SetMiddleFingertipTouchSocketName(const FName& SocketName)
{
MiddleFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FRotator& GetAnimationBoneRotationCorrectionOffset() const
{
return AnimationBoneRotationCorrectionOffset;
}
FORCEINLINE void SetAnimationBoneRotationCorrectionOffset(
const FRotator& InAnimationBoneRotationCorrectionOffset)
{
AnimationBoneRotationCorrectionOffset = InAnimationBoneRotationCorrectionOffset;
return GetVirtualHandSettings().AnimationSettings.AnimationBoneRotationCorrectionOffset;
}
FORCEINLINE bool ShouldAnimationApplyBoneLocation() const
{
return !!bShouldAnimationApplyBoneLocation;
}
FORCEINLINE void SetShouldAnimationApplyBoneLocation(const bool bInShouldAnimationApplyBoneLocation)
{
bShouldAnimationApplyBoneLocation = bInShouldAnimationApplyBoneLocation;
return !!GetVirtualHandSettings().AnimationSettings.bShouldAnimationApplyBoneLocation;
}
FORCEINLINE bool AutoStopsAllHapticsOnEndPlay() const
{
return !!bAutoStopAllHapticsOnEndPlay;
}
FORCEINLINE void SetAutoStopAllHapticsOnEndPlay(const bool bInAutoStopAllHapticsOnEndPlay)
{
bAutoStopAllHapticsOnEndPlay = bInAutoStopAllHapticsOnEndPlay;
return !!GetVirtualHandSettings().HapticsSettings.bAutoStopAllHapticsOnEndPlay;
}
FORCEINLINE const FName& GetGrabSocketName() const
{
return GrabSocketName;
return GetVirtualHandSettings().GrabSettings.PalmAttachPointSocketName;
}
FORCEINLINE const FVector& GetDefaultFingertipsGrabColliderSize() const
{
return DefaultFingertipsGrabColliderSize;
return GetVirtualHandSettings().GrabSettings.DefaultColliderSize;
}
FORCEINLINE const FName& GetThumbFingertipGrabSocketName() const
{
return ThumbFingertipGrabSocketName;
}
FORCEINLINE void SetThumbFingertipGrabSocketName(const FName& SocketName)
{
ThumbFingertipGrabSocketName = SocketName;
return GetVirtualHandSettings().GrabSettings.ThumbColliderSocketName;
}
FORCEINLINE const FName& GetIndexFingertipGrabSocketName() const
{
return IndexFingertipGrabSocketName;
}
FORCEINLINE void SetIndexFingertipGrabSocketName(const FName& SocketName)
{
IndexFingertipGrabSocketName = SocketName;
return GetVirtualHandSettings().GrabSettings.IndexColliderSocketName;
}
FORCEINLINE const FName& GetMiddleFingertipGrabSocketName() const
{
return MiddleFingertipGrabSocketName;
}
FORCEINLINE void SetMiddleFingertipGrabSocketName(const FName& SocketName)
{
MiddleFingertipGrabSocketName = SocketName;
return GetVirtualHandSettings().GrabSettings.MiddleColliderSocketName;
}
FORCEINLINE const FVector& GetDefaultFingertipsTouchColliderSize() const
{
return DefaultFingertipsTouchColliderSize;
return GetVirtualHandSettings().TouchSettings.DefaultColliderSize;
}
FORCEINLINE const FName& GetThumbFingertipTouchSocketName() const
{
return ThumbFingertipTouchSocketName;
}
FORCEINLINE void SetThumbFingertipTouchSocketName(const FName& SocketName)
{
ThumbFingertipTouchSocketName = SocketName;
return GetVirtualHandSettings().TouchSettings.ThumbColliderSocketName;
}
FORCEINLINE const FName& GetIndexFingertipTouchSocketName() const
{
return IndexFingertipTouchSocketName;
return GetVirtualHandSettings().TouchSettings.IndexColliderSocketName;
}
FORCEINLINE void SetIndexFingertipTouchSocketName(const FName& SocketName)
FORCEINLINE const FName& GetMiddleFingertipTouchSocketName() const
{
IndexFingertipTouchSocketName = SocketName;
return GetVirtualHandSettings().TouchSettings.MiddleColliderSocketName;
}
FORCEINLINE const FName& GetRingFingertipTouchSocketName() const
{
return RingFingertipTouchSocketName;
}
FORCEINLINE void SetRingFingertipTouchSocketName(const FName& SocketName)
{
RingFingertipTouchSocketName = SocketName;
return GetVirtualHandSettings().TouchSettings.RingColliderSocketName;
}
FORCEINLINE const FName& GetPinkyFingertipTouchSocketName() const
{
return PinkyFingertipTouchSocketName;
return GetVirtualHandSettings().TouchSettings.PinkyColliderSocketName;
}
FORCEINLINE void SetPinkyFingertipTouchSocketName(const FName& SocketName)
FORCEINLINE const FSGVirtualHandDebuggingSettings& GetVirtualHandDebuggingSettings() const
{
PinkyFingertipTouchSocketName = SocketName;
}
FORCEINLINE const FSGDebugVirtualHandSettings& GetDebugVirtualHandSettings() const
{
return DebugVirtualHandSettings;
}
FORCEINLINE FSGDebugVirtualHandSettings& GetDebugVirtualHandSettings()
{
return DebugVirtualHandSettings;
}
FORCEINLINE void SetDebugVirtualHandSettings(const FSGDebugVirtualHandSettings& InDebugVirtualHandSettings)
{
DebugVirtualHandSettings = InDebugVirtualHandSettings;
return GetVirtualHandSettings().DebuggingSettings;
}
FORCEINLINE bool IsVisibleWhenHandDataUnavailable() const
@@ -45,7 +45,7 @@
void FSGDebugVirtualHand::Draw(const UWorld* World,
const FXRMotionControllerData& MotionControllerData,
const FSGDebugVirtualHandSettings& Settings)
const FSGVirtualHandDebuggingSettings& Settings)
{
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
TEXT("Invalid virtual hand drawing mode!"));
@@ -40,7 +40,7 @@
#include "Math/Rotator.h"
#include "Math/Vector.h"
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
class UWorld;
@@ -50,7 +50,7 @@ public:
static void Draw(
const UWorld* World,
const FXRMotionControllerData& MotionControllerData,
const FSGDebugVirtualHandSettings& Settings);
const FSGVirtualHandDebuggingSettings& Settings);
public:
FSGDebugVirtualHand() = delete;
@@ -39,7 +39,7 @@
void USGDebugVirtualHandKismetLibrary::Draw(
UObject* WorldContextObject,
const FXRMotionControllerData& MotionControllerData, const FSGDebugVirtualHandSettings& Settings)
const FXRMotionControllerData& MotionControllerData, const FSGVirtualHandDebuggingSettings& Settings)
{
ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!"));
@@ -53,5 +53,5 @@ public:
static void Draw(
UObject* WorldContextObject,
const FXRMotionControllerData& MotionControllerData,
const FSGDebugVirtualHandSettings& Settings);
const FSGVirtualHandDebuggingSettings& Settings);
};
@@ -92,36 +92,18 @@ const FRotator& UVirtualHandComponentKismetLibrary::GetAnimationBoneRotationCorr
return VirtualHandComponent->GetAnimationBoneRotationCorrectionOffset();
}
void UVirtualHandComponentKismetLibrary::SetAnimationBoneRotationCorrectionOffset(
USGVirtualHandComponent* VirtualHandComponent, const FRotator& InAnimationBoneRotationCorrectionOffset)
{
VirtualHandComponent->SetAnimationBoneRotationCorrectionOffset(InAnimationBoneRotationCorrectionOffset);
}
bool UVirtualHandComponentKismetLibrary::ShouldAnimationApplyBoneLocation(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->ShouldAnimationApplyBoneLocation();
}
void UVirtualHandComponentKismetLibrary::SetShouldAnimationApplyBoneLocation(
USGVirtualHandComponent* VirtualHandComponent, const bool bInShouldAnimationApplyBoneLocation)
{
VirtualHandComponent->SetShouldAnimationApplyBoneLocation(bInShouldAnimationApplyBoneLocation);
}
bool UVirtualHandComponentKismetLibrary::AutoStopsAllHapticsOnEndPlay(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->AutoStopsAllHapticsOnEndPlay();
}
void UVirtualHandComponentKismetLibrary::SetAutoStopAllHapticsOnEndPlay(
USGVirtualHandComponent* VirtualHandComponent, const bool bInAutoStopAllHapticsOnEndPlay)
{
VirtualHandComponent->SetAutoStopAllHapticsOnEndPlay(bInAutoStopAllHapticsOnEndPlay);
}
const FName& UVirtualHandComponentKismetLibrary::GetGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetGrabSocketName();
@@ -139,36 +121,18 @@ const FName& UVirtualHandComponentKismetLibrary::GetThumbFingertipGrabSocketName
return VirtualHandComponent->GetThumbFingertipGrabSocketName();
}
void UVirtualHandComponentKismetLibrary::SetThumbFingertipGrabSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetThumbFingertipGrabSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetIndexFingertipGrabSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetIndexFingertipGrabSocketName();
}
void UVirtualHandComponentKismetLibrary::SetIndexFingertipGrabSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetIndexFingertipGrabSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetMiddleFingertipGrabSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetMiddleFingertipGrabSocketName();
}
void UVirtualHandComponentKismetLibrary::SetMiddleFingertipGrabSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetMiddleFingertipGrabSocketName(SocketName);
}
const FVector& UVirtualHandComponentKismetLibrary::GetDefaultFingertipsTouchColliderSize(
const USGVirtualHandComponent* VirtualHandComponent)
{
@@ -181,77 +145,34 @@ const FName& UVirtualHandComponentKismetLibrary::GetThumbFingertipTouchSocketNam
return VirtualHandComponent->GetThumbFingertipTouchSocketName();
}
void UVirtualHandComponentKismetLibrary::SetThumbFingertipTouchSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetThumbFingertipTouchSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetIndexFingertipTouchSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetIndexFingertipTouchSocketName();
}
void UVirtualHandComponentKismetLibrary::SetIndexFingertipTouchSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetIndexFingertipTouchSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetMiddleFingertipTouchSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetMiddleFingertipTouchSocketName();
}
void UVirtualHandComponentKismetLibrary::SetMiddleFingertipTouchSocketName(
USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName)
{
VirtualHandComponent->SetMiddleFingertipTouchSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetRingFingertipTouchSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetRingFingertipTouchSocketName();
}
void UVirtualHandComponentKismetLibrary::SetRingFingertipTouchSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetRingFingertipTouchSocketName(SocketName);
}
const FName& UVirtualHandComponentKismetLibrary::GetPinkyFingertipTouchSocketName(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetPinkyFingertipTouchSocketName();
}
void UVirtualHandComponentKismetLibrary::SetPinkyFingertipTouchSocketName(
USGVirtualHandComponent* VirtualHandComponent, const FName& SocketName)
{
VirtualHandComponent->SetPinkyFingertipTouchSocketName(SocketName);
}
const FSGDebugVirtualHandSettings& UVirtualHandComponentKismetLibrary::GetDebugVirtualHandSettings(
const FSGVirtualHandDebuggingSettings& UVirtualHandComponentKismetLibrary::GetVirtualHandDebuggingSettings(
const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->GetDebugVirtualHandSettings();
}
void UVirtualHandComponentKismetLibrary::SetDebugVirtualHandSettings(
USGVirtualHandComponent* VirtualHandComponent,
const FSGDebugVirtualHandSettings& InDebugVirtualHandSettings)
{
VirtualHandComponent->SetDebugVirtualHandSettings(InDebugVirtualHandSettings);
}
bool UVirtualHandComponentKismetLibrary::IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent)
{
return VirtualHandComponent->IsGloveConnected();
return VirtualHandComponent->GetVirtualHandDebuggingSettings();
}
USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove(
@@ -43,7 +43,7 @@
#include "UObject/NameTypes.h"
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
#include "SGVirtualHandComponentKismetLibrary.generated.h"
@@ -91,27 +91,13 @@ public:
static const FRotator& GetAnimationBoneRotationCorrectionOffset(
const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetAnimationBoneRotationCorrectionOffset(
UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FRotator& InAnimationBoneRotationCorrectionOffset);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static bool ShouldAnimationApplyBoneLocation(
const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetShouldAnimationApplyBoneLocation(
UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
bool bInShouldAnimationApplyBoneLocation);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static bool AutoStopsAllHapticsOnEndPlay(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetAutoStopAllHapticsOnEndPlay(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const bool bInAutoStopAllHapticsOnEndPlay);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
@@ -121,73 +107,34 @@ public:
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetThumbFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetThumbFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetIndexFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetIndexFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetMiddleFingertipGrabSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetMiddleFingertipGrabSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FVector& GetDefaultFingertipsTouchColliderSize(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetThumbFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetThumbFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetIndexFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetIndexFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetMiddleFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetMiddleFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetRingFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetRingFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FName& GetPinkyFingertipTouchSocketName(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component")
static void SetPinkyFingertipTouchSocketName(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FName& SocketName);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static const FSGDebugVirtualHandSettings& GetDebugVirtualHandSettings(
static const FSGVirtualHandDebuggingSettings& GetVirtualHandDebuggingSettings(
const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static void SetDebugVirtualHandSettings(UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent,
const FSGDebugVirtualHandSettings& InDebugVirtualHandSettings);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static bool IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component")
static USGHapticGlove* GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent);
@@ -36,7 +36,7 @@
#include "SGSettings/SGDebugGizmoSettings.h"
FSGDebugGizmoSettings::FSGDebugGizmoSettings()
: FSGDebugGizmoSettings(
: FSGDebugGizmoSettings{
4.0f,
0.4f,
FColor(255, 0, 0, 255),
@@ -44,7 +44,8 @@ FSGDebugGizmoSettings::FSGDebugGizmoSettings()
FColor(0, 0, 255, 255),
false,
1.1f,
0)
0
}
{
}
@@ -59,9 +60,9 @@ FSGDebugGizmoSettings::FSGDebugGizmoSettings(
const uint8 InDepthPriority)
: Length(InLength),
Thickness(InThickness),
XAxisColor(InXAxisColor),
YAxisColor(InYAxisColor),
ZAxisColor(InZAxisColor),
XAxisColor{InXAxisColor},
YAxisColor{InYAxisColor},
ZAxisColor{InZAxisColor},
bPersistentLines(bInPersistentLines),
LifeTimeModifier(InLifeTimeModifier),
DepthPriority(InDepthPriority)
@@ -36,12 +36,12 @@
#include "SGSettings/SGGameUserSettingSettings.h"
FSGGameUserSettingSettings::FSGGameUserSettingSettings()
: HardwareBenchmarkSettings{}
: HardwareBenchmarkSettings{FSGHardwareBenchmarkSettings{}}
{
}
FSGGameUserSettingSettings::FSGGameUserSettingSettings(
const FSGHardwareBenchmarkSettings& InHardwareBenchmarkSettings)
: HardwareBenchmarkSettings(InHardwareBenchmarkSettings)
: HardwareBenchmarkSettings{InHardwareBenchmarkSettings}
{
}
@@ -36,8 +36,9 @@
#include "SGSettings/SGGloveTrackingSettings.h"
FSGGloveTrackingSettings::FSGGloveTrackingSettings()
: FSGGloveTrackingSettings(
0.125f)
: FSGGloveTrackingSettings{
1000.0f / 60.0f
}
{
}
@@ -36,13 +36,14 @@
#include "SGSettings/SGHMDTrackingSettings.h"
FSGHMDTrackingSettings::FSGHMDTrackingSettings()
: FSGHMDTrackingSettings(
ESGViveHMDDetectionPriority::HtcViveFocus3First)
: FSGHMDTrackingSettings{
ESGViveHMDDetectionPriority::HtcViveFocus3First
}
{
}
FSGHMDTrackingSettings::FSGHMDTrackingSettings(
const ESGViveHMDDetectionPriority InViveHmdDetectionPriority)
: ViveHMDDetectionPriority(InViveHmdDetectionPriority)
: ViveHMDDetectionPriority(InViveHmdDetectionPriority)
{
}
@@ -36,9 +36,10 @@
#include "SGSettings/SGHandTrackingSettings.h"
FSGHandTrackingSettings::FSGHandTrackingSettings()
: FSGHandTrackingSettings(
: FSGHandTrackingSettings{
false,
true)
true
}
{
}
@@ -36,10 +36,11 @@
#include "SGSettings/SGHardwareBenchmarkSettings.h"
FSGHardwareBenchmarkSettings::FSGHardwareBenchmarkSettings()
: FSGHardwareBenchmarkSettings(
: FSGHardwareBenchmarkSettings{
10.0f,
1.0f,
1.0f)
1.0f
}
{
}
@@ -36,8 +36,9 @@
#include "SGSettings/SGInitializationSettings.h"
FSGInitializationSettings::FSGInitializationSettings()
: FSGInitializationSettings(
true)
: FSGInitializationSettings{
true
}
{
}
@@ -36,12 +36,13 @@
#include "SGSettings/SGTrackingSettings.h"
FSGTrackingSettings::FSGTrackingSettings()
: FSGTrackingSettings(
: FSGTrackingSettings{
false,
FSGGloveTrackingSettings{},
FSGHandTrackingSettings{},
FSGHMDTrackingSettings{},
FSGWristTrackingSettings{})
FSGWristTrackingSettings{}
}
{
}
@@ -0,0 +1,52 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandAnimationSettings.h"
FSGVirtualHandAnimationSettings::FSGVirtualHandAnimationSettings()
: FSGVirtualHandAnimationSettings{
FRotator{0.0f, 90.0f, 90.0f},
true
}
{
}
FSGVirtualHandAnimationSettings::FSGVirtualHandAnimationSettings(
const FRotator& InAnimationBoneRotationCorrectionOffset,
const bool bInShouldAnimationApplyBoneLocation)
: AnimationBoneRotationCorrectionOffset{InAnimationBoneRotationCorrectionOffset},
bShouldAnimationApplyBoneLocation(bInShouldAnimationApplyBoneLocation)
{
}
@@ -33,10 +33,10 @@
*/
#include "SGSettings/SGDebugVirtualHandSettings.h"
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings()
: FSGDebugVirtualHandSettings(
FSGVirtualHandDebuggingSettings::FSGVirtualHandDebuggingSettings()
: FSGVirtualHandDebuggingSettings{
false,
ESGDebugVirtualHandDrawingMode::None,
FVector(0.5f, 0.5f, 0.5f),
@@ -49,12 +49,13 @@ FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings()
FColor(0, 0, 255, 255),
false,
1.1f,
0)
0
}
{
}
FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings(
const bool bInDrawDebugVirtualHand,
FSGVirtualHandDebuggingSettings::FSGVirtualHandDebuggingSettings(
const bool bInDrawVirtualHandDebugging,
const ESGDebugVirtualHandDrawingMode InDrawingMode,
const FVector& InCubeExtent,
const FColor& InCubeColor,
@@ -67,7 +68,7 @@ FSGDebugVirtualHandSettings::FSGDebugVirtualHandSettings(
const bool bInPersistentLines,
const float InLifeTimeModifier,
const uint8 InDepthPriority)
: bDrawDebugVirtualHand(bInDrawDebugVirtualHand),
: bDrawVirtualHandDebugging(bInDrawVirtualHandDebugging),
DrawingMode(InDrawingMode),
CubeExtent(InCubeExtent),
CubeColor(InCubeColor),
@@ -0,0 +1,61 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandGrabSettings.h"
FSGVirtualHandGrabSettings::FSGVirtualHandGrabSettings()
: FSGVirtualHandGrabSettings{
FName{TEXT("GrabPalmAttachPoint")},
FVector{0.04f, 0.04f, 0.04f},
FName{TEXT("GrabThumbCollider")},
FName{TEXT("GrabIndexCollider")},
FName{TEXT("GrabMiddleCollider")}
}
{
}
FSGVirtualHandGrabSettings::FSGVirtualHandGrabSettings(
const FName& InPalmAttachPointSocketName,
const FVector& InDefaultColliderSize,
const FName& InThumbColliderSocketName,
const FName& InIndexColliderSocketName,
const FName& InMiddleColliderSocketName)
: PalmAttachPointSocketName{InPalmAttachPointSocketName},
DefaultColliderSize{InDefaultColliderSize},
ThumbColliderSocketName{InThumbColliderSocketName},
IndexColliderSocketName{InIndexColliderSocketName},
MiddleColliderSocketName{InMiddleColliderSocketName}
{
}
@@ -0,0 +1,49 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandHapticsSettings.h"
FSGVirtualHandHapticsSettings::FSGVirtualHandHapticsSettings()
: FSGVirtualHandHapticsSettings{
true
}
{
}
FSGVirtualHandHapticsSettings::FSGVirtualHandHapticsSettings(
bool bInAutoStopAllHapticsOnEndPlay)
: bAutoStopAllHapticsOnEndPlay(bInAutoStopAllHapticsOnEndPlay)
{
}
@@ -0,0 +1,416 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandMeshSettings.h"
#include "Engine/SkeletalMesh.h"
FSGVirtualHandMeshSettings::FSGVirtualHandMeshSettings()
: FSGVirtualHandMeshSettings{
nullptr,
nullptr,
FSGVirtualHandPhalangesLengthSettings{},
FRotator{0.0f, -90.0f, 0.0f}
}
{
}
FSGVirtualHandMeshSettings::FSGVirtualHandMeshSettings(
const TSoftObjectPtr<USkeletalMesh>& InLeftHandReferenceMesh,
const TSoftObjectPtr<USkeletalMesh>& InRightHandReferenceMesh,
const FSGVirtualHandPhalangesLengthSettings& InDistalPhalangesLengthSettings,
const FRotator& InRootBoneRotationCorrection)
: LeftHandReferenceMesh{InLeftHandReferenceMesh},
RightHandReferenceMesh{InRightHandReferenceMesh},
DistalPhalangesLengthSettings{InDistalPhalangesLengthSettings},
RootBoneRotationCorrection{InRootBoneRotationCorrection},
LeftHandDefaultReferenceBoneTransforms{
TPair<FName, FTransform>{
FName{TEXT("hand_l")},
FTransform{
FRotator{0.0f, -180.0f, 90.0f},
FVector{0.0f, 0.0f, 0.0f}
}
},
TPair<FName, FTransform>{
FName{TEXT("palm_l")},
FTransform{
FRotator{0.0f, 0.0f, 0.0f},
FVector{0.0f, 0.0f, -6.61557f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_01_l")},
FTransform{
FRotator{30.400068f, 75.42522f, 33.588919f},
FVector{2.581536f, 1.356605f, -1.992447f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_02_l")},
FTransform{
FRotator{-0.379136f, 4.00635f, -23.318826f},
FVector{0.0f, 0.0f, -4.378f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{0.0f, 0.0f, -3.086f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_metacarpal_l")},
FTransform{
FRotator{7.277920f, 3.392215f, 1.032481f},
FVector{2.379324f, -0.384681f, -3.444506f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_01_l")},
FTransform{
FRotator{0.0f, 0.0f, -23.373f},
FVector{-0.240876f, 0.043182f, -5.877098f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -14.892568f},
FVector{0.0f, 0.0f, -4.08f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -12.516401f},
FVector{0.0f, 0.0f, -2.595f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_metacarpal_l")},
FTransform{
FRotator{0.042392f, -4.274287f, 2.321687f},
FVector{0.182864f, -0.753571f, -3.375834f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_01_l")},
FTransform{
FRotator{0.0f, 0.0f, -31.572682f},
FVector{0.0f, 0.0f, -6.098209f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -20.76921f},
FVector{0.0f, 0.0f, -5.169f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{0.0f, 0.0f, -2.474f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_metacarpal_l")},
FTransform{
FRotator{-11.109678f, -13.886395f, 4.333313f},
FVector{-1.091757f, -0.542517f, -3.374304f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_01_l")},
FTransform{
FRotator{3.034822f, 5.633827f, -29.271656f},
FVector{0.020689f, -0.041625f, -5.645517f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -18.964f},
FVector{0.0f, 0.0f, -4.977f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -9.167999f},
FVector{0.0f, 0.0f, -2.265f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_metacarpal_l")},
FTransform{
FRotator{-22.65256f, -25.358337f, -1.818999f},
FVector{-2.391111f, -0.305917f, -3.314378f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_01_l")},
FTransform{
FRotator{3.247850f, 9.999765f, -14.49391f},
FVector{0.19884f, -0.14312f, -4.957568f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -21.286999f},
FVector{0.0f, 0.0f, -3.816f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -4.917f},
FVector{0.0f, 0.0f, -2.04f}
}
},
},
RightHandDefaultReferenceBoneTransforms{
TPair<FName, FTransform>{
FName{TEXT("hand_r")},
FTransform{
FRotator{0.0f, -180.0f, 90.0f},
FVector{0.0f, 0.0f, 0.0f}
}
},
TPair<FName, FTransform>{
FName{TEXT("palm_r")},
FTransform{
FRotator{0.0f, 0.0f, 0.0f},
FVector{0.000052f, -0.000629f, -6.615405f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_01_r")},
FTransform{
FRotator{-30.400068f, -75.42522f, 33.588919f},
FVector{-2.581326f, 1.356657f, -1.992833f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_02_r")},
FTransform{
FRotator{0.379136f, -4.00635f, -23.318826f},
FVector{0.000136f, -0.000427f, -4.377825f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{-0.000046f, 0.000015f, -3.085952f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_metacarpal_r")},
FTransform{
FRotator{-7.277920f, -3.392215f, 1.032481f},
FVector{-2.379309f, -0.385167f, -3.444514f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_01_r")},
FTransform{
FRotator{0.0f, 0.0f, -23.373f},
FVector{0.240952f, 0.043412f, -5.877205f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -14.892568f},
FVector{-0.000032f, -0.000005f, -4.079933f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -12.516401f},
FVector{0.000004f, -0.00004f, -2.595076f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_metacarpal_r")},
FTransform{
FRotator{-0.042392f, 4.274287f, 2.321687f},
FVector{-0.182806f, -0.754004f, -3.3758f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_01_r")},
FTransform{
FRotator{0.0f, 0.0f, -31.572682f},
FVector{-0.000001f, 0.000124f, -6.098366f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -20.76921f},
FVector{0.000037f, 0.000077f, -5.168992f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{-0.000034f, -0.000046f, -2.474047f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_metacarpal_r")},
FTransform{
FRotator{11.109678f, 13.886395f, 4.333313f},
FVector{1.091782f, -0.542992f, -3.374208f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_01_r")},
FTransform{
FRotator{-3.034822f, -5.633827f, -29.271656f},
FVector{-0.020675f, -0.041443f, -5.645712f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -18.964f},
FVector{0.000024f, 0.000021f, -4.977067f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -9.167999f},
FVector{0.000011f, -0.00005f, -2.264975f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_metacarpal_r")},
FTransform{
FRotator{22.65256f, 25.358337f, -1.818999f},
FVector{2.391287f, -0.305935f, -3.314677f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_01_r")},
FTransform{
FRotator{-3.24785f, -9.999765f, -14.49391f},
FVector{-0.19892f, -0.143261f, -4.957301f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -21.286999f},
FVector{-0.000033f, -0.00003f, -3.816036f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_03_r")},
FTransform{
FRotator{0.0f, -0.000002f, -4.917f},
FVector{0.000031f, 0.000018f, -2.04f}
}
},
},
LeftHandBoneNames
{
FName{TEXT("palm_l")},// Palm
FName{TEXT("hand_l")},// Wrist
FName{TEXT("thumb_01_l")},// ThumbMetacarpal
FName{TEXT("thumb_02_l")},// ThumbProximal
FName{TEXT("thumb_03_l")},// ThumbDistal
NAME_None,// ThumbTip
FName{TEXT("index_metacarpal_l")},// IndexMetacarpal
FName{TEXT("index_01_l")},// IndexProximal
FName{TEXT("index_02_l")},// IndexIntermediate
FName{TEXT("index_03_l")},// IndexDistal
NAME_None,// IndexTip
FName{TEXT("middle_metacarpal_l")},// MiddleMetacarpal
FName{TEXT("middle_01_l")},// MiddleProximal
FName{TEXT("middle_02_l")},// MiddleIntermediate
FName{TEXT("middle_03_l")},// MiddleDistal
NAME_None,// MiddleTip
FName{TEXT("ring_metacarpal_l")},// RingMetacarpal
FName{TEXT("ring_01_l")},// RingProximal
FName{TEXT("ring_02_l")},// RingIntermediate
FName{TEXT("ring_03_l")},// RingDistal
NAME_None,// RingTip
FName{TEXT("pinky_metacarpal_l")},// LittleMetacarpal
FName{TEXT("pinky_01_l")},// LittleProximal
FName{TEXT("pinky_02_l")},// LittleIntermediate
FName{TEXT("pinky_03_l")},// LittleDistal
NAME_None,// LittleTip
},
RightHandBoneNames
{
FName{TEXT("palm_r")},// Palm
FName{TEXT("hand_r")},// Wrist
FName{TEXT("thumb_01_r")},// ThumbMetacarpal
FName{TEXT("thumb_02_r")},// ThumbProximal
FName{TEXT("thumb_03_r")},// ThumbDistal
NAME_None,// ThumbTip
FName{TEXT("index_metacarpal_r")},// IndexMetacarpal
FName{TEXT("index_01_r")},// IndexProximal
FName{TEXT("index_02_r")},// IndexIntermediate
FName{TEXT("index_03_r")},// IndexDistal
NAME_None,// IndexTip
FName{TEXT("middle_metacarpal_r")},// MiddleMetacarpal
FName{TEXT("middle_01_r")},// MiddleProximal
FName{TEXT("middle_02_r")},// MiddleIntermediate
FName{TEXT("middle_03_r")},// MiddleDistal
NAME_None,// MiddleTip
FName{TEXT("ring_metacarpal_r")},// RingMetacarpal
FName{TEXT("ring_01_r")},// RingProximal
FName{TEXT("ring_02_r")},// RingIntermediate
FName{TEXT("ring_03_r")},// RingDistal
NAME_None,// RingTip
FName{TEXT("pinky_metacarpal_r")},// LittleMetacarpal
FName{TEXT("pinky_01_r")},// LittleProximal
FName{TEXT("pinky_02_r")},// LittleIntermediate
FName{TEXT("pinky_03_r")},// LittleDistal
NAME_None// LittleTip
}
{
}
@@ -0,0 +1,63 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandPhalangesLengthSettings.h"
#include "Engine/SkeletalMesh.h"
FSGVirtualHandPhalangesLengthSettings::FSGVirtualHandPhalangesLengthSettings()
: FSGVirtualHandPhalangesLengthSettings{
2.4f,
2.4f,
2.4f,
2.4f,
2.4f,
}
{
}
FSGVirtualHandPhalangesLengthSettings::FSGVirtualHandPhalangesLengthSettings(
const float InThumb,
const float InIndex,
const float InMiddle,
const float InRing,
const float InLittle)
: Thumb(InThumb),
Index(InIndex),
Middle(InMiddle),
Ring(InRing),
Little(InLittle)
{
}
@@ -38,390 +38,29 @@
#include "Engine/SkeletalMesh.h"
FSGVirtualHandSettings::FSGVirtualHandSettings()
: FSGVirtualHandSettings(
nullptr,
nullptr,
2.4f,
2.4f,
2.4f,
2.4f,
2.4f,
FRotator{0.0f, -90.0f, 0.0f})
: FSGVirtualHandSettings{
FSGVirtualHandAnimationSettings{},
FSGVirtualHandDebuggingSettings{},
FSGVirtualHandGrabSettings{},
FSGVirtualHandHapticsSettings{},
FSGVirtualHandMeshSettings{},
FSGVirtualHandTouchSettings{}
}
{
}
FSGVirtualHandSettings::FSGVirtualHandSettings(
const TSoftObjectPtr<USkeletalMesh>& InLeftHandReferenceMesh,
const TSoftObjectPtr<USkeletalMesh>& InRightHandReferenceMesh,
const float InThumbDistalPhalanxLength,
const float InIndexDistalPhalanxLength,
const float InMiddleDistalPhalanxLength,
const float InRingDistalPhalanxLength,
const float InLittleDistalPhalanxLength,
const FRotator& InRootBoneRotationCorrection)
: LeftHandReferenceMesh(InLeftHandReferenceMesh),
RightHandReferenceMesh(InRightHandReferenceMesh),
ThumbDistalPhalanxLength(InThumbDistalPhalanxLength),
IndexDistalPhalanxLength(InIndexDistalPhalanxLength),
MiddleDistalPhalanxLength(InMiddleDistalPhalanxLength),
RingDistalPhalanxLength(InRingDistalPhalanxLength),
LittleDistalPhalanxLength(InLittleDistalPhalanxLength),
RootBoneRotationCorrection(InRootBoneRotationCorrection),
LeftHandDefaultReferenceBoneTransforms{
TPair<FName, FTransform>{
FName{TEXT("hand_l")},
FTransform{
FRotator{0.0f, -180.0f, 90.0f},
FVector{0.0f, 0.0f, 0.0f}
}
},
TPair<FName, FTransform>{
FName{TEXT("palm_l")},
FTransform{
FRotator{0.0f, 0.0f, 0.0f},
FVector{0.0f, 0.0f, -6.61557f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_01_l")},
FTransform{
FRotator{30.400068f, 75.42522f, 33.588919f},
FVector{2.581536f, 1.356605f, -1.992447f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_02_l")},
FTransform{
FRotator{-0.379136f, 4.00635f, -23.318826f},
FVector{0.0f, 0.0f, -4.378f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{0.0f, 0.0f, -3.086f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_metacarpal_l")},
FTransform{
FRotator{7.277920f, 3.392215f, 1.032481f},
FVector{2.379324f, -0.384681f, -3.444506f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_01_l")},
FTransform{
FRotator{0.0f, 0.0f, -23.373f},
FVector{-0.240876f, 0.043182f, -5.877098f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -14.892568f},
FVector{0.0f, 0.0f, -4.08f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -12.516401f},
FVector{0.0f, 0.0f, -2.595f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_metacarpal_l")},
FTransform{
FRotator{0.042392f, -4.274287f, 2.321687f},
FVector{0.182864f, -0.753571f, -3.375834f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_01_l")},
FTransform{
FRotator{0.0f, 0.0f, -31.572682f},
FVector{0.0f, 0.0f, -6.098209f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -20.76921f},
FVector{0.0f, 0.0f, -5.169f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{0.0f, 0.0f, -2.474f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_metacarpal_l")},
FTransform{
FRotator{-11.109678f, -13.886395f, 4.333313f},
FVector{-1.091757f, -0.542517f, -3.374304f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_01_l")},
FTransform{
FRotator{3.034822f, 5.633827f, -29.271656f},
FVector{0.020689f, -0.041625f, -5.645517f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -18.964f},
FVector{0.0f, 0.0f, -4.977f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -9.167999f},
FVector{0.0f, 0.0f, -2.265f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_metacarpal_l")},
FTransform{
FRotator{-22.65256f, -25.358337f, -1.818999f},
FVector{-2.391111f, -0.305917f, -3.314378f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_01_l")},
FTransform{
FRotator{3.247850f, 9.999765f, -14.49391f},
FVector{0.19884f, -0.14312f, -4.957568f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_02_l")},
FTransform{
FRotator{0.0f, 0.0f, -21.286999f},
FVector{0.0f, 0.0f, -3.816f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_03_l")},
FTransform{
FRotator{0.0f, 0.0f, -4.917f},
FVector{0.0f, 0.0f, -2.04f}
}
},
},
RightHandDefaultReferenceBoneTransforms{
TPair<FName, FTransform>{
FName{TEXT("hand_r")},
FTransform{
FRotator{0.0f, -180.0f, 90.0f},
FVector{0.0f, 0.0f, 0.0f}
}
},
TPair<FName, FTransform>{
FName{TEXT("palm_r")},
FTransform{
FRotator{0.0f, 0.0f, 0.0f},
FVector{0.000052f, -0.000629f, -6.615405f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_01_r")},
FTransform{
FRotator{-30.400068f, -75.42522f, 33.588919f},
FVector{-2.581326f, 1.356657f, -1.992833f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_02_r")},
FTransform{
FRotator{0.379136f, -4.00635f, -23.318826f},
FVector{0.000136f, -0.000427f, -4.377825f}
}
},
TPair<FName, FTransform>{
FName{TEXT("thumb_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{-0.000046f, 0.000015f, -3.085952f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_metacarpal_r")},
FTransform{
FRotator{-7.277920f, -3.392215f, 1.032481f},
FVector{-2.379309f, -0.385167f, -3.444514f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_01_r")},
FTransform{
FRotator{0.0f, 0.0f, -23.373f},
FVector{0.240952f, 0.043412f, -5.877205f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -14.892568f},
FVector{-0.000032f, -0.000005f, -4.079933f}
}
},
TPair<FName, FTransform>{
FName{TEXT("index_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -12.516401f},
FVector{0.000004f, -0.00004f, -2.595076f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_metacarpal_r")},
FTransform{
FRotator{-0.042392f, 4.274287f, 2.321687f},
FVector{-0.182806f, -0.754004f, -3.3758f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_01_r")},
FTransform{
FRotator{0.0f, 0.0f, -31.572682f},
FVector{-0.000001f, 0.000124f, -6.098366f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -20.76921f},
FVector{0.000037f, 0.000077f, -5.168992f}
}
},
TPair<FName, FTransform>{
FName{TEXT("middle_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -10.0f},
FVector{-0.000034f, -0.000046f, -2.474047f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_metacarpal_r")},
FTransform{
FRotator{11.109678f, 13.886395f, 4.333313f},
FVector{1.091782f, -0.542992f, -3.374208f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_01_r")},
FTransform{
FRotator{-3.034822f, -5.633827f, -29.271656f},
FVector{-0.020675f, -0.041443f, -5.645712f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -18.964f},
FVector{0.000024f, 0.000021f, -4.977067f}
}
},
TPair<FName, FTransform>{
FName{TEXT("ring_03_r")},
FTransform{
FRotator{0.0f, 0.0f, -9.167999f},
FVector{0.000011f, -0.00005f, -2.264975f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_metacarpal_r")},
FTransform{
FRotator{22.65256f, 25.358337f, -1.818999f},
FVector{2.391287f, -0.305935f, -3.314677f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_01_r")},
FTransform{
FRotator{-3.24785f, -9.999765f, -14.49391f},
FVector{-0.19892f, -0.143261f, -4.957301f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_02_r")},
FTransform{
FRotator{0.0f, 0.0f, -21.286999f},
FVector{-0.000033f, -0.00003f, -3.816036f}
}
},
TPair<FName, FTransform>{
FName{TEXT("pinky_03_r")},
FTransform{
FRotator{0.0f, -0.000002f, -4.917f},
FVector{0.000031f, 0.000018f, -2.04f}
}
},
},
LeftHandBoneNames
{
FName{TEXT("palm_l")},// Palm
FName{TEXT("hand_l")},// Wrist
FName{TEXT("thumb_01_l")},// ThumbMetacarpal
FName{TEXT("thumb_02_l")},// ThumbProximal
FName{TEXT("thumb_03_l")},// ThumbDistal
NAME_None,// ThumbTip
FName{TEXT("index_metacarpal_l")},// IndexMetacarpal
FName{TEXT("index_01_l")},// IndexProximal
FName{TEXT("index_02_l")},// IndexIntermediate
FName{TEXT("index_03_l")},// IndexDistal
NAME_None,// IndexTip
FName{TEXT("middle_metacarpal_l")},// MiddleMetacarpal
FName{TEXT("middle_01_l")},// MiddleProximal
FName{TEXT("middle_02_l")},// MiddleIntermediate
FName{TEXT("middle_03_l")},// MiddleDistal
NAME_None,// MiddleTip
FName{TEXT("ring_metacarpal_l")},// RingMetacarpal
FName{TEXT("ring_01_l")},// RingProximal
FName{TEXT("ring_02_l")},// RingIntermediate
FName{TEXT("ring_03_l")},// RingDistal
NAME_None,// RingTip
FName{TEXT("pinky_metacarpal_l")},// LittleMetacarpal
FName{TEXT("pinky_01_l")},// LittleProximal
FName{TEXT("pinky_02_l")},// LittleIntermediate
FName{TEXT("pinky_03_l")},// LittleDistal
NAME_None,// LittleTip
},
RightHandBoneNames
{
FName{TEXT("palm_r")},// Palm
FName{TEXT("hand_r")},// Wrist
FName{TEXT("thumb_01_r")},// ThumbMetacarpal
FName{TEXT("thumb_02_r")},// ThumbProximal
FName{TEXT("thumb_03_r")},// ThumbDistal
NAME_None,// ThumbTip
FName{TEXT("index_metacarpal_r")},// IndexMetacarpal
FName{TEXT("index_01_r")},// IndexProximal
FName{TEXT("index_02_r")},// IndexIntermediate
FName{TEXT("index_03_r")},// IndexDistal
NAME_None,// IndexTip
FName{TEXT("middle_metacarpal_r")},// MiddleMetacarpal
FName{TEXT("middle_01_r")},// MiddleProximal
FName{TEXT("middle_02_r")},// MiddleIntermediate
FName{TEXT("middle_03_r")},// MiddleDistal
NAME_None,// MiddleTip
FName{TEXT("ring_metacarpal_r")},// RingMetacarpal
FName{TEXT("ring_01_r")},// RingProximal
FName{TEXT("ring_02_r")},// RingIntermediate
FName{TEXT("ring_03_r")},// RingDistal
NAME_None,// RingTip
FName{TEXT("pinky_metacarpal_r")},// LittleMetacarpal
FName{TEXT("pinky_01_r")},// LittleProximal
FName{TEXT("pinky_02_r")},// LittleIntermediate
FName{TEXT("pinky_03_r")},// LittleDistal
NAME_None// LittleTip
}
const FSGVirtualHandAnimationSettings& InAnimationSettings,
const FSGVirtualHandDebuggingSettings& InDebuggingSettings,
const FSGVirtualHandGrabSettings& InGrabSettings,
const FSGVirtualHandHapticsSettings& InHapticsSettings,
const FSGVirtualHandMeshSettings& InMeshSettings,
const FSGVirtualHandTouchSettings& InTouchSettings)
: AnimationSettings{InAnimationSettings},
DebuggingSettings{InDebuggingSettings},
GrabSettings{InGrabSettings},
HapticsSettings{InHapticsSettings},
MeshSettings{InMeshSettings},
TouchSettings{InTouchSettings}
{
}
@@ -0,0 +1,64 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGSettings/SGVirtualHandTouchSettings.h"
FSGVirtualHandTouchSettings::FSGVirtualHandTouchSettings()
: FSGVirtualHandTouchSettings{
FVector{0.04f, 0.04f, 0.04f},
FName{TEXT("TouchThumbCollider")},
FName{TEXT("TouchIndexCollider")},
FName{TEXT("TouchMiddleCollider")},
FName{TEXT("TouchRingCollider")},
FName{TEXT("TouchPinkyCollider")}
}
{
}
FSGVirtualHandTouchSettings::FSGVirtualHandTouchSettings(
const FVector& InDefaultColliderSize,
const FName& InThumbColliderSocketName,
const FName& InIndexColliderSocketName,
const FName& InMiddleColliderSocketName,
const FName& InRingColliderSocketName,
const FName& InPinkyColliderSocketName)
: DefaultColliderSize{InDefaultColliderSize},
ThumbColliderSocketName{InThumbColliderSocketName},
IndexColliderSocketName{InIndexColliderSocketName},
MiddleColliderSocketName{InMiddleColliderSocketName},
RingColliderSocketName{InRingColliderSocketName},
PinkyColliderSocketName{InPinkyColliderSocketName}
{
}
@@ -36,7 +36,7 @@
#include "SGSettings/SGWristTrackingSettings.h"
FSGWristTrackingSettings::FSGWristTrackingSettings()
: FSGWristTrackingSettings(
: FSGWristTrackingSettings{
ESGPositionalTrackingHardware::None,
FVector::ZeroVector,
FVector::ZeroVector,
@@ -45,7 +45,8 @@ FSGWristTrackingSettings::FSGWristTrackingSettings()
EControllerHand::Left,
EControllerHand::Right,
false,
FSGDebugGizmoSettings{})
FSGDebugGizmoSettings{}
}
{
}
@@ -60,13 +61,13 @@ FSGWristTrackingSettings::FSGWristTrackingSettings(
const bool bInDrawDebugGizmo,
const FSGDebugGizmoSettings& InDebugGizmoSettings)
: TrackingHardware(InTrackingHardware),
TrackingHardwareLocationOffsetLeftHand(InTrackingHardwareLocationOffsetLeftHand),
TrackingHardwareLocationOffsetRightHand(InTrackingHardwareLocationOffsetRightHand),
TrackingHardwareRotationOffsetLeftHand(InTrackingHardwareRotationOffsetLeftHand),
TrackingHardwareRotationOffsetRightHand(InTrackingHardwareRotationOffsetRightHand),
TrackingHardwareLocationOffsetLeftHand{InTrackingHardwareLocationOffsetLeftHand},
TrackingHardwareLocationOffsetRightHand{InTrackingHardwareLocationOffsetRightHand},
TrackingHardwareRotationOffsetLeftHand{InTrackingHardwareRotationOffsetLeftHand},
TrackingHardwareRotationOffsetRightHand{InTrackingHardwareRotationOffsetRightHand},
LeftHandMotionSource(InLeftHandMotionSource),
RightHandMotionSource(InRightHandMotionSource),
bDrawDebugGizmo(bInDrawDebugGizmo),
DebugGizmoSettings(InDebugGizmoSettings)
DebugGizmoSettings{InDebugGizmoSettings}
{
}
@@ -53,7 +53,7 @@ public:
* etc. are indeed SenseGlove classes or SenseGlove-derived classes. If not, it attempts to set them. If you don't
* like this behavior for whatever reason, consider disabling this option.
*/
UPROPERTY(Config, EditDefaultsOnly, Category="Glove Tracking")
UPROPERTY(Config, EditDefaultsOnly, Category="Initialization")
uint8 bValidateIfDefaultClassesAreSGCompliant : 1;
public:
@@ -0,0 +1,66 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGVirtualHandAnimationSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandAnimationSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Animation")
FRotator AnimationBoneRotationCorrectionOffset;
UPROPERTY(Config, EditDefaultsOnly, Category="Animation")
uint8 bShouldAnimationApplyBoneLocation : 1;
public:
FSGVirtualHandAnimationSettings();
FSGVirtualHandAnimationSettings(
const FRotator& InAnimationBoneRotationCorrectionOffset,
bool bInShouldAnimationApplyBoneLocation);
};
@@ -39,81 +39,81 @@
#include "SGTypes/SGDebugTypes.h"
#include "SGDebugVirtualHandSettings.generated.h"
#include "SGVirtualHandDebuggingSettings.generated.h"
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGDebugVirtualHandSettings
struct SENSEGLOVESETTINGS_API FSGVirtualHandDebuggingSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg")
uint8 bDrawDebugVirtualHand : 1;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging")
uint8 bDrawVirtualHandDebugging : 1;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand", EditConditionHides))
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging", EditConditionHides))
ESGDebugVirtualHandDrawingMode DrawingMode;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
EditConditionHides))
FVector CubeExtent;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
EditConditionHides))
FColor CubeColor;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints",
EditConditionHides))
float CubeThickness;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
float GizmoLength;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
float GizmoThickness;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
FColor GizmoXAxisColor;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
FColor GizmoYAxisColor;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
FColor GizmoZAxisColor;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
uint8 bPersistentLines : 1;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
float LifeTimeModifier;
UPROPERTY(Config, EditDefaultsOnly, Category = "Debug Virtual Handg",
meta=(EditCondition="bDrawDebugVirtualHand && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
UPROPERTY(Config, EditDefaultsOnly, Category = "Debugging",
meta=(EditCondition="bDrawVirtualHandDebugging && DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints",
EditConditionHides))
uint8 DepthPriority;
public:
FSGDebugVirtualHandSettings();
FSGVirtualHandDebuggingSettings();
FSGDebugVirtualHandSettings(
bool bInDrawDebugVirtualHand,
FSGVirtualHandDebuggingSettings(
bool bInDrawVirtualHandDebugging,
ESGDebugVirtualHandDrawingMode InDrawingMode,
const FVector& InCubeExtent,
const FColor& InCubeColor,
@@ -0,0 +1,78 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGVirtualHandGrabSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandGrabSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Grab")
FName PalmAttachPointSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Grab")
FVector DefaultColliderSize;
UPROPERTY(Config, EditDefaultsOnly, Category="Grab")
FName ThumbColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Grab")
FName IndexColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Grab")
FName MiddleColliderSocketName;
public:
FSGVirtualHandGrabSettings();
FSGVirtualHandGrabSettings(
const FName& InPalmAttachPointSocketName,
const FVector& InDefaultColliderSize,
const FName& InThumbColliderSocketName,
const FName& InIndexColliderSocketName,
const FName& InMiddleColliderSocketName);
};
@@ -0,0 +1,62 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGVirtualHandHapticsSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandHapticsSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Haptics")
uint8 bAutoStopAllHapticsOnEndPlay : 1;
public:
FSGVirtualHandHapticsSettings();
FSGVirtualHandHapticsSettings(
bool bInAutoStopAllHapticsOnEndPlay);
};
@@ -0,0 +1,88 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGSettings/SGVirtualHandPhalangesLengthSettings.h"
#include "SGVirtualHandMeshSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandMeshSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Mesh")
TSoftObjectPtr<USkeletalMesh> LeftHandReferenceMesh;
UPROPERTY(Config, EditDefaultsOnly, Category="Mesh")
TSoftObjectPtr<USkeletalMesh> RightHandReferenceMesh;
UPROPERTY(Config, EditDefaultsOnly, Category="Mesh")
FSGVirtualHandPhalangesLengthSettings DistalPhalangesLengthSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Mesh")
FRotator RootBoneRotationCorrection;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Mesh")
TMap<FName, FTransform> LeftHandDefaultReferenceBoneTransforms;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Mesh")
TMap<FName, FTransform> RightHandDefaultReferenceBoneTransforms;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Mesh")
TArray<FName> LeftHandBoneNames;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Mesh")
TArray<FName> RightHandBoneNames;
public:
FSGVirtualHandMeshSettings();
FSGVirtualHandMeshSettings(
const TSoftObjectPtr<USkeletalMesh>& InLeftHandReferenceMesh,
const TSoftObjectPtr<USkeletalMesh>& InRightHandReferenceMesh,
const FSGVirtualHandPhalangesLengthSettings& InDistalPhalangesLengthSettings,
const FRotator& InRootBoneRotationCorrection);
};
@@ -0,0 +1,78 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGVirtualHandPhalangesLengthSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandPhalangesLengthSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Phalanges Length")
float Thumb;
UPROPERTY(Config, EditDefaultsOnly, Category="Phalanges Length")
float Index;
UPROPERTY(Config, EditDefaultsOnly, Category="Phalanges Length")
float Middle;
UPROPERTY(Config, EditDefaultsOnly, Category="Phalanges Length")
float Ring;
UPROPERTY(Config, EditDefaultsOnly, Category="Phalanges Length")
float Little;
public:
FSGVirtualHandPhalangesLengthSettings();
FSGVirtualHandPhalangesLengthSettings(
float InThumb,
float InIndex,
float InMiddle,
float InRing,
float InLittle);
};
@@ -38,6 +38,13 @@
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGSettings/SGVirtualHandAnimationSettings.h"
#include "SGSettings/SGVirtualHandDebuggingSettings.h"
#include "SGSettings/SGVirtualHandGrabSettings.h"
#include "SGSettings/SGVirtualHandHapticsSettings.h"
#include "SGSettings/SGVirtualHandMeshSettings.h"
#include "SGSettings/SGVirtualHandTouchSettings.h"
#include "SGVirtualHandSettings.generated.h"
class USkeletalMesh;
@@ -52,51 +59,31 @@ struct SENSEGLOVESETTINGS_API FSGVirtualHandSettings
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
TSoftObjectPtr<USkeletalMesh> LeftHandReferenceMesh;
FSGVirtualHandAnimationSettings AnimationSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
TSoftObjectPtr<USkeletalMesh> RightHandReferenceMesh;
FSGVirtualHandDebuggingSettings DebuggingSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
float ThumbDistalPhalanxLength;
FSGVirtualHandGrabSettings GrabSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
float IndexDistalPhalanxLength;
FSGVirtualHandHapticsSettings HapticsSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
float MiddleDistalPhalanxLength;
FSGVirtualHandMeshSettings MeshSettings;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
float RingDistalPhalanxLength;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
float LittleDistalPhalanxLength;
UPROPERTY(Config, EditDefaultsOnly, Category="Virtual Hand")
FRotator RootBoneRotationCorrection;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Virtual Hand")
TMap<FName, FTransform> LeftHandDefaultReferenceBoneTransforms;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Virtual Hand")
TMap<FName, FTransform> RightHandDefaultReferenceBoneTransforms;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Virtual Hand")
TArray<FName> LeftHandBoneNames;
UPROPERTY(Config, VisibleDefaultsOnly, Category="Virtual Hand")
TArray<FName> RightHandBoneNames;
FSGVirtualHandTouchSettings TouchSettings;
public:
FSGVirtualHandSettings();
FSGVirtualHandSettings(
const TSoftObjectPtr<USkeletalMesh>& InLeftHandReferenceMesh,
const TSoftObjectPtr<USkeletalMesh>& InRightHandReferenceMesh,
float InThumbDistalPhalanxLength,
float InIndexDistalPhalanxLength,
float InMiddleDistalPhalanxLength,
float InRingDistalPhalanxLength,
float InLittleDistalPhalanxLength,
const FRotator& InRootBoneRotationCorrection);
const FSGVirtualHandAnimationSettings& InAnimationSettings,
const FSGVirtualHandDebuggingSettings& InDebuggingSettings,
const FSGVirtualHandGrabSettings& InGrabSettings,
const FSGVirtualHandHapticsSettings& InHapticsSettings,
const FSGVirtualHandMeshSettings& InMeshSettings,
const FSGVirtualHandTouchSettings& InTouchSettings);
};
@@ -0,0 +1,82 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2024 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
#include "UObject/ObjectMacros.h"
#include "UObject/SoftObjectPtr.h"
#include "SGVirtualHandTouchSettings.generated.h"
class USkeletalMesh;
/**
* Implements the hand tracking settings for the SenseGlove module.
*/
USTRUCT(BlueprintType)
struct SENSEGLOVESETTINGS_API FSGVirtualHandTouchSettings
{
GENERATED_USTRUCT_BODY()
public:
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FVector DefaultColliderSize;
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FName ThumbColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FName IndexColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FName MiddleColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FName RingColliderSocketName;
UPROPERTY(Config, EditDefaultsOnly, Category="Touch")
FName PinkyColliderSocketName;
public:
FSGVirtualHandTouchSettings();
FSGVirtualHandTouchSettings(
const FVector& InDefaultColliderSize,
const FName& InThumbColliderSocketName,
const FName& InIndexColliderSocketName,
const FName& InMiddleColliderSocketName,
const FName& InRingColliderSocketName,
const FName& InPinkyColliderSocketName);
};
@@ -403,7 +403,7 @@ struct FSGXRTracker::FImpl
FORCEINLINE static const FName& GetLeftMeshBoneName(const int32 JointIndex)
{
const FName& Name{GetVirtualHandSettings().LeftHandBoneNames[JointIndex]};
const FName& Name{GetVirtualHandSettings().MeshSettings.LeftHandBoneNames[JointIndex]};
return Name;
}
@@ -416,7 +416,7 @@ struct FSGXRTracker::FImpl
FORCEINLINE static const FName& GetRightMeshBoneName(const int32 JointIndex)
{
const FName& Name{GetVirtualHandSettings().RightHandBoneNames[JointIndex]};
const FName& Name{GetVirtualHandSettings().MeshSettings.RightHandBoneNames[JointIndex]};
return Name;
}
@@ -771,27 +771,27 @@ TArray<TArray<float>> FSGXRTracker::FImpl::GetFingerLengths(const bool bRight)
GetFingerLengths(bRight,
EHandKeypoint::ThumbProximal,
EHandKeypoint::ThumbDistal,
Settings.ThumbDistalPhalanxLength
Settings.MeshSettings.DistalPhalangesLengthSettings.Thumb
),
GetFingerLengths(bRight,
EHandKeypoint::IndexIntermediate,
EHandKeypoint::IndexDistal,
Settings.IndexDistalPhalanxLength
Settings.MeshSettings.DistalPhalangesLengthSettings.Index
),
GetFingerLengths(bRight,
EHandKeypoint::MiddleIntermediate,
EHandKeypoint::MiddleDistal,
Settings.MiddleDistalPhalanxLength
Settings.MeshSettings.DistalPhalangesLengthSettings.Middle
),
GetFingerLengths(bRight,
EHandKeypoint::RingIntermediate,
EHandKeypoint::RingDistal,
Settings.RingDistalPhalanxLength
Settings.MeshSettings.DistalPhalangesLengthSettings.Ring
),
GetFingerLengths(bRight,
EHandKeypoint::LittleIntermediate,
EHandKeypoint::LittleDistal,
Settings.LittleDistalPhalanxLength
Settings.MeshSettings.DistalPhalangesLengthSettings.Little
),
};
@@ -901,8 +901,8 @@ FTransform FSGXRTracker::FImpl::GetMeshRawBoneRefTransform(const bool bRight, co
{
const TSoftObjectPtr<USkeletalMesh>& HandMesh{
bRight
? GetVirtualHandSettings().LeftHandReferenceMesh
: GetVirtualHandSettings().RightHandReferenceMesh
? GetVirtualHandSettings().MeshSettings.LeftHandReferenceMesh
: GetVirtualHandSettings().MeshSettings.RightHandReferenceMesh
};
if (HandMesh.IsValid())
@@ -924,7 +924,7 @@ FTransform FSGXRTracker::FImpl::GetMeshRawBoneRefTransform(const bool bRight, co
return Transform;
}
const FSGVirtualHandSettings& Settings{GetVirtualHandSettings()};
const FSGVirtualHandMeshSettings& Settings{GetVirtualHandSettings().MeshSettings};
ensureAlwaysMsgf(
bRight
? Settings.RightHandDefaultReferenceBoneTransforms.Contains(BoneName)
@@ -942,7 +942,7 @@ FTransform FSGXRTracker::FImpl::GetMeshRawBoneRefTransform(const bool bRight, co
FTransform FSGXRTracker::FImpl::GetMeshWristChildBoneRefTransform(const bool bRight, const FName& BoneName)
{
FQuat RootRotationCorrection{
GetVirtualHandSettings().RootBoneRotationCorrection
GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection
};
const FTransform& RootBoneRefTransform{GetMeshRawBoneRefTransform(bRight, EHandKeypoint::Wrist)};
const FTransform& RawTransform{GetMeshRawBoneRefTransform(bRight, BoneName)};
@@ -957,7 +957,7 @@ FTransform FSGXRTracker::FImpl::GetMeshFingerStartBoneRefTransform(
const bool bRight, const EHandKeypoint Parent, const FName& BoneName)
{
FQuat RootRotationCorrection{
GetVirtualHandSettings().RootBoneRotationCorrection
GetVirtualHandSettings().MeshSettings.RootBoneRotationCorrection
};
const FTransform& RootBoneRefTransform{GetMeshRawBoneRefTransform(bRight, EHandKeypoint::Wrist)};
FQuat CorrectedRootBoneRefRotation{MoveTemp(RootRotationCorrection) * RootBoneRefTransform.GetRotation()};