Calculating local space position from reference pose on animated mesh
I'm not very good at geometry functions so I'm hoping to get some help here. Thanks in advance.
I'm trying to calculate the local(preskinned) position of a hit on a skeletal mesh. Now if the mesh is locked in its default, reference pose, all I have to do is subtract the ComponentTransform of the skeletal mesh from the ImpactPoint, and I can feed the result directly to my material and it will work well. However, I'm not sure how to get to the same result if the mesh is being animated.
I know I can access the reference skeleton, however, the locations of ref bones are all relative to their parent bone, as opposed to being relative to the skeletal mesh's root transform. GetBoneTransform() returns the bone's location relative to the root, which is something I could work with, however, I'm not sure what to do with the reference bones. Different approaches that I've tried yielded incorrect results, including the one described via this link.
According to the aforementioned article, this should have worked:
Except it doesn't. The final transformed position is not relative to the root bone. So either I'm doing something wrong, or the author forgot to mention something crucial.
Either way, any help would be appreciated, and thanks again.
Hi Visor, I have read the same tutorial by Tom Looman.
In my project GetRefBonePose() return position relative to the parent bone, so I made a recursive function to have results relative to world origin.
Follow this question
Once you sign in you will be able to subscribe for any updates here