Today I have made a commit that adds support for Inverse Kinematic constraint for bones.
The IK constraint is very very very … very simple yet, but I hope to improve it with time.
It works only for the most simple cases now and has lots of limitations.
The following options are not yet supported:
- pole target
- subtarget for targets that are objects in blender scene
- use tail
Most of them (except perhaps rotation) should not be extremely difficult to add so I hope to add support for them soon
The constraint will not work correctly in a chain that has more than one bone with IK. I still need to figure out how blender solves this situation (so if anyone could explain it to me I would be grateful ).
The quality of the result is not yet perfect and will probably not look very natural, but I hope to improve this by improving the algorithm I used.
I implemented the triangulation algorithm to solve the IK problem. It is described here:
Triangulation algorithm description (in pdf)
I know that my commit has almost only flaws. But I decided to post it now because it contains several bugfixes:
- applying and reading bones transformations in world space
- fixed a bug of lack of tracks for bones whose constraint made the bone move
and improved the bones loading from blender file
I do not expect you to like the way the IK is loaded at the moment because as I said - it still needs lots of improvements