11#include "Components/BillboardComponent.h"
12#include "GameFramework/GameModeBase.h"
18#include "Kismet/GameplayStatics.h"
24 : DefaultPlayerHeight(165)
25 , bLaserBeamActive(false)
26 , LeftTeleporterSocket(NAME_None)
27 , RightTeleporterSocket(NAME_None)
28 , TeleportControllerLeft(nullptr)
29 , TeleportControllerRight(nullptr)
30 , LeftLaserBeamSocket(NAME_None)
31 , RightLaserBeamSocket(NAME_None)
32 , LaserControllerLeft(nullptr)
33 , LaserControllerRight(nullptr)
34 , bLeftLaserBeamIsActiveOnStart(false)
35 , bRightLaserBeamIsActiveOnStart(false)
36 , WristMenuLoc(nullptr)
38 , WristMenuSocket(FName(
"WristMenuSocket"))
40 , MirroredWristMenuScale(FVector(1, -1, -1))
41 , ToolSocket(
"ToolSocket")
43 , BaseLookUpRate(45.0f)
44 , bDisableToolsInputBindings(false)
48 PrimaryActorTick.bCanEverTick =
true;
51 SetReplicateMovement(
true);
52 bNetLoadOnClient =
true;
54 static ConstructorHelpers::FObjectFinder<UStaticMesh> HeadMeshFinder(
55 TEXT(
"StaticMesh'/PixoCore/Meshes/SM_PlayerHead.SM_PlayerHead'"));
56 UStaticMesh* HeadMesh = HeadMeshFinder.Object;
58 static ConstructorHelpers::FObjectFinder<UMaterialInstance> HeadMeshMaterialFinder(
59 TEXT(
"MaterialInstanceConstant'/PixoCore/Materials/MI_PlayerHead.MI_PlayerHead'"));
60 UMaterialInstance* HeadMeshMaterial = HeadMeshMaterialFinder.Object;
62 static ConstructorHelpers::FObjectFinder<UStaticMesh> BodyMeshFinder(
63 TEXT(
"StaticMesh'/PixoCore/Meshes/BasicShapes/Cylinder.Cylinder'"));
64 UStaticMesh* BodyMesh = BodyMeshFinder.Object;
66 static ConstructorHelpers::FObjectFinder<UMaterial> BodyMeshMaterialFinder(
67 TEXT(
"Material'/PixoCore/Materials/Body/BasicShapeMaterialTrans.BasicShapeMaterialTrans'"));
68 UMaterial* BodyMeshMaterial = BodyMeshMaterialFinder.Object;
74 Head = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"HeadMesh"));
75 Head->SetStaticMesh(HeadMesh);
76 Head->SetMaterial(0, HeadMeshMaterial);
77 Head->SetRelativeLocation(FVector(0.0f, 0.0f, -15.0f));
78 Head->SetRelativeRotation(FRotator(0.0f, -90.0f, 0.0f));
79 Head->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
82 Body = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"BodyMesh"));
83 Body->SetStaticMesh(BodyMesh);
84 Body->SetMaterial(0, BodyMeshMaterial);
85 Body->SetRelativeLocation(FVector(-8.0f, 0.0f, -160.0f));
86 Body->SetRelativeScale3D(FVector(0.5f, 0.5f, 0.1f));
87 Body->SetCollisionProfileName(UCollisionProfile::CustomCollisionProfileName);
88 Body->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
89 Body->SetCollisionObjectType(ECollisionChannel::ECC_Pawn);
90 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Overlap);
91 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldDynamic, ECollisionResponse::ECR_Overlap);
92 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);
93 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_PhysicsBody, ECollisionResponse::ECR_Overlap);
94 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Vehicle, ECollisionResponse::ECR_Overlap);
95 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Destructible, ECollisionResponse::ECR_Overlap);
96 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Visibility, ECollisionResponse::ECR_Overlap);
97 Body->SetCollisionResponseToChannel(ECollisionChannel::ECC_Camera, ECollisionResponse::ECR_Overlap);
100 bUseControllerRotationPitch =
true;
101 bUseControllerRotationYaw =
true;
102 bUseControllerRotationRoll =
false;
109 WristMenuLoc = CreateDefaultSubobject<UBillboardComponent>(TEXT(
"Wrist Menu PC Location"));
110 WristMenuLoc->SetRelativeScale3D(FVector(.25f, .25f, .25f));
111 WristMenuLoc->SetRelativeLocation(FVector(50.0f, 2.0f, .0f));
115 LongHoldComponent = CreateDefaultSubobject<UPixoVRLongHoldComponent>(TEXT(
"LongHoldComponent"));
117 FadeSphere = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"FadeSphere"));
119 static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMeshAsset(
120 TEXT(
"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"));
121 FadeSphere->SetStaticMesh(SphereMeshAsset.Object);
122 static ConstructorHelpers::FObjectFinder<UMaterial> FadeSphereMaterialAsset(
123 TEXT(
"Material'/PixoCore/Materials/Controller/M_FadeMaterial.M_FadeMaterial'"));
124 FadeSphere->SetMaterial(0, FadeSphereMaterialAsset.Object);
125 FadeSphere->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
126 FadeSphere->SetCollisionEnabled(ECollisionEnabled::NoCollision);
140 if (GetLocalRole() == ROLE_Authority && GetWorld()->GetAuthGameMode()->GetClass()->ImplementsInterface(UPixoCoreInterface::StaticClass()))
142 HintManager = Cast<UHintManager>(IPixoCoreInterface::Execute_GetManagerRef(GetWorld()->GetAuthGameMode(), UHintManager::StaticClass()));
152 const auto DeviceName = UHeadMountedDisplayFunctionLibrary::GetHMDDeviceName();
154 UE_LOG(LogPixoVRCharacter, Log, TEXT(
"PixoVRCharacter::BeginPlay DeviceName = %s"), *DeviceName.ToString());
156 if (DeviceName ==
"SteamVR")
158 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
160 else if (DeviceName ==
"OculusHMD")
162 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Eye);
165 else if (DeviceName ==
"WaveVR")
167 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Eye);
169 else if (DeviceName ==
"PICOXRHMD")
171 UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);
181 Super::Tick(DeltaTime);
193 if(GetLocalRole() == ROLE_Authority)
200 FVector2D PadPosition = FVector2D::ZeroVector;
219 Super::SetupPlayerInputComponent(PlayerInputComponent);
227 UE_LOG(LogPixoVRCharacter,
Warning, TEXT(
"PixoVRCharacter::InputsTable not set!"));
281 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
298 Super::PossessedBy(NewController);
301 const FAttachmentTransformRules HandTransformRule = FAttachmentTransformRules(EAttachmentRule::SnapToTarget,
false);
302 FActorSpawnParameters ActorSpawnParameters = {};
303 ActorSpawnParameters.Owner =
this;
304 ActorSpawnParameters.Instigator =
this;
386 if(!TeleportController)
return;
400 case EControllerHand::Left:
408 case EControllerHand::Right:
425 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::KeepWorld,
false);
426 FActorSpawnParameters ActorSpawnParameters = {};
427 ActorSpawnParameters.Owner =
this;
428 ActorSpawnParameters.Instigator =
this;
432 case EControllerHand::Left:
449 case EControllerHand::Right:
470void APixoVRCharacter::MulticastActivateTeleporter_Implementation(EControllerHand Hand,
bool InActivate)
472 if(!IsLocallyControlled())
477 case EControllerHand::Left:
485 case EControllerHand::Right:
499void APixoVRCharacter::NotifyActivateTeleporter_Implementation(EControllerHand Hand,
bool InActivate)
504bool APixoVRCharacter::NotifyActivateTeleporter_Validate(EControllerHand Hand,
bool InActivate)
528 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
540 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
572 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
574 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandLeft->
HandMesh->GetAnimInstance(),
585 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
604void APixoVRCharacter::IsOverWidgetUse_Implementation(EControllerHand Hand,
bool InPressed)
609void APixoVRCharacter::PerformIsOverWidgetUse_Implementation(EControllerHand Hand,
bool InPressed)
615 case EControllerHand::Left:
623 case EControllerHand::Right:
635bool APixoVRCharacter::IsOverWidgetUse_Validate(EControllerHand Hand,
bool InPressed)
642 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget,
true);
643 FActorSpawnParameters ActorSpawnParameters = {};
644 ActorSpawnParameters.Owner =
this;
645 ActorSpawnParameters.Instigator =
this;
649 case EControllerHand::Left:
665 case EControllerHand::Right:
725void APixoVRCharacter::HandleLaserSelectEvent_Implementation(EControllerHand Hand,
bool Pressed)
730void APixoVRCharacter::MultiHandleLaserSelectEvent_Implementation(EControllerHand Hand,
bool Pressed)
739 case EControllerHand::Left:
744 case EControllerHand::Right:
754void APixoVRCharacter::ActivateLaserBeam_Implementation(EControllerHand Hand,
bool InActivate)
758 case EControllerHand::Left:
766 case EControllerHand::Right:
781bool APixoVRCharacter::ActivateLaserBeam_Validate(EControllerHand Hand,
bool InActivate)
786void APixoVRCharacter::ActivateFPSMode_Implementation(
bool Enable)
793 VRHandLeft->SetActorRelativeLocation(FVector(62.0f, -28.0f, -15.0f));
796 VRHandRight->SetActorRelativeLocation(FVector(62.0f, 31.0f, -15.0f));
798 bUseControllerRotationPitch =
false;
800 const auto MovementComponent = Cast<UVRCharacterMovementComponent>(GetMovementComponent());
801 MovementComponent->bUseClientControlRotation =
true;
802 MovementComponent->bAllowMovementMerging =
true;
832 AddControllerYawInput(Rate *
BaseTurnRate * GetWorld()->GetDeltaSeconds());
837 AddControllerPitchInput(Rate *
BaseLookUpRate * GetWorld()->GetDeltaSeconds());
861 if (
VRHandRight->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
883 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandRight->
HandMesh->GetAnimInstance(), GripAnimation);
908 if (
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
930 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandLeft->
HandMesh->GetAnimInstance(), GripAnimation);
967 UHandAnimationInterface::StaticClass()))
969 IHandAnimationInterface::Execute_SetAnimationGripState(
VRHandRight->
HandMesh->GetAnimInstance(),
1003 if(
VRHandLeft->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1014 UE_LOG(LogTemp,
Error, TEXT(
"APixoVRCharacter - Can't spawn object in the hand"));
1018 AActor* SpawnedActor = GetWorld()->SpawnActor(ActorClass);
1020 EControllerHand ActiveHand = RightHand ? EControllerHand::Right : EControllerHand::Left;
1030 auto ChangeAnimation = [=]()
1032 if (HandRef->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1036 if (SpawnedActor !=
nullptr)
1038 if (SpawnedActor->GetClass()->ImplementsInterface(UGripResponseAnimationInterface::StaticClass()))
1040 if (IGripResponseAnimationInterface::Execute_IsUsingCustomGripAnimation(SpawnedActor))
1042 GripAnimation = IGripResponseAnimationInterface::Execute_GetObjectGripAnimation(SpawnedActor);
1054 IHandAnimationInterface::Execute_SetAnimationGripState(HandRef->
HandMesh->GetAnimInstance(), GripAnimation);
1057 FTimerDelegate TimerDelegate;
1058 TimerDelegate.BindLambda(ChangeAnimation);
1059 GetWorldTimerManager().SetTimerForNextTick(TimerDelegate);
1060 return SpawnedActor;
1083 if(HandToReset->
HandMesh->GetAnimInstance()->GetClass()->ImplementsInterface(UHandAnimationInterface::StaticClass()))
1089 const FAttachmentTransformRules AttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1093 case EControllerHand::Left:
1097 case EControllerHand::Right:
1111 UE_LOG(LogTemp,
Error, TEXT(
"HintManager isn't initialized"));
1121 UE_LOG(LogTemp,
Error, TEXT(
"HintManager isn't initialized"));
1152void APixoVRCharacter::HandleTeleportRightRight_Implementation(
float Value)
1157bool APixoVRCharacter::HandleTeleportRightRight_Validate(
float Value)
1162void APixoVRCharacter::HandleTeleportRightUp_Implementation(
float Value)
1167bool APixoVRCharacter::HandleTeleportRightUp_Validate(
float Value)
1172void APixoVRCharacter::HandleTeleportLeftRight_Implementation(
float Value)
1177bool APixoVRCharacter::HandleTeleportLeftRight_Validate(
float Value)
1182void APixoVRCharacter::HandleTeleportLeftUp_Implementation(
float Value)
1187bool APixoVRCharacter::HandleTeleportLeftUp_Validate(
float Value)
1214void APixoVRCharacter::SpawnProgressBar_Implementation()
1216 const FAttachmentTransformRules ProgressBarAttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1217 FActorSpawnParameters ActorSpawnParameters = {};
1219 ActorSpawnParameters.Owner =
this;
1220 ActorSpawnParameters.Instigator =
this;
1229bool APixoVRCharacter::SpawnProgressBar_Validate()
1234void APixoVRCharacter::SpawnWristMenu_Implementation()
1238 const FAttachmentTransformRules WristMenuAttachmentTransformRules(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1240 FActorSpawnParameters ActorSpawnParameters = {};
1241 ActorSpawnParameters.Owner =
this;
1242 ActorSpawnParameters.Instigator =
this;
1249bool APixoVRCharacter::SpawnWristMenu_Validate()
1254void APixoVRCharacter::ActivateProgressBar_Implementation(EControllerHand Hand,
bool InActivate)
1258 const FAttachmentTransformRules ProgressBarAttachment(EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative, EAttachmentRule::KeepRelative,
true);
1268bool APixoVRCharacter::ActivateProgressBar_Validate(EControllerHand Hand,
bool InActivate)
1273void APixoVRCharacter::ActivateWristMenu_Implementation(EControllerHand Hand)
1285 const FAttachmentTransformRules WristMenuAttachmentTransformRules(EAttachmentRule::KeepRelative,
1286 EAttachmentRule::KeepRelative,
1287 EAttachmentRule::KeepRelative,
true);
1289 const auto PlatformName = UGameplayStatics::GetPlatformName();
1291 if (PlatformName ==
"Windows" || PlatformName ==
"Mac" || PlatformName ==
"Linux")
1302 if (Hand == EControllerHand::Left)
1328bool 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()
virtual void GrabLeftPressed()
UFUNCTION(BlueprintCallable, Category = "Hands")
TSubclassOf< APixoVRCircleProgress > ProgressBarClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRLaser * LaserControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
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")
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()
APixoVRTeleporter * TeleportControllerLeft
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
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...
TSubclassOf< APixoVRTeleporter > TeleportControllerClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
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 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)
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
TSubclassOf< APixoVRHand > VRHandClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hands")
void SelectWristMenu(EControllerHand Hand)
UFUNCTION(BlueprintCallable)
void ShowTool(EControllerHand Hand, AActor *Tool)
UFUNCTION(BlueprintCallable)
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 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()
APixoVRTeleporter * TeleportControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
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...
Class for VR teleporter functionality. It allows teleportation using visual indicators.
void ExecuteTeleportation(UVRBaseCharacterMovementComponent *MovementComponent, const FTransform &ActorTransform, const FVector &VRLocation, const FRotator &ActorRotation)
Execute the teleportation. It checks if there is a valid teleport destination before executing the te...
void ActivateTeleporter(bool InActivate)
Activate or deactivate the Teleporter.
bool IsActivated()
Check if the teleporter is activated.
void SetMotionController(UGripMotionControllerComponent *InMotionController)
Set the motion controller that controls this Teleport.
void UpdateMotionControllerRotation(const FVector2D &Direction)
Update the motion controller rotation for pad rotation.
USceneComponent * VRProxyComponent
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess ...
UGripMotionControllerComponent * RightMotionController
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess ...
FVector GetVRForwardVector() const
UFUNCTION(BlueprintPure, Category = "BaseVRCharacter|VRLocations")
void Server_SendTransformRightController(FBPVRComponentPosRep NewTransform)
UFUNCTION(Unreliable, Server, WithValidation)
FVector GetVRLocation() const
UFUNCTION(BlueprintPure, Category = "BaseVRCharacter|VRLocations")
FVector AddActorWorldRotationVR(FRotator DeltaRot, bool bUseYawOnly=true)
UFUNCTION(BlueprintCallable, Category = "BaseVRCharacter|VRLocations")
FVector GetVRRightVector() const
UFUNCTION(BlueprintPure, Category = "BaseVRCharacter|VRLocations")
UVRBaseCharacterMovementComponent * VRMovementReference
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, Transient, BlueprintReadOnly,...
UReplicatedVRCameraComponent * VRReplicatedCamera
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess ...
UGripMotionControllerComponent * LeftMotionController
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess ...
UParentRelativeAttachmentComponent * ParentRelativeAttachment
UPROPERTY(Category = VRBaseCharacter, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess ...
void Server_SendTransformLeftController(FBPVRComponentPosRep NewTransform)
UFUNCTION(Unreliable, Server, WithValidation)
VRBaseCharTransformRPC_Pointer OverrideSendTransform
void HintActivated(bool Activate)
This function is called when a hint is activated or deactivated. Broadcasts UHintActivatedEvent and O...
uint32 bAutoSetLockToHmd
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ReplicatedCamera|Advanced|Tracking")