129 lines
4.7 KiB
C++
129 lines
4.7 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
|
|
*
|
|
*
|
|
*/
|
|
|
|
|
|
#include "SGKismet/SGVirtualHandMeshComponentKismetLibrary.h"
|
|
|
|
#include "SenseGlove/Components/SGVirtualHandMeshComponent.h"
|
|
#include "SGCore/SGHandPose.h"
|
|
#include "SGUtils/SGArrayUtils.h"
|
|
|
|
TArray<FSGNameArray> UVirtualHandMeshComponentKismetLibrary::GetLeftHandFingerBoneNames()
|
|
{
|
|
return FSGArrayUtils::ToNestedBPArray<FName, FSGNameArray>(
|
|
USGVirtualHandMeshComponent::GetLeftHandFingerBoneNames());
|
|
}
|
|
|
|
TArray<FSGNameArray> UVirtualHandMeshComponentKismetLibrary::GetRightHandFingerBoneNames()
|
|
{
|
|
return FSGArrayUtils::ToNestedBPArray<FName, FSGNameArray>(
|
|
USGVirtualHandMeshComponent::GetRightHandFingerBoneNames());
|
|
}
|
|
|
|
const FName& UVirtualHandMeshComponentKismetLibrary::GetLeftHandFingerBoneName(const int32 Finger, const int32 Joint)
|
|
{
|
|
return USGVirtualHandMeshComponent::GetLeftHandFingerBoneName(Finger, Joint);
|
|
}
|
|
|
|
const FName& UVirtualHandMeshComponentKismetLibrary::GetRightHandFingerBoneName(const int32 Finger, const int32 Joint)
|
|
{
|
|
return USGVirtualHandMeshComponent::GetRightHandFingerBoneName(Finger, Joint);
|
|
}
|
|
|
|
bool UVirtualHandMeshComponentKismetLibrary::IsLeft(const USGVirtualHandMeshComponent* VirtualHandMeshComponent)
|
|
{
|
|
return VirtualHandMeshComponent->IsLeft();
|
|
}
|
|
|
|
bool UVirtualHandMeshComponentKismetLibrary::IsRight(const USGVirtualHandMeshComponent* VirtualHandMeshComponent)
|
|
{
|
|
return VirtualHandMeshComponent->IsRight();
|
|
}
|
|
|
|
void UVirtualHandMeshComponentKismetLibrary::SetRight(USGVirtualHandMeshComponent* VirtualHandMeshComponent,
|
|
const bool bInRight)
|
|
{
|
|
VirtualHandMeshComponent->SetRight(bInRight);
|
|
}
|
|
|
|
bool UVirtualHandMeshComponentKismetLibrary::IsHiddenInGameIfNoGloveDetected(
|
|
const USGVirtualHandMeshComponent* VirtualHandMeshComponent)
|
|
{
|
|
return VirtualHandMeshComponent->IsHiddenInGameIfNoGloveDetected();
|
|
}
|
|
|
|
void UVirtualHandMeshComponentKismetLibrary::SetHiddenIfNoGloveDetected(
|
|
USGVirtualHandMeshComponent* VirtualHandMeshComponent,
|
|
const bool bInHiddenIfNoGloveDetected)
|
|
{
|
|
VirtualHandMeshComponent->SetHiddenIfNoGloveDetected(bInHiddenIfNoGloveDetected);
|
|
}
|
|
|
|
bool UVirtualHandMeshComponentKismetLibrary::IsGloveConnected(
|
|
const USGVirtualHandMeshComponent* VirtualHandMeshComponent) const
|
|
{
|
|
return VirtualHandMeshComponent->IsGloveConnected();
|
|
}
|
|
|
|
USGHandPose* UVirtualHandMeshComponentKismetLibrary::GetHandPose(USGVirtualHandMeshComponent* VirtualHandMeshComponent)
|
|
{
|
|
return VirtualHandMeshComponent->GetHandPose();
|
|
}
|
|
|
|
const FName& UVirtualHandMeshComponentKismetLibrary::GetFingerBoneName(
|
|
const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
|
|
const int32 Finger, const int32 Joint) const
|
|
{
|
|
return VirtualHandMeshComponent->GetFingerBoneName(Finger, Joint);
|
|
}
|
|
|
|
const FTransform& UVirtualHandMeshComponentKismetLibrary::GetFingerBoneRefTransform(
|
|
const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
|
|
const int32 Finger, const int32 Joint) const
|
|
{
|
|
return VirtualHandMeshComponent->GetFingerBoneRefTransform(Finger, Joint);
|
|
}
|
|
|
|
FRotator UVirtualHandMeshComponentKismetLibrary::GetFingerBoneRefRotation(
|
|
const USGVirtualHandMeshComponent* VirtualHandMeshComponent,
|
|
const int32 Finger, const int32 Joint) const
|
|
{
|
|
return VirtualHandMeshComponent->GetFingerBoneRefRotation(Finger, Joint);
|
|
}
|
|
|
|
TMap<FName, FRotator> UVirtualHandMeshComponentKismetLibrary::GetFingersBonesRotations(
|
|
USGVirtualHandMeshComponent* VirtualHandMeshComponent)
|
|
{
|
|
return VirtualHandMeshComponent->GetFingersBonesRotations();
|
|
} |