I am trying to align and snap two actors in runtime(C++) based on sockets.
ActorA->MeshComponentA->SocketA
ActorB->MeshComponentB->SocketB
So, first I translate ActorB to ActorA such that the sockets are at the same location.
And then I need to rotate ActorB such that the socket rotations are aligned.
I think I can find the correct rotation (subtract SocketA rotator from SocketB rotator).
But, how do I then rotate ActorB around the socket location with this rotation?
I’m not 100% sure what you mean. But I’m guessing socket A is pointing in a direction and you want socket B to point in the same direction. Sockets A and B have different translations and orientations to their respective actors.
You can find the quat between the 2 sockets by multiplying the quat socket A by the inverse of quat of socket B.
Myltiply that quat by the quat of actor B. This should give both sockets the same orientation.
The translation of actor B is finding the difference between new location of socket B (that quat * location of socket B) and the location of socket A.