A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
APixoVRLaser Class ReferenceBlueprintable

Class for VR laser interaction. It can interact with widget buttons or actors derived from IPixoVRInteractionInterface. More...

#include <PixoVRLaser.h>

Inheritance diagram for APixoVRLaser:
[legend]

Public Member Functions

 APixoVRLaser ()
 
void ActivateLaserBeam (bool InActivate)
 Activate or deactivate the laser beam.
 
bool IsActivated () const
 Check if the laser is activated.
 
bool IsOverWidgetUse (bool InPressed)
 Check if the laser is over a widget and simulate button press.
 
void MulticastTriggerHover (bool State, AActor *InteractableObject, const FHitResult &HitResult, APlayerController *Executor)
 UFUNCTION(NetMulticast, Reliable, WithValidation)
 
void OnHoverBegin (const FHitResult &HitResult)
 Called when an object enters the hover state.
 
void OnHoverEnd (const FHitResult &HitResult)
 Called when an object exits the hover state.
 
void OnSelected (const FHitResult &HitResult)
 Called when the user selects the hovered object.
 
void OnUnSelected (const FHitResult &HitResult)
 Called when the user unselects the hovered object.
 
void ServerTriggerHover (bool State, AActor *InteractableObject, const FHitResult &HitResult, APlayerController *Executor)
 UFUNCTION(Server, Reliable, WithValidation)
 
void ServerTriggerSelect (bool State, AActor *InteractableObject, const FHitResult &HitResult, APlayerController *Executor)
 UFUNCTION(Server, Reliable, WithValidation)
 
void SetHandType (EControllerHand HandType, bool InIsLocal)
 Set the hand type describing which hand is holding it.
 
void TriggerHover (bool State, AActor *InteractableObject, const FHitResult &HitResult)
 Call this method when the user wants to hover over an object.
 
void TriggerSelect (bool State)
 Call this method when the user wants to select the hovered object.
 

Public Attributes

bool bActivateHovering
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
bool bIsLaserBeamActive
 UPROPERTY(BlueprintReadOnly, Transient, ReplicatedUsing=OnRep_LaserBeamActive, Category = "PixoVR | Laser")
 
bool bLinkToInteraction
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
TWeakObjectPtr< class AActorHitActor
 
FHitResult HoverHitResult
 
UStaticMeshComponentLaserBeam
 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
 
FLinearColor LaserBeamColor
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
UStaticMeshComponentLaserBeamEndPoint
 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
 
FLinearColor LaserBeamEndpointColor
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
UMaterialInstanceDynamic * LaserBeamEndpointMaterialDynamic
 
float LaserBeamEndpointRadius
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
UMaterialLaserBeamMaterial
 
UMaterialInstanceDynamic * LaserBeamMaterialDynamic
 
float LaserBeamMaxDistance
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
float LaserBeamRadius
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
 
UStaticMeshComponentLaserPointerMesh
 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
 
FLaserBeamActivated OnLaserBeamActivated
 UPROPERTY(BlueprintAssignable, Category = "PixoVR | Laser")
 
USceneComponentSceneComponent
 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
 
UWidgetInteractionComponent * WidgetInteraction
 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
 

Private Member Functions

void ClientTickLaserBeam (float DeltaTime)
 UFUNCTION(Client, Unreliable)
 
 GENERATED_BODY ()
 
virtual void OnConstruction (const FTransform &Transform) override
 
void OnRep_LaserBeamActive ()
 UFUNCTION()
 
virtual void Tick (float DeltaTime) override
 
void UpdateStateLaserBeam ()
 

Private Attributes

bool bIsLocal
 

Detailed Description

Class for VR laser interaction. It can interact with widget buttons or actors derived from IPixoVRInteractionInterface.

UCLASS(Blueprintable)

Definition at line 22 of file PixoVRLaser.h.

Constructor & Destructor Documentation

◆ APixoVRLaser()

APixoVRLaser::APixoVRLaser ( )

The constructor. Sets up connections to parents and implements default settings.

Definition at line 55 of file PixoVRLaser.cpp.

Member Function Documentation

◆ ActivateLaserBeam()

void APixoVRLaser::ActivateLaserBeam ( bool InActivate)
ReliableBlueprintCallableServer

Activate or deactivate the laser beam.

Parameters
InActivateWhether to activate or deactivate the laser beam.

UFUNCTION(BlueprintCallable, Server, Reliable, Category = "PixoVR | Laser")

◆ ClientTickLaserBeam()

void APixoVRLaser::ClientTickLaserBeam ( float DeltaTime)
privateClientUnreliable

UFUNCTION(Client, Unreliable)

Here is the caller graph for this function:

◆ GENERATED_BODY()

APixoVRLaser::GENERATED_BODY ( )
private

◆ IsActivated()

bool APixoVRLaser::IsActivated ( ) const
BlueprintPure

Check if the laser is activated.

Returns
True if the laser is activated, false otherwise.

UFUNCTION(BlueprintPure, Category = "PixoVR | Laser")

Definition at line 486 of file PixoVRLaser.cpp.

◆ IsOverWidgetUse()

bool APixoVRLaser::IsOverWidgetUse ( bool InPressed)
BlueprintCallable

Check if the laser is over a widget and simulate button press.

Parameters
InPressedWhether the laser button is pressed.
Returns
True if the laser is over a widget and the button is pressed, false otherwise.

UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")

Definition at line 249 of file PixoVRLaser.cpp.

◆ MulticastTriggerHover()

void APixoVRLaser::MulticastTriggerHover ( bool State,
AActor * InteractableObject,
const FHitResult & HitResult,
APlayerController * Executor )
WithValidationReliableNetMulticast

UFUNCTION(NetMulticast, Reliable, WithValidation)

◆ OnConstruction()

void APixoVRLaser::OnConstruction ( const FTransform & Transform)
overrideprivatevirtual
Parameters
Transformthe offset from the parent.

Tracks all the time after construction is complete.

Definition at line 131 of file PixoVRLaser.cpp.

◆ OnHoverBegin()

void APixoVRLaser::OnHoverBegin ( const FHitResult & HitResult)
BlueprintNativeEvent

Called when an object enters the hover state.

Parameters
HitResultThe hit result of the hovered object.

UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")

◆ OnHoverEnd()

void APixoVRLaser::OnHoverEnd ( const FHitResult & HitResult)
BlueprintNativeEvent

Called when an object exits the hover state.

Parameters
HitResultThe hit result of the exited object.

UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")

Here is the caller graph for this function:

◆ OnRep_LaserBeamActive()

void APixoVRLaser::OnRep_LaserBeamActive ( )
private

UFUNCTION()

Definition at line 165 of file PixoVRLaser.cpp.

Here is the call graph for this function:

◆ OnSelected()

void APixoVRLaser::OnSelected ( const FHitResult & HitResult)
BlueprintNativeEvent

Called when the user selects the hovered object.

Parameters
HitResultThe hit result of the selected object.

UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")

Here is the caller graph for this function:

◆ OnUnSelected()

void APixoVRLaser::OnUnSelected ( const FHitResult & HitResult)
BlueprintNativeEvent

Called when the user unselects the hovered object.

Parameters
HitResultThe hit result of the unselected object.

UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")

Here is the caller graph for this function:

◆ ServerTriggerHover()

void APixoVRLaser::ServerTriggerHover ( bool State,
AActor * InteractableObject,
const FHitResult & HitResult,
APlayerController * Executor )
WithValidationReliableServer

UFUNCTION(Server, Reliable, WithValidation)

Here is the caller graph for this function:

◆ ServerTriggerSelect()

void APixoVRLaser::ServerTriggerSelect ( bool State,
AActor * InteractableObject,
const FHitResult & HitResult,
APlayerController * Executor )
WithValidationReliableServer

UFUNCTION(Server, Reliable, WithValidation)

Here is the caller graph for this function:

◆ SetHandType()

void APixoVRLaser::SetHandType ( EControllerHand HandType,
bool InIsLocal )
BlueprintCallable

Set the hand type describing which hand is holding it.

Parameters
HandTypeThe hand (left or right).
InIsLocalWhether the laser is attached to the local hand.

UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")

Definition at line 160 of file PixoVRLaser.cpp.

Here is the caller graph for this function:

◆ Tick()

void APixoVRLaser::Tick ( float DeltaTime)
overrideprivatevirtual

Definition at line 146 of file PixoVRLaser.cpp.

Here is the call graph for this function:

◆ TriggerHover()

void APixoVRLaser::TriggerHover ( bool State,
AActor * InteractableObject,
const FHitResult & HitResult )
BlueprintCallable

Call this method when the user wants to hover over an object.

Parameters
StateThe hover state.
InteractableObjectThe interactable object being hovered over.
HitResultThe hit result of the hover.

UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")

Definition at line 373 of file PixoVRLaser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TriggerSelect()

void APixoVRLaser::TriggerSelect ( bool State)
BlueprintCallable

Call this method when the user wants to select the hovered object.

Parameters
StateShows whether object was selected or not.

UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")

Definition at line 439 of file PixoVRLaser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateStateLaserBeam()

