Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
BaseWristMenuButton.cpp
Go to the documentation of this file.
2
3#include "PixoVRCharacter.h"
5
7{
8 PointingFingerCollisionComp = CreateDefaultSubobject<UBoxComponent>("PointingFingerCollision");
9 PointingFingerCollisionComp->OnComponentBeginOverlap.AddDynamic(this,
11 PointingFingerCollisionComp->OnComponentEndOverlap.AddDynamic(this,
13}
14
15void ABaseWristMenuButton::OnBeginOverlapPointingFingerCollision(UPrimitiveComponent* OverlappedComponent,
16 AActor* OtherActor, UPrimitiveComponent* OtherComp,
17 int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
18{
20}
21
22void ABaseWristMenuButton::OnEndOverlapPointingFingerCollision(UPrimitiveComponent* OverlappedComponent,
23 AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
24{
26}
27
28void ABaseWristMenuButton::OnPointingFingerCollisionOverlapChange(AActor* OtherActor, bool IsBeginOverlap) const
29{
30 const APixoVRHand* Hand = Cast<APixoVRHand>(OtherActor);
31 if (Hand)
32 {
33 /* If overlapping hand doesn't hold object */
34 if (!Hand->HandHoldingObject && (!Hand->LaserMesh || !Hand->LaserMesh->IsVisible()))
35 {
36 /* Change hand animation */
37 IHandAnimationInterface::Execute_SetAnimationGripState(Hand->HandMesh->GetAnimInstance(),
39 }
40 }
41}
void OnEndOverlapPointingFingerCollision(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
Change hand animation to default.
void OnBeginOverlapPointingFingerCollision(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
Change hand animation to pointing finger.
void OnPointingFingerCollisionOverlapChange(AActor *OtherActor, bool IsBeginOverlap) const
Change hand animation.
UBoxComponent * PointingFingerCollisionComp
UPROPERTY(EditDefaultsOnly)
APixoVRHand is an actor class that represents a hand in the VR environment.
Definition PixoVRHand.h:99
UStaticMeshComponent * LaserMesh
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
Definition PixoVRHand.h:136
USkeletalMeshComponent * HandMesh
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
Definition PixoVRHand.h:130
UObject * HandHoldingObject
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
Definition PixoVRHand.h:250