Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
PixoVRTeleporter.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "TeleporterBase.h"
7#include "PixoVRTeleporter.generated.h"
8
9class USplineComponent;
10class UStaticMeshComponent;
11class UMaterial;
12class UMaterialInstance;
13class UGripMotionControllerComponent;
14class UNavigationSystemV1;
15class USplineMeshComponent;
16class UVRBaseCharacterMovementComponent;
17
18DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRTeleporter, Log, All);
19
24UCLASS()
25class PIXOCORE_API APixoVRTeleporter : public ATeleporterBase
26{
27 GENERATED_BODY()
28
29public:
31
36 virtual void ActivateTeleporter(bool InActivate) override;
37
46 virtual void ExecuteTeleportation(UVRBaseCharacterMovementComponent* MovementComponent,
47 const FTransform& ActorTransform, const FVector& VRLocation,
48 const FRotator& ActorRotation) override;
49
50private:
51 virtual void BeginPlay() override;
52
64 bool TraceTeleportDestination(TArray<FVector>& TracePoints, FVector& TraceLocation, FVector& NavMeshLocation);
65
71 void UpdateTeleportCylinder(const FVector& NewLocation, bool ValidLocationFound);
72
77 virtual void TickTeleporter(float DeltaTime) override;
78public:
79 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
80 UStaticMeshComponent* TeleportCylinder;
81
82 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
83 UStaticMeshComponent* Ring;
84
85 UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
86 bool bDrawTeleportCylinder;
87
88 UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
89 FLinearColor TeleportFadeColor;
90
91private:
92 UNavigationSystemV1* NavigationSystem;
93 UVRBaseCharacterMovementComponent* MovementComponent;
94
95#if WITH_EDITOR
96 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
97#endif
98};
DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRTeleporter, Log, All)
Class for VR teleporter functionality. It allows teleportation using visual indicators.
FLinearColor TeleportFadeColor
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
bool bDrawTeleportCylinder
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
UStaticMeshComponent * TeleportCylinder
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
UStaticMeshComponent * Ring
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
UVRBaseCharacterMovementComponent * MovementComponent
UNavigationSystemV1 * NavigationSystem
UCLASS(Abstract)
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 void BeginPlay() override
virtual void TickTeleporter(float DeltaTime) PURE_VIRTUAL(
Tick the Teleporter.