add support for wrist squeeze to the haptics component
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "SGCore/SGCustomWaveform.h"
|
||||
#include "SGCore/SGHapticGlove.h"
|
||||
#include "SGCore/SGHandLayer.h"
|
||||
#include "SGTracking/SGGloveTracker.h"
|
||||
|
||||
struct USGHapticsComponent::FImpl
|
||||
@@ -242,6 +243,16 @@ bool USGHapticsComponent::QueueVibroLevel(const ESGHapticLocation Location, cons
|
||||
return false;
|
||||
}
|
||||
|
||||
bool USGHapticsComponent::SupportsWristSqueeze() const
|
||||
{
|
||||
return FSGHandLayer::SupportsWristSqueeze(IsRight());
|
||||
}
|
||||
|
||||
bool USGHapticsComponent::QueueWristSqueeze(const float SqueezeLevel01, const bool bSendImmediate)
|
||||
{
|
||||
return FSGHandLayer::QueueCommand_WristSqueeze(IsRight(), SqueezeLevel01, bSendImmediate);
|
||||
}
|
||||
|
||||
USGHapticsComponent::FImpl::FImpl(USGHapticsComponent* InOwner)
|
||||
: Owner(InOwner)
|
||||
{
|
||||
|
||||
@@ -198,4 +198,18 @@ public:
|
||||
* vibration.
|
||||
*/
|
||||
bool QueueVibroLevel(ESGHapticLocation Location, float Level01);
|
||||
|
||||
/**
|
||||
* Returns true if the chosen glove supports active contact feedback on the Wrist.
|
||||
*/
|
||||
bool SupportsWristSqueeze() const;
|
||||
|
||||
/**
|
||||
* Queue a command to set the amount of squeeze level (a.k.a. squeeze-feedback) to the desired level
|
||||
* (0 = no squeeze, 1 = full squeeze) on the wrist, and optionally send it right away.
|
||||
*
|
||||
* @param SqueezeLevel01
|
||||
* @param bSendImmediate
|
||||
*/
|
||||
bool QueueWristSqueeze(float SqueezeLevel01, bool bSendImmediate);
|
||||
};
|
||||
@@ -139,4 +139,17 @@ bool UHapticsComponentKismetLibrary::QueueVibroLevel(
|
||||
const ESGHapticLocation Location, const float Level01)
|
||||
{
|
||||
return HapticsComponent->QueueVibroLevel(Location, Level01);
|
||||
}
|
||||
|
||||
bool UHapticsComponentKismetLibrary::SupportsWristSqueeze(
|
||||
const USGHapticsComponent* HapticsComponent)
|
||||
{
|
||||
return HapticsComponent->SupportsWristSqueeze();
|
||||
}
|
||||
|
||||
bool UHapticsComponentKismetLibrary::QueueWristSqueeze(
|
||||
USGHapticsComponent* HapticsComponent,
|
||||
const float SqueezeLevel01, const bool bSendImmediate)
|
||||
{
|
||||
return HapticsComponent->QueueWristSqueeze(SqueezeLevel01, bSendImmediate);
|
||||
}
|
||||
@@ -179,4 +179,21 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Haptics Component")
|
||||
static bool QueueVibroLevel(UPARAM(ref) USGHapticsComponent* HapticsComponent,
|
||||
ESGHapticLocation Location, float Level01);
|
||||
|
||||
/**
|
||||
* Returns true if the chosen glove supports active contact feedback on the Wrist.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Haptics Component")
|
||||
static bool SupportsWristSqueeze(const USGHapticsComponent* HapticsComponent);
|
||||
|
||||
/**
|
||||
* Queue a command to set the amount of squeeze level (a.k.a. squeeze-feedback) to the desired level
|
||||
* (0 = no squeeze, 1 = full squeeze) on the wrist, and optionally send it right away.
|
||||
*
|
||||
* @param SqueezeLevel01
|
||||
* @param bSendImmediate
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Haptics Component")
|
||||
static bool QueueWristSqueeze(UPARAM(ref) USGHapticsComponent* HapticsComponent,
|
||||
float SqueezeLevel01, bool bSendImmediate);
|
||||
};
|
||||
Reference in New Issue
Block a user