A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
APixoVRHand Class Reference

APixoVRHand is an actor class that represents a hand in the VR environment. More...

#include <PixoVRHand.h>

Inheritance diagram for APixoVRHand:
[legend]

Public Member Functions

 APixoVRHand ()
 
void DeactivateTouchCooldown ()
 Deactivates the touch cooldown of the hand.
 
bool DenyDropping ()
 Deny dropping. If this is set to true the actor will not be dropped after releasing until set to false again.
 
bool DenyGrippingPixoVR (UGripMotionControllerComponent *GrippingController)
 Deny gripping. If this is set to true the actor can't be gripped anymore until set the false again.
 
bool DenyTriggerGripping ()
 Deny gripping after triggering grip.
 
bool DisablePhysicsOnDrop ()
 Disable Physics on Drop. When this is set to 'true' if user drops object it will disable physics else it will use default.
 
TArray< FVector > GetRelativePointsArray (USplineComponent *FingerSpline, float Precision)
 Retrieves an array of relative points along the finger spline.
 
void GrabObject ()
 Grabs the object currently overlapped by grab sphere.
 
void GripMode (EPixoVRGripModeEnum &GripMode)
 Will be used to determine how to do the grabbing. Using normal attachment or a physics constraint.
 
void GripTriggerMode (EPixoVRGripTriggerModeEnum &GripTriggerMode)
 Will be used to determine how the gripping trigger should behave.
 
void GripTriggerTransform (UGripMotionControllerComponent *GrippingController, bool &UseCustomTransform, FTransform &CustomTransform)
 This specified transformation will be used when flag is set and a grip is happening.
 
void InitPixoVRHands (EControllerHand MotionSource, APixoVRCharacter *Character)
 
void ManuallyPutActorToHand (AActor *ActorRef)
 Manually puts an actor into the hand. Hand will try to grab this actor.
 
void OnGripObject (UGripMotionControllerComponent *GrippingController, AActor *GrippedActor)
 Will be called when user grabs an object.
 
void OnGripObjectRelease (UGripMotionControllerComponent *ReleasingController, AActor *GrippedActor)
 Will be called when the user releases an object.
 
void OnObjectPaused ()
 This event runs when the user "pauses" this object. Pausing should turn off visibility and functionality of this object.
 
void OnObjectUnPaused ()
 This event runs when the user "unpauses" this object. Unpausing should turn on visibility and functionality of this object.
 
void OnTouchWidget (UWidgetComponent *WidgetComponent, UWidgetComponent *PreviousWidgetComponent)
 Called when the hand touches a widget component.
 
void OnTryGripObject (UGripMotionControllerComponent *GrippingController, AActor *GrippedActor)
 Will be called when user tried to grab the object.
 
void ReleaseHeldObjectOnOtherHand (AActor *HeldActor)
 Releases the held object on the other hand.
 
void ReleaseObject ()
 Releases the currently held object.
 
void SetupFingerTracePoints ()
 Sets up the cache of relative points for finger tracing. This function should be called during initialization to precalculate the relative points along each finger spline.
 
virtual void Tick (float DeltaTime) override
 
void ToggleLaser (bool Visible)
 Toggles the visibility of the laser.
 
float TraceFingerForObstacle (TArray< FVector > RelativePointsArray)
 Traces the finger along the given array of relative points to check for obstacles.
 
void UpdateFingerData ()
 Updates the finger data by tracing each finger for obstacles and storing the normalized obstacle distances. This function should be when we trying to grip object.
 

Public Attributes

bool ChangeHandAnimationNearInteractableObject = false
 UPROPERTY(EditDefaultsOnly, Category = "Animation")
 
FFingerData FingerData
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "Animation")
 
USphereComponentGrabSphere
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
 
EGrippableTypeChecker GrippableTypeChecker = EGrippableTypeChecker::Default
 Flag that indicated near which objects should we change animation.
 
UObjectHandHoldingObject
 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
 
USkeletalMeshComponentHandMesh
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
 
EControllerHand HandMotionSource
 UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))
 
TArray< FVector > IndexPositionCache
 
USplineComponent * IndexSpline
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
bool InteractableObjectNearHand = false
 
bool IsObjectHighlightActive = false
 Show highlight if hand near object that we can grab.
 
UStaticMeshComponentLaserMesh
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
 
USoundCue * LaserSound
 UPROPERTY()
 
TArray< FVector > MiddlePositionCache
 
USplineComponent * MiddleSpline
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
UGripMotionControllerComponentMotionController
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
 
AActorOverlapedActor = nullptr
 
APixoVRCharacterOwningCharacter
 UPROPERTY(BlueprintReadWrite, Category = "Init")
 
TArray< FVector > PinkyPositionCache
 
USplineComponent * PinkySpline
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
TArray< FVector > RingPositionCache
 
USplineComponent * RingSpline
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
USceneComponentRoot
 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
 
TArray< FVector > ThumbPositionCache
 
USplineComponent * ThumbSpline
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
UWidgetInteractionComponent * TouchComponent
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
bool UseCustomAnimation = false
 UPROPERTY(BlueprintReadWrite, Category = "Animation")
 

Protected Member Functions

virtual void BeginPlay () override
 
void GetOverlappingActor (FOverlappingInfo &OverlappingInfo)
 Gets the info of actor currently overlapping with the grab sphere.
 

Protected Attributes

bool TouchComponentCooldownActive
 

Private Member Functions

 GENERATED_BODY ()
 

Detailed Description

APixoVRHand is an actor class that represents a hand in the VR environment.

UCLASS()

Definition at line 98 of file PixoVRHand.h.

Constructor & Destructor Documentation

◆ APixoVRHand()

APixoVRHand::APixoVRHand ( )

Definition at line 12 of file PixoVRHand.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ BeginPlay()

void APixoVRHand::BeginPlay ( )
overrideprotectedvirtual

Definition at line 271 of file PixoVRHand.cpp.

◆ DeactivateTouchCooldown()

void APixoVRHand::DeactivateTouchCooldown ( )
BlueprintCallable

Deactivates the touch cooldown of the hand.

UFUNCTION(BlueprintCallable, Category = "TouchWidget")

Definition at line 137 of file PixoVRHand.cpp.

Here is the caller graph for this function:

◆ DenyDropping()

bool IPixoVRGripInterface::DenyDropping ( )
inheritedBlueprintCallableBlueprintNativeEvent

Deny dropping. If this is set to true the actor will not be dropped after releasing until set to false again.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ DenyGrippingPixoVR()

bool IPixoVRGripInterface::DenyGrippingPixoVR ( UGripMotionControllerComponent * GrippingController)
inheritedBlueprintCallableBlueprintNativeEvent

Deny gripping. If this is set to true the actor can't be gripped anymore until set the false again.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ DenyTriggerGripping()

bool IPixoVRGripInterface::DenyTriggerGripping ( )
inheritedBlueprintCallableBlueprintNativeEvent

Deny gripping after triggering grip.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ DisablePhysicsOnDrop()

bool IPixoVRGripInterface::DisablePhysicsOnDrop ( )
inheritedBlueprintCallableBlueprintNativeEvent

Disable Physics on Drop. When this is set to 'true' if user drops object it will disable physics else it will use default.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ GENERATED_BODY()

APixoVRHand::GENERATED_BODY ( )
private

◆ GetOverlappingActor()

void APixoVRHand::GetOverlappingActor ( FOverlappingInfo & OverlappingInfo)
protected

Gets the info of actor currently overlapping with the grab sphere.

Parameters
OverlappingInfoThe struct to store the overlapping information.

Definition at line 395 of file PixoVRHand.cpp.

Here is the caller graph for this function:

◆ GetRelativePointsArray()

TArray< FVector > APixoVRHand::GetRelativePointsArray ( USplineComponent * FingerSpline,
float Precision )
BlueprintCallable

Retrieves an array of relative points along the finger spline.

Parameters
FingerSplineThe spline component representing the finger.
PrecisionThe number of points to generate along the spline.
Returns
An array of relative points along the finger spline.

UFUNCTION(BlueprintCallable, Category = "Animation")

Definition at line 183 of file PixoVRHand.cpp.

Here is the caller graph for this function:

◆ GrabObject()

void APixoVRHand::GrabObject ( )

Grabs the object currently overlapped by grab sphere.

UFUNCTION()

Definition at line 74 of file PixoVRHand.cpp.

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

◆ GripMode()

void IPixoVRGripInterface::GripMode ( EPixoVRGripModeEnum & GripMode)
inheritedBlueprintCallableBlueprintNativeEvent

Will be used to determine how to do the grabbing. Using normal attachment or a physics constraint.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ GripTriggerMode()

void IPixoVRGripInterface::GripTriggerMode ( EPixoVRGripTriggerModeEnum & GripTriggerMode)
inheritedBlueprintCallableBlueprintNativeEvent

Will be used to determine how the gripping trigger should behave.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ GripTriggerTransform()

void IPixoVRGripInterface::GripTriggerTransform ( UGripMotionControllerComponent * GrippingController,
bool & UseCustomTransform,
FTransform & CustomTransform )
inheritedBlueprintCallableBlueprintNativeEvent

