As i understand it i need to use worldToLocal function to convert my world coordinates ( box2d body position) to local coordinates in Spine Skeleton. localX and localY is just output from worldToLocal function, and calling updateWorldTransform should calculate world x and y based on local x and y. But for some reason its not working as would like it to work. Nate please give me some feedback π
Ok, so i think that i might found the problem, looking at the source code and debugging i misunderstood it completely. Correct me if i'm mistaken, so bone worldX and worldY are relative to SkeletonAnimation node anchor point that is relative to parent node, and that is ok. But, since we cant directly modify worldX and worldY we have to find bone localX and localY that is relative to SRT (and not to SkeletonAnimatioN) from our parent node (where box2d bodies are), if i'm correct. So i thought that worldToLocal would give me this coordinates but apparently it is not working.
The process i'm using is something like this
1) get box2d body coordinates, multiple by PTM
2) find that coordinates relative to SkeletonAnimation node
3) user worldToLocal method to convert coordinates from step 2 to local bones coordinates
4) update bone.
@Nate can you shed some light on this problem.