I know there are many posts on this--I've spent the last hour looking through them--but none of them seem have a working solution, or are 5 years old and no longer seem to work.
I want to get the position of a bone undergoing animation. It will be used as the starting position for a special effect that will go flying to some other position which won't be attached to the skeleton or the entity's scene node in any way.
At the moment I have this:
Code: Select all
Bone* bone = mEntity->getSkeleton()->getBone("Bone_R.006");
Vector3 emitter = mNode->_getDerivedPosition() + mNode->_getDerivedOrientation() * bone->_getDerivedPosition();
If I have animation disabled, then this correctly gives me the position of the bone, as indicated by an object I place there to see it visually. However, if I let the animation run, the object's position doesn't change (yes I'm running the above code and updating the object's position every frame). So it seems this above code always returns the initial position of the bone, not the position resulting form animation. Or maybe I just don't know what I'm doing (seems likely).
Does anybody know how to do this?