add a new FSGHandLayer::GetWristLocation() overload which allows passing FRotator instead of FQuat as input or output parameters
This commit is contained in:
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Added a `USGHapticsComponent` to allow sending a variety of haptic feedbacks (force-feedback, vibrotactile, custom waveforms, and wrist-squeeze) to the gloves without touching SenseGlove's low-level API.
|
||||
- Added a `USGHandTrackerComponent` to allow retrieval or visualization of `FXRHandTrackingState` without relying on low-level SenseGlove API or UE's generic `GetHandTrackingState()` functionality. This is useful when developing a custom hand-interaction system using SenseGlove/UE OpenXR API or interfacing with third-party OpenXR-compatible plugins such as [VR Expansion Plugin (VRE)](https://vreue4.com/). Using this component removes the need to calculate the wrist offsets manually, or an extra call to `USGHapticGlove::GetWristLocation()`, in comparison to when the `FXRHandTrackingState` is retrieved via UE's `GetHandTrackingState()`.
|
||||
- A new `FSGDebugVirtualHand::Draw()` overload has been added to allow visualizing `FSGDebugGizmoSettings` directly. This is used internally by the new `USGHandTrackerComponent` to visualize its `FXRHandTrackingState` if `bVisualize` is enabled.
|
||||
- Added a new `FSGHandLayer::GetWristLocation()` overload to allow passing `FRotator`s instead of `FQuat`s as input or output parameters.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -132,6 +132,25 @@ void FSGHandLayer::GetWristLocation(
|
||||
OutWristRotation = MoveTemp(OutWristRotationContainer.Quat);
|
||||
}
|
||||
|
||||
void FSGHandLayer::GetWristLocation(
|
||||
const bool bRightHanded, const FVector& ReferencePosition, const FRotator& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware, FVector& OutWristPosition, FRotator& OutWristRotation)
|
||||
{
|
||||
FSGIC_FVector ReferencePositionContainer{ReferencePosition};
|
||||
FSGIC_FQuat ReferenceRotationContainer{ReferenceRotation.Quaternion()};
|
||||
FSGIC_ESGPositionalTrackingHardware TrackingHardwareContainer{TrackingHardware};
|
||||
FSGIC_FVector OutWristPositionContainer;
|
||||
FSGIC_FQuat OutWristRotationContainer;
|
||||
|
||||
SGCoreImpl_FSGHandLayerImpl_GetWristLocation(
|
||||
bRightHanded, &ReferencePositionContainer, &ReferenceRotationContainer,
|
||||
&TrackingHardwareContainer,
|
||||
&OutWristPositionContainer, &OutWristRotationContainer);
|
||||
|
||||
OutWristPosition = MoveTemp(OutWristPositionContainer.Vector);
|
||||
OutWristRotation = OutWristRotationContainer.Quat.Rotator();
|
||||
}
|
||||
|
||||
void FSGHandLayer::StopAllHaptics(const bool bRightHanded)
|
||||
{
|
||||
SGCoreImpl_FSGHandLayerImpl_StopAllHaptics(bRightHanded);
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "Containers/UnrealString.h"
|
||||
#include "HAL/Platform.h"
|
||||
#include "Math/Quat.h"
|
||||
#include "Math/Rotator.h"
|
||||
#include "Math/Vector.h"
|
||||
#include "UObject/ObjectMacros.h"
|
||||
|
||||
@@ -148,6 +149,22 @@ public:
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation);
|
||||
|
||||
/**
|
||||
* Calculate the Wrist Location of the chosen hand, based on a reference location and tracking hardware.
|
||||
*
|
||||
* @param bRightHanded
|
||||
* @param ReferencePosition
|
||||
* @param ReferenceRotation
|
||||
* @param TrackingHardware
|
||||
* @param OutWristPosition
|
||||
* @param OutWristRotation
|
||||
*/
|
||||
static void GetWristLocation(
|
||||
bool bRightHanded,
|
||||
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation);
|
||||
|
||||
/**
|
||||
* Stop all haptics on the chosen hand.
|
||||
*
|
||||
|
||||
@@ -91,15 +91,26 @@ bool USGHandLayerKismetLibrary::GetHandPose(UObject* WorldContextObject,
|
||||
return FSGHandLayer::GetHandPose(WorldContextObject, bRightHanded, OutHandPose);
|
||||
}
|
||||
|
||||
void USGHandLayerKismetLibrary::GetWristLocation(const bool bRightHanded,
|
||||
void USGHandLayerKismetLibrary::GetWristLocation_bRH_FQuat_RR_TH_OutWP_OutWR(
|
||||
const bool bRightHanded,
|
||||
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
|
||||
const ESGPositionalTrackingHardware TrackingHardware,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation)
|
||||
{
|
||||
FSGHandLayer::GetWristLocation(bRightHanded, ReferencePosition, ReferenceRotation, TrackingHardware,
|
||||
OutWristPosition, OutWristRotation);
|
||||
}
|
||||
|
||||
void USGHandLayerKismetLibrary::GetWristLocation_bRH_RP_FRotator_RR_TH_OutWP_OutWR(
|
||||
const bool bRightHanded,
|
||||
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation)
|
||||
{
|
||||
FSGHandLayer::GetWristLocation(bRightHanded, ReferencePosition, ReferenceRotation, TrackingHardware,
|
||||
OutWristPosition, OutWristRotation);
|
||||
}
|
||||
|
||||
void USGHandLayerKismetLibrary::StopAllHaptics(const bool bRightHanded)
|
||||
{
|
||||
FSGHandLayer::StopAllHaptics(bRightHanded);
|
||||
|
||||
@@ -122,13 +122,23 @@ public:
|
||||
/**
|
||||
* Calculate the Wrist Location of the chosen hand, based on a reference location and tracking hardware.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Hand Layer")
|
||||
static void GetWristLocation(
|
||||
UFUNCTION(BlueprintCallable, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Hand Layer")
|
||||
static void GetWristLocation_bRH_FQuat_RR_TH_OutWP_OutWR(
|
||||
bool bRightHanded,
|
||||
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FQuat& OutWristRotation);
|
||||
|
||||
/**
|
||||
* Calculate the Wrist Location of the chosen hand, based on a reference location and tracking hardware.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Hand Layer")
|
||||
static void GetWristLocation_bRH_RP_FRotator_RR_TH_OutWP_OutWR(
|
||||
bool bRightHanded,
|
||||
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
|
||||
ESGPositionalTrackingHardware TrackingHardware,
|
||||
FVector& OutWristPosition, FRotator& OutWristRotation);
|
||||
|
||||
/**
|
||||
* Stop all haptics on the chosen hand.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user