Files
Plugin/Source/SenseGloveKismet/Public/SGKismet/SGVirtualHandMeshComponentKismetLibrary.h
T

114 lines
5.2 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
* A data class containing the minimum required data for a hand's forward
* kinematics.
* Used in both kinematics and calibration.
*/
#pragma once
#include "Containers/Array.h"
#include "Containers/Map.h"
#include "GameFramework/Actor.h"
#include "Math/Rotator.h"
#include "Math/Transform.h"
#include "UObject/NameTypes.h"
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGNameArray.h"
#include "SGVirtualHandMeshComponentKismetLibrary.generated.h"
class USkeletalMeshComponent;
class USGVirtualHandMeshComponent;
class USGHandPose;
/**
* Represents data of a user's hand required for forward kinematics.
*/
UCLASS(meta=(ScriptName = "SesneGloveVirtualHandMeshComponentKismetLibrary"))
class SENSEGLOVEKISMET_API UVirtualHandMeshComponentKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static TArray<FSGNameArray> GetLeftHandFingerBoneNames();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static TArray<FSGNameArray> GetRightHandFingerBoneNames();
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static const FName& GetLeftHandFingerBoneName(int32 Finger, int32 Joint);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static const FName& GetRightHandFingerBoneName(int32 Finger, int32 Joint);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static bool IsLeft(const USGVirtualHandMeshComponent* VirtualHandMeshComponent);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static bool IsRight(const USGVirtualHandMeshComponent* VirtualHandMeshComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static void SetRight(UPARAM(ref) USGVirtualHandMeshComponent* VirtualHandMeshComponent, bool bInRight);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static bool IsHiddenInGameIfNoGloveDetected(const USGVirtualHandMeshComponent* VirtualHandMeshComponent);
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
static void SetHiddenIfNoGloveDetected(UPARAM(ref) USGVirtualHandMeshComponent* VirtualHandMeshComponent,
bool bInHiddenIfNoGloveDetected);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
bool IsGloveConnected(const USGVirtualHandMeshComponent* VirtualHandMeshComponent) const;
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
USGHandPose* GetHandPose(UPARAM(ref) USGVirtualHandMeshComponent* VirtualHandMeshComponent);
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
const FName& GetFingerBoneName(const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
int32 Finger, int32 Joint) const;
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
const FTransform& GetFingerBoneRefTransform(const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
int32 Finger, int32 Joint) const;
UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Mesh Component")
FRotator GetFingerBoneRefRotation(const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
int32 Finger, int32 Joint) const;
UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Mesh Component")
TMap<FName, FRotator> GetFingersBonesRotations(UPARAM(ref) USGVirtualHandMeshComponent* VirtualHandMeshComponent);
};