You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
33 lines
1.3 KiB
C++
33 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "WindowsMixedRealityHandTrackingFunctionLibrary.h"
|
|
#include "IWindowsMixedRealityHandTrackingPlugin.h"
|
|
#include "WindowsMixedRealityHandTracking.h"
|
|
|
|
bool UWindowsMixedRealityHandTrackingFunctionLibrary::GetHandJointTransform(EControllerHand Hand, EWMRHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius)
|
|
{
|
|
TSharedPtr<FWindowsMixedRealityHandTracking> HandTracking = StaticCastSharedPtr<FWindowsMixedRealityHandTracking>(IWindowsMixedRealityHandTrackingModule::Get().GetInputDevice());
|
|
|
|
//UE_LOG(LogWindowsMixedRealityHandTracking, Display, TEXT("CNNTEMP GetGestureKeypointTransform 0"));
|
|
if (HandTracking.IsValid() && HandTracking->IsHandTrackingStateValid())
|
|
{
|
|
FTransform KeyPointTransform;
|
|
const bool bSuccess = HandTracking->GetKeypointTransform(Hand, Keypoint, KeyPointTransform);
|
|
//UE_LOG(LogWindowsMixedRealityHandTracking, Display, TEXT("CNNTEMP GetGestureKeypointTransform hand %d joint %d (%d)"), (uint32)Hand, (uint32)Keypoint, bSuccess);
|
|
|
|
if (bSuccess)
|
|
{
|
|
OutTransform = KeyPointTransform;
|
|
HandTracking->GetKeypointRadius(Hand, Keypoint, OutRadius);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool UWindowsMixedRealityHandTrackingFunctionLibrary::SupportsHandTracking()
|
|
{
|
|
return WindowsMixedReality::FWindowsMixedRealityStatics::SupportsHandTracking();
|
|
}
|