6#include "Engine/BlueprintGeneratedClass.h"
7#include "Engine/NetDriver.h"
11 : Super(ObjectInitializer)
47 if (WorldContextObject->GetClass()->ImplementsInterface(UVRGripInterface::StaticClass()))
49 TArray<UVRGripScriptBase*> GripScripts;
50 if (IVRGripInterface::Execute_GetGripScripts(WorldContextObject, GripScripts))
54 if (Script && Script->IsA(GripScriptClass))
73 UBlueprintGeneratedClass* BPClass = Cast<UBlueprintGeneratedClass>(GetClass());
76 BPClass->GetLifetimeBlueprintReplicationList(OutLifetimeProps);
107 if(IsTemplate(RF_ClassDefaultObject))
108 return ETickableTickType::Never;
110 return bCanEverTick ? ETickableTickType::Conditional : ETickableTickType::Never;
156 bool bProcessed =
false;
160 FWorldContext*
const Context = GEngine->GetWorldContextFromWorld(
GetWorld());
161 if (Context !=
nullptr)
163 for (FNamedNetDriver& Driver : Context->ActiveNetDrivers)
165 if (Driver.NetDriver !=
nullptr && Driver.NetDriver->ShouldReplicateFunction(MyOwner,
Function))
167 Driver.NetDriver->ProcessRemoteFunction(MyOwner,
Function, Parms, OutParms, Stack,
this);
185 return GEngine->GetGlobalFunctionCallspace(
Function,
this, Stack);
189 return Owner->GetFunctionCallspace(
Function, Stack);
205 else if (
AActor * ParentActor = Cast<AActor>(ParentObj))
207 return ParentActor->GetRootComponent();
219 if (BoneName != NAME_None)
221 return PrimParent->GetSocketTransform(BoneName);
225 return PrimParent->GetComponentTransform();
228 else if (
AActor* ParentActor = Cast<AActor>(ParentObj))
230 return ParentActor->GetActorTransform();
233 return FTransform::Identity;
240 if (UPrimitiveComponent * PrimParent = Cast<UPrimitiveComponent>(ParentObj))
242 return PrimParent->GetBodyInstance(OptionalBoneName);
244 else if (
AActor * ParentActor = Cast<AActor>(ParentObj))
246 if (UPrimitiveComponent * Prim = Cast<UPrimitiveComponent>(ParentActor->GetRootComponent()))
248 return Prim->GetBodyInstance(OptionalBoneName);
257 return this->GetOuter();
262 UObject * myOuter = this->GetOuter();
267 if (
AActor * ActorOwner = Cast<AActor>(myOuter))
271 else if (
UActorComponent * ComponentOwner = Cast<UActorComponent>(myOuter))
273 return ComponentOwner->GetOwner();
283 return MyOwner->GetLocalRole() == ROLE_Authority;
293 return MyOwner->GetNetMode() < ENetMode::NM_Client;
304 if (GIsEditor && !GIsPlayInEditorWorld)
308 else if (
UObject * Outer = GetOuter())
310 return Outer->GetWorld();
334 Super::PostInitProperties();
341 if (Owner->IsActorInitialized())
EGSTransformOverrideType
UENUM(Blueprintable)
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
void ReceiveTick(float DeltaSeconds)
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Tick"))
virtual void Tick(float DeltaTime) override
UCLASS(NotBlueprintable, BlueprintType, EditInlineNew, DefaultToInstanced, Abstract,...
virtual bool IsTickable() const override
void OnBeginPlay(UObject *CallingOwner)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripScript")
virtual void PostInitProperties() override
bool bDenyAutoDrop
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
virtual void HandlePostPhysicsHandle(UGripMotionControllerComponent *GrippingController, FBPActorPhysicsHandleInformation *HandleInfo)
FBodyInstance * GetParentBodyInstance(FName OptionalBoneName=NAME_None)
virtual void OnGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false)
virtual bool Wants_DenyTeleport_Implementation(UGripMotionControllerComponent *Controller)
FTransform GetGripTransform(const FBPActorGripInformation &Grip, const FTransform &ParentTransform)
UFUNCTION(BlueprintPure, Category = "VRGripScript")
virtual UWorld * GetTickableGameObjectWorld() const override
virtual bool IsTickableInEditor() const
FTransform GetParentTransform(bool bGetWorldTransform=true, FName BoneName=NAME_None)
UFUNCTION(BlueprintPure, Category = "VRGripScript")
void OnEndPlay(const EEndPlayReason::Type EndPlayReason)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripScript")
bool bForceDrop
UPROPERTY(BlueprintReadWrite, Category = "GSSettings")
virtual void GetLifetimeReplicatedProps(TArray< class FLifetimeProperty > &OutLifetimeProps) const override
virtual void OnEndPlay_Implementation(const EEndPlayReason::Type EndPlayReason)
virtual void Tick(float DeltaTime) override
virtual ETickableTickType GetTickableTickType() const
bool bAllowTicking
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "TickSettings")
virtual UWorld * GetWorld() const override
EGSTransformOverrideType GetWorldTransformOverrideType()
bool IsServer()
UFUNCTION(BlueprintPure, Category = "VRGripScript")
virtual void OnSecondaryGrip_Implementation(UGripMotionControllerComponent *Controller, USceneComponent *SecondaryGripComponent, const FBPActorGripInformation &GripInformation)
virtual void OnBeginPlay_Implementation(UObject *CallingOwner)
void BeginPlay(UObject *CallingOwner)
virtual int32 GetFunctionCallspace(UFunction *Function, FFrame *Stack) override
bool bDenyLateUpdates
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
virtual void OnSecondaryGripRelease_Implementation(UGripMotionControllerComponent *Controller, USceneComponent *ReleasingSecondaryGripComponent, const FBPActorGripInformation &GripInformation)
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)
bool IsSupportedForNetworking() const override
bool bAlreadyNotifiedPlay
EGSTransformOverrideType WorldTransformOverrideType
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
UVRGripScriptBase(const FObjectInitializer &ObjectInitializer)
static UVRGripScriptBase * GetGripScriptByClass(UObject *WorldContextObject, TSubclassOf< UVRGripScriptBase > GripScriptClass, EBPVRResultSwitch &Result)
UFUNCTION(BlueprintCallable, Category = "VRGripScript|Functions", meta = (WorldContext = "WorldContex...
virtual void OnGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
virtual void HandlePrePhysicsHandle(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInfo, FBPActorPhysicsHandleInformation *HandleInfo, FTransform &KinPose)
bool HasAuthority()
UFUNCTION(BlueprintPure, Category = "VRGripScript")
bool bIsActive
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "GSSettings")
AActor * GetOwner()
UFUNCTION(BlueprintPure, Category = "VRGripScript")
void EndPlay(const EEndPlayReason::Type EndPlayReason)
virtual TStatId GetStatId() const override
void SetTickEnabled(bool bTickEnabled)
UFUNCTION(BlueprintCallable, Category = "TickSettings")
bool bCanEverTick
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "TickSettings")
virtual bool IsTickableWhenPaused() const override
USceneComponent * GetParentSceneComp()
UFUNCTION(BlueprintCallable, Category = "VRGripScript")
UObject * GetParent()
UFUNCTION(BlueprintPure, Category = "VRGripScript")
virtual bool CallRemoteFunction(UFunction *Function, void *Parms, FOutParmRec *OutParms, FFrame *Stack) override