Files
Plugin/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGHapticGloveKismetLibrary.h
T

206 lines
11 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 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 "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGHapticGloveKismetLibrary.generated.h"
class USGBasicHandModel;
class USGBuzzCommand;
class USGForceFeedbackCommand;
class USGHandPose;
class USGHandProfile;
class USGHapticGlove;
class USGThumperCommand;
UCLASS(meta=(ScriptName = "SesneGloveHapticGloveKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGHapticGloveKismetLibrary : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static TArray<USGHapticGlove*> GetHapticGloves(UObject* WorldContextObject);
UFUNCTION(BlueprintCallable, DisplayName="Get Glove", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetGlove_OutGlove(UObject* WorldContextObject, USGHapticGlove*& OutGlove);
UFUNCTION(BlueprintCallable, DisplayName="Get Glove", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetGlove_bRightHanded_OutGlove(UObject* WorldContextObject, bool bRightHanded,
USGHapticGlove*& OutGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static ESGDeviceType GetDeviceType(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static FString GetDeviceId(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static FString GetHardwareVersion(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static int32 GetFirmwareVersion(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static int32 GetSubFirmwareVersion(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove")
static bool IsRight(const USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintCallable, DisplayName="Get Imu Rotation", Category="SenseGlove | Core | Haptic Glove")
static bool GetImuRotation_FQuatOutImu(UPARAM(ref) USGHapticGlove* HapticGlove, FQuat& OutImu);
UFUNCTION(BlueprintCallable, DisplayName="Get Imu Rotation", Category="SenseGlove | Core | Haptic Glove")
static bool GetImuRotation_FRotatorOutImu(UPARAM(ref) USGHapticGlove* HapticGlove, FRotator& OutImu);
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HandGeometry_HandProfile_OutHandPose(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove,
const USGBasicHandModel* HandGeometry,
const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose);
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HandProfile_OutHandPose(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove,
const USGHandProfile* HandProfile,
USGHandPose*& OutHandPose);
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_HandGeometry_OutHandPose(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove,
const USGBasicHandModel* HandGeometry,
USGHandPose*& OutHandPose);
UFUNCTION(BlueprintCallable, DisplayName="Get Hand Pose", Category="SenseGlove | Core | Haptic Glove",
meta=(WorldContext="WorldContextObject"))
static bool GetHandPose_OutHandPose(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove,
USGHandPose*& OutHandPose);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void StopHaptics(UPARAM(ref) USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void StopVibrations(UPARAM(ref) USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_ForceFeedbackCommand(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand);
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_BuzzCommand(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGBuzzCommand* BuzzCommand);
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_ThumperCommand(UPARAM(ref) USGHapticGlove* HapticGlove,
const USGThumperCommand* ThumperCommand);
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_ForceFeedbackCommand_BuzzCommand(
UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand);
UFUNCTION(BlueprintCallable, DisplayName="Send Haptics", Category="SenseGlove | Core | Haptic Glove")
static void SendHaptics_ForceFeedbackCommand_BuzzCommand_ThumperCommand(
UPARAM(ref) USGHapticGlove* HapticGlove,
const USGForceFeedbackCommand* ForceFeedbackCommand,
const USGBuzzCommand* BuzzCommand,
const USGThumperCommand* ThumperCommand);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static bool GetCalibrationValues(UPARAM(ref) USGHapticGlove* HapticGlove, TArray<FVector>& OutValues);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void ResetCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void UpdateCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove);
UFUNCTION(BlueprintCallable, DisplayName="Update Calibration", Category="SenseGlove | Core | Haptic Glove")
static void UpdateCalibrationRange_CalibrationValues(UPARAM(ref) USGHapticGlove* HapticGlove,
const TArray<FVector>& CalibrationValues);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove")
static void GetCalibrationRange(UPARAM(ref) USGHapticGlove* HapticGlove,
TArray<FVector>& OutMinValues, TArray<FVector>& OutMaxValues);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static void UpdateCalibration(UObject* WorldContextObject,
UPARAM(ref) USGHapticGlove* HapticGlove, USGHandProfile*& OutProfile);
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Haptic Glove", meta=(WorldContext="WorldContextObject"))
static void ApplyCalibration(UObject* WorldContextObject,
const USGHapticGlove* HapticGlove, USGHandProfile*& OutProfile);
UFUNCTION(BlueprintPure, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Haptic Glove")
static void GetWristLocation_ReferencePosition_ReferenceRotation_TrackingHardware_OutWristPosition_OutWristLocation(
const USGHapticGlove* HapticGlove,
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FQuat& OutWristRotation);
UFUNCTION(BlueprintPure, DisplayName="Get Wrist Location", Category="SenseGlove | Core | Haptic Glove")
static void
GetWristLocation_ReferencePosition_FRotatorReferenceRotation_TrackingHardware_OutWristPosition_FRotatorOutWristLocation(
const USGHapticGlove* HapticGlove,
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutWristPosition, FRotator& OutWristRotation);
UFUNCTION(BlueprintPure, DisplayName="Get Glove Location", Category="SenseGlove | Core | Haptic Glove")
static void GetGloveLocation_ReferencePosition_ReferenceRotation_TrackingHardware_OutGlovePosition_OutGloveRotation(
const USGHapticGlove* HapticGlove,
const FVector& ReferencePosition, const FQuat& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FQuat& OutGloveRotation);
UFUNCTION(BlueprintPure, DisplayName="Get Glove Location", Category="SenseGlove | Core | Haptic Glove")
static void
GetGloveLocation_FRotatorReferencePosition_ReferenceRotation_TrackingHardware_OutGlovePosition_FRotatorOutGloveRotation(
const USGHapticGlove* HapticGlove,
const FVector& ReferencePosition, const FRotator& ReferenceRotation,
ESGPositionalTrackingHardware TrackingHardware,
FVector& OutGlovePosition, FRotator& OutGloveRotation);
};