Files
Plugin/Source/SenseGloveCoreImpl/Public/SGCoreImpl/SGHandLayerImpl.h
T

118 lines
3.8 KiB
C++

/**
* @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 "Containers/Array.h"
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Math/Quat.h"
#include "Math/Vector.h"
#include "Templates/SharedPointer.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
{
class HandLayer;
}
class FSGCustomWaveformImpl;
class FSGHandPoseImpl;
class FSGHapticGloveImpl;
class SENSEGLOVECOREIMPL_API FSGHandLayerImpl final
{
public:
typedef SGCore::HandLayer FHandLayerType;
public:
static bool DeviceConnected(bool bRightHanded);
static ESGDeviceType GetDeviceType(bool bRightHanded);
static bool GetFirstGloveHandedness();
static int32 GlovesConnected();
static bool GetGloveInstance(bool bRightHanded, TSharedPtr<FSGHapticGloveImpl>& OutGlove);
static ESGHapticGloveCalibrationState GetCalibrationState(bool bRightHanded);
static FString GetCalibrationInstructions(bool bRightHanded);
static void ResetCalibration(bool bRightHanded);
static void EndCalibration(bool bRightHanded);
static bool GetHandPose(bool bRightHanded, FSGHandPoseImpl& OutHandPose);
static void GetWristLocation(
bool bRightHanded,
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation);
static bool SendHaptics(bool bRightHanded);
static void StopAllHaptics(bool bRightHanded);
static bool QueueCommand_ForceFeedbackLevel(bool bRightHanded, int32 Finger, float Level01, bool bSendImmediate);
static bool QueueCommand_ForceFeedbackLevels(
bool bRightHanded, const TArray<float>& Levels01, bool bSendImmediate);
static bool QueueCommand_SetVibroLevel(bool bRightHanded, int32 Finger, float Level01, bool bSendImmediate);
static bool QueueCommand_SetVibroLevels(bool bRightHanded, const TArray<float>& Levels01, bool bSendImmediate);
static bool SupportsCustomWaveform(bool bRightHanded, ESGHapticLocation AtLocation);
static bool SendCustomWaveform(bool bRightHanded, FSGCustomWaveformImpl& OutWaveform, ESGHapticLocation Location);
static bool SupportsWristSqueeze(bool bRightHanded);
static bool QueueCommand_WristSqueeze(bool bRightHanded, float SqueezeLevel01, bool bSendImmediate);
static bool SupportsFlexionLocks(bool bRightHanded);
static bool QueueCommand_FlexionLock(bool bRightHanded, int32 Finger, float Flexion01, bool bSendImmediate);
static bool QueueCommand_ClearFlexionLock(bool bRightHanded, int32 Finger, bool bSendImmediate);
public:
FSGHandLayerImpl() = delete;
virtual ~FSGHandLayerImpl() = delete;
};