Working on a game mod in FiveM in which I am representing bullet impacts with drawn lines in the game world along their flight path. I am getting a normalized vector and then calculating the offset from the entity, and this works well for rigid-body entities like cars but for peds with skeletons not so much. I am trying to shift and attach the impact to the damaged entity bone, but am struggling to calculate the offset given the initial rotation/position, and then the current rotation/position. I looked at quaternions, and angle of rotation, but am not sure how to translate that into a function to calculate the final coord using the originally calculated offset.
Anyone able to point me in the direction of the math I need to solve this? Essentially I am just looking for the final 3D coords, and know I need some sort of advanced math (trig, quats, etc) to find it but am struggling to understand which solution I need.
I know I basically have the following:
initial rotation of entity bone, initial position of entity bone, initial offset from entity bone, initial coordinates of offset
final rotation of entity bone, final position of entity bone, and the offset I need to find the coords
and need to calculate
final coords of the offset