I am stuck with a seemingly simple problem:
For my VR project, I have physics-based hands that can grab actors in the world. To define the grab position and rotation on an actor, I use hand position components. When grabbing, the grabbed actor should be rotated and moved towards the hand actor, in a way that the
hand positioner component ends up aligned with the grab position component of the hand actor (see image).
Calculating the needed position offset is simple, but calculating the end rotation is something I can’t get right. What I tried is calculating the rotation using UKismetMathLibrary::ComposeRotators(), but the result is not correct.
BoxHit.Actor->SetActorRotation( UKismetMathLibrary::ComposeRotators( GrabPositionComp->GetComponentRotation(),
HandPositionerComp->GetRelativeRotation()), ETeleportType::TeleportPhysics);