From 962e0387548b6b9ad5c0b031f5f00c874d2f162f Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 10 Feb 2026 11:22:45 +0100 Subject: [PATCH] add an exact overload to haptics component SendCustomWaveform similar to hand layer or haptic glove classes --- .../SenseGlove/Components/SGHapticsComponent.cpp | 12 ++++++++++++ .../SenseGlove/Components/SGHapticsComponent.h | 9 +++++++++ .../SGKismet/SGHapticsComponentKismetLibrary.cpp | 7 +++++++ .../SGKismet/SGHapticsComponentKismetLibrary.h | 10 ++++++++++ 4 files changed, 38 insertions(+) diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGHapticsComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGHapticsComponent.cpp index 5f25a68d..e8e17837 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGHapticsComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGHapticsComponent.cpp @@ -156,6 +156,18 @@ bool USGHapticsComponent::SupportsCustomWaveform(const ESGHapticLocation AtLocat return false; } +bool USGHapticsComponent::SendCustomWaveform( + USGCustomWaveform* OutWaveform, const ESGHapticLocation Location) +{ + USGHapticGlove* Glove{Pimpl->GetGlove()}; + if (IsValid(Glove) && Glove->IsConnected()) + { + return Glove->SendCustomWaveform(OutWaveform, Location); + } + + return false; +} + bool USGHapticsComponent::SendCustomWaveform( const float Amplitude, const float Duration, const ESGHapticLocation Location) { diff --git a/Source/SenseGlove/Public/SenseGlove/Components/SGHapticsComponent.h b/Source/SenseGlove/Public/SenseGlove/Components/SGHapticsComponent.h index 06ad350b..e387e688 100644 --- a/Source/SenseGlove/Public/SenseGlove/Components/SGHapticsComponent.h +++ b/Source/SenseGlove/Public/SenseGlove/Components/SGHapticsComponent.h @@ -131,6 +131,15 @@ public: */ bool SupportsCustomWaveform(ESGHapticLocation AtLocation) const; + /** + * Sends a custom waveform to the location specified, provided that the glove has a motor there, and can support + * custom waveforms. + * + * @param OutWaveform + * @param Location + */ + bool SendCustomWaveform(USGCustomWaveform* OutWaveform, ESGHapticLocation Location); + /** * Sends a custom waveform to the location specified, provided that the glove has a motor there, and can support * custom waveforms. diff --git a/Source/SenseGloveKismet/Private/SGKismet/SGHapticsComponentKismetLibrary.cpp b/Source/SenseGloveKismet/Private/SGKismet/SGHapticsComponentKismetLibrary.cpp index dd0501c0..ec34c2e3 100644 --- a/Source/SenseGloveKismet/Private/SGKismet/SGHapticsComponentKismetLibrary.cpp +++ b/Source/SenseGloveKismet/Private/SGKismet/SGHapticsComponentKismetLibrary.cpp @@ -92,6 +92,13 @@ bool UHapticsComponentKismetLibrary::SupportsCustomWaveform( return HapticsComponent->SupportsCustomWaveform(AtLocation); } +bool UHapticsComponentKismetLibrary::SendCustomWaveform( + USGHapticsComponent* HapticsComponent, + USGCustomWaveform* OutWaveform, const ESGHapticLocation Location) +{ + return HapticsComponent->SendCustomWaveform(OutWaveform, Location); +} + bool UHapticsComponentKismetLibrary::SendCustomWaveform_Amplitude_Duration_Location( USGHapticsComponent* HapticsComponent, const float Amplitude, const float Duration, const ESGHapticLocation Location) diff --git a/Source/SenseGloveKismet/Public/SGKismet/SGHapticsComponentKismetLibrary.h b/Source/SenseGloveKismet/Public/SGKismet/SGHapticsComponentKismetLibrary.h index 204ddb48..ea551105 100644 --- a/Source/SenseGloveKismet/Public/SGKismet/SGHapticsComponentKismetLibrary.h +++ b/Source/SenseGloveKismet/Public/SGKismet/SGHapticsComponentKismetLibrary.h @@ -95,6 +95,16 @@ public: static bool SupportsCustomWaveform(const USGHapticsComponent* HapticsComponent, ESGHapticLocation AtLocation); + /** + * Sends a custom waveform to the location specified, provided that the glove has a motor there, and can support + * custom waveforms. + * + * @param OutWaveform + * @param Location + */ + static bool SendCustomWaveform(UPARAM(ref) USGHapticsComponent* HapticsComponent, + USGCustomWaveform* OutWaveform, ESGHapticLocation Location); + /** * Sends a custom waveform to the location specified, provided that the glove has a motor there, and can support * custom waveforms.