4#include "CoreMinimal.h"
6#include "UObject/ObjectMacros.h"
7#include "UObject/ScriptMacros.h"
8#include "UObject/Interface.h"
10#include "VRTrackedParentInterface.generated.h"
13UINTERFACE(MinimalAPI, meta = (CannotImplementInterfaceInBlueprint))
22 GENERATED_IINTERFACE_BODY()
27 UFUNCTION(BlueprintCallable, Category = "VRTrackedParentInterface")
28 virtual
void SetTrackedParent(UPrimitiveComponent * NewParentComponent,
float WaistRadius,
EBPVRWaistTrackingMode WaistTrackingMode)
35 if (OptionalWaistTrackingParent.
IsValid())
38 Self->RemoveTickPrerequisiteComponent(OptionalWaistTrackingParent.
TrackedDevice);
41 if (!NewParentComponent || !Self)
43 OptionalWaistTrackingParent.
Clear();
48 if (NewParentComponent->PrimaryComponentTick.TickGroup == Self->PrimaryComponentTick.TickGroup)
51 NewParentComponent->RemoveTickPrerequisiteComponent(Self);
54 Self->AddTickPrerequisiteComponent(NewParentComponent);
57 OptionalWaistTrackingParent.
TrackedDevice = NewParentComponent;
58 OptionalWaistTrackingParent.
RestingRotation = NewParentComponent->GetRelativeRotation();
61 OptionalWaistTrackingParent.
TrackingMode = WaistTrackingMode;
62 OptionalWaistTrackingParent.
WaistRadius = WaistRadius;
68 if (!WaistTrackingInfo.
IsValid())
69 return FTransform::Identity;
71 FTransform DeviceTransform = WaistTrackingInfo.
TrackedDevice->GetRelativeTransform();
74 DeviceTransform.ConcatenateRotation(WaistTrackingInfo.
RestingRotation.Quaternion().Inverse());
75 DeviceTransform.SetScale3D(FVector(1, 1, 1));
80 DeviceTransform.AddToTranslation(DeviceTransform.GetRotation().RotateVector(FVector(-WaistTrackingInfo.
WaistRadius, 0, 0)));
99 return DeviceTransform;
EBPVRWaistTrackingMode
UENUM(Blueprintable)
static void Default_SetTrackedParent_Impl(UPrimitiveComponent *NewParentComponent, float WaistRadius, EBPVRWaistTrackingMode WaistTrackingMode, FBPVRWaistTracking_Info &OptionalWaistTrackingParent, USceneComponent *Self)
virtual void SetTrackedParent(UPrimitiveComponent *NewParentComponent, float WaistRadius, EBPVRWaistTrackingMode WaistTrackingMode)
UFUNCTION(BlueprintCallable, Category = "VRTrackedParentInterface")
static FTransform Default_GetWaistOrientationAndPosition(FBPVRWaistTracking_Info &WaistTrackingInfo)
GENERATED_IINTERFACE_BODY()
UINTERFACE(MinimalAPI, meta = (CannotImplementInterfaceInBlueprint))
GENERATED_UINTERFACE_BODY()
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
float WaistRadius
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Settings")
FRotator RestingRotation
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Settings")
EBPVRWaistTrackingMode TrackingMode
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Settings")
UPrimitiveComponent * TrackedDevice
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Settings")