do not reigger OnGrabStateUpdated and OnTouchStateUpdated at all when the hand mesh is not valid or visible and also some other extra measures to make sure even if they are triggered they won't affect anything
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ This is a minor release focusing mainly on bringing OpenXR-compatible hand track
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed a bug when the virtual hand inside the game is not visible but still have collisions with other objects inside the scene.
|
- Fixed a bug when the virtual hand inside the game is not visible but still collides with other objects inside the scene, mistakenly triggering events like OnGrabStateUpdated and OnTouchStateUpdated.
|
||||||
- Fix various wrong Kismet script names and their class exports.
|
- Fix various wrong Kismet script names and their class exports.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -616,14 +616,14 @@ void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
|||||||
bGotMotionControllerData
|
bGotMotionControllerData
|
||||||
&& MotionControllerData.bValid
|
&& MotionControllerData.bValid
|
||||||
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand;
|
&& MotionControllerData.DeviceVisualType == EXRVisualType::Hand;
|
||||||
const bool bIsHandVisible = Owner->GetVisibleFlag();
|
const bool bHandVisible = Owner->IsVisible();
|
||||||
const bool bShouldBeVisibleWhenHandDataUnavailable = Owner->IsVisibleWhenHandDataUnavailable();
|
const bool bShouldBeVisibleWhenHandDataUnavailable = Owner->IsVisibleWhenHandDataUnavailable();
|
||||||
|
|
||||||
bool bSetNewVisibility = false;
|
bool bSetNewVisibility = false;
|
||||||
|
|
||||||
if (bHandDataAvailable)
|
if (bHandDataAvailable)
|
||||||
{
|
{
|
||||||
if (bIsHandVisible)
|
if (bHandVisible)
|
||||||
{
|
{
|
||||||
bSetNewVisibility = false;
|
bSetNewVisibility = false;
|
||||||
}
|
}
|
||||||
@@ -634,7 +634,7 @@ void USGVirtualHandComponent::FImpl::UpdateVisibility()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bIsHandVisible)
|
if (bHandVisible)
|
||||||
{
|
{
|
||||||
if (bShouldBeVisibleWhenHandDataUnavailable)
|
if (bShouldBeVisibleWhenHandDataUnavailable)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -725,12 +725,25 @@ void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorThumbCanGrab = OtherActor;
|
LeftHandGrabState.ActorThumbCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -742,12 +755,19 @@ void ASGPawn::OnLeftThumbFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandGrabState.ActorThumbCanGrab == OtherActor)
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandGrabState.ActorThumbCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorThumbCanGrab = nullptr;
|
LeftHandGrabState.ActorThumbCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapBegins(
|
void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -763,12 +783,25 @@ void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorIndexCanGrab = OtherActor;
|
LeftHandGrabState.ActorIndexCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -780,12 +813,19 @@ void ASGPawn::OnLeftIndexFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandGrabState.ActorIndexCanGrab == OtherActor)
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandGrabState.ActorIndexCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorIndexCanGrab = nullptr;
|
LeftHandGrabState.ActorIndexCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapBegins(
|
void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -801,12 +841,25 @@ void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorMiddleCanGrab = OtherActor;
|
LeftHandGrabState.ActorMiddleCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -818,12 +871,19 @@ void ASGPawn::OnLeftMiddleFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandGrabState.ActorMiddleCanGrab == OtherActor)
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandGrabState.ActorMiddleCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandGrabState.ActorMiddleCanGrab = nullptr;
|
LeftHandGrabState.ActorMiddleCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(LeftHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -839,13 +899,26 @@ void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorThumbTouching = OtherActor;
|
LeftHandTouchState.ActorThumbTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -857,13 +930,20 @@ void ASGPawn::OnLeftThumbFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandTouchState.ActorThumbTouching == OtherActor)
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandTouchState.ActorThumbTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorThumbTouching = nullptr;
|
LeftHandTouchState.ActorThumbTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -879,13 +959,26 @@ void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorIndexTouching = OtherActor;
|
LeftHandTouchState.ActorIndexTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -897,13 +990,20 @@ void ASGPawn::OnLeftIndexFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandTouchState.ActorIndexTouching == OtherActor)
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandTouchState.ActorIndexTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorIndexTouching = nullptr;
|
LeftHandTouchState.ActorIndexTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -919,13 +1019,26 @@ void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorMiddleTouching = OtherActor;
|
LeftHandTouchState.ActorMiddleTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -937,13 +1050,20 @@ void ASGPawn::OnLeftMiddleFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandTouchState.ActorMiddleTouching == OtherActor)
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandTouchState.ActorMiddleTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorMiddleTouching = nullptr;
|
LeftHandTouchState.ActorMiddleTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftRingFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnLeftRingFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -959,13 +1079,26 @@ void ASGPawn::OnLeftRingFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorRingTouching = OtherActor;
|
LeftHandTouchState.ActorRingTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftRingFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnLeftRingFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -977,13 +1110,20 @@ void ASGPawn::OnLeftRingFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandTouchState.ActorRingTouching == OtherActor)
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandTouchState.ActorRingTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorRingTouching = nullptr;
|
LeftHandTouchState.ActorRingTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -999,13 +1139,26 @@ void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = LeftHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorPinkyTouching = OtherActor;
|
LeftHandTouchState.ActorPinkyTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1017,13 +1170,20 @@ void ASGPawn::OnLeftPinkyFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (LeftHandTouchState.ActorPinkyTouching == OtherActor)
|
if (!IsValid(LeftHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LeftHandTouchState.ActorPinkyTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LeftHandTouchState.ActorPinkyTouching = nullptr;
|
LeftHandTouchState.ActorPinkyTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(LeftHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(LeftHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightThumbFingertipGrabColliderOverlapBegins(
|
void ASGPawn::OnRightThumbFingertipGrabColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1039,12 +1199,25 @@ void ASGPawn::OnRightThumbFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorThumbCanGrab = OtherActor;
|
RightHandGrabState.ActorThumbCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightThumbFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnRightThumbFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1056,12 +1229,19 @@ void ASGPawn::OnRightThumbFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandGrabState.ActorThumbCanGrab == OtherActor)
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandGrabState.ActorThumbCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorThumbCanGrab = nullptr;
|
RightHandGrabState.ActorThumbCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightIndexFingertipGrabColliderOverlapBegins(
|
void ASGPawn::OnRightIndexFingertipGrabColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1077,12 +1257,25 @@ void ASGPawn::OnRightIndexFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorIndexCanGrab = OtherActor;
|
RightHandGrabState.ActorIndexCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightIndexFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnRightIndexFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1094,12 +1287,19 @@ void ASGPawn::OnRightIndexFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandGrabState.ActorThumbCanGrab == OtherActor)
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandGrabState.ActorThumbCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorIndexCanGrab = nullptr;
|
RightHandGrabState.ActorIndexCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapBegins(
|
void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1115,12 +1315,25 @@ void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGGrabComponent::IsGrabbable(OtherActor))
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandGrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGGrabComponent::IsGrabbable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorMiddleCanGrab = OtherActor;
|
RightHandGrabState.ActorMiddleCanGrab = OtherActor;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapEnds(
|
void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1132,12 +1345,19 @@ void ASGPawn::OnRightMiddleFingertipGrabColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandGrabState.ActorMiddleCanGrab == OtherActor)
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandGrabState.ActorMiddleCanGrab != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandGrabState.ActorMiddleCanGrab = nullptr;
|
RightHandGrabState.ActorMiddleCanGrab = nullptr;
|
||||||
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
Pimpl->TriggerGrabStateUpdatedEvent(RightHandGrabState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightThumbFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnRightThumbFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1153,13 +1373,26 @@ void ASGPawn::OnRightThumbFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorThumbTouching = OtherActor;
|
RightHandTouchState.ActorThumbTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightThumbFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnRightThumbFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1171,13 +1404,20 @@ void ASGPawn::OnRightThumbFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandTouchState.ActorThumbTouching == OtherActor)
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandTouchState.ActorThumbTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorThumbTouching = nullptr;
|
RightHandTouchState.ActorThumbTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightIndexFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnRightIndexFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1193,13 +1433,26 @@ void ASGPawn::OnRightIndexFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorIndexTouching = OtherActor;
|
RightHandTouchState.ActorIndexTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightIndexFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnRightIndexFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1211,13 +1464,20 @@ void ASGPawn::OnRightIndexFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandTouchState.ActorIndexTouching == OtherActor)
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandTouchState.ActorIndexTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorIndexTouching = nullptr;
|
RightHandTouchState.ActorIndexTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1233,13 +1493,26 @@ void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorMiddleTouching = OtherActor;
|
RightHandTouchState.ActorMiddleTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1251,13 +1524,20 @@ void ASGPawn::OnRightMiddleFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandTouchState.ActorMiddleTouching == OtherActor)
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandTouchState.ActorMiddleTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorMiddleTouching = nullptr;
|
RightHandTouchState.ActorMiddleTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightRingFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnRightRingFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1273,13 +1553,26 @@ void ASGPawn::OnRightRingFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorRingTouching = OtherActor;
|
RightHandTouchState.ActorRingTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightRingFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnRightRingFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1291,13 +1584,20 @@ void ASGPawn::OnRightRingFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandTouchState.ActorRingTouching == OtherActor)
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandTouchState.ActorRingTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorRingTouching = nullptr;
|
RightHandTouchState.ActorRingTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapBegins(
|
void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapBegins(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1313,13 +1613,26 @@ void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapBegins(
|
|||||||
(void) bFromSweep;
|
(void) bFromSweep;
|
||||||
(void) SweepResult;
|
(void) SweepResult;
|
||||||
|
|
||||||
if (USGTouchComponent::IsTouchable(OtherActor))
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = RightHandTouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!USGTouchComponent::IsTouchable(OtherActor))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorPinkyTouching = OtherActor;
|
RightHandTouchState.ActorPinkyTouching = OtherActor;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerBeginTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapEnds(
|
void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapEnds(
|
||||||
UPrimitiveComponent* OverlappedComponent,
|
UPrimitiveComponent* OverlappedComponent,
|
||||||
@@ -1331,36 +1644,53 @@ void ASGPawn::OnRightPinkyFingertipTouchColliderOverlapEnds(
|
|||||||
(void) OtherComp;
|
(void) OtherComp;
|
||||||
(void) OtherBodyIndex;
|
(void) OtherBodyIndex;
|
||||||
|
|
||||||
if (RightHandTouchState.ActorPinkyTouching == OtherActor)
|
if (!IsValid(RightHandTouchState.Hand))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RightHandTouchState.ActorPinkyTouching != OtherActor)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RightHandTouchState.ActorPinkyTouching = nullptr;
|
RightHandTouchState.ActorPinkyTouching = nullptr;
|
||||||
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
Pimpl->TriggerTouchStateUpdatedEvent(RightHandTouchState);
|
||||||
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
Pimpl->TriggerEndTouch(RightHandTouchState.Hand, OtherActor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool ASGPawn::IsLeftHandGrabbing(AActor*& OutActor) const
|
bool ASGPawn::IsLeftHandGrabbing(AActor*& OutActor) const
|
||||||
{
|
{
|
||||||
if (IsValid(LeftHandGrabState.GrabbedActor))
|
if (!IsValid(LeftHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsValid(LeftHandGrabState.GrabbedActor))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
OutActor = LeftHandGrabState.GrabbedActor;
|
OutActor = LeftHandGrabState.GrabbedActor;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ASGPawn::IsRightHandGrabbing(AActor*& OutActor) const
|
bool ASGPawn::IsRightHandGrabbing(AActor*& OutActor) const
|
||||||
{
|
{
|
||||||
if (IsValid(RightHandGrabState.GrabbedActor))
|
if (!IsValid(RightHandGrabState.Hand))
|
||||||
{
|
{
|
||||||
OutActor = RightHandGrabState.GrabbedActor;
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IsValid(RightHandGrabState.GrabbedActor))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutActor = RightHandGrabState.GrabbedActor;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ASGPawn::IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor) const
|
bool ASGPawn::IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor) const
|
||||||
{
|
{
|
||||||
return Hand == HandLeft ? IsLeftHandGrabbing(OutActor) : IsRightHandGrabbing(OutActor);
|
return Hand == HandLeft ? IsLeftHandGrabbing(OutActor) : IsRightHandGrabbing(OutActor);
|
||||||
@@ -1368,13 +1698,24 @@ bool ASGPawn::IsGrabbing(const USGVirtualHandComponent* Hand, AActor*& OutActor)
|
|||||||
|
|
||||||
void ASGPawn::Grab(USGVirtualHandComponent* Hand, AActor* Actor)
|
void ASGPawn::Grab(USGVirtualHandComponent* Hand, AActor* Actor)
|
||||||
{
|
{
|
||||||
|
if (!ensureAlwaysMsgf(IsValid(Hand), TEXT("%s"), TEXT("ERROR: invalid hand!")))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
if (!ensureAlwaysMsgf(IsValid(Actor), TEXT("%s"), TEXT("ERROR: invalid actor!")))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const USGGrabComponent* GrabComponent{USGGrabComponent::GetGrabComponent(Actor)};
|
const USGGrabComponent* GrabComponent{USGGrabComponent::GetGrabComponent(Actor)};
|
||||||
if (!GrabComponent)
|
if (!IsValid(GrabComponent))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,6 +266,16 @@ void ASGPlayerController::BeginPlay()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = GrabState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
if (SGPawn->IsGrabbing(GrabState.Hand))
|
||||||
|
{
|
||||||
|
SGPawn->Release(GrabState.Hand);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (SGPawn->IsGrabbing(GrabState.Hand))
|
if (SGPawn->IsGrabbing(GrabState.Hand))
|
||||||
{
|
{
|
||||||
if (!IsValid(GrabState.ActorThumbCanGrab) ||
|
if (!IsValid(GrabState.ActorThumbCanGrab) ||
|
||||||
@@ -287,6 +297,28 @@ void ASGPlayerController::BeginPlay()
|
|||||||
SGPawn->OnTouchStateUpdated().AddWeakLambda(
|
SGPawn->OnTouchStateUpdated().AddWeakLambda(
|
||||||
this, [= SG_CAPTURE_THIS](const FSGTouchState& TouchState) -> void
|
this, [= SG_CAPTURE_THIS](const FSGTouchState& TouchState) -> void
|
||||||
{
|
{
|
||||||
|
if (!IsValid(SGPawn))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsValid(TouchState.Hand))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bHandVisible = TouchState.Hand->IsVisible();
|
||||||
|
if (!bHandVisible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bGloveConnected = TouchState.Hand->IsGloveConnected();
|
||||||
|
if (!bGloveConnected)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Pimpl->UpdateHapticsFeedback(TouchState);
|
Pimpl->UpdateHapticsFeedback(TouchState);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -313,6 +345,12 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool bGloveConnected = Glove->IsConnected()
|
||||||
|
if (!bGloveConnected)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Queue the Force-Feedback command...
|
// Queue the Force-Feedback command...
|
||||||
TArray<float> ForceFeedbackLevels{
|
TArray<float> ForceFeedbackLevels{
|
||||||
GetForceFeedbackLevels(
|
GetForceFeedbackLevels(
|
||||||
@@ -342,11 +380,19 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
|
|||||||
FTimerDelegate TouchVibrotactileStopHandler;
|
FTimerDelegate TouchVibrotactileStopHandler;
|
||||||
TouchVibrotactileStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
|
TouchVibrotactileStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
|
||||||
{
|
{
|
||||||
if (IsValid(Glove))
|
if (!IsValid(Glove))
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool bGloveConnected = Glove->IsConnected();
|
||||||
|
if (!bGloveConnected)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Glove->QueueVibroLevels(VibrotactileOffCommand);
|
Glove->QueueVibroLevels(VibrotactileOffCommand);
|
||||||
Glove->SendHaptics();
|
Glove->SendHaptics();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Owner->GetWorldTimerManager().SetTimer(
|
Owner->GetWorldTimerManager().SetTimer(
|
||||||
|
|||||||
Reference in New Issue
Block a user