feature(Interaction): improve grabbing
Here are some problems I encountered with the grabbing behavior.
1. Search for UInteractable at parent component if hit actor is a child actor
Setting: A parent actor that contains a child actor, e.g. a WIM that contains a smaller representation of a real object as child actor. Problem: Currently it is not possible, that the parent actor is grabbable, if the child actor is not grabbable. Reason: In GrabComponent.cpp a sphere cast is done to find objects close by. If the sphere cast hits the child actor we search for UInteractableComponent in the child actor, which we do not want to be grabbable, therefore there is no UInteractableComponent.
Solution:
- Provide a way to specify the actor that should move (parent or child etc.). Since this might be an edge case, I just used a boolean flag for now that per default behaves like before.
2. Expose a TryRealease() function that releases the currently grabbed object
3. InteractableComponent can broadcast OnActionStart events without requiring hover to be called first.
This is a little bit misleading. I kind of expect, if I subscribe to the OnActionBegin event in the grabbing component, that this is called after the object has successfully been grabbed. I now added OnBeginGrab/OnEndGrab events returning the grabbed object and a IsObjectGrabbed() function
Discussion: I think in general, OnActioStart events should only be called if we currently hover.
4. GrabbablesInRange.AddUnique() in GrabComponent.cpp
An actor can have multiple static meshes, that return a collision, therefore we would add the same actor multiple times which is probably unwanted behavior.
5. Added option to only grab closest object
Merge request reports
Activity
changed milestone to %Consistent Interaction Base
added Discussion Feature labels
requested review from @marcel.krueger
assigned to @david.gilbert
added 27 commits
-
34691cfb...dc57f757 - 26 commits from branch
vr-vis/VR-Group/unreal-development/plugins:dev/5.3
- 02ab0e9c - Merge branch 'dev/5.3' of...
-
34691cfb...dc57f757 - 26 commits from branch
added 1 commit
- 6caecdb5 - fix(interaction): removes unused/broken include after renaming
added 1 commit
- a3654dfb - fix(interaction): removes unused/broken include after renaming
added 3 commits
-
a3654dfb...9bd56300 - 2 commits from branch
vr-vis/VR-Group/unreal-development/plugins:dev/5.3
- 5d6bee08 - Merge branch 'dev/5.3' into 'dev/5.3'
-
a3654dfb...9bd56300 - 2 commits from branch
- Resolved by David Gilbert
- Resolved by Daniel Rupp
Can you also rephrase point 3? So currently it is possible that OnAction is called without OnHover being called first? When does it happen ? Depending on the circumstances we should probably discuss if we want the OnHover first or just supress OnAction.
- Resolved by Daniel Rupp
Discussion w.r.t to childs being grabbable. We basically have 4 possibilities:
G = Grabbable N = Not Grabbable # Parent Child Behaviour 1 G G What should we do here? What should happen if the child is grabbed? Move Parent or move child relative to parent ? 2 G N We check if parent is grabbable and if it is we move the parent? 3 N G Do we move the child relative to the parent or do we apply the transform to the parent? 4 N N Nothing
Do we find a solution that is always correct, or should we have options to specify behaviour for cases 1 and 2 ?
Edited by Marcel Krüger
added 1 commit
- abffb24d - fix(interaction): use first encountered UInteractable
added 8 commits
-
abffb24d...49b2e936 - 6 commits from branch
vr-vis/VR-Group/unreal-development/plugins:dev/5.3
- 38c5fba2 - Merge branch 'refactor/pawn_movement_var' into '5.3'
- 6027ba91 - Merge branch rwth-vr-toolkit:5.3 into dev/5.3
-
abffb24d...49b2e936 - 6 commits from branch