2019-12-27 09:26:59 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-06-10 12:22:13 -04:00
|
|
|
|
|
|
|
|
#include "WindowsMixedRealityHandTrackingFunctionLibrary.h"
|
|
|
|
|
#include "IWindowsMixedRealityHandTrackingPlugin.h"
|
|
|
|
|
#include "WindowsMixedRealityHandTracking.h"
|
|
|
|
|
|
2022-01-19 18:42:21 -05:00
|
|
|
bool UDEPRECATED_WindowsMixedRealityHandTrackingFunctionLibrary::GetHandJointTransform(EControllerHand Hand, EWMRHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius)
|
2019-06-10 12:22:13 -04:00
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
{
|
2020-03-31 15:56:17 -04:00
|
|
|
OutTransform = KeyPointTransform;
|
2020-02-12 13:27:19 -05:00
|
|
|
HandTracking->GetKeypointRadius(Hand, Keypoint, OutRadius);
|
2019-06-10 12:22:13 -04:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2020-02-12 13:27:19 -05:00
|
|
|
|
2022-01-19 18:42:21 -05:00
|
|
|
bool UDEPRECATED_WindowsMixedRealityHandTrackingFunctionLibrary::SupportsHandTracking()
|
2020-02-12 13:27:19 -05:00
|
|
|
{
|
|
|
|
|
return WindowsMixedReality::FWindowsMixedRealityStatics::SupportsHandTracking();
|
|
|
|
|
}
|