Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
BySpotTeleporter.h
Go to the documentation of this file.
1// Copyright(c) 2018 PixoVR, LLC. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "TeleporterBase.h"
7#include "BySpotTeleporter.generated.h"
8
10DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnCharacterTeleportedOnSpot, ATeleportersSpot*, TeleportersSpot, APixoVRCharacter*, Character);
11
12UCLASS(BlueprintType)
13class PIXOCORE_API ATeleportersSpot : public AActor
14{
15 GENERATED_BODY()
16public:
17
19
20 virtual void BeginPlay() override;
21
22 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Spot")
23 UStaticMeshComponent* TeleportersSpotCylinder;
24
25 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Spot")
26 UStaticMeshComponent* TeleportersSpotRing;
27
28 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spot")
29 bool IsSpotHaveCubeShape = false;
31 UPROPERTY(EditAnywhere, Category = "Spot | Color")
32 FColor NotActiveColorOfSpot = FColor(128,128,128);
33
34 UPROPERTY(EditAnywhere, Category = "Spot | Color")
35 FColor ActiveColorOfSpot = FColor(0, 153, 235);
36
37 UPROPERTY(EditAnywhere, Category = "Spot | Bounds")
38 float BufferBoundsRadiusDetection = -20.f;
39
40 UPROPERTY(EditAnywhere, Category = "Spot | Bounds")
41 float BufferBoundsHeightDetection = 0.f;
42
43 UPROPERTY(BlueprintAssignable, Category = "Spot | Delegates")
44 FOnCharacterTeleportedOnSpot OnCharacterTeleportedOnSpot;
45
50 void ActivateSpot(bool InActivate);
51
52 bool IsActive();
53
54private:
55 bool bIsActive = false;
57 UPROPERTY()
58 UMaterialInstanceDynamic* CylinderMaterialInstanceDynamic;
59
60 UPROPERTY()
61 UMaterialInstanceDynamic* RingMaterialInstanceDynamic;
62};
63
64UCLASS()
65class PIXOCORE_API ABySpotTeleporter : public ATeleporterBase
66{
67 GENERATED_BODY()
69public:
70 // Sets default values for this actor's properties
72
73 virtual void BeginPlay() override;
75 virtual void ExecuteTeleportation(UVRBaseCharacterMovementComponent* InMovementComponent,
76 const FTransform& ActorTransform, const FVector& VRLocation, const FRotator& ActorRotation) override;
77
78 virtual void ActivateTeleporter(bool InActivate) override;
79
80private:
81 virtual void TickTeleporter(float DeltaTime) override;
82
83 bool TraceTeleportDestination(TArray<FVector>& TracePoints, FVector& TraceLocation);
84
85 void DeactivateAllSpots();
86
87 bool AtListOneTeleportersActive();
88
89 UVRBaseCharacterMovementComponent* MovementComponent;
91 UPROPERTY()
92 TArray<ATeleportersSpot*> TeleportersSpots;
93
94 float SpotTeleporterExtendCoeficient = 1.5;
95};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnCharacterTeleportedOnSpot, ATeleportersSpot *, TeleportersSpot, APixoVRCharacter *, Character)
UVRBaseCharacterMovementComponent * MovementComponent
TArray< ATeleportersSpot * > TeleportersSpots
UPROPERTY()
Pixo VR Character This class represents the main character in the Pixo VR game. It extends the AVRCha...
UCLASS(Abstract)
UCLASS(BlueprintType)
UMaterialInstanceDynamic * RingMaterialInstanceDynamic
UPROPERTY()
UMaterialInstanceDynamic * CylinderMaterialInstanceDynamic
UPROPERTY()
UStaticMeshComponent * TeleportersSpotRing
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Spot")
FOnCharacterTeleportedOnSpot OnCharacterTeleportedOnSpot
UPROPERTY(BlueprintAssignable, Category = "Spot | Delegates")
UStaticMeshComponent * TeleportersSpotCylinder
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Spot")