12#include "Components/BillboardComponent.h"
13#include "GameFramework/GameModeBase.h"
14#include "Grippables/GrippableActor.h"
19#include "Kismet/GameplayStatics.h"
25 : DefaultPlayerHeight(165)
26 , bLaserBeamActive(false)
27 , LeftTeleporterSocket(NAME_None)
28 , RightTeleporterSocket(NAME_None)
29 , TeleportControllerLeft(nullptr)
30 , TeleportControllerRight(nullptr)
31 , LeftLaserBeamSocket(NAME_None)
32 , RightLaserBeamSocket(NAME_None)
33 , LaserControllerLeft(nullptr)
34 , LaserControllerRight(nullptr)
35 , bLeftLaserBeamIsActiveOnStart(false)
36 , bRightLaserBeamIsActiveOnStart(false)
37 , WristMenuLoc(nullptr)
39 , WristMenuSocket(FName(
"WristMenuSocket"))
41 , MirroredWristMenuScale(FVector(1, -1, -1))
42 , ToolSocket(
"ToolSocket")
44 , BaseLookUpRate(45.0f)
45 , bDisableToolsInputBindings(false)
49 PrimaryActorTick.bCanEverTick =
true;
52 SetReplicateMovement(
true);
53 bNetLoadOnClient =
true;
55 static ConstructorHelpers::FObjectFinder<UStaticMesh> HeadMeshFinder(
56 TEXT(
"StaticMesh'/PixoCore/Meshes/SM_PlayerHead.SM_PlayerHead'"));
57 UStaticMesh* HeadMesh = HeadMeshFinder.Object;
59 static ConstructorHelpers::FObjectFinder<UMaterialInstance> HeadMeshMaterialFinder(
60 TEXT(
"MaterialInstanceConstant'/PixoCore/Materials/MI_PlayerHead.MI_PlayerHead'"));
61 UMaterialInstance* HeadMeshMaterial = HeadMeshMaterialFinder.Object;
63 static ConstructorHelpers::FObjectFinder<UStaticMesh> BodyMeshFinder(
64 TEXT(
"StaticMesh'/PixoCore/Meshes/BasicShapes/Cylinder.Cylinder'"));
65 UStaticMesh* BodyMesh = BodyMeshFinder.Object;
67 static ConstructorHelpers::FObjectFinder<UMaterial> BodyMeshMaterialFinder(
68 TEXT(
"Material'/PixoCore/Materials/Body/BasicShapeMaterialTrans.BasicShapeMaterialTrans'"));
69 UMaterial* BodyMeshMaterial = BodyMeshMaterialFinder.Object;
75 Head = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"HeadMesh"));
76 Head->SetStaticMesh(HeadMesh);
77 Head->SetMaterial(0, HeadMeshMaterial);
78 Head->SetRelativeLocation(FVector(0.0f, 0.0f, -15.0f));
79 Head->SetRelativeRotation(FRotator(0.0f, -90.0f, 0.0f));
80 Head->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
81 Head->SetupAttachment(VRReplicatedCamera);
83 Body = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"BodyMesh"));
84 Body->SetStaticMesh(BodyMesh);
85 Body->SetMaterial(0, BodyMeshMaterial);
86 Body->SetRelativeLocation(FVector(-8.0f, 0.0f, -160.0f));
87 Body->SetRelativeScale3D(FVector(0.5f, 0.5f, 0.1f));
88 Body->SetCollisionProfileName(UCollisionProfile::CustomCollisionProfileName);
89 Body->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
90 Body->SetCollisionObjectType(ECollisionChannel::ECC_Pawn);
91 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Overlap);
92 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldDynamic, ECollisionResponse::ECR_Overlap);
93 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);
94 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_PhysicsBody, ECollisionResponse::ECR_Overlap);
95 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Vehicle, ECollisionResponse::ECR_Overlap);
96 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Destructible, ECollisionResponse::ECR_Overlap);
97 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Visibility, ECollisionResponse::ECR_Overlap);
98 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Camera, ECollisionResponse::ECR_Overlap);
99 Body->SetupAttachment(ParentRelativeAttachment);
101 bUseControllerRotationPitch =
true;
102 bUseControllerRotationYaw =
true;
103 bUseControllerRotationRoll =
false;
105 VRReplicatedCamera->bUsePawnControlRotation =
false;
106 VRReplicatedCamera->bLockToHmd =
true;
107 VRReplicatedCamera->bAutoSetLockToHmd =
true;
110 WristMenuLoc = CreateDefaultSubobject<UBillboardComponent>(TEXT(
"Wrist Menu PC Location"));
111 WristMenuLoc->SetRelativeScale3D(FVector(.25f, .25f, .25f));
112 WristMenuLoc->SetRelativeLocation(FVector(50.0f, 2.0f, .0f));
116 LongHoldComponent = CreateDefaultSubobject<UPixoVRLongHoldComponent>(TEXT(
"LongHoldComponent"));
118 FadeSphere = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"FadeSphere"));
119 FadeSphere->SetupAttachment(VRReplicatedCamera);
120 static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMeshAsset(
121 TEXT(
"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"));
122 FadeSphere->SetStaticMesh(SphereMeshAsset.Object);
123 static ConstructorHelpers::FObjectFinder<UMaterial> FadeSphereMaterialAsset(
124 TEXT(
"Material'/PixoCore/Materials/Controller/M_FadeMaterial.M_FadeMaterial'"));
125 FadeSphere->SetMaterial(0, FadeSphereMaterialAsset.Object);
126 FadeSphere->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
127 FadeSphere->SetCollisionEnabled(ECollisionEnabled::NoCollision);
141 if (GetLocalRole() == ROLE_Authority && GetWorld()->GetAuthGameMode()->GetClass()->ImplementsInterface(UPixoCoreInterface::StaticClass()))
143 HintManager = Cast<UHintManager>(IPixoCoreInterface::Execute_GetManagerRef(GetWorld()->GetAuthGameMode(), UHintManager::StaticClass()));
153 const auto DeviceName = UHeadMountedDisplayFunctionLibrary::GetHMDDeviceName();
155 UE_LOG(LogPixoVRCharacter, Log, TEXT(
"PixoVRCharacter::BeginPlay DeviceName = %s"), *DeviceName.ToString());
157 if (DeviceName ==
"SteamVR")
159 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
161 else if (DeviceName ==
"OculusHMD")
163 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Eye);
166 else if (DeviceName ==
"WaveVR")
168 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
170 else if (DeviceName ==
"PICOXRHMD")
172 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
174 else if (DeviceName.ToString().Contains(
"Monado"))
176 FBPVRControllerProfile ControllerProfile;
177 UVRGlobalSettings::GetControllerProfile(
"VRX", ControllerProfile);
178 UVRGlobalSettings::LoadControllerProfile(ControllerProfile,
true);
180 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
181 VRProxyComponent->AddLocalOffset(FVector(0.0f, 0.0f, 15.f));
192 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
200 Super::Tick(DeltaTime);
212 if(GetLocalRole() == ROLE_Authority)
219 FVector2D PadPosition = FVector2D::ZeroVector;
238 Super::SetupPlayerInputComponent(PlayerInputComponent);
246 UE_LOG(LogPixoVRCharacter, Warning, TEXT(
"PixoVRCharacter::InputsTable not set!"));
304 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
321 Super::PossessedBy(NewController);
324 const FAttachmentTransformRules HandTransformRule = FAttachmentTransformRules(EAttachmentRule::SnapToTarget,
false);
325 FActorSpawnParameters ActorSpawnParameters = {};
326 ActorSpawnParameters.Owner =
this;
327 ActorSpawnParameters.Instigator =
this;
331 VRHandLeft->AttachToComponent(VRProxyComponent, HandTransformRule);
337 VRHandRight->AttachToComponent(VRProxyComponent, HandTransformRule);
394 static bool IsLeftTeleportActivatedByFunc =
false;
403 IsLeftTeleportActivatedByFunc =
true;
406 else if (CurrentAxisValue <= 0.f && IsLeftTeleportActivatedByFunc)
408 IsLeftTeleportActivatedByFunc =
false;
421 static bool IsRightTeleportActivatedByFunc =
false;
430 IsRightTeleportActivatedByFunc =
true;
433 else if (CurrentAxisValue <= 0.f && IsRightTeleportActivatedByFunc)
435 IsRightTeleportActivatedByFunc =
false;
463 if(!TeleportController)
return;
466 TeleportController->
ExecuteTeleportation(VRMovementReference, GetActorTransform(), GetVRLocation(), GetActorRotation());
477 case EControllerHand::Left:
485 case EControllerHand::Right:
502 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::KeepWorld,
false);
503 FActorSpawnParameters ActorSpawnParameters = {};
504 ActorSpawnParameters.Owner =
this;
505 ActorSpawnParameters.Instigator =
this;
509 case EControllerHand::Left:
526 case EControllerHand::Right:
558void APixoVRCharacter::MulticastActivateTeleporter_Implementation(EControllerHand Hand,
bool InActivate)
560 if(!IsLocallyControlled())
565 case EControllerHand::Left:
573 case EControllerHand::Right:
587void APixoVRCharacter::NotifyActivateTeleporter_Implementation(EControllerHand Hand,
bool InActivate)
592bool APixoVRCharacter::NotifyActivateTeleporter_Validate(EControllerHand Hand,
bool InActivate)
616 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
628 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
660 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
662 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandLeft->
HandMesh->GetAnimInstance(),
673 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
692void APixoVRCharacter::IsOverWidgetUse_Implementation(EControllerHand Hand,
bool InPressed)
697void APixoVRCharacter::PerformIsOverWidgetUse_Implementation(EControllerHand Hand,
bool InPressed)
703 case EControllerHand::Left:
711 case EControllerHand::Right:
723bool APixoVRCharacter::IsOverWidgetUse_Validate(EControllerHand Hand,
bool InPressed)
730 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget,
true);
731 FActorSpawnParameters ActorSpawnParameters = {};
732 ActorSpawnParameters.Owner =
this;
733 ActorSpawnParameters.Instigator =
this;
737 case EControllerHand::Left:
753 case EControllerHand::Right:
813void APixoVRCharacter::HandleLaserSelectEvent_Implementation(EControllerHand Hand,
bool Pressed)
818void APixoVRCharacter::MultiHandleLaserSelectEvent_Implementation(EControllerHand Hand,
bool Pressed)
827 case EControllerHand::Left:
832 case EControllerHand::Right:
842void APixoVRCharacter::ActivateLaserBeam_Implementation(EControllerHand Hand,
bool InActivate)
846 case EControllerHand::Left:
854 case EControllerHand::Right:
869bool APixoVRCharacter::ActivateLaserBeam_Validate(EControllerHand Hand,
bool InActivate)
874void APixoVRCharacter::ActivateFPSMode_Implementation(
bool Enable)
880 VRHandLeft->AttachToComponent(VRReplicatedCamera, FAttachmentTransformRules(EAttachmentRule::SnapToTarget,
false));
881 VRHandLeft->SetActorRelativeLocation(FVector(62.0f, -28.0f, -15.0f));
883 VRHandRight->AttachToComponent(VRReplicatedCamera, FAttachmentTransformRules(EAttachmentRule::SnapToTarget,
false));
884 VRHandRight->SetActorRelativeLocation(FVector(62.0f, 31.0f, -15.0f));
886 bUseControllerRotationPitch =
false;
888 const auto MovementComponent = Cast<UVRCharacterMovementComponent>(GetMovementComponent());
889 MovementComponent->bUseClientControlRotation =
true;
890 MovementComponent->bAllowMovementMerging =
true;
892 VRReplicatedCamera->bUsePawnControlRotation =
true;
893 VRReplicatedCamera->bLockToHmd =
false;
894 VRReplicatedCamera->bAutoSetLockToHmd =
false;
900 static float PreviousAxisValue = 0.f;
902 if (CurrentAxisValue != 0.f)
904 if (CurrentAxisValue > 0.f && PreviousAxisValue <= 0.f)
906 else if (CurrentAxisValue < 0.f && PreviousAxisValue >= 0.f)
910 PreviousAxisValue = CurrentAxisValue;
937 AddMovementInput(GetVRForwardVector(), Value);
942 AddMovementInput(GetVRRightVector(), Value);
947 AddControllerYawInput(Rate *
BaseTurnRate * GetWorld()->GetDeltaSeconds());
952 AddControllerPitchInput(Rate *
BaseLookUpRate * GetWorld()->GetDeltaSeconds());
992 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1014 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandRight->
HandMesh->GetAnimInstance(), GripAnimation);
1055 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1077 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandLeft->
HandMesh->GetAnimInstance(), GripAnimation);
1112 UHandAnimationInterface::StaticClass()))
1114 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandRight->
HandMesh->GetAnimInstance(),
1148 if(
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1196 UE_LOG(LogTemp, Error, TEXT(
"APixoVRCharacter - Can't spawn object in the hand"));
1200 AActor* SpawnedActor = GetWorld()->SpawnActor(ActorClass);
1202 EControllerHand ActiveHand = RightHand ? EControllerHand::Right : EControllerHand::Left;
1220 auto ChangeAnimation = [=]()
1222 if (HandRef->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1226 if (SpawnedActor !=
nullptr)
1228 if (SpawnedActor->GetClass()->ImplementsInterface(UGripResponseAnimationInterface::StaticClass()))
1230 if (IGripResponseAnimationInterface::Execute_IsUsingCustomGripAnimation(SpawnedActor))
1232 GripAnimation = IGripResponseAnimationInterface::Execute_GetObjectGripAnimation(SpawnedActor);
1244 IHandAnimationInterface::Execute_SetAnimationGripState(HandRef->
HandMesh->GetAnimInstance(), GripAnimation);
1247 FTimerDelegate TimerDelegate;
1248 TimerDelegate.BindLambda(ChangeAnimation);
1249 GetWorldTimerManager().SetTimerForNextTick(TimerDelegate);
1250 return SpawnedActor;
1273 if(HandToReset->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1279 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1283 case EControllerHand::Left:
1287 case EControllerHand::Right:
1301 UE_LOG(LogTemp, Error, TEXT(
"HintManager isn't initialized"));
1311 UE_LOG(LogTemp, Error, TEXT(
"HintManager isn't initialized"));
1342void APixoVRCharacter::HandleTeleportRightRight_Implementation(
float Value)
1347bool APixoVRCharacter::HandleTeleportRightRight_Validate(
float Value)
1352void APixoVRCharacter::HandleTeleportRightUp_Implementation(
float Value)
1357bool APixoVRCharacter::HandleTeleportRightUp_Validate(
float Value)
1362void APixoVRCharacter::HandleTeleportLeftRight_Implementation(
float Value)
1367bool APixoVRCharacter::HandleTeleportLeftRight_Validate(
float Value)
1372void APixoVRCharacter::HandleTeleportLeftUp_Implementation(
float Value)
1377bool APixoVRCharacter::HandleTeleportLeftUp_Validate(
float Value)
1404void APixoVRCharacter::SpawnProgressBar_Implementation()
1406 const FAttachmentTransformRules ProgressBarAttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1407 FActorSpawnParameters ActorSpawnParameters = {};
1409 ActorSpawnParameters.Owner =
this;
1410 ActorSpawnParameters.Instigator =
this;
1419bool APixoVRCharacter::SpawnProgressBar_Validate()
1424void APixoVRCharacter::SpawnWristMenu_Implementation()
1428 const FAttachmentTransformRules WristMenuAttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1430 FActorSpawnParameters ActorSpawnParameters = {};
1431 ActorSpawnParameters.Owner =
this;
1432 ActorSpawnParameters.Instigator =
this;
1439bool APixoVRCharacter::SpawnWristMenu_Validate()
1444void APixoVRCharacter::ActivateProgressBar_Implementation(EControllerHand Hand,
bool InActivate)
1448 const FAttachmentTransformRules ProgressBarAttachment(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1458bool APixoVRCharacter::ActivateProgressBar_Validate(EControllerHand Hand,
bool InActivate)
1463void APixoVRCharacter::ActivateWristMenu_Implementation(EControllerHand Hand)
1475 const FAttachmentTransformRules WristMenuAttachmentTransformRules(EAttachmentRule::KeepRelative,
1476 EAttachmentRule::KeepRelative,
1477 EAttachmentRule::KeepRelative,
true);
1479 const auto PlatformName = UGameplayStatics::GetPlatformName();
1481 if (PlatformName ==
"Windows" || PlatformName ==
"Mac" || PlatformName ==
"Linux")
1492 if (Hand == EControllerHand::Left)
1518bool APixoVRCharacter::ActivateWristMenu_Validate(EControllerHand Hand)
EPixoVRGripState
Enumeration for different grip states for hand animation in PixoVR.
DEFINE_LOG_CATEGORY(LogPixoVRCharacter)
Pixo VR Character This class represents the main character in the Pixo VR game. It extends the AVRCha...
FName LeftTeleporterSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRCircleProgress * ProgressBar
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
bool bActivateRightLaser
UPROPERTY(BlueprintReadOnly, Replicated)
bool bIsOverWidgetUse
UPROPERTY(Replicated)
float DefaultPlayerHeight
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "PixoVR")
bool bActivateLeftLaser
UPROPERTY(BlueprintReadOnly, Replicated)
bool bLeftLaserBeamIsActiveOnStart
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
void HandleLaserSelectEvent(EControllerHand Hand, bool Pressed)
UFUNCTION(Server, Reliable)
virtual void HandleWristMenuItem3Pressed()
virtual bool CanTeleport() const
EControllerHand CurrentWristMenuHand
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Replicated, Category= "PixoVR")
virtual void HandleWristMenuItem1Pressed()
void DeactivateHint()
UFUNCTION(BlueprintCallable, Category = "Hint")
void PlayerDestroyed(AActor *Act)
UFUNCTION()
void ActivateHint()
UFUNCTION(BlueprintCallable, Category = "Hint")
void HandleLaserReleaseRight()
FVector2D LastTeleportLeftDirectionVector
void HandleSelectWristMenuItemPressed()
UFUNCTION(BlueprintCallable)
void HandleLaserSelectRight()
void ExecuteTeleportation(EControllerHand Hand)
UFUNCTION()
FOnCameraRotatedByController OnCameraRotatedByController
UPROPERTY(BlueprintAssignable, Category = "Hands")
virtual void GrabLeftPressed()
UFUNCTION(BlueprintCallable, Category = "Hands")
TSubclassOf< APixoVRCircleProgress > ProgressBarClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRLaser * LaserControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
virtual void TurnVRByAxis(float Value)
void HandleTeleportLeftRight(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
void IsOverWidgetUse(EControllerHand Hand, bool InPressed)
UFUNCTION(Server, Reliable, WithValidation)
virtual void GrabRightPressed()
UFUNCTION(BlueprintCallable, Category = "Hands")
FName LeftLaserBeamSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRHand * VRHandLeft
UPROPERTY(BlueprintReadOnly, Category = "Hands")
virtual void BeginPlay() override
void ActivateWristMenu(EControllerHand Hand)
Activate/Deactivate the Wrist Menu.
void HandleHandAnimationLaser(EControllerHand Hand)
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category ="PixoVR")
TSubclassOf< ATeleporterBase > TeleportControllerClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
virtual void PossessedBy(AController *NewController) override
TSubclassOf< APixoVRWristMenu > WristMenuClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
TSubclassOf< APixoVRLaser > LaserControllerClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
UDataTable * InputsTable
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category="PixoVR")
void SpawnLaserBeam(EControllerHand Hand, bool InActivate)
UFUNCTION()
void HandleTeleportRightReleased()
UFUNCTION(BlueprintCallable)
void PerformIsOverWidgetUse(EControllerHand Hand, bool InPressed)
UFUNCTION(Client, Reliable)
void ResetHand(bool RightHand)
Reset hand animation to Open state and drop any object holding.
virtual void HandleWristMenuItem8Pressed()
void TurnAtRate(float Rate)
FName RightLaserBeamSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
UHintManager * HintManager
UPROPERTY(BlueprintReadOnly)
FName RightTeleporterSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
bool bTeleporterEnabled
Allows for disabling of Teleporter via BP.
virtual void TurnVRRight()
void HandleTeleportLeftPressed()
UFUNCTION(BlueprintCallable)
FVector MirroredWristMenuScale
virtual void HandleSelectWristMenuItemPressedLeft()
void HandleLaserSelect(EControllerHand Hand, bool Pressed)
UFUNCTION()
void LookUpAtRate(float Rate)
UStaticMeshComponent * Body
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
void ActivateTeleporter(EControllerHand Hand, bool InActivate)
Activate/Deactivate the Teleporter.
void HandleActivateWristMenuPressedRight()
UFUNCTION(BlueprintCallable)
virtual void HandleWristMenuDoubleTap(FKey InputKey)
bool bRightLaserBeamIsActiveOnStart
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
void HandleTeleportLeftUp(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
FVector2D LastTeleportRightDirectionVector
void MoveRight(float Value)
UPixoVRLongHoldComponent * LongHoldComponent
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
void IsLaserActivated(bool &IsActivated, EControllerHand &Hand)
UStaticMeshComponent * Head
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
void ActivateProgressBar(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
APixoVRHand * VRHandRight
UPROPERTY(BlueprintReadOnly, Category = "Hands")
void HandleTeleportLeftByAxis(float CurrentAxisValue)
UFUNCTION(BlueprintCallable)
void HandleActivateWristMenuPressedLeft()
UFUNCTION(BlueprintCallable)
APixoVRWristMenu * WristMenu
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
void MultiHandleLaserSelectEvent(EControllerHand Hand, bool Pressed)
UFUNCTION(NetMulticast, Reliable)
APixoVRLaser * LaserControllerLeft
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void SpawnTeleporter(EControllerHand Hand, bool InActivate)
UFUNCTION()
void MulticastActivateTeleporter(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, NetMulticast, Reliable, Category = "PixoVR")
virtual void HandleWristMenuItem6Pressed()
virtual void SetupPlayerInputComponent(UInputComponent *PlayerInputComponent) override
void ActivateLaserBeam(EControllerHand Hand, bool InActivate)
Activate/Deactivate the Laser-beam.
FOnTeleportationActivated & OnTeleportationActivated()
void HandleLaserReleaseLeft()
USceneComponent * WristMenuLoc
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR")
void HandleLaserSelectLeft()
void HandleLaserBeamLeftPressed()
UFUNCTION(BlueprintCallable)
bool bLaserBeamActive
UPROPERTY(BlueprintReadWrite, Category = "PixoVR")
float DeflectionAngle
The angle by which we rotate the player.
UStaticMeshComponent * FadeSphere
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fade")
virtual void HandleWristMenuItem5Pressed()
void HandleTeleportRightRight(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
void HandleActivateWristMenuPressed()
UFUNCTION(BlueprintCallable)
bool bRotationByControllerEnabled
UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "PixoVR")
virtual void HandleSelectWristMenuItemPressedRight()
void MoveForward(float Value)
UPixoVRInputAdapter * InputAdapter
UPROPERTY()
AActor * SpawnActorInHand(TSubclassOf< AActor > ActorClass, bool RightHand)
UFUNCTION(BlueprintCallable, Category = "Hands")
void ActivateFPSMode(bool Enable)
For Windows.
virtual void Tick(float DeltaTime) override
ATeleporterBase * TeleportControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
ATeleporterBase * TeleportControllerLeft
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
TSubclassOf< APixoVRHand > VRHandClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hands")
void SelectWristMenu(EControllerHand Hand)
UFUNCTION(BlueprintCallable)
void ShowTool(EControllerHand Hand, AActor *Tool)
UFUNCTION(BlueprintCallable)
void SpawnNewTeleporterClass(TSubclassOf< ATeleporterBase > TeleporterClass)
UFUNCTION(BlueprintCallable, Category = "PixoVR")
void HandleTeleportLeftReleased()
UFUNCTION(BlueprintCallable)
void HandleTeleportRightUp(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
FName ToolSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FName WristMenuSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FOnHandGrabAction OnHandGrabAction
UPROPERTY(BlueprintAssignable, Category = "Hands")
virtual void GetLifetimeReplicatedProps(TArray< FLifetimeProperty > &OutLifetimeProps) const override
void HandleTeleportRightPressed()
UFUNCTION(BlueprintCallable)
virtual void GrabLeftReleased()
UFUNCTION(BlueprintCallable, Category = "Hands")
virtual void TurnVRLeft()
FOnWristMenuActivated OnWristMenuActivated
UPROPERTY(BlueprintAssignable)
void HandleTeleportRightByAxis(float CurrentAxisValue)
UFUNCTION(BlueprintCallable)
void NotifyActivateTeleporter(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
void ResetHandHoldingObject()
UFUNCTION(BlueprintCallable, Category = "Hands")
virtual void GrabRightReleased()
UFUNCTION(BlueprintCallable, Category = "Hands")
void HandleLaserBeamRightPressed()
UFUNCTION(BlueprintCallable)
virtual void HandleWristMenuItem2Pressed()
void SpawnWristMenu()
UFUNCTION(Server, Reliable, WithValidation)
virtual void HandleWristMenuItem7Pressed()
void SpawnProgressBar()
UFUNCTION(Server, Reliable, WithValidation)
virtual void HandleWristMenuItem4Pressed()
Class representing a circular progress indicator in PixoVR. The circle progress can be updated to dis...
void SetCircleProgressEnabled(bool bIsEnabled)
Sets the enabled state of the circle progress.
APixoVRHand is an actor class that represents a hand in the VR environment.
void ManuallyPutActorToHand(AActor *ActorRef)
Manually puts an actor into the hand. Hand will try to grab this actor.
USkeletalMeshComponent * HandMesh
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
void GrabObject()
Grabs the object currently overlapped by grab sphere.
void InitPixoVRHands(EControllerHand MotionSource, APixoVRCharacter *Character)
UGripMotionControllerComponent * MotionController
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
void ReleaseObject()
Releases the currently held object.
UObject * HandHoldingObject
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void ToggleLaser(bool Visible)
Toggles the visibility of the laser.
Class for VR laser interaction. It can interact with widget buttons or actors derived from IPixoVRInt...
bool IsOverWidgetUse(bool InPressed)
Check if the laser is over a widget and simulate button press.
void TriggerSelect(bool State)
Call this method when the user wants to select the hovered object.
void SetHandType(EControllerHand HandType, bool InIsLocal)
Set the hand type describing which hand is holding it.
UWidgetInteractionComponent * WidgetInteraction
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
void ActivateLaserBeam(bool InActivate)
Activate or deactivate the laser beam.
bool bIsLaserBeamActive
UPROPERTY(BlueprintReadOnly, Transient, ReplicatedUsing=OnRep_LaserBeamActive, Category = "PixoVR | L...
virtual void ActivateTeleporter(bool InActivate)
Activate or deactivate the Teleporter.
virtual void ExecuteTeleportation(UVRBaseCharacterMovementComponent *MovementComponent, const FTransform &ActorTransform, const FVector &VRLocation, const FRotator &ActorRotation) PURE_VIRTUAL(
Execute the teleportation. It checks if there is a valid teleport destination before executing the te...
virtual bool IsActivated()
Check if the teleporter is activated.
virtual void SetMotionController(UGripMotionControllerComponent *InMotionController)
Set the motion controller that controls this Teleport.
virtual void UpdateMotionControllerRotation(const FVector2D &Direction)
Update the motion controller rotation for pad rotation.
void HintActivated(bool Activate)
This function is called when a hint is activated or deactivated. Broadcasts UHintActivatedEvent and O...