|
|
|
@@ -53,6 +53,13 @@ struct ASGPawn::FImpl
|
|
|
|
|
* Static methods
|
|
|
|
|
************************/
|
|
|
|
|
|
|
|
|
|
/************************
|
|
|
|
|
* Member variables
|
|
|
|
|
************************/
|
|
|
|
|
|
|
|
|
|
bool bUpdateLeftHandLocationAndRotation;
|
|
|
|
|
bool bUpdateRightHandLocationAndRotation;
|
|
|
|
|
|
|
|
|
|
/************************
|
|
|
|
|
* Owner object
|
|
|
|
|
************************/
|
|
|
|
@@ -86,6 +93,23 @@ struct ASGPawn::FImpl
|
|
|
|
|
void BindFingerTouchOverlapEvents();
|
|
|
|
|
void UnbindFingerTouchOverlapEvents();
|
|
|
|
|
|
|
|
|
|
void SetVisibility(USceneComponent* SceneComponent, const bool bVisibility) const;
|
|
|
|
|
|
|
|
|
|
void UpdateHandLocation(const bool bRight, const FVector& Location, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateLeftHandLocation(const FVector& Location, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateRightHandLocation(const FVector& Location, const bool bUpdateVirtualHand);
|
|
|
|
|
|
|
|
|
|
void UpdateHandRotation(const bool bRight, const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateLeftHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateRightHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
|
|
|
|
|
void UpdateHandLocationAndRotation(
|
|
|
|
|
const bool bRight, const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateLeftHandLocationAndRotation(
|
|
|
|
|
const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
void UpdateRightHandLocationAndRotation(
|
|
|
|
|
const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand);
|
|
|
|
|
|
|
|
|
|
void DisableActorPhysics(const AActor* Actor) const;
|
|
|
|
|
void EnableActorPhysics(const AActor* Actor) const;
|
|
|
|
|
|
|
|
|
@@ -120,6 +144,19 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
|
|
|
|
|
HandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandLeft"));
|
|
|
|
|
HandLeft->SetupAttachment(GetRootComponent());
|
|
|
|
|
HandLeft->SetCanEverAffectNavigation(false);
|
|
|
|
|
HandLeft->SetGenerateOverlapEvents(true);
|
|
|
|
|
HandLeft->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
HandLeft->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
HandLeft->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
|
|
|
|
|
HandLeft->SetCollisionResponseToAllChannels(ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_Pawn, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Block);
|
|
|
|
|
HandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
|
|
|
|
|
HandLeft->SetRight(false);
|
|
|
|
|
HandLeft->SetHiddenIfNoGloveDetected(true);
|
|
|
|
|
HandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
|
|
|
|
@@ -128,6 +165,36 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
HandLeft->SetWristTracker(WristTrackerLeft);
|
|
|
|
|
|
|
|
|
|
RealHandLeft = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("RealHandLeft"));
|
|
|
|
|
RealHandLeft->SetupAttachment(GetRootComponent());
|
|
|
|
|
RealHandLeft->SetCanEverAffectNavigation(false);
|
|
|
|
|
RealHandLeft->SetGenerateOverlapEvents(true);
|
|
|
|
|
RealHandLeft->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RealHandLeft->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RealHandLeft->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetRight(false);
|
|
|
|
|
Pimpl->SetVisibility(RealHandLeft, false);
|
|
|
|
|
RealHandLeft->SetHiddenIfNoGloveDetected(true);
|
|
|
|
|
RealHandLeft->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
RealHandLeft->SetRelativeLocation(FVector{30.0f, -20.0f, -10.0f},
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
RealHandLeft->SetWristTracker(WristTrackerLeft);
|
|
|
|
|
|
|
|
|
|
FSGDebugVirtualHandSettings RealHandLeftDebugSettings;
|
|
|
|
|
RealHandLeftDebugSettings.bDrawDebugVirtualHand = true;
|
|
|
|
|
RealHandLeftDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
|
|
|
|
|
RealHandLeftDebugSettings.GizmoThickness = 0.5f;
|
|
|
|
|
RealHandLeft->SetDebugVirtualHandSettings(MoveTemp(RealHandLeftDebugSettings));
|
|
|
|
|
|
|
|
|
|
LeftThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
|
|
|
|
this, TEXT("LeftThumbFingertipGrabCollider"));
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetRelativeScale3D(HandLeft->GetDefaultFingertipsGrabColliderSize());
|
|
|
|
@@ -136,7 +203,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftThumbFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftThumbFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -155,7 +223,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftIndexFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftIndexFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftIndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -174,7 +243,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftMiddleFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftMiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -193,7 +263,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftThumbFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftThumbFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -212,7 +283,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftIndexFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftIndexFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftIndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -231,7 +303,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftMiddleFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftMiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -250,7 +323,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftRingFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftRingFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftRingFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftRingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -269,7 +343,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
LeftPinkyFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
LeftPinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -287,7 +362,21 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
|
|
|
|
|
HandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("HandRight"));
|
|
|
|
|
HandRight->SetupAttachment(GetRootComponent());
|
|
|
|
|
HandRight->SetCanEverAffectNavigation(false);
|
|
|
|
|
HandRight->SetGenerateOverlapEvents(true);
|
|
|
|
|
HandRight->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
HandRight->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
HandRight->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
|
|
|
|
|
HandRight->SetCollisionResponseToAllChannels(ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_Pawn, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Block);
|
|
|
|
|
HandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Block);
|
|
|
|
|
HandRight->SetRight(true);
|
|
|
|
|
HandRight->SetHiddenInGame(true);
|
|
|
|
|
HandRight->SetHiddenIfNoGloveDetected(true);
|
|
|
|
|
HandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
@@ -295,6 +384,36 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
HandRight->SetWristTracker(WristTrackerRight);
|
|
|
|
|
|
|
|
|
|
RealHandRight = ObjectInitializer.CreateDefaultSubobject<USGVirtualHandComponent>(this, TEXT("RealHandRight"));
|
|
|
|
|
RealHandRight->SetupAttachment(GetRootComponent());
|
|
|
|
|
RealHandRight->SetCanEverAffectNavigation(false);
|
|
|
|
|
RealHandRight->SetGenerateOverlapEvents(true);
|
|
|
|
|
RealHandRight->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RealHandRight->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RealHandRight->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RealHandRight->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetRight(true);
|
|
|
|
|
Pimpl->SetVisibility(RealHandRight, false);
|
|
|
|
|
RealHandRight->SetHiddenIfNoGloveDetected(true);
|
|
|
|
|
RealHandRight->SetRelativeRotation(FRotator{0.0f, -90.0f, 0.0f},
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
RealHandRight->SetRelativeLocation(FVector{30.0f, 20.0f, -10.0f},
|
|
|
|
|
false, nullptr, ETeleportType::None);
|
|
|
|
|
RealHandRight->SetWristTracker(WristTrackerRight);
|
|
|
|
|
|
|
|
|
|
FSGDebugVirtualHandSettings RealHandRightDebugSettings;
|
|
|
|
|
RealHandRightDebugSettings.bDrawDebugVirtualHand = true;
|
|
|
|
|
RealHandRightDebugSettings.DrawingMode = ESGDebugVirtualHandDrawingMode::GizmoJoints;
|
|
|
|
|
RealHandRightDebugSettings.GizmoThickness = 0.5f;
|
|
|
|
|
RealHandRight->SetDebugVirtualHandSettings(MoveTemp(RealHandRightDebugSettings));
|
|
|
|
|
|
|
|
|
|
RightThumbFingertipGrabCollider = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(
|
|
|
|
|
this, TEXT("RightThumbFingertipGrabCollider"));
|
|
|
|
|
RightThumbFingertipGrabCollider->SetRelativeScale3D(HandLeft->GetDefaultFingertipsGrabColliderSize());
|
|
|
|
@@ -303,7 +422,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightThumbFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightThumbFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightThumbFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightThumbFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -322,7 +442,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightIndexFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightIndexFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightIndexFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightIndexFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -341,7 +462,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightMiddleFingertipGrabCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetReceivesDecals(true);
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightMiddleFingertipGrabCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightMiddleFingertipGrabCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -360,7 +482,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightThumbFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightThumbFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightThumbFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightThumbFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -379,7 +502,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightIndexFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightIndexFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightIndexFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightIndexFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -398,7 +522,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightMiddleFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightMiddleFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightMiddleFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -417,7 +542,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightRingFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightRingFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
RightRingFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightRingFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightRingFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightRingFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightRingFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightRingFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightRingFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -436,7 +562,8 @@ ASGPawn::ASGPawn(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
RightPinkyFingertipTouchCollider->bCastDynamicShadow = false;
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetReceivesDecals(true);
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCanEverAffectNavigation(false);
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RightPinkyFingertipTouchCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_Owner;
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCollisionObjectType(ECC_Pawn);
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RightPinkyFingertipTouchCollider->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
@@ -469,26 +596,22 @@ void ASGPawn::BeginPlay()
|
|
|
|
|
|
|
|
|
|
WristTrackerLeft->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
|
|
|
|
|
{
|
|
|
|
|
HandLeft->SetWorldLocation(Location);
|
|
|
|
|
RealHandLeft->SetWorldLocation(Location);
|
|
|
|
|
Pimpl->UpdateLeftHandLocation(Location, Pimpl->bUpdateLeftHandLocationAndRotation);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WristTrackerLeft->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
|
|
|
|
|
{
|
|
|
|
|
HandLeft->SetWorldRotation(Rotation);
|
|
|
|
|
RealHandLeft->SetWorldRotation(Rotation);
|
|
|
|
|
Pimpl->UpdateLeftHandRotation(Rotation, Pimpl->bUpdateLeftHandLocationAndRotation);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WristTrackerRight->OnWristLocationChanged().AddWeakLambda(this, [&](const FVector& Location)-> void
|
|
|
|
|
{
|
|
|
|
|
HandRight->SetWorldLocation(Location);
|
|
|
|
|
RealHandRight->SetWorldLocation(Location);
|
|
|
|
|
Pimpl->UpdateRightHandLocation(Location, Pimpl->bUpdateRightHandLocationAndRotation);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WristTrackerRight->OnWristRotationChanged().AddWeakLambda(this, [&](const FRotator& Rotation)-> void
|
|
|
|
|
{
|
|
|
|
|
HandRight->SetWorldRotation(Rotation);
|
|
|
|
|
RealHandRight->SetWorldRotation(Rotation);
|
|
|
|
|
Pimpl->UpdateRightHandRotation(Rotation, Pimpl->bUpdateRightHandLocationAndRotation);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Pimpl->BindRealHandsOverlapEvents();
|
|
|
|
@@ -526,40 +649,6 @@ void ASGPawn::PreInitializeComponents()
|
|
|
|
|
void ASGPawn::PostInitializeComponents()
|
|
|
|
|
{
|
|
|
|
|
Super::PostInitializeComponents();
|
|
|
|
|
|
|
|
|
|
RealHandLeft = DuplicateObject<USGVirtualHandComponent>(HandLeft, this, FName(TEXT("RealHandLeft")));
|
|
|
|
|
if (ensureAlwaysMsgf(IsValid(RealHandLeft), TEXT("failed to duplicate the left hand!")))
|
|
|
|
|
{
|
|
|
|
|
RealHandLeft->SetupAttachment(GetRootComponent());
|
|
|
|
|
RealHandLeft->SetCanEverAffectNavigation(false);
|
|
|
|
|
RealHandLeft->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RealHandLeft->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
|
|
|
|
RealHandLeft->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RealHandRight = DuplicateObject<USGVirtualHandComponent>(HandRight, this, FName(TEXT("RealHandRight")));
|
|
|
|
|
if (ensureAlwaysMsgf(IsValid(RealHandRight), TEXT("failed to duplicate the right hand!")))
|
|
|
|
|
{
|
|
|
|
|
RealHandRight->SetupAttachment(GetRootComponent());
|
|
|
|
|
RealHandRight->SetCanEverAffectNavigation(false);
|
|
|
|
|
RealHandRight->SetCollisionObjectType(ECC_WorldDynamic);
|
|
|
|
|
RealHandRight->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
|
|
|
RealHandRight->SetCollisionResponseToAllChannels(ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_WorldDynamic, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Visibility, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_PhysicsBody, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Vehicle, ECR_Overlap);
|
|
|
|
|
RealHandRight->SetCollisionResponseToChannel(ECC_Destructible, ECR_Overlap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::OnRealLeftHandOverlapBegins(
|
|
|
|
@@ -571,9 +660,26 @@ void ASGPawn::OnRealLeftHandOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
|
|
|
|
|
|
if (OtherActor == this)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Pimpl->bUpdateLeftHandLocationAndRotation)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pimpl->bUpdateLeftHandLocationAndRotation = false;
|
|
|
|
|
|
|
|
|
|
/*FVector WristLocation{WristTrackerLeft->GetWristLocation()};
|
|
|
|
|
FRotator WristRotation{WristTrackerLeft->GetWristRotation()};
|
|
|
|
|
Pimpl->UpdateLeftHandLocationAndRotation(MoveTemp(WristLocation), MoveTemp(WristRotation), true);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::OnRealLeftHandOverlapEnds(
|
|
|
|
@@ -583,7 +689,24 @@ void ASGPawn::OnRealLeftHandOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (OtherActor == this)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Pimpl->bUpdateLeftHandLocationAndRotation)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pimpl->bUpdateLeftHandLocationAndRotation = true;
|
|
|
|
|
|
|
|
|
|
/*FVector WristLocation{WristTrackerLeft->GetWristLocation()};
|
|
|
|
|
FRotator WristRotation{WristTrackerLeft->GetWristRotation()};
|
|
|
|
|
Pimpl->UpdateLeftHandLocationAndRotation(MoveTemp(WristLocation), MoveTemp(WristRotation), true);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::OnRealRightHandOverlapBegins(
|
|
|
|
@@ -595,9 +718,26 @@ void ASGPawn::OnRealRightHandOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
|
|
|
|
|
|
if (OtherActor == this)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Pimpl->bUpdateRightHandLocationAndRotation)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pimpl->bUpdateRightHandLocationAndRotation = false;
|
|
|
|
|
|
|
|
|
|
/*FVector WristLocation{WristTrackerRight->GetWristLocation()};
|
|
|
|
|
FRotator WristRotation{WristTrackerRight->GetWristRotation()};
|
|
|
|
|
Pimpl->UpdateRightHandLocationAndRotation(MoveTemp(WristLocation), MoveTemp(WristRotation), true);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::OnRealRightHandOverlapEnds(
|
|
|
|
@@ -607,7 +747,24 @@ void ASGPawn::OnRealRightHandOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (OtherActor == this)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Pimpl->bUpdateRightHandLocationAndRotation)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pimpl->bUpdateRightHandLocationAndRotation = true;
|
|
|
|
|
|
|
|
|
|
/*FVector WristLocation{WristTrackerRight->GetWristLocation()};
|
|
|
|
|
FRotator WristRotation{WristTrackerRight->GetWristRotation()};
|
|
|
|
|
Pimpl->UpdateRightHandLocationAndRotation(MoveTemp(WristLocation), MoveTemp(WristRotation), true);*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapBegins(
|
|
|
|
@@ -619,6 +776,7 @@ void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -637,6 +795,7 @@ void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (LeftHandGrabState.ActorThumbCanGrab == OtherActor)
|
|
|
|
@@ -655,6 +814,7 @@ void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -673,6 +833,7 @@ void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (LeftHandGrabState.ActorIndexCanGrab == OtherActor)
|
|
|
|
@@ -691,6 +852,7 @@ void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -709,6 +871,7 @@ void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (LeftHandGrabState.ActorMiddleCanGrab == OtherActor)
|
|
|
|
@@ -917,6 +1080,7 @@ void ASGPawn::OnRightThumbFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -935,6 +1099,7 @@ void ASGPawn::OnRightThumbFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (RightHandGrabState.ActorThumbCanGrab == OtherActor)
|
|
|
|
@@ -953,6 +1118,7 @@ void ASGPawn::OnRightIndexFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -971,6 +1137,7 @@ void ASGPawn::OnRightIndexFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (RightHandGrabState.ActorThumbCanGrab == OtherActor)
|
|
|
|
@@ -989,6 +1156,7 @@ void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapBegins(
|
|
|
|
|
const FHitResult& SweepResult)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
(void) bFromSweep;
|
|
|
|
|
(void) SweepResult;
|
|
|
|
@@ -1007,6 +1175,7 @@ void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapEnds(
|
|
|
|
|
const int32 OtherBodyIndex)
|
|
|
|
|
{
|
|
|
|
|
(void) OverlappedComponent;
|
|
|
|
|
(void) OtherComp;
|
|
|
|
|
(void) OtherBodyIndex;
|
|
|
|
|
|
|
|
|
|
if (RightHandGrabState.ActorMiddleCanGrab == OtherActor)
|
|
|
|
@@ -1309,7 +1478,9 @@ void ASGPawn::ReleaseRight()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ASGPawn::FImpl::FImpl(ASGPawn* InOwner)
|
|
|
|
|
: Owner(InOwner)
|
|
|
|
|
: bUpdateLeftHandLocationAndRotation(true),
|
|
|
|
|
bUpdateRightHandLocationAndRotation(true),
|
|
|
|
|
Owner(InOwner)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1317,14 +1488,24 @@ void ASGPawn::FImpl::BindRealHandsOverlapEvents()
|
|
|
|
|
{
|
|
|
|
|
Owner->RealHandLeft->OnComponentBeginOverlap.AddDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealLeftHandOverlapBegins);
|
|
|
|
|
Owner->RealHandLeft->OnComponentEndOverlap.AddDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealLeftHandOverlapEnds);
|
|
|
|
|
|
|
|
|
|
Owner->RealHandRight->OnComponentBeginOverlap.AddDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealRightHandOverlapBegins);
|
|
|
|
|
Owner->RealHandRight->OnComponentEndOverlap.AddDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealRightHandOverlapEnds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UnbindRealHandsOverlapEvents()
|
|
|
|
|
{
|
|
|
|
|
Owner->RealHandLeft->OnComponentBeginOverlap.RemoveDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealLeftHandOverlapBegins);
|
|
|
|
|
Owner->RealHandLeft->OnComponentEndOverlap.RemoveDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealLeftHandOverlapEnds);
|
|
|
|
|
|
|
|
|
|
Owner->RealHandRight->OnComponentBeginOverlap.RemoveDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealRightHandOverlapBegins);
|
|
|
|
|
Owner->RealHandRight->OnComponentEndOverlap.RemoveDynamic(
|
|
|
|
|
Owner, &ASGPawn::OnRealRightHandOverlapEnds);
|
|
|
|
|
}
|
|
|
|
@@ -1516,6 +1697,104 @@ void ASGPawn::FImpl::UnbindFingerTouchOverlapEvents()
|
|
|
|
|
Owner, &ASGPawn::OnRightPinkyFingertipTouchColliderOverlapEnds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::SetVisibility(USceneComponent* SceneComponent, const bool bVisibility) const
|
|
|
|
|
{
|
|
|
|
|
if (!ensureAlwaysMsgf(IsValid(SceneComponent), TEXT("Invalid SceneComponent!")))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SceneComponent->SetHiddenInGame(!bVisibility);
|
|
|
|
|
SceneComponent->SetVisibility(bVisibility);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateHandLocation(const bool bRight, const FVector& Location, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bRight)
|
|
|
|
|
{
|
|
|
|
|
UpdateRightHandLocation(Location, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UpdateLeftHandLocation(Location, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateLeftHandLocation(const FVector& Location, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
Owner->HandLeft->SetWorldLocation(Location);
|
|
|
|
|
}
|
|
|
|
|
Owner->RealHandLeft->SetWorldLocation(Location);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateRightHandLocation(const FVector& Location, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
Owner->HandRight->SetWorldLocation(Location);
|
|
|
|
|
}
|
|
|
|
|
Owner->RealHandRight->SetWorldLocation(Location);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateHandRotation(const bool bRight, const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bRight)
|
|
|
|
|
{
|
|
|
|
|
UpdateRightHandRotation(Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UpdateLeftHandRotation(Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateLeftHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
Owner->HandLeft->SetWorldRotation(Rotation);
|
|
|
|
|
}
|
|
|
|
|
Owner->RealHandLeft->SetWorldRotation(Rotation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateRightHandRotation(const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
Owner->HandRight->SetWorldRotation(Rotation);
|
|
|
|
|
}
|
|
|
|
|
Owner->RealHandRight->SetWorldRotation(Rotation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateHandLocationAndRotation(
|
|
|
|
|
const bool bRight, const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
if (bRight)
|
|
|
|
|
{
|
|
|
|
|
UpdateRightHandLocationAndRotation(Location, Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UpdateLeftHandLocationAndRotation(Location, Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateLeftHandLocationAndRotation(
|
|
|
|
|
const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
UpdateLeftHandLocation(Location, bUpdateVirtualHand);
|
|
|
|
|
UpdateLeftHandRotation(Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::UpdateRightHandLocationAndRotation(
|
|
|
|
|
const FVector& Location, const FRotator& Rotation, const bool bUpdateVirtualHand)
|
|
|
|
|
{
|
|
|
|
|
UpdateRightHandLocation(Location, bUpdateVirtualHand);
|
|
|
|
|
UpdateRightHandRotation(Rotation, bUpdateVirtualHand);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ASGPawn::FImpl::DisableActorPhysics(const AActor* Actor) const
|
|
|
|
|
{
|
|
|
|
|
UPrimitiveComponent* ActorRootComponent{Cast<UPrimitiveComponent>(Actor->GetRootComponent())};
|
|
|
|
|