void APixoVRLaser::UpdateStateLaserBeam ( )
private

Definition at line 170 of file PixoVRLaser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bActivateHovering

bool APixoVRLaser::bActivateHovering
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

If checked it will fire OnHoverBegin/OnHovered/OnSelected if the laser hovers something.

Definition at line 258 of file PixoVRLaser.h.

◆ bIsLaserBeamActive

bool APixoVRLaser::bIsLaserBeamActive
TransientBlueprintReadOnly

UPROPERTY(BlueprintReadOnly, Transient, ReplicatedUsing=OnRep_LaserBeamActive, Category = "PixoVR | Laser")

Will be true if the laser beam is active else false.

Definition at line 216 of file PixoVRLaser.h.

◆ bIsLocal

bool APixoVRLaser::bIsLocal
private

Definition at line 280 of file PixoVRLaser.h.

◆ bLinkToInteraction

bool APixoVRLaser::bLinkToInteraction
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

If checked the widget interaction distance will be the same as the laser LaserBeamMaxDistance.

Definition at line 265 of file PixoVRLaser.h.

◆ HitActor

TWeakObjectPtr<class AActor> APixoVRLaser::HitActor

Definition at line 274 of file PixoVRLaser.h.

◆ HoverHitResult

FHitResult APixoVRLaser::HoverHitResult

Definition at line 273 of file PixoVRLaser.h.

◆ LaserBeam

UStaticMeshComponent* APixoVRLaser::LaserBeam
BlueprintReadWriteVisibleDefaultsOnly

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)

This component is used to simulate a laser beam. Its just a mesh that will be scaled.

Definition at line 188 of file PixoVRLaser.h.

◆ LaserBeamColor

FLinearColor APixoVRLaser::LaserBeamColor
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

The color of the laser beam.

Definition at line 244 of file PixoVRLaser.h.

◆ LaserBeamEndPoint

UStaticMeshComponent* APixoVRLaser::LaserBeamEndPoint
BlueprintReadWriteVisibleDefaultsOnly

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)

This component is used to draw a sphere to show a hitpoint.

Definition at line 195 of file PixoVRLaser.h.

◆ LaserBeamEndpointColor

FLinearColor APixoVRLaser::LaserBeamEndpointColor
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

The color of the laser beam endpoint.

Definition at line 251 of file PixoVRLaser.h.

◆ LaserBeamEndpointMaterialDynamic

UMaterialInstanceDynamic* APixoVRLaser::LaserBeamEndpointMaterialDynamic

Definition at line 277 of file PixoVRLaser.h.

◆ LaserBeamEndpointRadius

float APixoVRLaser::LaserBeamEndpointRadius
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

Size of the laser beam endpoint.

Definition at line 237 of file PixoVRLaser.h.

◆ LaserBeamMaterial

UMaterial* APixoVRLaser::LaserBeamMaterial

Definition at line 275 of file PixoVRLaser.h.

◆ LaserBeamMaterialDynamic

UMaterialInstanceDynamic* APixoVRLaser::LaserBeamMaterialDynamic

Definition at line 276 of file PixoVRLaser.h.

◆ LaserBeamMaxDistance

float APixoVRLaser::LaserBeamMaxDistance
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

The maximum distance of the laser beam.

Definition at line 223 of file PixoVRLaser.h.

◆ LaserBeamRadius

float APixoVRLaser::LaserBeamRadius
EditAnywhereBlueprintReadWrite

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")

Size of the laser beam.

Definition at line 230 of file PixoVRLaser.h.

◆ LaserPointerMesh

UStaticMeshComponent* APixoVRLaser::LaserPointerMesh
BlueprintReadWriteVisibleDefaultsOnly

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)

This component refers to mesh pointer hold in hand

Definition at line 202 of file PixoVRLaser.h.

◆ OnLaserBeamActivated

FLaserBeamActivated APixoVRLaser::OnLaserBeamActivated
BlueprintAssignable

UPROPERTY(BlueprintAssignable, Category = "PixoVR | Laser")

Definition at line 271 of file PixoVRLaser.h.

◆ SceneComponent

USceneComponent* APixoVRLaser::SceneComponent
BlueprintReadWriteVisibleDefaultsOnly

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)

This component is used to make child transform easier.

Definition at line 181 of file PixoVRLaser.h.

◆ WidgetInteraction

UWidgetInteractionComponent* APixoVRLaser::WidgetInteraction
BlueprintReadWriteVisibleDefaultsOnly

UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)

This component is used to interact with UMG widgets.

Definition at line 209 of file PixoVRLaser.h.


The documentation for this class was generated from the following files: