A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
GS_LerpToHand.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "VRGripScriptBase.h"
7#include "VRBPDatatypes.h"
8#include "Curves/CurveFloat.h"
9#include "GS_LerpToHand.generated.h"
10
11DECLARE_DYNAMIC_MULTICAST_DELEGATE(FVRLerpToHandFinishedSignature);
12
13
14// A grip script that causes new grips to lerp to the hand (from their current position to where they are supposed to sit).
15// It turns off when the lerp is complete.
16UCLASS(NotBlueprintable, ClassGroup = (VRExpansionPlugin), hideCategories = TickSettings)
17class VREXPANSIONPLUGIN_API UGS_LerpToHand : public UVRGripScriptBase
18{
20public:
21
22 UGS_LerpToHand(const FObjectInitializer& ObjectInitializer);
23
24 float CurrentLerpTime;
25 float LerpSpeed;
26
27 // If the initial grip distance is closer than this value then the lerping will not be performed.
28 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
29 float MinDistanceForLerp;
30
31 // How many seconds the lerp should take
32 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
33 float LerpDuration;
34
35 // The minimum speed (in UU per second) that that the lerp should have across the initial grip distance
36 // Will speed the LerpSpeed up to try and maintain this initial speed if required
37 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
38 float MinSpeedForLerp;
39
40 // The maximum speed (in UU per second) that the lerp should have across the initial grip distance
41 // Will slow the LerpSpeed down to try and maintain this initial speed if required
42 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
43 float MaxSpeedForLerp;
45 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
46 EVRLerpInterpolationMode LerpInterpolationMode;
47
48 UPROPERTY(BlueprintAssignable, Category = "LerpEvents")
49 FVRLerpToHandFinishedSignature OnLerpToHandBegin;
50
51 UPROPERTY(BlueprintAssignable, Category = "LerpEvents")
52 FVRLerpToHandFinishedSignature OnLerpToHandFinished;
54 // Whether to use a curve map to map the lerp to
55 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpCurve")
56 bool bUseCurve;
57
58 // The curve to follow when using a curve map, only uses from 0.0 - 1.0 of the curve timeline and maps it across the entire duration
59 UPROPERTY(Category = "LerpCurve", EditAnywhere, meta = (editcondition = "bUseCurve"))
60 FRuntimeFloatCurve OptionalCurveToFollow;
61
62 FTransform OnGripTransform;
63 uint8 TargetGrip;
64
65 //virtual void BeginPlay_Implementation() override;
66 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;
67 virtual void OnGrip_Implementation(UGripMotionControllerComponent * GrippingController, const FBPActorGripInformation & GripInformation) override;
68 virtual void OnGripRelease_Implementation(UGripMotionControllerComponent * ReleasingController, const FBPActorGripInformation & GripInformation, bool bWasSocketed) override;
69};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FVRLerpToHandFinishedSignature)
EVRLerpInterpolationMode
UENUM(BlueprintType)
UCLASS(NotBlueprintable, ClassGroup = (VRExpansionPlugin), hideCategories = TickSettings)
FVRLerpToHandFinishedSignature OnLerpToHandBegin
UPROPERTY(BlueprintAssignable, Category = "LerpEvents")
float MinSpeedForLerp
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
float MaxSpeedForLerp
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LerpSettings")
FRuntimeFloatCurve OptionalCurveToFollow
UPROPERTY(Category = "LerpCurve", EditAnywhere, meta = (editcondition = "bUseCurve"))
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)
UCLASS(NotBlueprintable, BlueprintType, EditInlineNew, DefaultToInstanced, Abstract,...
virtual void OnGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false)
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)
virtual void OnGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")