Class for VR teleporter functionality. It allows teleportation using visual indicators.
More...
#include <PixoVRTeleporter.h>
|
| APixoVRTeleporter () |
|
virtual void | ActivateTeleporter (bool InActivate) override |
| Activate or deactivate the Teleporter.
|
|
virtual void | ExecuteTeleportation (UVRBaseCharacterMovementComponent *MovementComponent, const FTransform &ActorTransform, const FVector &VRLocation, const FRotator &ActorRotation) override |
| Execute the teleportation. It checks if there is a valid teleport destination before executing the teleportation. The teleport destination is determined based on the last valid location of the teleport cylinder.
|
|
virtual void | GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override |
|
void | GetTeleportationTransform (FVector &Location, FVector &ForwardVector) |
| Get the teleportation transform which includes location and orientation.
|
|
virtual void FVector | GetTeleportDestination (const FVector &OriginalLocation) |
| Get the teleport destination.
|
|
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.
|
|
|
UStaticMeshComponent * | ArcEndPoint |
| UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
|
|
USplineComponent * | ArcSplineComponent |
| UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
|
|
UMaterial * | ArcSplineMaterial |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Teleporter", Meta = (AllowPrivateAccess = "true"))
|
|
UStaticMesh * | ArcSplineMesh |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Teleporter", Meta = (AllowPrivateAccess = "true"))
|
|
UStaticMeshComponent * | Arrow |
| UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
|
|
bool | bActivateOneTeleporterAtTime = false |
| UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
|
|
bool | bDrawArcSpline |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
bool | bDrawTeleportArrow |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
bool | bDrawTeleportCylinder |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
bool | bIsTeleporterActive |
| UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
|
|
bool | bIsValidTeleportDestination |
| UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
|
|
float | FadeInDuration |
| UPROPERTY(EditAnywhere, Category = "PiUpdateMotionControllerRotationxoVR | Teleporter")
|
|
float | FadeOutDuration |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
UGripMotionControllerComponent * | MotionController |
| UPROPERTY(Replicated)
|
|
FRotator | PadRotation |
| UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
|
|
UStaticMeshComponent * | Ring |
| UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
|
|
UStaticMeshComponent * | TeleportCylinder |
| UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
|
|
FLinearColor | TeleportFadeColor |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
float | TeleportLaunchVelocity |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
FRotator | TeleportRotation |
| UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
|
|
float | ThumbDeadZone |
| UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
|
|
|
virtual void | Destroyed () override |
|
virtual void | Tick (float DeltaTime) override |
|
virtual void | UpdateArcEndpoint (const FVector &NewLocation, bool ValidLocationFound) |
| Update the endpoint of the arc spline.
|
|
virtual void | UpdateArcSpline (TArray< FVector > &SplinePoints, bool ValidLocationFound) |
| Update the arc spline.
|
|
|
virtual void | BeginPlay () override |
|
virtual void virtual void | ClearArc () |
| Clear the arc spline.
|
|
| GENERATED_BODY () |
|
FRotator | GetRotationFromInput (const FVector2D &Direction) |
| Calculate the FRotator from the pad of a controller.
|
|
virtual void | TickTeleporter (float DeltaTime) override |
| Tick the Teleporter.
|
|
bool | TraceTeleportDestination (TArray< FVector > &TracePoints, FVector &TraceLocation, FVector &NavMeshLocation) |
| Traces the teleport destination using projectile path prediction and navigation system. This function traces the teleport destination by simulating a projectile path based on the start position and launch velocity. It checks for collision with world static objects and collects the trace points along the path. If a valid hit is found, it stores the hit location in TraceLocation. Additionally, if the navigation system is available, it projects the hit location to the navigation mesh and stores the projected location in NavMeshLocation.
|
|
void | UpdateTeleportCylinder (const FVector &NewLocation, bool ValidLocationFound) |
| Update the teleport cylinder.
|
|
Class for VR teleporter functionality. It allows teleportation using visual indicators.
UCLASS()
Definition at line 27 of file PixoVRTeleporter.h.
◆ APixoVRTeleporter()
APixoVRTeleporter::APixoVRTeleporter |
( |
| ) |
|
◆ ActivateTeleporter()
void APixoVRTeleporter::ActivateTeleporter |
( |
bool | InActivate | ) |
|
|
overridevirtual |
Activate or deactivate the Teleporter.
- Parameters
-
InActivate | Whether to activate or deactivate the Teleporter. |
Reimplemented from ATeleporterBase.
Definition at line 57 of file PixoVRTeleporter.cpp.
◆ BeginPlay()
void APixoVRTeleporter::BeginPlay |
( |
| ) |
|
|
overrideprivatevirtual |
◆ ClearArc()
void ATeleporterBase::ClearArc |
( |
| ) |
|
|
privatevirtualinherited |
◆ Destroyed()
void ATeleporterBase::Destroyed |
( |
| ) |
|
|
overrideprotectedvirtualinherited |
◆ ExecuteTeleportation()
void APixoVRTeleporter::ExecuteTeleportation |
( |
UVRBaseCharacterMovementComponent * | MovementComponent, |
|
|
const FTransform & | ActorTransform, |
|
|
const FVector & | VRLocation, |
|
|
const FRotator & | ActorRotation ) |
|
overridevirtual |
Execute the teleportation. It checks if there is a valid teleport destination before executing the teleportation. The teleport destination is determined based on the last valid location of the teleport cylinder.
- Parameters
-
MovementComponent | The movement component of the character. |
ActorTransform | The transform of the character. |
VRLocation | The HMD location (usually you can get it by GetVRLocation()). |
ActorRotation | The rotation of the character. |
Reimplemented from ATeleporterBase.
Definition at line 253 of file PixoVRTeleporter.cpp.
◆ GENERATED_BODY()
APixoVRTeleporter::GENERATED_BODY |
( |
| ) |
|
|
private |
◆ GetLifetimeReplicatedProps()
void ATeleporterBase::GetLifetimeReplicatedProps |
( |
TArray< FLifetimeProperty > & | OutLifetimeProps | ) |
const |
|
overridevirtualinherited |
◆ GetRotationFromInput()
FRotator ATeleporterBase::GetRotationFromInput |
( |
const FVector2D & | Direction | ) |
|
|
privateinherited |
Calculate the FRotator from the pad of a controller.
- Parameters
-
Direction | The direction of the pad. |
- Returns
- The calculated FRotator.
Definition at line 253 of file TeleporterBase.cpp.
◆ GetTeleportationTransform()
void ATeleporterBase::GetTeleportationTransform |
( |
FVector & | Location, |
|
|
FVector & | ForwardVector ) |
|
inheritedBlueprintPure |
Get the teleportation transform which includes location and orientation.
- Parameters
-
Location | The teleportation location. |
ForwardVector | The forward vector for orientation. |
UFUNCTION(BlueprintPure, Category = "PixoVR | Teleporter")
Definition at line 230 of file TeleporterBase.cpp.
◆ GetTeleportDestination()
FVector ATeleporterBase::GetTeleportDestination |
( |
const FVector & | OriginalLocation | ) |
|
|
inheritedBlueprintPure |
Get the teleport destination.
- Parameters
-
OriginalLocation | Desired teleport location. |
- Returns
- The teleport destination.
UFUNCTION(BlueprintPure, Category = "PixoVR | Teleporter")
Definition at line 222 of file TeleporterBase.cpp.
◆ IsActivated()
bool ATeleporterBase::IsActivated |
( |
| ) |
|
|
virtualinheritedBlueprintCallable |
Check if the teleporter is activated.
- Returns
- True if the teleporter is activated, false otherwise.
UFUNCTION(BlueprintCallable, Category = "PixoVR | Teleporter")
Definition at line 211 of file TeleporterBase.cpp.
◆ SetMotionController()
void ATeleporterBase::SetMotionController |
( |
UGripMotionControllerComponent * | InMotionController | ) |
|
|
virtualinheritedBlueprintCallable |
Set the motion controller that controls this Teleport.
- Parameters
-
InMotionController | The motion controller component. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Teleporter")
Definition at line 276 of file TeleporterBase.cpp.
◆ Tick()
void ATeleporterBase::Tick |
( |
float | DeltaTime | ) |
|
|
overrideprotectedvirtualinherited |
◆ TickTeleporter()
void APixoVRTeleporter::TickTeleporter |
( |
float | DeltaTime | ) |
|
|
overrideprivatevirtual |
◆ TraceTeleportDestination()
bool APixoVRTeleporter::TraceTeleportDestination |
( |
TArray< FVector > & | TracePoints, |
|
|
FVector & | TraceLocation, |
|
|
FVector & | NavMeshLocation ) |
|
private |
Traces the teleport destination using projectile path prediction and navigation system. This function traces the teleport destination by simulating a projectile path based on the start position and launch velocity. It checks for collision with world static objects and collects the trace points along the path. If a valid hit is found, it stores the hit location in TraceLocation. Additionally, if the navigation system is available, it projects the hit location to the navigation mesh and stores the projected location in NavMeshLocation.
- Parameters
-
TracePoints | Array to store the trace points along the projectile path. |
TraceLocation | The hit location of the projectile path trace. |
NavMeshLocation | The projected location on the navigation mesh. |
- Returns
- True if a valid hit and navigation projection are found, false otherwise.
Definition at line 135 of file PixoVRTeleporter.cpp.
◆ UpdateArcEndpoint()
void ATeleporterBase::UpdateArcEndpoint |
( |
const FVector & | NewLocation, |
|
|
bool | ValidLocationFound ) |
|
protectedvirtualinherited |
Update the endpoint of the arc spline.
- Parameters
-
NewLocation | The new location for the endpoint. |
ValidLocationFound | Whether a valid teleport location is found. |
Definition at line 216 of file TeleporterBase.cpp.
◆ UpdateArcSpline()
void ATeleporterBase::UpdateArcSpline |
( |
TArray< FVector > & | SplinePoints, |
|
|
bool | ValidLocationFound ) |
|
protectedvirtualinherited |
Update the arc spline.
- Parameters
-
SplinePoints | The spline points for the arc. |
ValidLocationFound | Whether a valid teleport location is found. |
Definition at line 90 of file TeleporterBase.cpp.
◆ UpdateMotionControllerRotation()
void ATeleporterBase::UpdateMotionControllerRotation |
( |
const FVector2D & | Direction | ) |
|
|
virtualinheritedBlueprintCallable |
Update the motion controller rotation for pad rotation.
- Parameters
-
Direction | The motion controller pad axis direction. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Teleporter")
Definition at line 243 of file TeleporterBase.cpp.
◆ UpdateTeleportCylinder()
void APixoVRTeleporter::UpdateTeleportCylinder |
( |
const FVector & | NewLocation, |
|
|
bool | ValidLocationFound ) |
|
private |
Update the teleport cylinder.
- Parameters
-
NewLocation | The new location for the teleport cylinder. |
ValidLocationFound | Whether a valid teleport location is found. |
Definition at line 192 of file PixoVRTeleporter.cpp.
◆ ArcEndPoint
UStaticMeshComponent* ATeleporterBase::ArcEndPoint |
|
inheritedVisibleDefaultsOnlyBlueprintReadWrite |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
Definition at line 137 of file TeleporterBase.h.
◆ ArcSplineComponent
USplineComponent* ATeleporterBase::ArcSplineComponent |
|
inheritedVisibleDefaultsOnlyBlueprintReadWrite |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
Definition at line 130 of file TeleporterBase.h.
◆ ArcSplineMaterial
UMaterial* ATeleporterBase::ArcSplineMaterial |
|
inheritedBlueprintReadWriteEditAnywhere |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Teleporter", Meta = (AllowPrivateAccess = "true"))
Definition at line 158 of file TeleporterBase.h.
◆ ArcSplineMesh
UStaticMesh* ATeleporterBase::ArcSplineMesh |
|
inheritedBlueprintReadWriteEditAnywhere |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Teleporter", Meta = (AllowPrivateAccess = "true"))
Definition at line 151 of file TeleporterBase.h.
◆ Arrow
UStaticMeshComponent* ATeleporterBase::Arrow |
|
inheritedVisibleDefaultsOnlyBlueprintReadWrite |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
Definition at line 144 of file TeleporterBase.h.
◆ bActivateOneTeleporterAtTime
bool ATeleporterBase::bActivateOneTeleporterAtTime = false |
|
inheritedBlueprintReadOnly |
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
Definition at line 69 of file TeleporterBase.h.
◆ bDrawArcSpline
bool ATeleporterBase::bDrawArcSpline |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
If set to 'true' it will draw the arc spline that is used to show the direction of the teleport location.
Definition at line 81 of file TeleporterBase.h.
◆ bDrawTeleportArrow
bool ATeleporterBase::bDrawTeleportArrow |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
If set to 'true' it will draw the arrow that points to the direction of the controller pad location.
Definition at line 87 of file TeleporterBase.h.
◆ bDrawTeleportCylinder
bool APixoVRTeleporter::bDrawTeleportCylinder |
|
EditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
If set to 'true' it will draw the cylinder that is used to show the area of the teleport location.
Definition at line 99 of file PixoVRTeleporter.h.
◆ bIsTeleporterActive
bool ATeleporterBase::bIsTeleporterActive |
|
inheritedBlueprintReadOnly |
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
Holds the state if the teleporter is active or not.
Definition at line 63 of file TeleporterBase.h.
◆ bIsValidTeleportDestination
bool ATeleporterBase::bIsValidTeleportDestination |
|
inheritedBlueprintReadOnly |
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
Holds the state if the last teleport location is valid or not.
Definition at line 75 of file TeleporterBase.h.
◆ FadeInDuration
float ATeleporterBase::FadeInDuration |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PiUpdateMotionControllerRotationxoVR | Teleporter")
Definition at line 111 of file TeleporterBase.h.
◆ FadeOutDuration
float ATeleporterBase::FadeOutDuration |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
Definition at line 117 of file TeleporterBase.h.
◆ MotionController
UGripMotionControllerComponent* ATeleporterBase::MotionController |
|
inheritedReplicated |
◆ MovementComponent
UVRBaseCharacterMovementComponent* APixoVRTeleporter::MovementComponent |
|
private |
◆ NavigationSystem
UNavigationSystemV1* APixoVRTeleporter::NavigationSystem |
|
private |
◆ PadRotation
FRotator ATeleporterBase::PadRotation |
|
inheritedBlueprintReadOnly |
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
Definition at line 105 of file TeleporterBase.h.
◆ Ring
UStaticMeshComponent* APixoVRTeleporter::Ring |
|
VisibleDefaultsOnlyBlueprintReadWrite |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
Definition at line 93 of file PixoVRTeleporter.h.
◆ SplineMeshComponents
TArray<USplineMeshComponent*> ATeleporterBase::SplineMeshComponents |
|
privateinherited |
◆ TeleportCylinder
UStaticMeshComponent* APixoVRTeleporter::TeleportCylinder |
|
VisibleDefaultsOnlyBlueprintReadWrite |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
Definition at line 86 of file PixoVRTeleporter.h.
◆ TeleportFadeColor
FLinearColor APixoVRTeleporter::TeleportFadeColor |
|
EditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
Definition at line 105 of file PixoVRTeleporter.h.
◆ TeleportLaunchVelocity
float ATeleporterBase::TeleportLaunchVelocity |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
Set this to higher values to make the teleporter teleport more far away.
Definition at line 93 of file TeleporterBase.h.
◆ TeleportRotation
FRotator ATeleporterBase::TeleportRotation |
|
inheritedBlueprintReadOnly |
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Teleporter")
Definition at line 99 of file TeleporterBase.h.
◆ ThumbDeadZone
float ATeleporterBase::ThumbDeadZone |
|
inheritedEditAnywhere |
UPROPERTY(EditAnywhere, Category = "PixoVR | Teleporter")
This value is used to check when to create a direction arrow of the controller pad.
Definition at line 123 of file TeleporterBase.h.
◆ TimedLocation
FVector ATeleporterBase::TimedLocation |
|
protectedinherited |
◆ TimedRotation
FRotator ATeleporterBase::TimedRotation |
|
protectedinherited |
The documentation for this class was generated from the following files: