Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RWTH VR Toolkit
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel Rupp
RWTH VR Toolkit
Commits
3e60730d
Commit
3e60730d
authored
Nov 20, 2023
by
Daniel Rupp
Browse files
Options
Downloads
Patches
Plain Diff
fix(interaction): change hit actor to parent, hit actor of sphere cast is a child actor
parent
2b82ad57
No related branches found
No related tags found
No related merge requests found
Pipeline
#331659
failed
Nov 20, 2023
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/RWTHVRToolkit/Private/Interaction/Interactors/GrabComponent.cpp
+6
-1
6 additions, 1 deletion
...Toolkit/Private/Interaction/Interactors/GrabComponent.cpp
with
6 additions
and
1 deletion
Source/RWTHVRToolkit/Private/Interaction/Interactors/GrabComponent.cpp
+
6
−
1
View file @
3e60730d
...
@@ -28,6 +28,7 @@ void UGrabComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
...
@@ -28,6 +28,7 @@ void UGrabComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
TArray
<
UInteractableComponent
*>
CurrentGrabCompsInRange
;
TArray
<
UInteractableComponent
*>
CurrentGrabCompsInRange
;
TArray
<
AActor
*>
ActorsToIgnore
;
TArray
<
AActor
*>
ActorsToIgnore
;
ActorsToIgnore
.
Add
(
GetOwner
());
TArray
<
FHitResult
>
OutHits
;
TArray
<
FHitResult
>
OutHits
;
const
ETraceTypeQuery
TraceType
=
UEngineTypes
::
ConvertToTraceType
(
ECollisionChannel
::
ECC_PhysicsBody
);
const
ETraceTypeQuery
TraceType
=
UEngineTypes
::
ConvertToTraceType
(
ECollisionChannel
::
ECC_PhysicsBody
);
...
@@ -43,6 +44,10 @@ void UGrabComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
...
@@ -43,6 +44,10 @@ void UGrabComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
AActor
*
HitActor
=
Hit
.
GetActor
();
AActor
*
HitActor
=
Hit
.
GetActor
();
if
(
HitActor
)
if
(
HitActor
)
{
{
if
(
HitActor
->
IsChildActor
())
{
HitActor
=
HitActor
->
GetParentActor
();
// search at parent if found actor is a child actor
}
UInteractableComponent
*
Grabbable
=
HitActor
->
FindComponentByClass
<
UInteractableComponent
>
();
UInteractableComponent
*
Grabbable
=
HitActor
->
FindComponentByClass
<
UInteractableComponent
>
();
if
(
Grabbable
&&
Grabbable
->
HasInteractionTypeFlag
(
EInteractorType
::
Grab
)
&&
Grabbable
->
IsInteractable
)
if
(
Grabbable
&&
Grabbable
->
HasInteractionTypeFlag
(
EInteractorType
::
Grab
)
&&
Grabbable
->
IsInteractable
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment