159 lines
5.4 KiB
C++
159 lines
5.4 KiB
C++
/**
|
|
* @file
|
|
*
|
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
|
*
|
|
* @section LICENSE
|
|
*
|
|
* (The MIT License)
|
|
*
|
|
* Copyright (c) 2020 - 2025 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/SGVirtualHandComponentKismetLibrary.h"
|
|
|
|
#include "SenseGlove/Components/SGVirtualHandComponent.h"
|
|
#include "SGCore/SGHapticGlove.h"
|
|
|
|
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetLeftHandBoneNames()
|
|
{
|
|
return USGVirtualHandComponent::GetLeftHandBoneNames();
|
|
}
|
|
|
|
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetRightHandBoneNames()
|
|
{
|
|
return USGVirtualHandComponent::GetRightHandBoneNames();
|
|
}
|
|
|
|
const FName& UVirtualHandComponentKismetLibrary::GetLeftHandBoneName(const int32 Joint)
|
|
{
|
|
return USGVirtualHandComponent::GetLeftHandBoneName(Joint);
|
|
}
|
|
|
|
const FName& UVirtualHandComponentKismetLibrary::GetRightHandBoneName(const int32 Joint)
|
|
{
|
|
return USGVirtualHandComponent::GetRightHandBoneName(Joint);
|
|
}
|
|
|
|
bool UVirtualHandComponentKismetLibrary::IsLeft(const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->IsLeft();
|
|
}
|
|
|
|
bool UVirtualHandComponentKismetLibrary::IsRight(const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->IsRight();
|
|
}
|
|
|
|
void UVirtualHandComponentKismetLibrary::SetRight(
|
|
USGVirtualHandComponent* VirtualHandComponent, const bool bInRight)
|
|
{
|
|
VirtualHandComponent->SetRight(bInRight);
|
|
}
|
|
|
|
bool UVirtualHandComponentKismetLibrary::OverridesPluginVirtualHandSettings(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->OverridesPluginVirtualHandSettings();
|
|
}
|
|
|
|
const FSGVirtualHandSettingsOverrides& UVirtualHandComponentKismetLibrary::GetVirtualHandSettingsOverrides(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetVirtualHandSettingsOverrides();
|
|
}
|
|
|
|
void UVirtualHandComponentKismetLibrary::SetVirtualHandSettingsOverrides(
|
|
USGVirtualHandComponent* VirtualHandComponent,
|
|
const FSGVirtualHandSettingsOverrides& InVirtualHandSettingsOverrides)
|
|
{
|
|
VirtualHandComponent->SetVirtualHandSettingsOverrides(InVirtualHandSettingsOverrides);
|
|
}
|
|
|
|
FSGVirtualHandSettings UVirtualHandComponentKismetLibrary::GetVirtualHandSettings(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetVirtualHandSettings();
|
|
}
|
|
|
|
bool UVirtualHandComponentKismetLibrary::IsGloveConnected(const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->IsGloveConnected();
|
|
}
|
|
|
|
USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetConnectedGlove();
|
|
}
|
|
|
|
const FXRHandTrackingState& UVirtualHandComponentKismetLibrary::GetHandTrackingState(
|
|
USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetHandTrackingState();
|
|
}
|
|
|
|
const TArray<FName>& UVirtualHandComponentKismetLibrary::GetHandBoneNames(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneNames();
|
|
}
|
|
|
|
const FName& UVirtualHandComponentKismetLibrary::GetHandBoneName(
|
|
const USGVirtualHandComponent* VirtualHandComponent, const int32 Joint)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneName(Joint);
|
|
}
|
|
|
|
const FTransform& UVirtualHandComponentKismetLibrary::GetHandBoneRefTransform_BN(
|
|
const USGVirtualHandComponent* VirtualHandComponent, const FName& BoneName)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneRefTransform(BoneName);
|
|
}
|
|
|
|
const FTransform& UVirtualHandComponentKismetLibrary::GetHandBoneRefTransform_J(
|
|
const USGVirtualHandComponent* VirtualHandComponent, const int32 Joint)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneRefTransform(Joint);
|
|
}
|
|
|
|
const FTransform& UVirtualHandComponentKismetLibrary::GetHandRootBoneRefTransform(
|
|
const USGVirtualHandComponent* VirtualHandComponent)
|
|
{
|
|
return VirtualHandComponent->GetHandRootBoneRefTransform();
|
|
}
|
|
|
|
FRotator UVirtualHandComponentKismetLibrary::GetHandBoneRefRotation_BN(
|
|
const USGVirtualHandComponent* VirtualHandComponent, const FName& BoneName)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneRefRotation(BoneName);
|
|
}
|
|
|
|
FRotator UVirtualHandComponentKismetLibrary::GetHandBoneRefRotation_J(
|
|
const USGVirtualHandComponent* VirtualHandComponent, const int32 Joint)
|
|
{
|
|
return VirtualHandComponent->GetHandBoneRefRotation(Joint);
|
|
} |