This specified transformation will be used when flag is set and a grip is happening.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ InitPixoVRHands()

void APixoVRHand::InitPixoVRHands ( EControllerHand MotionSource,
APixoVRCharacter * Character )

Definition at line 353 of file PixoVRHand.cpp.

Here is the caller graph for this function:

◆ ManuallyPutActorToHand()

void APixoVRHand::ManuallyPutActorToHand ( AActor * ActorRef)

Manually puts an actor into the hand. Hand will try to grab this actor.

Parameters
ActorRefThe actor to put into the hand.

UFUNCTION()

Definition at line 116 of file PixoVRHand.cpp.

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

◆ OnGripObject()

void IPixoVRGripInterface::OnGripObject ( UGripMotionControllerComponent * GrippingController,
AActor * GrippedActor )
inheritedBlueprintCallableBlueprintNativeEvent

Will be called when user grabs an object.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ OnGripObjectRelease()

void IPixoVRGripInterface::OnGripObjectRelease ( UGripMotionControllerComponent * ReleasingController,
AActor * GrippedActor )
inheritedBlueprintCallableBlueprintNativeEvent

Will be called when the user releases an object.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ OnObjectPaused()

void IPixoVRGripInterface::OnObjectPaused ( )
inheritedBlueprintCallableBlueprintNativeEvent

This event runs when the user "pauses" this object. Pausing should turn off visibility and functionality of this object.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ OnObjectUnPaused()

void IPixoVRGripInterface::OnObjectUnPaused ( )
inheritedBlueprintCallableBlueprintNativeEvent

This event runs when the user "unpauses" this object. Unpausing should turn on visibility and functionality of this object.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ OnTouchWidget()

void APixoVRHand::OnTouchWidget ( UWidgetComponent * WidgetComponent,
UWidgetComponent * PreviousWidgetComponent )
BlueprintCallable

Called when the hand touches a widget component.

Parameters
WidgetComponentThe widget component that was touched.
PreviousWidgetComponentThe previously touched widget component.

UFUNCTION(BlueprintCallable, Category = "TouchWidget")

Definition at line 126 of file PixoVRHand.cpp.

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

◆ OnTryGripObject()

void IPixoVRGripInterface::OnTryGripObject ( UGripMotionControllerComponent * GrippingController,
AActor * GrippedActor )
inheritedBlueprintCallableBlueprintNativeEvent

Will be called when user tried to grab the object.

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "PixoVR | Grip Interface")

◆ ReleaseHeldObjectOnOtherHand()

void APixoVRHand::ReleaseHeldObjectOnOtherHand ( AActor * HeldActor)

Releases the held object on the other hand.

Parameters
HeldActorThe actor that is being held.

UFUNCTION()

Definition at line 143 of file PixoVRHand.cpp.

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

◆ ReleaseObject()

void APixoVRHand::ReleaseObject ( )

Releases the currently held object.

UFUNCTION()

Definition at line 101 of file PixoVRHand.cpp.

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

◆ SetupFingerTracePoints()

void APixoVRHand::SetupFingerTracePoints ( )
BlueprintCallable

Sets up the cache of relative points for finger tracing. This function should be called during initialization to precalculate the relative points along each finger spline.

UFUNCTION(BlueprintCallable, Category = "Animation")

Definition at line 251 of file PixoVRHand.cpp.

Here is the call graph for this function:

◆ Tick()

void APixoVRHand::Tick ( float DeltaTime)
overridevirtual

Definition at line 280 of file PixoVRHand.cpp.

Here is the call graph for this function:

◆ ToggleLaser()

void APixoVRHand::ToggleLaser ( bool Visible)
BlueprintCallable

Toggles the visibility of the laser.

Parameters
VisibleIndicates whether the laser should be visible or not.

UFUNCTION(BlueprintCallable)

Definition at line 176 of file PixoVRHand.cpp.

◆ TraceFingerForObstacle()

float APixoVRHand::TraceFingerForObstacle ( TArray< FVector > RelativePointsArray)
BlueprintCallable

Traces the finger along the given array of relative points to check for obstacles.

Parameters
RelativePointsArrayThe array of relative points along the finger spline.
Returns
The normalized distance along the finger spline where an obstacle is encountered. Returns 0 if no obstacles are found, 1 if the entire spline is obstructed.

UFUNCTION(BlueprintCallable, Category = "Animation")

Definition at line 207 of file PixoVRHand.cpp.

Here is the caller graph for this function:

◆ UpdateFingerData()

void APixoVRHand::UpdateFingerData ( )
BlueprintCallable

Updates the finger data by tracing each finger for obstacles and storing the normalized obstacle distances. This function should be when we trying to grip object.

