6#include "Math/DualQuat.h"
9 Super(ObjectInitializer)
46 float Distance = FVector::Dist(
OnGripTransform.GetLocation(), TargetTransform.GetLocation());
55 float LerpScaler = 1.0f;
77 GripInfo->bIsLerping =
true;
99 float DeltaTime, FTransform & WorldTransform,
100 const FTransform &ParentTransform,
103 UPrimitiveComponent * root,
104 bool bRootHasInterface,
105 bool bActorHasInterface,
141 Alpha = FMath::Clamp(richCurve->Eval(Alpha), 0.f, 1.f);
147 FTransform NB = WorldTransform;
148 NA.NormalizeRotation();
149 NB.NormalizeRotation();
154 WorldTransform.Blend(NA, NB, Alpha);
160 WorldTransform.SetTranslation(FMath::Lerp(NA.GetTranslation(), NB.GetTranslation(), Alpha));
161 WorldTransform.SetScale3D(FMath::Lerp(NA.GetScale3D(), NB.GetScale3D(), Alpha));
163 FRotator A = NA.Rotator();
164 FRotator B = NB.Rotator();
165 WorldTransform.SetRotation(FQuat(A + (Alpha * (B - A))));
170 if ((NB.GetRotation() | NA.GetRotation()) < 0.0f)
172 NB.SetRotation(NB.GetRotation()*-1.0f);
174 WorldTransform = (FDualQuat(NA)*(1 - Alpha) + FDualQuat(NB)*Alpha).Normalized().AsFTransform(FMath::Lerp(NA.GetScale3D(), NB.GetScale3D(), Alpha));
178 if (OrigAlpha == 1.0f)
#define INVALID_VRGRIP_ID
virtual void OnGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation) override
virtual void OnGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed) override
FVRLerpToHandFinishedSignature OnLerpToHandBegin
UPROPERTY(BlueprintAssignable, Category = "LerpEvents")
float MinSpeedForLerp
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
float MaxSpeedForLerp
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
virtual bool GetWorldTransform_Implementation(UGripMotionControllerComponent *OwningController, float DeltaTime, FTransform &WorldTransform, const FTransform &ParentTransform, FBPActorGripInformation &Grip, AActor *actor, UPrimitiveComponent *root, bool bRootHasInterface, bool bActorHasInterface, bool bIsForTeleport) override
FRuntimeFloatCurve OptionalCurveToFollow
UPROPERTY(Category = "LerpCurve", EditAnywhere, meta = (editcondition = "bUseCurve"))
UGS_LerpToHand(const FObjectInitializer &ObjectInitializer)
FVRLerpToHandFinishedSignature OnLerpToHandFinished
UPROPERTY(BlueprintAssignable, Category = "LerpEvents")
float LerpDuration
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
EVRLerpInterpolationMode LerpInterpolationMode
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
bool bUseCurve
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpCurve")
float MinDistanceForLerp
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
FTransform OnGripTransform
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
FVROnControllerGripSignature OnLerpToHandFinished
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
FBPActorGripInformation * GetGripPtrByID(uint8 IDToLookForGrip)
FORCEINLINE FTransform GetPivotTransform()
UCLASS(config = Engine, defaultconfig)
bool bDenyAutoDrop
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
FTransform GetParentTransform(bool bGetWorldTransform=true, FName BoneName=NAME_None)
UFUNCTION(BlueprintPure, Category = "VRGripScript")
EGSTransformOverrideType WorldTransformOverrideType
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
bool bIsActive
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
UObject * GetParent()
UFUNCTION(BlueprintPure, Category = "VRGripScript")