Hi, i have been playing around with spine but cant figure out a reliable way to point a bone at the mouse cursor.
I have a test file that works http://i.imgur.com/urvsFGr.png, and one that doesn't http://i.imgur.com/4zKplbN.png (I am only trying to rotate the blue bar). The only difference are the bones below the one i want to rotate. It looks like setting the rotate needs to take into account the bones below but i cant find a way to do that.
What i want to do:
spBone *leftArm = spSkeleton_findBone(skeleton, "l_shoulder");
// point direction is the vector from our bone position to the mouse cursor
float rot = atan2(pointDirection.y, pointDirection.x) * math::TO_DEG;
// what to take into account? (actually for the "working" example i need to subtract 90 degreeds)
leftArm->rotation = rot;
Any ideas on how to make it work? 🙂