UFUNCTION(BlueprintCallable, Category = "Animation")

Definition at line 261 of file PixoVRHand.cpp.

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

Member Data Documentation

◆ ChangeHandAnimationNearInteractableObject

bool APixoVRHand::ChangeHandAnimationNearInteractableObject = false
EditDefaultsOnly

UPROPERTY(EditDefaultsOnly, Category = "Animation")

Definition at line 303 of file PixoVRHand.h.

◆ FingerData

FFingerData APixoVRHand::FingerData
BlueprintReadWriteEditAnywhereReplicated

UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "Animation")

Definition at line 282 of file PixoVRHand.h.

◆ GrabSphere

USphereComponent* APixoVRHand::GrabSphere
VisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 124 of file PixoVRHand.h.

◆ GrippableTypeChecker

EGrippableTypeChecker APixoVRHand::GrippableTypeChecker = EGrippableTypeChecker::Default
EditDefaultsOnly

Flag that indicated near which objects should we change animation.

UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))

Definition at line 311 of file PixoVRHand.h.

◆ HandHoldingObject

UObject* APixoVRHand::HandHoldingObject
BlueprintReadOnlyReplicated

UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")

Definition at line 228 of file PixoVRHand.h.

◆ HandMesh

USkeletalMeshComponent* APixoVRHand::HandMesh
VisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 130 of file PixoVRHand.h.

◆ HandMotionSource

EControllerHand APixoVRHand::HandMotionSource
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))

Definition at line 352 of file PixoVRHand.h.

◆ IndexPositionCache

TArray<FVector> APixoVRHand::IndexPositionCache

Definition at line 324 of file PixoVRHand.h.

◆ IndexSpline

USplineComponent* APixoVRHand::IndexSpline
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 148 of file PixoVRHand.h.

◆ InteractableObjectNearHand

bool APixoVRHand::InteractableObjectNearHand = false

Definition at line 320 of file PixoVRHand.h.

◆ IsObjectHighlightActive

bool APixoVRHand::IsObjectHighlightActive = false
EditDefaultsOnly

Show highlight if hand near object that we can grab.

UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))

Definition at line 319 of file PixoVRHand.h.

◆ LaserMesh

UStaticMeshComponent* APixoVRHand::LaserMesh
VisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 136 of file PixoVRHand.h.

◆ LaserSound

USoundCue* APixoVRHand::LaserSound

UPROPERTY()

Definition at line 242 of file PixoVRHand.h.

◆ MiddlePositionCache

TArray<FVector> APixoVRHand::MiddlePositionCache

Definition at line 325 of file PixoVRHand.h.

◆ MiddleSpline

USplineComponent* APixoVRHand::MiddleSpline
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 154 of file PixoVRHand.h.

◆ MotionController

UGripMotionControllerComponent* APixoVRHand::MotionController
VisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 118 of file PixoVRHand.h.

◆ OverlapedActor

AActor* APixoVRHand::OverlapedActor = nullptr

Definition at line 321 of file PixoVRHand.h.

◆ OwningCharacter

APixoVRCharacter* APixoVRHand::OwningCharacter
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Init")

Definition at line 358 of file PixoVRHand.h.

◆ PinkyPositionCache

TArray<FVector> APixoVRHand::PinkyPositionCache

Definition at line 327 of file PixoVRHand.h.

◆ PinkySpline

USplineComponent* APixoVRHand::PinkySpline
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 166 of file PixoVRHand.h.

◆ RingPositionCache

TArray<FVector> APixoVRHand::RingPositionCache

Definition at line 326 of file PixoVRHand.h.

◆ RingSpline

USplineComponent* APixoVRHand::RingSpline
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 160 of file PixoVRHand.h.

◆ Root

USceneComponent* APixoVRHand::Root
VisibleAnywhereBlueprintReadWrite

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 112 of file PixoVRHand.h.

◆ ThumbPositionCache

TArray<FVector> APixoVRHand::ThumbPositionCache

Definition at line 323 of file PixoVRHand.h.

◆ ThumbSpline

USplineComponent* APixoVRHand::ThumbSpline
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 142 of file PixoVRHand.h.

◆ TouchComponent

UWidgetInteractionComponent* APixoVRHand::TouchComponent
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Definition at line 172 of file PixoVRHand.h.

◆ TouchComponentCooldownActive

bool APixoVRHand::TouchComponentCooldownActive
protected

Definition at line 339 of file PixoVRHand.h.

◆ UseCustomAnimation

bool APixoVRHand::UseCustomAnimation = false
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Animation")

Should we use custom animation instead advanced grab.

Definition at line 297 of file PixoVRHand.h.


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