A Demo Project for the UnrealEngineSDK
|
Class for VR laser interaction. It can interact with widget buttons or actors derived from IPixoVRInteractionInterface. More...
#include <PixoVRLaser.h>
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 AActor > | HitActor |
FHitResult | HoverHitResult |
UStaticMeshComponent * | LaserBeam |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite) | |
FLinearColor | LaserBeamColor |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser") | |
UStaticMeshComponent * | LaserBeamEndPoint |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite) | |
FLinearColor | LaserBeamEndpointColor |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser") | |
UMaterialInstanceDynamic * | LaserBeamEndpointMaterialDynamic |
float | LaserBeamEndpointRadius |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser") | |
UMaterial * | LaserBeamMaterial |
UMaterialInstanceDynamic * | LaserBeamMaterialDynamic |
float | LaserBeamMaxDistance |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser") | |
float | LaserBeamRadius |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser") | |
UStaticMeshComponent * | LaserPointerMesh |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite) | |
FLaserBeamActivated | OnLaserBeamActivated |
UPROPERTY(BlueprintAssignable, Category = "PixoVR | Laser") | |
USceneComponent * | SceneComponent |
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 |
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.
APixoVRLaser::APixoVRLaser | ( | ) |
The constructor. Sets up connections to parents and implements default settings.
Definition at line 55 of file PixoVRLaser.cpp.
|
ServerBlueprintCallableReliable |
Activate or deactivate the laser beam.
InActivate | Whether to activate or deactivate the laser beam. |
UFUNCTION(BlueprintCallable, Server, Reliable, Category = "PixoVR | Laser")
|
privateClientUnreliable |
UFUNCTION(Client, Unreliable)
|
private |
|
BlueprintPure |
Check if the laser is activated.
UFUNCTION(BlueprintPure, Category = "PixoVR | Laser")
Definition at line 486 of file PixoVRLaser.cpp.
Check if the laser is over a widget and simulate button press.
InPressed | Whether the laser button is pressed. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")
Definition at line 249 of file PixoVRLaser.cpp.
|
NetMulticastReliableWithValidation |
UFUNCTION(NetMulticast, Reliable, WithValidation)
|
overrideprivatevirtual |
Transform | the offset from the parent. |
Tracks all the time after construction is complete.
Definition at line 131 of file PixoVRLaser.cpp.
|
BlueprintNativeEvent |
Called when an object enters the hover state.
HitResult | The hit result of the hovered object. |
UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")
|
BlueprintNativeEvent |
Called when an object exits the hover state.
HitResult | The hit result of the exited object. |
UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")
|
private |
UFUNCTION()
Definition at line 165 of file PixoVRLaser.cpp.
|
BlueprintNativeEvent |
Called when the user selects the hovered object.
HitResult | The hit result of the selected object. |
UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")
|
BlueprintNativeEvent |
Called when the user unselects the hovered object.
HitResult | The hit result of the unselected object. |
UFUNCTION(BlueprintNativeEvent, Category = "PixoVR | Laser")
|
ServerReliableWithValidation |
UFUNCTION(Server, Reliable, WithValidation)
|
ServerReliableWithValidation |
UFUNCTION(Server, Reliable, WithValidation)
|
BlueprintCallable |
Set the hand type describing which hand is holding it.
HandType | The hand (left or right). |
InIsLocal | Whether the laser is attached to the local hand. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")
Definition at line 160 of file PixoVRLaser.cpp.
|
overrideprivatevirtual |
|
BlueprintCallable |
Call this method when the user wants to hover over an object.
State | The hover state. |
InteractableObject | The interactable object being hovered over. |
HitResult | The hit result of the hover. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")
Definition at line 373 of file PixoVRLaser.cpp.
|
BlueprintCallable |
Call this method when the user wants to select the hovered object.
State | Shows whether object was selected or not. |
UFUNCTION(BlueprintCallable, Category = "PixoVR | Laser")
Definition at line 439 of file PixoVRLaser.cpp.
|
private |
Definition at line 170 of file PixoVRLaser.cpp.
|
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.
|
BlueprintReadOnlyTransient |
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.
|
private |
Definition at line 280 of file PixoVRLaser.h.
|
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.
TWeakObjectPtr<class AActor> APixoVRLaser::HitActor |
Definition at line 274 of file PixoVRLaser.h.
FHitResult APixoVRLaser::HoverHitResult |
Definition at line 273 of file PixoVRLaser.h.
|
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.
|
EditAnywhereBlueprintReadWrite |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
The color of the laser beam.
Definition at line 244 of file PixoVRLaser.h.
|
BlueprintReadWriteVisibleDefaultsOnly |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
This component is used to draw a sphere to show a hitpoint.
Definition at line 195 of file PixoVRLaser.h.
|
EditAnywhereBlueprintReadWrite |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
The color of the laser beam endpoint.
Definition at line 251 of file PixoVRLaser.h.
UMaterialInstanceDynamic* APixoVRLaser::LaserBeamEndpointMaterialDynamic |
Definition at line 277 of file PixoVRLaser.h.
|
EditAnywhereBlueprintReadWrite |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
Size of the laser beam endpoint.
Definition at line 237 of file PixoVRLaser.h.
UMaterial* APixoVRLaser::LaserBeamMaterial |
Definition at line 275 of file PixoVRLaser.h.
UMaterialInstanceDynamic* APixoVRLaser::LaserBeamMaterialDynamic |
Definition at line 276 of file PixoVRLaser.h.
|
EditAnywhereBlueprintReadWrite |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
The maximum distance of the laser beam.
Definition at line 223 of file PixoVRLaser.h.
|
EditAnywhereBlueprintReadWrite |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Laser")
Size of the laser beam.
Definition at line 230 of file PixoVRLaser.h.
|
BlueprintReadWriteVisibleDefaultsOnly |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
This component refers to mesh pointer hold in hand
Definition at line 202 of file PixoVRLaser.h.
|
BlueprintAssignable |
UPROPERTY(BlueprintAssignable, Category = "PixoVR | Laser")
Definition at line 271 of file PixoVRLaser.h.
|
BlueprintReadWriteVisibleDefaultsOnly |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
This component is used to make child transform easier.
Definition at line 181 of file PixoVRLaser.h.
|
BlueprintReadWriteVisibleDefaultsOnly |
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
This component is used to interact with UMG widgets.
Definition at line 209 of file PixoVRLaser.h.