109 lines
2.3 KiB
C++
109 lines
2.3 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
|
#include "PICO_MovementFunctionLibrary.generated.h"
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(PICOOpenXRMovement, Log, All);
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EBodyJointPICO : uint8
|
|
{
|
|
Pelvis = 0,
|
|
LeftHip = 1,
|
|
RightHip = 2,
|
|
Spine1 = 3,
|
|
LeftKnee = 4,
|
|
RightKnee = 5,
|
|
Spine2 = 6,
|
|
LeftAnkle = 7,
|
|
RightAnkle = 8,
|
|
Spine3 = 9,
|
|
LeftFoot = 10,
|
|
RightFoot = 11,
|
|
Neck = 12,
|
|
LeftCollar = 13,
|
|
RightCollar = 14,
|
|
Head = 15,
|
|
LeftShoulder = 16,
|
|
RightShoulder = 17,
|
|
LeftElbow = 18,
|
|
RightElbow = 19,
|
|
LeftWrist = 20,
|
|
RightWrist = 21,
|
|
LeftHand = 22,
|
|
RightHand = 23
|
|
};
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EBodyTrackingModePICO : uint8
|
|
{
|
|
Default = 0 UMETA(Hidden),
|
|
LowLatency = 1,
|
|
HighAccuracy = 2
|
|
};
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FBodyJointDataPICO
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
EBodyJointPICO Joint;
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
bool bIsValid;
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
FRotator Orientation;
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
FVector Position;
|
|
|
|
FBodyJointDataPICO()
|
|
{}
|
|
};
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FBodyStatePICO
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
bool IsActive;
|
|
|
|
UPROPERTY(BlueprintReadOnly, Category = "PICO|BodyTracking")
|
|
TArray<FBodyJointDataPICO> BaseJointsData;
|
|
|
|
FBodyStatePICO()
|
|
{}
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class PICOOPENXRMOVEMENT_API UMovementFunctionLibraryPICO : public UBlueprintFunctionLibrary
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
/** Pose data is tracking space. */
|
|
UFUNCTION(BlueprintPure, Category = "PICO|BodyTracking")
|
|
static bool TryGetBodyStatePICO(FBodyStatePICO& outBodyState, float WorldToMeters = 100.0f);
|
|
|
|
UFUNCTION(BlueprintPure, Category = "PICO|BodyTracking")
|
|
static bool IsBodyTrackingEnabledPICO();
|
|
|
|
UFUNCTION(BlueprintPure, Category = "PICO|BodyTracking")
|
|
static bool IsBodyTrackingSupportedPICO();
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "PICO|BodyTracking")
|
|
static bool StartBodyTrackingPICO(EBodyTrackingModePICO Mode = EBodyTrackingModePICO::HighAccuracy);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "PICO|BodyTracking")
|
|
static bool StopBodyTrackingPICO();
|
|
};
|